blocks-v3
7 months ago
_acf-blocks-src.js
7 months ago
_acf-blocks-v3.js
7 months ago
_acf-blocks.js
7 months ago
_acf-field-flexible-content.js
9 months ago
_acf-field-gallery.js
1 year ago
_acf-field-repeater.js
1 year ago
_acf-jsx-names.js
1 year ago
_acf-setting-clone.js
1 year ago
_acf-setting-flexible-content.js
1 year ago
_acf-setting-repeater.js
1 year ago
_acf-ui-options-page.js
9 months ago
acf-pro-blocks.js
9 months ago
acf-pro-field-group.js
1 year ago
acf-pro-input.js
1 year ago
acf-pro-ui-options-page.js
1 year ago
_acf-blocks.js
5164 lines
| 1 | ( () => { |
| 2 | var e = { |
| 3 | 20: ( e, t, n ) => { |
| 4 | 'use strict'; |
| 5 | var r = n( 540 ), |
| 6 | o = Symbol.for( 'react.element' ), |
| 7 | i = Symbol.for( 'react.fragment' ), |
| 8 | a = Object.prototype.hasOwnProperty, |
| 9 | s = |
| 10 | r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED |
| 11 | .ReactCurrentOwner, |
| 12 | l = { key: ! 0, ref: ! 0, __self: ! 0, __source: ! 0 }; |
| 13 | function c( e, t, n ) { |
| 14 | var r, |
| 15 | i = {}, |
| 16 | c = null, |
| 17 | d = null; |
| 18 | for ( r in ( void 0 !== n && ( c = '' + n ), |
| 19 | void 0 !== t.key && ( c = '' + t.key ), |
| 20 | void 0 !== t.ref && ( d = t.ref ), |
| 21 | t ) ) |
| 22 | a.call( t, r ) && |
| 23 | ! l.hasOwnProperty( r ) && |
| 24 | ( i[ r ] = t[ r ] ); |
| 25 | if ( e && e.defaultProps ) |
| 26 | for ( r in ( t = e.defaultProps ) ) |
| 27 | void 0 === i[ r ] && ( i[ r ] = t[ r ] ); |
| 28 | return { |
| 29 | $$typeof: o, |
| 30 | type: e, |
| 31 | key: c, |
| 32 | ref: d, |
| 33 | props: i, |
| 34 | _owner: s.current, |
| 35 | }; |
| 36 | } |
| 37 | ( t.Fragment = i ), ( t.jsx = c ), ( t.jsxs = c ); |
| 38 | }, |
| 39 | 138: () => { |
| 40 | jQuery, |
| 41 | ( acf.jsxNameReplacements = { |
| 42 | 'accent-height': 'accentHeight', |
| 43 | accentheight: 'accentHeight', |
| 44 | 'accept-charset': 'acceptCharset', |
| 45 | acceptcharset: 'acceptCharset', |
| 46 | accesskey: 'accessKey', |
| 47 | 'alignment-baseline': 'alignmentBaseline', |
| 48 | alignmentbaseline: 'alignmentBaseline', |
| 49 | allowedblocks: 'allowedBlocks', |
| 50 | allowfullscreen: 'allowFullScreen', |
| 51 | allowreorder: 'allowReorder', |
| 52 | 'arabic-form': 'arabicForm', |
| 53 | arabicform: 'arabicForm', |
| 54 | attributename: 'attributeName', |
| 55 | attributetype: 'attributeType', |
| 56 | autocapitalize: 'autoCapitalize', |
| 57 | autocomplete: 'autoComplete', |
| 58 | autocorrect: 'autoCorrect', |
| 59 | autofocus: 'autoFocus', |
| 60 | autoplay: 'autoPlay', |
| 61 | autoreverse: 'autoReverse', |
| 62 | autosave: 'autoSave', |
| 63 | basefrequency: 'baseFrequency', |
| 64 | 'baseline-shift': 'baselineShift', |
| 65 | baselineshift: 'baselineShift', |
| 66 | baseprofile: 'baseProfile', |
| 67 | calcmode: 'calcMode', |
| 68 | 'cap-height': 'capHeight', |
| 69 | capheight: 'capHeight', |
| 70 | cellpadding: 'cellPadding', |
| 71 | cellspacing: 'cellSpacing', |
| 72 | charset: 'charSet', |
| 73 | class: 'className', |
| 74 | classid: 'classID', |
| 75 | classname: 'className', |
| 76 | 'clip-path': 'clipPath', |
| 77 | 'clip-rule': 'clipRule', |
| 78 | clippath: 'clipPath', |
| 79 | clippathunits: 'clipPathUnits', |
| 80 | cliprule: 'clipRule', |
| 81 | 'color-interpolation': 'colorInterpolation', |
| 82 | 'color-interpolation-filters': |
| 83 | 'colorInterpolationFilters', |
| 84 | 'color-profile': 'colorProfile', |
| 85 | 'color-rendering': 'colorRendering', |
| 86 | colorinterpolation: 'colorInterpolation', |
| 87 | colorinterpolationfilters: 'colorInterpolationFilters', |
| 88 | colorprofile: 'colorProfile', |
| 89 | colorrendering: 'colorRendering', |
| 90 | colspan: 'colSpan', |
| 91 | contenteditable: 'contentEditable', |
| 92 | contentscripttype: 'contentScriptType', |
| 93 | contentstyletype: 'contentStyleType', |
| 94 | contextmenu: 'contextMenu', |
| 95 | controlslist: 'controlsList', |
| 96 | crossorigin: 'crossOrigin', |
| 97 | dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', |
| 98 | datetime: 'dateTime', |
| 99 | defaultchecked: 'defaultChecked', |
| 100 | defaultvalue: 'defaultValue', |
| 101 | diffuseconstant: 'diffuseConstant', |
| 102 | disablepictureinpicture: 'disablePictureInPicture', |
| 103 | disableremoteplayback: 'disableRemotePlayback', |
| 104 | 'dominant-baseline': 'dominantBaseline', |
| 105 | dominantbaseline: 'dominantBaseline', |
| 106 | edgemode: 'edgeMode', |
| 107 | 'enable-background': 'enableBackground', |
| 108 | enablebackground: 'enableBackground', |
| 109 | enctype: 'encType', |
| 110 | enterkeyhint: 'enterKeyHint', |
| 111 | externalresourcesrequired: 'externalResourcesRequired', |
| 112 | 'fill-opacity': 'fillOpacity', |
| 113 | 'fill-rule': 'fillRule', |
| 114 | fillopacity: 'fillOpacity', |
| 115 | fillrule: 'fillRule', |
| 116 | filterres: 'filterRes', |
| 117 | filterunits: 'filterUnits', |
| 118 | 'flood-color': 'floodColor', |
| 119 | 'flood-opacity': 'floodOpacity', |
| 120 | floodcolor: 'floodColor', |
| 121 | floodopacity: 'floodOpacity', |
| 122 | 'font-family': 'fontFamily', |
| 123 | 'font-size': 'fontSize', |
| 124 | 'font-size-adjust': 'fontSizeAdjust', |
| 125 | 'font-stretch': 'fontStretch', |
| 126 | 'font-style': 'fontStyle', |
| 127 | 'font-variant': 'fontVariant', |
| 128 | 'font-weight': 'fontWeight', |
| 129 | fontfamily: 'fontFamily', |
| 130 | fontsize: 'fontSize', |
| 131 | fontsizeadjust: 'fontSizeAdjust', |
| 132 | fontstretch: 'fontStretch', |
| 133 | fontstyle: 'fontStyle', |
| 134 | fontvariant: 'fontVariant', |
| 135 | fontweight: 'fontWeight', |
| 136 | for: 'htmlFor', |
| 137 | foreignobject: 'foreignObject', |
| 138 | formaction: 'formAction', |
| 139 | formenctype: 'formEncType', |
| 140 | formmethod: 'formMethod', |
| 141 | formnovalidate: 'formNoValidate', |
| 142 | formtarget: 'formTarget', |
| 143 | frameborder: 'frameBorder', |
| 144 | 'glyph-name': 'glyphName', |
| 145 | 'glyph-orientation-horizontal': |
| 146 | 'glyphOrientationHorizontal', |
| 147 | 'glyph-orientation-vertical': |
| 148 | 'glyphOrientationVertical', |
| 149 | glyphname: 'glyphName', |
| 150 | glyphorientationhorizontal: |
| 151 | 'glyphOrientationHorizontal', |
| 152 | glyphorientationvertical: 'glyphOrientationVertical', |
| 153 | glyphref: 'glyphRef', |
| 154 | gradienttransform: 'gradientTransform', |
| 155 | gradientunits: 'gradientUnits', |
| 156 | 'horiz-adv-x': 'horizAdvX', |
| 157 | 'horiz-origin-x': 'horizOriginX', |
| 158 | horizadvx: 'horizAdvX', |
| 159 | horizoriginx: 'horizOriginX', |
| 160 | hreflang: 'hrefLang', |
| 161 | htmlfor: 'htmlFor', |
| 162 | 'http-equiv': 'httpEquiv', |
| 163 | httpequiv: 'httpEquiv', |
| 164 | 'image-rendering': 'imageRendering', |
| 165 | imagerendering: 'imageRendering', |
| 166 | innerhtml: 'innerHTML', |
| 167 | inputmode: 'inputMode', |
| 168 | itemid: 'itemID', |
| 169 | itemprop: 'itemProp', |
| 170 | itemref: 'itemRef', |
| 171 | itemscope: 'itemScope', |
| 172 | itemtype: 'itemType', |
| 173 | kernelmatrix: 'kernelMatrix', |
| 174 | kernelunitlength: 'kernelUnitLength', |
| 175 | keyparams: 'keyParams', |
| 176 | keypoints: 'keyPoints', |
| 177 | keysplines: 'keySplines', |
| 178 | keytimes: 'keyTimes', |
| 179 | keytype: 'keyType', |
| 180 | lengthadjust: 'lengthAdjust', |
| 181 | 'letter-spacing': 'letterSpacing', |
| 182 | letterspacing: 'letterSpacing', |
| 183 | 'lighting-color': 'lightingColor', |
| 184 | lightingcolor: 'lightingColor', |
| 185 | limitingconeangle: 'limitingConeAngle', |
| 186 | marginheight: 'marginHeight', |
| 187 | marginwidth: 'marginWidth', |
| 188 | 'marker-end': 'markerEnd', |
| 189 | 'marker-mid': 'markerMid', |
| 190 | 'marker-start': 'markerStart', |
| 191 | markerend: 'markerEnd', |
| 192 | markerheight: 'markerHeight', |
| 193 | markermid: 'markerMid', |
| 194 | markerstart: 'markerStart', |
| 195 | markerunits: 'markerUnits', |
| 196 | markerwidth: 'markerWidth', |
| 197 | maskcontentunits: 'maskContentUnits', |
| 198 | maskunits: 'maskUnits', |
| 199 | maxlength: 'maxLength', |
| 200 | mediagroup: 'mediaGroup', |
| 201 | minlength: 'minLength', |
| 202 | nomodule: 'noModule', |
| 203 | novalidate: 'noValidate', |
| 204 | numoctaves: 'numOctaves', |
| 205 | 'overline-position': 'overlinePosition', |
| 206 | 'overline-thickness': 'overlineThickness', |
| 207 | overlineposition: 'overlinePosition', |
| 208 | overlinethickness: 'overlineThickness', |
| 209 | 'paint-order': 'paintOrder', |
| 210 | paintorder: 'paintOrder', |
| 211 | 'panose-1': 'panose1', |
| 212 | pathlength: 'pathLength', |
| 213 | patterncontentunits: 'patternContentUnits', |
| 214 | patterntransform: 'patternTransform', |
| 215 | patternunits: 'patternUnits', |
| 216 | playsinline: 'playsInline', |
| 217 | 'pointer-events': 'pointerEvents', |
| 218 | pointerevents: 'pointerEvents', |
| 219 | pointsatx: 'pointsAtX', |
| 220 | pointsaty: 'pointsAtY', |
| 221 | pointsatz: 'pointsAtZ', |
| 222 | preservealpha: 'preserveAlpha', |
| 223 | preserveaspectratio: 'preserveAspectRatio', |
| 224 | primitiveunits: 'primitiveUnits', |
| 225 | radiogroup: 'radioGroup', |
| 226 | readonly: 'readOnly', |
| 227 | referrerpolicy: 'referrerPolicy', |
| 228 | refx: 'refX', |
| 229 | refy: 'refY', |
| 230 | 'rendering-intent': 'renderingIntent', |
| 231 | renderingintent: 'renderingIntent', |
| 232 | repeatcount: 'repeatCount', |
| 233 | repeatdur: 'repeatDur', |
| 234 | requiredextensions: 'requiredExtensions', |
| 235 | requiredfeatures: 'requiredFeatures', |
| 236 | rowspan: 'rowSpan', |
| 237 | 'shape-rendering': 'shapeRendering', |
| 238 | shaperendering: 'shapeRendering', |
| 239 | specularconstant: 'specularConstant', |
| 240 | specularexponent: 'specularExponent', |
| 241 | spellcheck: 'spellCheck', |
| 242 | spreadmethod: 'spreadMethod', |
| 243 | srcdoc: 'srcDoc', |
| 244 | srclang: 'srcLang', |
| 245 | srcset: 'srcSet', |
| 246 | startoffset: 'startOffset', |
| 247 | stddeviation: 'stdDeviation', |
| 248 | stitchtiles: 'stitchTiles', |
| 249 | 'stop-color': 'stopColor', |
| 250 | 'stop-opacity': 'stopOpacity', |
| 251 | stopcolor: 'stopColor', |
| 252 | stopopacity: 'stopOpacity', |
| 253 | 'strikethrough-position': 'strikethroughPosition', |
| 254 | 'strikethrough-thickness': 'strikethroughThickness', |
| 255 | strikethroughposition: 'strikethroughPosition', |
| 256 | strikethroughthickness: 'strikethroughThickness', |
| 257 | 'stroke-dasharray': 'strokeDasharray', |
| 258 | 'stroke-dashoffset': 'strokeDashoffset', |
| 259 | 'stroke-linecap': 'strokeLinecap', |
| 260 | 'stroke-linejoin': 'strokeLinejoin', |
| 261 | 'stroke-miterlimit': 'strokeMiterlimit', |
| 262 | 'stroke-opacity': 'strokeOpacity', |
| 263 | 'stroke-width': 'strokeWidth', |
| 264 | strokedasharray: 'strokeDasharray', |
| 265 | strokedashoffset: 'strokeDashoffset', |
| 266 | strokelinecap: 'strokeLinecap', |
| 267 | strokelinejoin: 'strokeLinejoin', |
| 268 | strokemiterlimit: 'strokeMiterlimit', |
| 269 | strokeopacity: 'strokeOpacity', |
| 270 | strokewidth: 'strokeWidth', |
| 271 | suppresscontenteditablewarning: |
| 272 | 'suppressContentEditableWarning', |
| 273 | suppresshydrationwarning: 'suppressHydrationWarning', |
| 274 | surfacescale: 'surfaceScale', |
| 275 | systemlanguage: 'systemLanguage', |
| 276 | tabindex: 'tabIndex', |
| 277 | tablevalues: 'tableValues', |
| 278 | targetx: 'targetX', |
| 279 | targety: 'targetY', |
| 280 | templatelock: 'templateLock', |
| 281 | 'text-anchor': 'textAnchor', |
| 282 | 'text-decoration': 'textDecoration', |
| 283 | 'text-rendering': 'textRendering', |
| 284 | textanchor: 'textAnchor', |
| 285 | textdecoration: 'textDecoration', |
| 286 | textlength: 'textLength', |
| 287 | textrendering: 'textRendering', |
| 288 | 'underline-position': 'underlinePosition', |
| 289 | 'underline-thickness': 'underlineThickness', |
| 290 | underlineposition: 'underlinePosition', |
| 291 | underlinethickness: 'underlineThickness', |
| 292 | 'unicode-bidi': 'unicodeBidi', |
| 293 | 'unicode-range': 'unicodeRange', |
| 294 | unicodebidi: 'unicodeBidi', |
| 295 | unicoderange: 'unicodeRange', |
| 296 | 'units-per-em': 'unitsPerEm', |
| 297 | unitsperem: 'unitsPerEm', |
| 298 | usemap: 'useMap', |
| 299 | 'v-alphabetic': 'vAlphabetic', |
| 300 | 'v-hanging': 'vHanging', |
| 301 | 'v-ideographic': 'vIdeographic', |
| 302 | 'v-mathematical': 'vMathematical', |
| 303 | valphabetic: 'vAlphabetic', |
| 304 | 'vector-effect': 'vectorEffect', |
| 305 | vectoreffect: 'vectorEffect', |
| 306 | 'vert-adv-y': 'vertAdvY', |
| 307 | 'vert-origin-x': 'vertOriginX', |
| 308 | 'vert-origin-y': 'vertOriginY', |
| 309 | vertadvy: 'vertAdvY', |
| 310 | vertoriginx: 'vertOriginX', |
| 311 | vertoriginy: 'vertOriginY', |
| 312 | vhanging: 'vHanging', |
| 313 | videographic: 'vIdeographic', |
| 314 | viewbox: 'viewBox', |
| 315 | viewtarget: 'viewTarget', |
| 316 | vmathematical: 'vMathematical', |
| 317 | 'word-spacing': 'wordSpacing', |
| 318 | wordspacing: 'wordSpacing', |
| 319 | 'writing-mode': 'writingMode', |
| 320 | writingmode: 'writingMode', |
| 321 | 'x-height': 'xHeight', |
| 322 | xchannelselector: 'xChannelSelector', |
| 323 | xheight: 'xHeight', |
| 324 | 'xlink:actuate': 'xlinkActuate', |
| 325 | 'xlink:arcrole': 'xlinkArcrole', |
| 326 | 'xlink:href': 'xlinkHref', |
| 327 | 'xlink:role': 'xlinkRole', |
| 328 | 'xlink:show': 'xlinkShow', |
| 329 | 'xlink:title': 'xlinkTitle', |
| 330 | 'xlink:type': 'xlinkType', |
| 331 | xlinkactuate: 'xlinkActuate', |
| 332 | xlinkarcrole: 'xlinkArcrole', |
| 333 | xlinkhref: 'xlinkHref', |
| 334 | xlinkrole: 'xlinkRole', |
| 335 | xlinkshow: 'xlinkShow', |
| 336 | xlinktitle: 'xlinkTitle', |
| 337 | xlinktype: 'xlinkType', |
| 338 | 'xml:base': 'xmlBase', |
| 339 | 'xml:lang': 'xmlLang', |
| 340 | 'xml:space': 'xmlSpace', |
| 341 | xmlbase: 'xmlBase', |
| 342 | xmllang: 'xmlLang', |
| 343 | 'xmlns:xlink': 'xmlnsXlink', |
| 344 | xmlnsxlink: 'xmlnsXlink', |
| 345 | xmlspace: 'xmlSpace', |
| 346 | ychannelselector: 'yChannelSelector', |
| 347 | zoomandpan: 'zoomAndPan', |
| 348 | } ); |
| 349 | }, |
| 350 | 151: ( e ) => { |
| 351 | var t = { |
| 352 | utf8: { |
| 353 | stringToBytes: function ( e ) { |
| 354 | return t.bin.stringToBytes( |
| 355 | unescape( encodeURIComponent( e ) ) |
| 356 | ); |
| 357 | }, |
| 358 | bytesToString: function ( e ) { |
| 359 | return decodeURIComponent( |
| 360 | escape( t.bin.bytesToString( e ) ) |
| 361 | ); |
| 362 | }, |
| 363 | }, |
| 364 | bin: { |
| 365 | stringToBytes: function ( e ) { |
| 366 | for ( var t = [], n = 0; n < e.length; n++ ) |
| 367 | t.push( 255 & e.charCodeAt( n ) ); |
| 368 | return t; |
| 369 | }, |
| 370 | bytesToString: function ( e ) { |
| 371 | for ( var t = [], n = 0; n < e.length; n++ ) |
| 372 | t.push( String.fromCharCode( e[ n ] ) ); |
| 373 | return t.join( '' ); |
| 374 | }, |
| 375 | }, |
| 376 | }; |
| 377 | e.exports = t; |
| 378 | }, |
| 379 | 206: ( e ) => { |
| 380 | function t( e ) { |
| 381 | return ( |
| 382 | !! e.constructor && |
| 383 | 'function' == typeof e.constructor.isBuffer && |
| 384 | e.constructor.isBuffer( e ) |
| 385 | ); |
| 386 | } |
| 387 | e.exports = function ( e ) { |
| 388 | return ( |
| 389 | null != e && |
| 390 | ( t( e ) || |
| 391 | ( function ( e ) { |
| 392 | return ( |
| 393 | 'function' == typeof e.readFloatLE && |
| 394 | 'function' == typeof e.slice && |
| 395 | t( e.slice( 0, 0 ) ) |
| 396 | ); |
| 397 | } )( e ) || |
| 398 | !! e._isBuffer ) |
| 399 | ); |
| 400 | }; |
| 401 | }, |
| 402 | 287: ( e, t ) => { |
| 403 | 'use strict'; |
| 404 | var n = Symbol.for( 'react.element' ), |
| 405 | r = Symbol.for( 'react.portal' ), |
| 406 | o = Symbol.for( 'react.fragment' ), |
| 407 | i = Symbol.for( 'react.strict_mode' ), |
| 408 | a = Symbol.for( 'react.profiler' ), |
| 409 | s = Symbol.for( 'react.provider' ), |
| 410 | l = Symbol.for( 'react.context' ), |
| 411 | c = Symbol.for( 'react.forward_ref' ), |
| 412 | d = Symbol.for( 'react.suspense' ), |
| 413 | u = Symbol.for( 'react.memo' ), |
| 414 | p = Symbol.for( 'react.lazy' ), |
| 415 | f = Symbol.iterator, |
| 416 | h = { |
| 417 | isMounted: function () { |
| 418 | return ! 1; |
| 419 | }, |
| 420 | enqueueForceUpdate: function () {}, |
| 421 | enqueueReplaceState: function () {}, |
| 422 | enqueueSetState: function () {}, |
| 423 | }, |
| 424 | m = Object.assign, |
| 425 | b = {}; |
| 426 | function g( e, t, n ) { |
| 427 | ( this.props = e ), |
| 428 | ( this.context = t ), |
| 429 | ( this.refs = b ), |
| 430 | ( this.updater = n || h ); |
| 431 | } |
| 432 | function k() {} |
| 433 | function v( e, t, n ) { |
| 434 | ( this.props = e ), |
| 435 | ( this.context = t ), |
| 436 | ( this.refs = b ), |
| 437 | ( this.updater = n || h ); |
| 438 | } |
| 439 | ( g.prototype.isReactComponent = {} ), |
| 440 | ( g.prototype.setState = function ( e, t ) { |
| 441 | if ( |
| 442 | 'object' != typeof e && |
| 443 | 'function' != typeof e && |
| 444 | null != e |
| 445 | ) |
| 446 | throw Error( |
| 447 | 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.' |
| 448 | ); |
| 449 | this.updater.enqueueSetState( this, e, t, 'setState' ); |
| 450 | } ), |
| 451 | ( g.prototype.forceUpdate = function ( e ) { |
| 452 | this.updater.enqueueForceUpdate( |
| 453 | this, |
| 454 | e, |
| 455 | 'forceUpdate' |
| 456 | ); |
| 457 | } ), |
| 458 | ( k.prototype = g.prototype ); |
| 459 | var y = ( v.prototype = new k() ); |
| 460 | ( y.constructor = v ), |
| 461 | m( y, g.prototype ), |
| 462 | ( y.isPureReactComponent = ! 0 ); |
| 463 | var x = Array.isArray, |
| 464 | w = Object.prototype.hasOwnProperty, |
| 465 | E = { current: null }, |
| 466 | _ = { key: ! 0, ref: ! 0, __self: ! 0, __source: ! 0 }; |
| 467 | function C( e, t, r ) { |
| 468 | var o, |
| 469 | i = {}, |
| 470 | a = null, |
| 471 | s = null; |
| 472 | if ( null != t ) |
| 473 | for ( o in ( void 0 !== t.ref && ( s = t.ref ), |
| 474 | void 0 !== t.key && ( a = '' + t.key ), |
| 475 | t ) ) |
| 476 | w.call( t, o ) && |
| 477 | ! _.hasOwnProperty( o ) && |
| 478 | ( i[ o ] = t[ o ] ); |
| 479 | var l = arguments.length - 2; |
| 480 | if ( 1 === l ) i.children = r; |
| 481 | else if ( 1 < l ) { |
| 482 | for ( var c = Array( l ), d = 0; d < l; d++ ) |
| 483 | c[ d ] = arguments[ d + 2 ]; |
| 484 | i.children = c; |
| 485 | } |
| 486 | if ( e && e.defaultProps ) |
| 487 | for ( o in ( l = e.defaultProps ) ) |
| 488 | void 0 === i[ o ] && ( i[ o ] = l[ o ] ); |
| 489 | return { |
| 490 | $$typeof: n, |
| 491 | type: e, |
| 492 | key: a, |
| 493 | ref: s, |
| 494 | props: i, |
| 495 | _owner: E.current, |
| 496 | }; |
| 497 | } |
| 498 | function j( e ) { |
| 499 | return ( |
| 500 | 'object' == typeof e && null !== e && e.$$typeof === n |
| 501 | ); |
| 502 | } |
| 503 | var I = /\/+/g; |
| 504 | function S( e, t ) { |
| 505 | return 'object' == typeof e && null !== e && null != e.key |
| 506 | ? ( function ( e ) { |
| 507 | var t = { '=': '=0', ':': '=2' }; |
| 508 | return ( |
| 509 | '$' + |
| 510 | e.replace( /[=:]/g, function ( e ) { |
| 511 | return t[ e ]; |
| 512 | } ) |
| 513 | ); |
| 514 | } )( '' + e.key ) |
| 515 | : t.toString( 36 ); |
| 516 | } |
| 517 | function A( e, t, o, i, a ) { |
| 518 | var s = typeof e; |
| 519 | ( 'undefined' !== s && 'boolean' !== s ) || ( e = null ); |
| 520 | var l = ! 1; |
| 521 | if ( null === e ) l = ! 0; |
| 522 | else |
| 523 | switch ( s ) { |
| 524 | case 'string': |
| 525 | case 'number': |
| 526 | l = ! 0; |
| 527 | break; |
| 528 | case 'object': |
| 529 | switch ( e.$$typeof ) { |
| 530 | case n: |
| 531 | case r: |
| 532 | l = ! 0; |
| 533 | } |
| 534 | } |
| 535 | if ( l ) |
| 536 | return ( |
| 537 | ( a = a( ( l = e ) ) ), |
| 538 | ( e = '' === i ? '.' + S( l, 0 ) : i ), |
| 539 | x( a ) |
| 540 | ? ( ( o = '' ), |
| 541 | null != e && |
| 542 | ( o = e.replace( I, '$&/' ) + '/' ), |
| 543 | A( a, t, o, '', function ( e ) { |
| 544 | return e; |
| 545 | } ) ) |
| 546 | : null != a && |
| 547 | ( j( a ) && |
| 548 | ( a = ( function ( e, t ) { |
| 549 | return { |
| 550 | $$typeof: n, |
| 551 | type: e.type, |
| 552 | key: t, |
| 553 | ref: e.ref, |
| 554 | props: e.props, |
| 555 | _owner: e._owner, |
| 556 | }; |
| 557 | } )( |
| 558 | a, |
| 559 | o + |
| 560 | ( ! a.key || |
| 561 | ( l && l.key === a.key ) |
| 562 | ? '' |
| 563 | : ( '' + a.key ).replace( |
| 564 | I, |
| 565 | '$&/' |
| 566 | ) + '/' ) + |
| 567 | e |
| 568 | ) ), |
| 569 | t.push( a ) ), |
| 570 | 1 |
| 571 | ); |
| 572 | if ( |
| 573 | ( ( l = 0 ), ( i = '' === i ? '.' : i + ':' ), x( e ) ) |
| 574 | ) |
| 575 | for ( var c = 0; c < e.length; c++ ) { |
| 576 | var d = i + S( ( s = e[ c ] ), c ); |
| 577 | l += A( s, t, o, d, a ); |
| 578 | } |
| 579 | else if ( |
| 580 | ( ( d = ( function ( e ) { |
| 581 | return null === e || 'object' != typeof e |
| 582 | ? null |
| 583 | : 'function' == |
| 584 | typeof ( e = |
| 585 | ( f && e[ f ] ) || e[ '@@iterator' ] ) |
| 586 | ? e |
| 587 | : null; |
| 588 | } )( e ) ), |
| 589 | 'function' == typeof d ) |
| 590 | ) |
| 591 | for ( |
| 592 | e = d.call( e ), c = 0; |
| 593 | ! ( s = e.next() ).done; |
| 594 | |
| 595 | ) |
| 596 | l += A( |
| 597 | ( s = s.value ), |
| 598 | t, |
| 599 | o, |
| 600 | ( d = i + S( s, c++ ) ), |
| 601 | a |
| 602 | ); |
| 603 | else if ( 'object' === s ) |
| 604 | throw ( |
| 605 | ( ( t = String( e ) ), |
| 606 | Error( |
| 607 | 'Objects are not valid as a React child (found: ' + |
| 608 | ( '[object Object]' === t |
| 609 | ? 'object with keys {' + |
| 610 | Object.keys( e ).join( ', ' ) + |
| 611 | '}' |
| 612 | : t ) + |
| 613 | '). If you meant to render a collection of children, use an array instead.' |
| 614 | ) ) |
| 615 | ); |
| 616 | return l; |
| 617 | } |
| 618 | function T( e, t, n ) { |
| 619 | if ( null == e ) return e; |
| 620 | var r = [], |
| 621 | o = 0; |
| 622 | return ( |
| 623 | A( e, r, '', '', function ( e ) { |
| 624 | return t.call( n, e, o++ ); |
| 625 | } ), |
| 626 | r |
| 627 | ); |
| 628 | } |
| 629 | function B( e ) { |
| 630 | if ( -1 === e._status ) { |
| 631 | var t = e._result; |
| 632 | ( t = t() ).then( |
| 633 | function ( t ) { |
| 634 | ( 0 !== e._status && -1 !== e._status ) || |
| 635 | ( ( e._status = 1 ), ( e._result = t ) ); |
| 636 | }, |
| 637 | function ( t ) { |
| 638 | ( 0 !== e._status && -1 !== e._status ) || |
| 639 | ( ( e._status = 2 ), ( e._result = t ) ); |
| 640 | } |
| 641 | ), |
| 642 | -1 === e._status && |
| 643 | ( ( e._status = 0 ), ( e._result = t ) ); |
| 644 | } |
| 645 | if ( 1 === e._status ) return e._result.default; |
| 646 | throw e._result; |
| 647 | } |
| 648 | var F = { current: null }, |
| 649 | O = { transition: null }, |
| 650 | N = { |
| 651 | ReactCurrentDispatcher: F, |
| 652 | ReactCurrentBatchConfig: O, |
| 653 | ReactCurrentOwner: E, |
| 654 | }; |
| 655 | function R() { |
| 656 | throw Error( |
| 657 | 'act(...) is not supported in production builds of React.' |
| 658 | ); |
| 659 | } |
| 660 | ( t.Children = { |
| 661 | map: T, |
| 662 | forEach: function ( e, t, n ) { |
| 663 | T( |
| 664 | e, |
| 665 | function () { |
| 666 | t.apply( this, arguments ); |
| 667 | }, |
| 668 | n |
| 669 | ); |
| 670 | }, |
| 671 | count: function ( e ) { |
| 672 | var t = 0; |
| 673 | return ( |
| 674 | T( e, function () { |
| 675 | t++; |
| 676 | } ), |
| 677 | t |
| 678 | ); |
| 679 | }, |
| 680 | toArray: function ( e ) { |
| 681 | return ( |
| 682 | T( e, function ( e ) { |
| 683 | return e; |
| 684 | } ) || [] |
| 685 | ); |
| 686 | }, |
| 687 | only: function ( e ) { |
| 688 | if ( ! j( e ) ) |
| 689 | throw Error( |
| 690 | 'React.Children.only expected to receive a single React element child.' |
| 691 | ); |
| 692 | return e; |
| 693 | }, |
| 694 | } ), |
| 695 | ( t.Component = g ), |
| 696 | ( t.Fragment = o ), |
| 697 | ( t.Profiler = a ), |
| 698 | ( t.PureComponent = v ), |
| 699 | ( t.StrictMode = i ), |
| 700 | ( t.Suspense = d ), |
| 701 | ( t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = |
| 702 | N ), |
| 703 | ( t.act = R ), |
| 704 | ( t.cloneElement = function ( e, t, r ) { |
| 705 | if ( null == e ) |
| 706 | throw Error( |
| 707 | 'React.cloneElement(...): The argument must be a React element, but you passed ' + |
| 708 | e + |
| 709 | '.' |
| 710 | ); |
| 711 | var o = m( {}, e.props ), |
| 712 | i = e.key, |
| 713 | a = e.ref, |
| 714 | s = e._owner; |
| 715 | if ( null != t ) { |
| 716 | if ( |
| 717 | ( void 0 !== t.ref && |
| 718 | ( ( a = t.ref ), ( s = E.current ) ), |
| 719 | void 0 !== t.key && ( i = '' + t.key ), |
| 720 | e.type && e.type.defaultProps ) |
| 721 | ) |
| 722 | var l = e.type.defaultProps; |
| 723 | for ( c in t ) |
| 724 | w.call( t, c ) && |
| 725 | ! _.hasOwnProperty( c ) && |
| 726 | ( o[ c ] = |
| 727 | void 0 === t[ c ] && void 0 !== l |
| 728 | ? l[ c ] |
| 729 | : t[ c ] ); |
| 730 | } |
| 731 | var c = arguments.length - 2; |
| 732 | if ( 1 === c ) o.children = r; |
| 733 | else if ( 1 < c ) { |
| 734 | l = Array( c ); |
| 735 | for ( var d = 0; d < c; d++ ) |
| 736 | l[ d ] = arguments[ d + 2 ]; |
| 737 | o.children = l; |
| 738 | } |
| 739 | return { |
| 740 | $$typeof: n, |
| 741 | type: e.type, |
| 742 | key: i, |
| 743 | ref: a, |
| 744 | props: o, |
| 745 | _owner: s, |
| 746 | }; |
| 747 | } ), |
| 748 | ( t.createContext = function ( e ) { |
| 749 | return ( |
| 750 | ( ( e = { |
| 751 | $$typeof: l, |
| 752 | _currentValue: e, |
| 753 | _currentValue2: e, |
| 754 | _threadCount: 0, |
| 755 | Provider: null, |
| 756 | Consumer: null, |
| 757 | _defaultValue: null, |
| 758 | _globalName: null, |
| 759 | } ).Provider = { $$typeof: s, _context: e } ), |
| 760 | ( e.Consumer = e ) |
| 761 | ); |
| 762 | } ), |
| 763 | ( t.createElement = C ), |
| 764 | ( t.createFactory = function ( e ) { |
| 765 | var t = C.bind( null, e ); |
| 766 | return ( t.type = e ), t; |
| 767 | } ), |
| 768 | ( t.createRef = function () { |
| 769 | return { current: null }; |
| 770 | } ), |
| 771 | ( t.forwardRef = function ( e ) { |
| 772 | return { $$typeof: c, render: e }; |
| 773 | } ), |
| 774 | ( t.isValidElement = j ), |
| 775 | ( t.lazy = function ( e ) { |
| 776 | return { |
| 777 | $$typeof: p, |
| 778 | _payload: { _status: -1, _result: e }, |
| 779 | _init: B, |
| 780 | }; |
| 781 | } ), |
| 782 | ( t.memo = function ( e, t ) { |
| 783 | return { |
| 784 | $$typeof: u, |
| 785 | type: e, |
| 786 | compare: void 0 === t ? null : t, |
| 787 | }; |
| 788 | } ), |
| 789 | ( t.startTransition = function ( e ) { |
| 790 | var t = O.transition; |
| 791 | O.transition = {}; |
| 792 | try { |
| 793 | e(); |
| 794 | } finally { |
| 795 | O.transition = t; |
| 796 | } |
| 797 | } ), |
| 798 | ( t.unstable_act = R ), |
| 799 | ( t.useCallback = function ( e, t ) { |
| 800 | return F.current.useCallback( e, t ); |
| 801 | } ), |
| 802 | ( t.useContext = function ( e ) { |
| 803 | return F.current.useContext( e ); |
| 804 | } ), |
| 805 | ( t.useDebugValue = function () {} ), |
| 806 | ( t.useDeferredValue = function ( e ) { |
| 807 | return F.current.useDeferredValue( e ); |
| 808 | } ), |
| 809 | ( t.useEffect = function ( e, t ) { |
| 810 | return F.current.useEffect( e, t ); |
| 811 | } ), |
| 812 | ( t.useId = function () { |
| 813 | return F.current.useId(); |
| 814 | } ), |
| 815 | ( t.useImperativeHandle = function ( e, t, n ) { |
| 816 | return F.current.useImperativeHandle( e, t, n ); |
| 817 | } ), |
| 818 | ( t.useInsertionEffect = function ( e, t ) { |
| 819 | return F.current.useInsertionEffect( e, t ); |
| 820 | } ), |
| 821 | ( t.useLayoutEffect = function ( e, t ) { |
| 822 | return F.current.useLayoutEffect( e, t ); |
| 823 | } ), |
| 824 | ( t.useMemo = function ( e, t ) { |
| 825 | return F.current.useMemo( e, t ); |
| 826 | } ), |
| 827 | ( t.useReducer = function ( e, t, n ) { |
| 828 | return F.current.useReducer( e, t, n ); |
| 829 | } ), |
| 830 | ( t.useRef = function ( e ) { |
| 831 | return F.current.useRef( e ); |
| 832 | } ), |
| 833 | ( t.useState = function ( e ) { |
| 834 | return F.current.useState( e ); |
| 835 | } ), |
| 836 | ( t.useSyncExternalStore = function ( e, t, n ) { |
| 837 | return F.current.useSyncExternalStore( e, t, n ); |
| 838 | } ), |
| 839 | ( t.useTransition = function () { |
| 840 | return F.current.useTransition(); |
| 841 | } ), |
| 842 | ( t.version = '18.3.1' ); |
| 843 | }, |
| 844 | 503: ( e, t, n ) => { |
| 845 | var r, o, i, a, s; |
| 846 | ( r = n( 939 ) ), |
| 847 | ( o = n( 151 ).utf8 ), |
| 848 | ( i = n( 206 ) ), |
| 849 | ( a = n( 151 ).bin ), |
| 850 | ( ( s = function ( e, t ) { |
| 851 | e.constructor == String |
| 852 | ? ( e = |
| 853 | t && 'binary' === t.encoding |
| 854 | ? a.stringToBytes( e ) |
| 855 | : o.stringToBytes( e ) ) |
| 856 | : i( e ) |
| 857 | ? ( e = Array.prototype.slice.call( e, 0 ) ) |
| 858 | : Array.isArray( e ) || |
| 859 | e.constructor === Uint8Array || |
| 860 | ( e = e.toString() ); |
| 861 | for ( |
| 862 | var n = r.bytesToWords( e ), |
| 863 | l = 8 * e.length, |
| 864 | c = 1732584193, |
| 865 | d = -271733879, |
| 866 | u = -1732584194, |
| 867 | p = 271733878, |
| 868 | f = 0; |
| 869 | f < n.length; |
| 870 | f++ |
| 871 | ) |
| 872 | n[ f ] = |
| 873 | ( 16711935 & |
| 874 | ( ( n[ f ] << 8 ) | ( n[ f ] >>> 24 ) ) ) | |
| 875 | ( 4278255360 & |
| 876 | ( ( n[ f ] << 24 ) | ( n[ f ] >>> 8 ) ) ); |
| 877 | ( n[ l >>> 5 ] |= 128 << l % 32 ), |
| 878 | ( n[ 14 + ( ( ( l + 64 ) >>> 9 ) << 4 ) ] = l ); |
| 879 | var h = s._ff, |
| 880 | m = s._gg, |
| 881 | b = s._hh, |
| 882 | g = s._ii; |
| 883 | for ( f = 0; f < n.length; f += 16 ) { |
| 884 | var k = c, |
| 885 | v = d, |
| 886 | y = u, |
| 887 | x = p; |
| 888 | ( c = h( c, d, u, p, n[ f + 0 ], 7, -680876936 ) ), |
| 889 | ( p = h( |
| 890 | p, |
| 891 | c, |
| 892 | d, |
| 893 | u, |
| 894 | n[ f + 1 ], |
| 895 | 12, |
| 896 | -389564586 |
| 897 | ) ), |
| 898 | ( u = h( |
| 899 | u, |
| 900 | p, |
| 901 | c, |
| 902 | d, |
| 903 | n[ f + 2 ], |
| 904 | 17, |
| 905 | 606105819 |
| 906 | ) ), |
| 907 | ( d = h( |
| 908 | d, |
| 909 | u, |
| 910 | p, |
| 911 | c, |
| 912 | n[ f + 3 ], |
| 913 | 22, |
| 914 | -1044525330 |
| 915 | ) ), |
| 916 | ( c = h( |
| 917 | c, |
| 918 | d, |
| 919 | u, |
| 920 | p, |
| 921 | n[ f + 4 ], |
| 922 | 7, |
| 923 | -176418897 |
| 924 | ) ), |
| 925 | ( p = h( |
| 926 | p, |
| 927 | c, |
| 928 | d, |
| 929 | u, |
| 930 | n[ f + 5 ], |
| 931 | 12, |
| 932 | 1200080426 |
| 933 | ) ), |
| 934 | ( u = h( |
| 935 | u, |
| 936 | p, |
| 937 | c, |
| 938 | d, |
| 939 | n[ f + 6 ], |
| 940 | 17, |
| 941 | -1473231341 |
| 942 | ) ), |
| 943 | ( d = h( |
| 944 | d, |
| 945 | u, |
| 946 | p, |
| 947 | c, |
| 948 | n[ f + 7 ], |
| 949 | 22, |
| 950 | -45705983 |
| 951 | ) ), |
| 952 | ( c = h( |
| 953 | c, |
| 954 | d, |
| 955 | u, |
| 956 | p, |
| 957 | n[ f + 8 ], |
| 958 | 7, |
| 959 | 1770035416 |
| 960 | ) ), |
| 961 | ( p = h( |
| 962 | p, |
| 963 | c, |
| 964 | d, |
| 965 | u, |
| 966 | n[ f + 9 ], |
| 967 | 12, |
| 968 | -1958414417 |
| 969 | ) ), |
| 970 | ( u = h( |
| 971 | u, |
| 972 | p, |
| 973 | c, |
| 974 | d, |
| 975 | n[ f + 10 ], |
| 976 | 17, |
| 977 | -42063 |
| 978 | ) ), |
| 979 | ( d = h( |
| 980 | d, |
| 981 | u, |
| 982 | p, |
| 983 | c, |
| 984 | n[ f + 11 ], |
| 985 | 22, |
| 986 | -1990404162 |
| 987 | ) ), |
| 988 | ( c = h( |
| 989 | c, |
| 990 | d, |
| 991 | u, |
| 992 | p, |
| 993 | n[ f + 12 ], |
| 994 | 7, |
| 995 | 1804603682 |
| 996 | ) ), |
| 997 | ( p = h( |
| 998 | p, |
| 999 | c, |
| 1000 | d, |
| 1001 | u, |
| 1002 | n[ f + 13 ], |
| 1003 | 12, |
| 1004 | -40341101 |
| 1005 | ) ), |
| 1006 | ( u = h( |
| 1007 | u, |
| 1008 | p, |
| 1009 | c, |
| 1010 | d, |
| 1011 | n[ f + 14 ], |
| 1012 | 17, |
| 1013 | -1502002290 |
| 1014 | ) ), |
| 1015 | ( c = m( |
| 1016 | c, |
| 1017 | ( d = h( |
| 1018 | d, |
| 1019 | u, |
| 1020 | p, |
| 1021 | c, |
| 1022 | n[ f + 15 ], |
| 1023 | 22, |
| 1024 | 1236535329 |
| 1025 | ) ), |
| 1026 | u, |
| 1027 | p, |
| 1028 | n[ f + 1 ], |
| 1029 | 5, |
| 1030 | -165796510 |
| 1031 | ) ), |
| 1032 | ( p = m( |
| 1033 | p, |
| 1034 | c, |
| 1035 | d, |
| 1036 | u, |
| 1037 | n[ f + 6 ], |
| 1038 | 9, |
| 1039 | -1069501632 |
| 1040 | ) ), |
| 1041 | ( u = m( |
| 1042 | u, |
| 1043 | p, |
| 1044 | c, |
| 1045 | d, |
| 1046 | n[ f + 11 ], |
| 1047 | 14, |
| 1048 | 643717713 |
| 1049 | ) ), |
| 1050 | ( d = m( |
| 1051 | d, |
| 1052 | u, |
| 1053 | p, |
| 1054 | c, |
| 1055 | n[ f + 0 ], |
| 1056 | 20, |
| 1057 | -373897302 |
| 1058 | ) ), |
| 1059 | ( c = m( |
| 1060 | c, |
| 1061 | d, |
| 1062 | u, |
| 1063 | p, |
| 1064 | n[ f + 5 ], |
| 1065 | 5, |
| 1066 | -701558691 |
| 1067 | ) ), |
| 1068 | ( p = m( |
| 1069 | p, |
| 1070 | c, |
| 1071 | d, |
| 1072 | u, |
| 1073 | n[ f + 10 ], |
| 1074 | 9, |
| 1075 | 38016083 |
| 1076 | ) ), |
| 1077 | ( u = m( |
| 1078 | u, |
| 1079 | p, |
| 1080 | c, |
| 1081 | d, |
| 1082 | n[ f + 15 ], |
| 1083 | 14, |
| 1084 | -660478335 |
| 1085 | ) ), |
| 1086 | ( d = m( |
| 1087 | d, |
| 1088 | u, |
| 1089 | p, |
| 1090 | c, |
| 1091 | n[ f + 4 ], |
| 1092 | 20, |
| 1093 | -405537848 |
| 1094 | ) ), |
| 1095 | ( c = m( |
| 1096 | c, |
| 1097 | d, |
| 1098 | u, |
| 1099 | p, |
| 1100 | n[ f + 9 ], |
| 1101 | 5, |
| 1102 | 568446438 |
| 1103 | ) ), |
| 1104 | ( p = m( |
| 1105 | p, |
| 1106 | c, |
| 1107 | d, |
| 1108 | u, |
| 1109 | n[ f + 14 ], |
| 1110 | 9, |
| 1111 | -1019803690 |
| 1112 | ) ), |
| 1113 | ( u = m( |
| 1114 | u, |
| 1115 | p, |
| 1116 | c, |
| 1117 | d, |
| 1118 | n[ f + 3 ], |
| 1119 | 14, |
| 1120 | -187363961 |
| 1121 | ) ), |
| 1122 | ( d = m( |
| 1123 | d, |
| 1124 | u, |
| 1125 | p, |
| 1126 | c, |
| 1127 | n[ f + 8 ], |
| 1128 | 20, |
| 1129 | 1163531501 |
| 1130 | ) ), |
| 1131 | ( c = m( |
| 1132 | c, |
| 1133 | d, |
| 1134 | u, |
| 1135 | p, |
| 1136 | n[ f + 13 ], |
| 1137 | 5, |
| 1138 | -1444681467 |
| 1139 | ) ), |
| 1140 | ( p = m( |
| 1141 | p, |
| 1142 | c, |
| 1143 | d, |
| 1144 | u, |
| 1145 | n[ f + 2 ], |
| 1146 | 9, |
| 1147 | -51403784 |
| 1148 | ) ), |
| 1149 | ( u = m( |
| 1150 | u, |
| 1151 | p, |
| 1152 | c, |
| 1153 | d, |
| 1154 | n[ f + 7 ], |
| 1155 | 14, |
| 1156 | 1735328473 |
| 1157 | ) ), |
| 1158 | ( c = b( |
| 1159 | c, |
| 1160 | ( d = m( |
| 1161 | d, |
| 1162 | u, |
| 1163 | p, |
| 1164 | c, |
| 1165 | n[ f + 12 ], |
| 1166 | 20, |
| 1167 | -1926607734 |
| 1168 | ) ), |
| 1169 | u, |
| 1170 | p, |
| 1171 | n[ f + 5 ], |
| 1172 | 4, |
| 1173 | -378558 |
| 1174 | ) ), |
| 1175 | ( p = b( |
| 1176 | p, |
| 1177 | c, |
| 1178 | d, |
| 1179 | u, |
| 1180 | n[ f + 8 ], |
| 1181 | 11, |
| 1182 | -2022574463 |
| 1183 | ) ), |
| 1184 | ( u = b( |
| 1185 | u, |
| 1186 | p, |
| 1187 | c, |
| 1188 | d, |
| 1189 | n[ f + 11 ], |
| 1190 | 16, |
| 1191 | 1839030562 |
| 1192 | ) ), |
| 1193 | ( d = b( |
| 1194 | d, |
| 1195 | u, |
| 1196 | p, |
| 1197 | c, |
| 1198 | n[ f + 14 ], |
| 1199 | 23, |
| 1200 | -35309556 |
| 1201 | ) ), |
| 1202 | ( c = b( |
| 1203 | c, |
| 1204 | d, |
| 1205 | u, |
| 1206 | p, |
| 1207 | n[ f + 1 ], |
| 1208 | 4, |
| 1209 | -1530992060 |
| 1210 | ) ), |
| 1211 | ( p = b( |
| 1212 | p, |
| 1213 | c, |
| 1214 | d, |
| 1215 | u, |
| 1216 | n[ f + 4 ], |
| 1217 | 11, |
| 1218 | 1272893353 |
| 1219 | ) ), |
| 1220 | ( u = b( |
| 1221 | u, |
| 1222 | p, |
| 1223 | c, |
| 1224 | d, |
| 1225 | n[ f + 7 ], |
| 1226 | 16, |
| 1227 | -155497632 |
| 1228 | ) ), |
| 1229 | ( d = b( |
| 1230 | d, |
| 1231 | u, |
| 1232 | p, |
| 1233 | c, |
| 1234 | n[ f + 10 ], |
| 1235 | 23, |
| 1236 | -1094730640 |
| 1237 | ) ), |
| 1238 | ( c = b( |
| 1239 | c, |
| 1240 | d, |
| 1241 | u, |
| 1242 | p, |
| 1243 | n[ f + 13 ], |
| 1244 | 4, |
| 1245 | 681279174 |
| 1246 | ) ), |
| 1247 | ( p = b( |
| 1248 | p, |
| 1249 | c, |
| 1250 | d, |
| 1251 | u, |
| 1252 | n[ f + 0 ], |
| 1253 | 11, |
| 1254 | -358537222 |
| 1255 | ) ), |
| 1256 | ( u = b( |
| 1257 | u, |
| 1258 | p, |
| 1259 | c, |
| 1260 | d, |
| 1261 | n[ f + 3 ], |
| 1262 | 16, |
| 1263 | -722521979 |
| 1264 | ) ), |
| 1265 | ( d = b( |
| 1266 | d, |
| 1267 | u, |
| 1268 | p, |
| 1269 | c, |
| 1270 | n[ f + 6 ], |
| 1271 | 23, |
| 1272 | 76029189 |
| 1273 | ) ), |
| 1274 | ( c = b( |
| 1275 | c, |
| 1276 | d, |
| 1277 | u, |
| 1278 | p, |
| 1279 | n[ f + 9 ], |
| 1280 | 4, |
| 1281 | -640364487 |
| 1282 | ) ), |
| 1283 | ( p = b( |
| 1284 | p, |
| 1285 | c, |
| 1286 | d, |
| 1287 | u, |
| 1288 | n[ f + 12 ], |
| 1289 | 11, |
| 1290 | -421815835 |
| 1291 | ) ), |
| 1292 | ( u = b( |
| 1293 | u, |
| 1294 | p, |
| 1295 | c, |
| 1296 | d, |
| 1297 | n[ f + 15 ], |
| 1298 | 16, |
| 1299 | 530742520 |
| 1300 | ) ), |
| 1301 | ( c = g( |
| 1302 | c, |
| 1303 | ( d = b( |
| 1304 | d, |
| 1305 | u, |
| 1306 | p, |
| 1307 | c, |
| 1308 | n[ f + 2 ], |
| 1309 | 23, |
| 1310 | -995338651 |
| 1311 | ) ), |
| 1312 | u, |
| 1313 | p, |
| 1314 | n[ f + 0 ], |
| 1315 | 6, |
| 1316 | -198630844 |
| 1317 | ) ), |
| 1318 | ( p = g( |
| 1319 | p, |
| 1320 | c, |
| 1321 | d, |
| 1322 | u, |
| 1323 | n[ f + 7 ], |
| 1324 | 10, |
| 1325 | 1126891415 |
| 1326 | ) ), |
| 1327 | ( u = g( |
| 1328 | u, |
| 1329 | p, |
| 1330 | c, |
| 1331 | d, |
| 1332 | n[ f + 14 ], |
| 1333 | 15, |
| 1334 | -1416354905 |
| 1335 | ) ), |
| 1336 | ( d = g( |
| 1337 | d, |
| 1338 | u, |
| 1339 | p, |
| 1340 | c, |
| 1341 | n[ f + 5 ], |
| 1342 | 21, |
| 1343 | -57434055 |
| 1344 | ) ), |
| 1345 | ( c = g( |
| 1346 | c, |
| 1347 | d, |
| 1348 | u, |
| 1349 | p, |
| 1350 | n[ f + 12 ], |
| 1351 | 6, |
| 1352 | 1700485571 |
| 1353 | ) ), |
| 1354 | ( p = g( |
| 1355 | p, |
| 1356 | c, |
| 1357 | d, |
| 1358 | u, |
| 1359 | n[ f + 3 ], |
| 1360 | 10, |
| 1361 | -1894986606 |
| 1362 | ) ), |
| 1363 | ( u = g( |
| 1364 | u, |
| 1365 | p, |
| 1366 | c, |
| 1367 | d, |
| 1368 | n[ f + 10 ], |
| 1369 | 15, |
| 1370 | -1051523 |
| 1371 | ) ), |
| 1372 | ( d = g( |
| 1373 | d, |
| 1374 | u, |
| 1375 | p, |
| 1376 | c, |
| 1377 | n[ f + 1 ], |
| 1378 | 21, |
| 1379 | -2054922799 |
| 1380 | ) ), |
| 1381 | ( c = g( |
| 1382 | c, |
| 1383 | d, |
| 1384 | u, |
| 1385 | p, |
| 1386 | n[ f + 8 ], |
| 1387 | 6, |
| 1388 | 1873313359 |
| 1389 | ) ), |
| 1390 | ( p = g( |
| 1391 | p, |
| 1392 | c, |
| 1393 | d, |
| 1394 | u, |
| 1395 | n[ f + 15 ], |
| 1396 | 10, |
| 1397 | -30611744 |
| 1398 | ) ), |
| 1399 | ( u = g( |
| 1400 | u, |
| 1401 | p, |
| 1402 | c, |
| 1403 | d, |
| 1404 | n[ f + 6 ], |
| 1405 | 15, |
| 1406 | -1560198380 |
| 1407 | ) ), |
| 1408 | ( d = g( |
| 1409 | d, |
| 1410 | u, |
| 1411 | p, |
| 1412 | c, |
| 1413 | n[ f + 13 ], |
| 1414 | 21, |
| 1415 | 1309151649 |
| 1416 | ) ), |
| 1417 | ( c = g( |
| 1418 | c, |
| 1419 | d, |
| 1420 | u, |
| 1421 | p, |
| 1422 | n[ f + 4 ], |
| 1423 | 6, |
| 1424 | -145523070 |
| 1425 | ) ), |
| 1426 | ( p = g( |
| 1427 | p, |
| 1428 | c, |
| 1429 | d, |
| 1430 | u, |
| 1431 | n[ f + 11 ], |
| 1432 | 10, |
| 1433 | -1120210379 |
| 1434 | ) ), |
| 1435 | ( u = g( |
| 1436 | u, |
| 1437 | p, |
| 1438 | c, |
| 1439 | d, |
| 1440 | n[ f + 2 ], |
| 1441 | 15, |
| 1442 | 718787259 |
| 1443 | ) ), |
| 1444 | ( d = g( |
| 1445 | d, |
| 1446 | u, |
| 1447 | p, |
| 1448 | c, |
| 1449 | n[ f + 9 ], |
| 1450 | 21, |
| 1451 | -343485551 |
| 1452 | ) ), |
| 1453 | ( c = ( c + k ) >>> 0 ), |
| 1454 | ( d = ( d + v ) >>> 0 ), |
| 1455 | ( u = ( u + y ) >>> 0 ), |
| 1456 | ( p = ( p + x ) >>> 0 ); |
| 1457 | } |
| 1458 | return r.endian( [ c, d, u, p ] ); |
| 1459 | } )._ff = function ( e, t, n, r, o, i, a ) { |
| 1460 | var s = |
| 1461 | e + ( ( t & n ) | ( ~t & r ) ) + ( o >>> 0 ) + a; |
| 1462 | return ( ( s << i ) | ( s >>> ( 32 - i ) ) ) + t; |
| 1463 | } ), |
| 1464 | ( s._gg = function ( e, t, n, r, o, i, a ) { |
| 1465 | var s = |
| 1466 | e + ( ( t & r ) | ( n & ~r ) ) + ( o >>> 0 ) + a; |
| 1467 | return ( ( s << i ) | ( s >>> ( 32 - i ) ) ) + t; |
| 1468 | } ), |
| 1469 | ( s._hh = function ( e, t, n, r, o, i, a ) { |
| 1470 | var s = e + ( t ^ n ^ r ) + ( o >>> 0 ) + a; |
| 1471 | return ( ( s << i ) | ( s >>> ( 32 - i ) ) ) + t; |
| 1472 | } ), |
| 1473 | ( s._ii = function ( e, t, n, r, o, i, a ) { |
| 1474 | var s = e + ( n ^ ( t | ~r ) ) + ( o >>> 0 ) + a; |
| 1475 | return ( ( s << i ) | ( s >>> ( 32 - i ) ) ) + t; |
| 1476 | } ), |
| 1477 | ( s._blocksize = 16 ), |
| 1478 | ( s._digestsize = 16 ), |
| 1479 | ( e.exports = function ( e, t ) { |
| 1480 | if ( null == e ) |
| 1481 | throw new Error( 'Illegal argument ' + e ); |
| 1482 | var n = r.wordsToBytes( s( e, t ) ); |
| 1483 | return t && t.asBytes |
| 1484 | ? n |
| 1485 | : t && t.asString |
| 1486 | ? a.bytesToString( n ) |
| 1487 | : r.bytesToHex( n ); |
| 1488 | } ); |
| 1489 | }, |
| 1490 | 540: ( e, t, n ) => { |
| 1491 | 'use strict'; |
| 1492 | e.exports = n( 287 ); |
| 1493 | }, |
| 1494 | 848: ( e, t, n ) => { |
| 1495 | 'use strict'; |
| 1496 | e.exports = n( 20 ); |
| 1497 | }, |
| 1498 | 939: ( e ) => { |
| 1499 | var t, n; |
| 1500 | ( t = |
| 1501 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' ), |
| 1502 | ( n = { |
| 1503 | rotl: function ( e, t ) { |
| 1504 | return ( e << t ) | ( e >>> ( 32 - t ) ); |
| 1505 | }, |
| 1506 | rotr: function ( e, t ) { |
| 1507 | return ( e << ( 32 - t ) ) | ( e >>> t ); |
| 1508 | }, |
| 1509 | endian: function ( e ) { |
| 1510 | if ( e.constructor == Number ) |
| 1511 | return ( |
| 1512 | ( 16711935 & n.rotl( e, 8 ) ) | |
| 1513 | ( 4278255360 & n.rotl( e, 24 ) ) |
| 1514 | ); |
| 1515 | for ( var t = 0; t < e.length; t++ ) |
| 1516 | e[ t ] = n.endian( e[ t ] ); |
| 1517 | return e; |
| 1518 | }, |
| 1519 | randomBytes: function ( e ) { |
| 1520 | for ( var t = []; e > 0; e-- ) |
| 1521 | t.push( Math.floor( 256 * Math.random() ) ); |
| 1522 | return t; |
| 1523 | }, |
| 1524 | bytesToWords: function ( e ) { |
| 1525 | for ( |
| 1526 | var t = [], n = 0, r = 0; |
| 1527 | n < e.length; |
| 1528 | n++, r += 8 |
| 1529 | ) |
| 1530 | t[ r >>> 5 ] |= e[ n ] << ( 24 - ( r % 32 ) ); |
| 1531 | return t; |
| 1532 | }, |
| 1533 | wordsToBytes: function ( e ) { |
| 1534 | for ( var t = [], n = 0; n < 32 * e.length; n += 8 ) |
| 1535 | t.push( |
| 1536 | ( e[ n >>> 5 ] >>> ( 24 - ( n % 32 ) ) ) & |
| 1537 | 255 |
| 1538 | ); |
| 1539 | return t; |
| 1540 | }, |
| 1541 | bytesToHex: function ( e ) { |
| 1542 | for ( var t = [], n = 0; n < e.length; n++ ) |
| 1543 | t.push( ( e[ n ] >>> 4 ).toString( 16 ) ), |
| 1544 | t.push( ( 15 & e[ n ] ).toString( 16 ) ); |
| 1545 | return t.join( '' ); |
| 1546 | }, |
| 1547 | hexToBytes: function ( e ) { |
| 1548 | for ( var t = [], n = 0; n < e.length; n += 2 ) |
| 1549 | t.push( parseInt( e.substr( n, 2 ), 16 ) ); |
| 1550 | return t; |
| 1551 | }, |
| 1552 | bytesToBase64: function ( e ) { |
| 1553 | for ( var n = [], r = 0; r < e.length; r += 3 ) |
| 1554 | for ( |
| 1555 | var o = |
| 1556 | ( e[ r ] << 16 ) | |
| 1557 | ( e[ r + 1 ] << 8 ) | |
| 1558 | e[ r + 2 ], |
| 1559 | i = 0; |
| 1560 | i < 4; |
| 1561 | i++ |
| 1562 | ) |
| 1563 | 8 * r + 6 * i <= 8 * e.length |
| 1564 | ? n.push( |
| 1565 | t.charAt( |
| 1566 | ( o >>> |
| 1567 | ( 6 * ( 3 - i ) ) ) & |
| 1568 | 63 |
| 1569 | ) |
| 1570 | ) |
| 1571 | : n.push( '=' ); |
| 1572 | return n.join( '' ); |
| 1573 | }, |
| 1574 | base64ToBytes: function ( e ) { |
| 1575 | e = e.replace( /[^A-Z0-9+\/]/gi, '' ); |
| 1576 | for ( |
| 1577 | var n = [], r = 0, o = 0; |
| 1578 | r < e.length; |
| 1579 | o = ++r % 4 |
| 1580 | ) |
| 1581 | 0 != o && |
| 1582 | n.push( |
| 1583 | ( ( t.indexOf( e.charAt( r - 1 ) ) & |
| 1584 | ( Math.pow( 2, -2 * o + 8 ) - |
| 1585 | 1 ) ) << |
| 1586 | ( 2 * o ) ) | |
| 1587 | ( t.indexOf( e.charAt( r ) ) >>> |
| 1588 | ( 6 - 2 * o ) ) |
| 1589 | ); |
| 1590 | return n; |
| 1591 | }, |
| 1592 | } ), |
| 1593 | ( e.exports = n ); |
| 1594 | }, |
| 1595 | }, |
| 1596 | t = {}; |
| 1597 | function n( r ) { |
| 1598 | var o = t[ r ]; |
| 1599 | if ( void 0 !== o ) return o.exports; |
| 1600 | var i = ( t[ r ] = { exports: {} } ); |
| 1601 | return e[ r ]( i, i.exports, n ), i.exports; |
| 1602 | } |
| 1603 | ( () => { |
| 1604 | 'use strict'; |
| 1605 | n( 138 ); |
| 1606 | var e = n( 848 ); |
| 1607 | const t = n( 503 ); |
| 1608 | ( ( n, r ) => { |
| 1609 | const { |
| 1610 | BlockControls: o, |
| 1611 | InspectorControls: i, |
| 1612 | InnerBlocks: a, |
| 1613 | useBlockProps: s, |
| 1614 | AlignmentToolbar: l, |
| 1615 | BlockVerticalAlignmentToolbar: c, |
| 1616 | } = wp.blockEditor, |
| 1617 | { |
| 1618 | ToolbarGroup: d, |
| 1619 | ToolbarButton: u, |
| 1620 | Placeholder: p, |
| 1621 | Spinner: f, |
| 1622 | } = wp.components, |
| 1623 | { Fragment: h } = wp.element, |
| 1624 | { Component: m } = React, |
| 1625 | { useSelect: b } = wp.data, |
| 1626 | { createHigherOrderComponent: g } = wp.compose, |
| 1627 | k = |
| 1628 | wp.blockEditor.__experimentalBlockAlignmentMatrixToolbar || |
| 1629 | wp.blockEditor.BlockAlignmentMatrixToolbar, |
| 1630 | v = |
| 1631 | wp.blockEditor.__experimentalBlockAlignmentMatrixControl || |
| 1632 | wp.blockEditor.BlockAlignmentMatrixControl, |
| 1633 | y = |
| 1634 | wp.blockEditor |
| 1635 | .__experimentalBlockFullHeightAligmentControl || |
| 1636 | wp.blockEditor |
| 1637 | .__experimentalBlockFullHeightAlignmentControl || |
| 1638 | wp.blockEditor.BlockFullHeightAlignmentControl, |
| 1639 | x = |
| 1640 | wp.blockEditor.__experimentalUseInnerBlocksProps || |
| 1641 | wp.blockEditor.useInnerBlocksProps, |
| 1642 | w = {}; |
| 1643 | function E( e ) { |
| 1644 | return w[ e ] || ! 1; |
| 1645 | } |
| 1646 | function _( e ) { |
| 1647 | return E( e ).acf_block_version || 1; |
| 1648 | } |
| 1649 | function C( e ) { |
| 1650 | return E( e ).validate; |
| 1651 | } |
| 1652 | function j( e ) { |
| 1653 | const t = wp.data |
| 1654 | .select( 'core/block-editor' ) |
| 1655 | .getBlockParents( e ); |
| 1656 | return wp.data |
| 1657 | .select( 'core/block-editor' ) |
| 1658 | .getBlocksByClientId( t ) |
| 1659 | .filter( ( e ) => 'core/query' === e.name ).length; |
| 1660 | } |
| 1661 | function I() { |
| 1662 | return ( |
| 1663 | document.querySelectorAll( 'iframe[name="editor-canvas"]' ) |
| 1664 | .length > 0 |
| 1665 | ); |
| 1666 | } |
| 1667 | function S( t ) { |
| 1668 | const n = t.post_types || []; |
| 1669 | if ( n.length ) { |
| 1670 | n.push( 'wp_block' ); |
| 1671 | const e = acf.get( 'postType' ); |
| 1672 | if ( ! n.includes( e ) ) return ! 1; |
| 1673 | } |
| 1674 | if ( |
| 1675 | 'string' == typeof t.icon && |
| 1676 | '<svg' === t.icon.substr( 0, 4 ) |
| 1677 | ) { |
| 1678 | const n = t.icon; |
| 1679 | t.icon = ( 0, e.jsx )( $, { children: n } ); |
| 1680 | } |
| 1681 | t.icon || delete t.icon, |
| 1682 | wp.blocks |
| 1683 | .getCategories() |
| 1684 | .filter( ( { slug: e } ) => e === t.category ) |
| 1685 | .pop() || ( t.category = 'common' ), |
| 1686 | ( t = acf.parseArgs( t, { |
| 1687 | title: '', |
| 1688 | name: '', |
| 1689 | category: '', |
| 1690 | api_version: 2, |
| 1691 | acf_block_version: 1, |
| 1692 | } ) ); |
| 1693 | for ( const e in t.attributes ) |
| 1694 | 'default' in t.attributes[ e ] && |
| 1695 | 0 === t.attributes[ e ].default.length && |
| 1696 | delete t.attributes[ e ].default; |
| 1697 | t.supports.anchor && |
| 1698 | ( t.attributes.anchor = { type: 'string' } ); |
| 1699 | let i = L, |
| 1700 | a = H; |
| 1701 | var s; |
| 1702 | ( t.supports.alignText || t.supports.align_text ) && |
| 1703 | ( ( t.attributes = Y( |
| 1704 | t.attributes, |
| 1705 | 'align_text', |
| 1706 | 'string' |
| 1707 | ) ), |
| 1708 | ( i = ( function ( t, n ) { |
| 1709 | const r = J; |
| 1710 | return ( |
| 1711 | ( n.alignText = r( n.alignText ) ), |
| 1712 | class extends m { |
| 1713 | render() { |
| 1714 | const { attributes: n, setAttributes: i } = |
| 1715 | this.props, |
| 1716 | { alignText: a } = n; |
| 1717 | return ( 0, e.jsxs )( h, { |
| 1718 | children: [ |
| 1719 | ( 0, e.jsx )( o, { |
| 1720 | group: 'block', |
| 1721 | children: ( 0, e.jsx )( l, { |
| 1722 | value: r( a ), |
| 1723 | onChange: function ( e ) { |
| 1724 | i( { |
| 1725 | alignText: r( e ), |
| 1726 | } ); |
| 1727 | }, |
| 1728 | } ), |
| 1729 | } ), |
| 1730 | ( 0, e.jsx )( t, { |
| 1731 | ...this.props, |
| 1732 | } ), |
| 1733 | ], |
| 1734 | } ); |
| 1735 | } |
| 1736 | } |
| 1737 | ); |
| 1738 | } )( i, t ) ) ), |
| 1739 | ( t.supports.alignContent || t.supports.align_content ) && |
| 1740 | ( ( t.attributes = Y( |
| 1741 | t.attributes, |
| 1742 | 'align_content', |
| 1743 | 'string' |
| 1744 | ) ), |
| 1745 | ( i = ( function ( t, n ) { |
| 1746 | let i, |
| 1747 | a, |
| 1748 | s = |
| 1749 | n.supports.align_content || |
| 1750 | n.supports.alignContent; |
| 1751 | return ( |
| 1752 | 'matrix' === s |
| 1753 | ? ( ( i = v || k ), ( a = X ) ) |
| 1754 | : ( ( i = c ), ( a = W ) ), |
| 1755 | i === r |
| 1756 | ? ( console.warn( |
| 1757 | `The "${ s }" alignment component was not found.` |
| 1758 | ), |
| 1759 | t ) |
| 1760 | : ( ( n.alignContent = a( |
| 1761 | n.alignContent |
| 1762 | ) ), |
| 1763 | class extends m { |
| 1764 | render() { |
| 1765 | const { |
| 1766 | attributes: n, |
| 1767 | setAttributes: r, |
| 1768 | } = this.props, |
| 1769 | { alignContent: s } = n; |
| 1770 | return ( 0, e.jsxs )( h, { |
| 1771 | children: [ |
| 1772 | ( 0, e.jsx )( o, { |
| 1773 | group: 'block', |
| 1774 | children: ( 0, |
| 1775 | e.jsx )( i, { |
| 1776 | label: acf.__( |
| 1777 | 'Change content alignment' |
| 1778 | ), |
| 1779 | value: a( s ), |
| 1780 | onChange: |
| 1781 | function ( |
| 1782 | e |
| 1783 | ) { |
| 1784 | r( { |
| 1785 | alignContent: |
| 1786 | a( |
| 1787 | e |
| 1788 | ), |
| 1789 | } ); |
| 1790 | }, |
| 1791 | } ), |
| 1792 | } ), |
| 1793 | ( 0, e.jsx )( t, { |
| 1794 | ...this.props, |
| 1795 | } ), |
| 1796 | ], |
| 1797 | } ); |
| 1798 | } |
| 1799 | } ) |
| 1800 | ); |
| 1801 | } )( i, t ) ) ), |
| 1802 | ( t.supports.fullHeight || t.supports.full_height ) && |
| 1803 | ( ( t.attributes = Y( |
| 1804 | t.attributes, |
| 1805 | 'full_height', |
| 1806 | 'boolean' |
| 1807 | ) ), |
| 1808 | ( s = i ), |
| 1809 | t.blockType, |
| 1810 | ( i = y |
| 1811 | ? class extends m { |
| 1812 | render() { |
| 1813 | const { |
| 1814 | attributes: t, |
| 1815 | setAttributes: n, |
| 1816 | } = this.props, |
| 1817 | { fullHeight: r } = t; |
| 1818 | return ( 0, e.jsxs )( h, { |
| 1819 | children: [ |
| 1820 | ( 0, e.jsx )( o, { |
| 1821 | group: 'block', |
| 1822 | children: ( 0, e.jsx )( y, { |
| 1823 | isActive: r, |
| 1824 | onToggle: function ( |
| 1825 | e |
| 1826 | ) { |
| 1827 | n( { |
| 1828 | fullHeight: e, |
| 1829 | } ); |
| 1830 | }, |
| 1831 | } ), |
| 1832 | } ), |
| 1833 | ( 0, e.jsx )( s, { |
| 1834 | ...this.props, |
| 1835 | } ), |
| 1836 | ], |
| 1837 | } ); |
| 1838 | } |
| 1839 | } |
| 1840 | : s ) ), |
| 1841 | ( t.edit = ( t ) => ( |
| 1842 | wp.element.useEffect( |
| 1843 | () => () => { |
| 1844 | wp.data.dispatch( 'core/editor' ) && |
| 1845 | wp.data |
| 1846 | .dispatch( 'core/editor' ) |
| 1847 | .unlockPostSaving( |
| 1848 | 'acf/block/' + t.clientId |
| 1849 | ); |
| 1850 | }, |
| 1851 | [] |
| 1852 | ), |
| 1853 | ( 0, e.jsx )( i, { ...t } ) |
| 1854 | ) ), |
| 1855 | ( t.save = () => ( 0, e.jsx )( a, {} ) ), |
| 1856 | ( w[ t.name ] = t ); |
| 1857 | const d = wp.blocks.registerBlockType( t.name, t ); |
| 1858 | return ( |
| 1859 | d.attributes.anchor && |
| 1860 | ( d.attributes.anchor = { type: 'string' } ), |
| 1861 | d |
| 1862 | ); |
| 1863 | } |
| 1864 | acf.blockInstances = {}; |
| 1865 | const A = {}, |
| 1866 | T = {}; |
| 1867 | function B( e ) { |
| 1868 | const { |
| 1869 | attributes: r = {}, |
| 1870 | context: o = {}, |
| 1871 | query: i = {}, |
| 1872 | clientId: a = null, |
| 1873 | delay: s = 0, |
| 1874 | } = e, |
| 1875 | l = t( JSON.stringify( { ...r, ...o, ...i } ) ), |
| 1876 | c = A[ l ] || { |
| 1877 | query: {}, |
| 1878 | timeout: ! 1, |
| 1879 | promise: n.Deferred(), |
| 1880 | started: ! 1, |
| 1881 | }; |
| 1882 | return ( |
| 1883 | ( c.query = { ...c.query, ...i } ), |
| 1884 | c.started || |
| 1885 | ( clearTimeout( c.timeout ), |
| 1886 | ( c.timeout = setTimeout( () => { |
| 1887 | ( c.started = ! 0 ), |
| 1888 | T[ l ] |
| 1889 | ? ( ( A[ l ] = null ), |
| 1890 | c.promise.resolve.apply( |
| 1891 | T[ l ][ 0 ], |
| 1892 | T[ l ][ 1 ] |
| 1893 | ) ) |
| 1894 | : n |
| 1895 | .ajax( { |
| 1896 | url: acf.get( 'ajaxurl' ), |
| 1897 | dataType: 'json', |
| 1898 | type: 'post', |
| 1899 | cache: ! 1, |
| 1900 | data: acf.prepareForAjax( { |
| 1901 | action: 'acf/ajax/fetch-block', |
| 1902 | block: JSON.stringify( r ), |
| 1903 | clientId: a, |
| 1904 | context: |
| 1905 | JSON.stringify( o ), |
| 1906 | query: c.query, |
| 1907 | } ), |
| 1908 | } ) |
| 1909 | .always( () => { |
| 1910 | A[ l ] = null; |
| 1911 | } ) |
| 1912 | .done( function () { |
| 1913 | ( T[ l ] = [ |
| 1914 | this, |
| 1915 | arguments, |
| 1916 | ] ), |
| 1917 | c.promise.resolve.apply( |
| 1918 | this, |
| 1919 | arguments |
| 1920 | ); |
| 1921 | } ) |
| 1922 | .fail( function () { |
| 1923 | c.promise.reject.apply( |
| 1924 | this, |
| 1925 | arguments |
| 1926 | ); |
| 1927 | } ); |
| 1928 | }, s ) ), |
| 1929 | ( A[ l ] = c ) ), |
| 1930 | c.promise |
| 1931 | ); |
| 1932 | } |
| 1933 | function F( e, t ) { |
| 1934 | return JSON.stringify( e ) === JSON.stringify( t ); |
| 1935 | } |
| 1936 | function O( t, n, r = 0 ) { |
| 1937 | const o = ( function ( e, t ) { |
| 1938 | switch ( e ) { |
| 1939 | case 'innerblocks': |
| 1940 | return t < 2 ? a : 'ACFInnerBlocks'; |
| 1941 | case 'script': |
| 1942 | return q; |
| 1943 | case '#comment': |
| 1944 | return null; |
| 1945 | default: |
| 1946 | e = N( e ); |
| 1947 | } |
| 1948 | return e; |
| 1949 | } )( t.nodeName.toLowerCase(), n ); |
| 1950 | if ( ! o ) return null; |
| 1951 | const i = {}; |
| 1952 | if ( |
| 1953 | ( 1 === r && |
| 1954 | 'ACFInnerBlocks' !== o && |
| 1955 | ( i.ref = React.createRef() ), |
| 1956 | acf |
| 1957 | .arrayArgs( t.attributes ) |
| 1958 | .map( P ) |
| 1959 | .forEach( ( { name: e, value: t } ) => { |
| 1960 | i[ e ] = t; |
| 1961 | } ), |
| 1962 | 'ACFInnerBlocks' === o ) |
| 1963 | ) |
| 1964 | return ( 0, e.jsx )( R, { ...i } ); |
| 1965 | const s = [ o, i ]; |
| 1966 | return ( |
| 1967 | acf.arrayArgs( t.childNodes ).forEach( ( e ) => { |
| 1968 | if ( e instanceof Text ) { |
| 1969 | const t = e.textContent; |
| 1970 | t && s.push( t ); |
| 1971 | } else s.push( O( e, n, r + 1 ) ); |
| 1972 | } ), |
| 1973 | React.createElement.apply( this, s ) |
| 1974 | ); |
| 1975 | } |
| 1976 | function N( e ) { |
| 1977 | return acf.isget( acf, 'jsxNameReplacements', e ) || e; |
| 1978 | } |
| 1979 | function R( t ) { |
| 1980 | const { className: n = 'acf-innerblocks-container' } = t, |
| 1981 | r = x( { className: n }, t ); |
| 1982 | return ( 0, e.jsx )( 'div', { ...r, children: r.children } ); |
| 1983 | } |
| 1984 | function P( e ) { |
| 1985 | let t = e.name, |
| 1986 | n = e.value, |
| 1987 | r = acf.applyFilters( |
| 1988 | 'acf_blocks_parse_node_attr', |
| 1989 | ! 1, |
| 1990 | e |
| 1991 | ); |
| 1992 | if ( r ) return r; |
| 1993 | switch ( t ) { |
| 1994 | case 'class': |
| 1995 | t = 'className'; |
| 1996 | break; |
| 1997 | case 'style': |
| 1998 | const e = {}; |
| 1999 | n.split( ';' ).forEach( ( t ) => { |
| 2000 | const n = t.indexOf( ':' ); |
| 2001 | if ( n > 0 ) { |
| 2002 | let r = t.substr( 0, n ).trim(); |
| 2003 | const o = t.substr( n + 1 ).trim(); |
| 2004 | '-' !== r.charAt( 0 ) && |
| 2005 | ( r = acf.strCamelCase( r ) ), |
| 2006 | ( e[ r ] = o ); |
| 2007 | } |
| 2008 | } ), |
| 2009 | ( n = e ); |
| 2010 | break; |
| 2011 | default: |
| 2012 | if ( 0 === t.indexOf( 'data-' ) ) break; |
| 2013 | t = N( t ); |
| 2014 | const r = n.charAt( 0 ); |
| 2015 | ( '[' !== r && '{' !== r ) || ( n = JSON.parse( n ) ), |
| 2016 | ( 'true' !== n && 'false' !== n ) || |
| 2017 | ( n = 'true' === n ); |
| 2018 | } |
| 2019 | return { name: t, value: n }; |
| 2020 | } |
| 2021 | acf.parseJSX = ( e, t ) => ( |
| 2022 | ( e = ( e = '<div>' + e + '</div>' ).replace( |
| 2023 | /<InnerBlocks([^>]+)?\/>/, |
| 2024 | '<InnerBlocks$1></InnerBlocks>' |
| 2025 | ) ), |
| 2026 | O( n( e )[ 0 ], t, 0 ).props.children |
| 2027 | ); |
| 2028 | const M = g( |
| 2029 | ( t ) => |
| 2030 | class extends m { |
| 2031 | constructor( e ) { |
| 2032 | super( e ); |
| 2033 | const { name: t, attributes: n } = this.props, |
| 2034 | o = E( t ); |
| 2035 | if ( ! o ) return; |
| 2036 | Object.keys( n ).forEach( ( e ) => { |
| 2037 | '' === n[ e ] && delete n[ e ]; |
| 2038 | } ); |
| 2039 | const i = { |
| 2040 | full_height: 'fullHeight', |
| 2041 | align_content: 'alignContent', |
| 2042 | align_text: 'alignText', |
| 2043 | }; |
| 2044 | Object.keys( i ).forEach( ( e ) => { |
| 2045 | n[ e ] !== r |
| 2046 | ? ( n[ i[ e ] ] = n[ e ] ) |
| 2047 | : n[ i[ e ] ] === r && |
| 2048 | o[ e ] !== r && |
| 2049 | ( n[ i[ e ] ] = o[ e ] ), |
| 2050 | delete o[ e ], |
| 2051 | delete n[ e ]; |
| 2052 | } ); |
| 2053 | for ( let e in o.attributes ) |
| 2054 | n[ e ] === r && |
| 2055 | o[ e ] !== r && |
| 2056 | ( n[ e ] = o[ e ] ); |
| 2057 | } |
| 2058 | render() { |
| 2059 | return ( 0, e.jsx )( t, { ...this.props } ); |
| 2060 | } |
| 2061 | }, |
| 2062 | 'withDefaultAttributes' |
| 2063 | ); |
| 2064 | function H() { |
| 2065 | return ( 0, e.jsx )( a.Content, {} ); |
| 2066 | } |
| 2067 | wp.hooks.addFilter( |
| 2068 | 'editor.BlockListBlock', |
| 2069 | 'acf/with-default-attributes', |
| 2070 | M |
| 2071 | ); |
| 2072 | class L extends m { |
| 2073 | constructor( e ) { |
| 2074 | super( e ), this.setup(); |
| 2075 | } |
| 2076 | setup() { |
| 2077 | const { name: e, attributes: t, clientId: n } = this.props, |
| 2078 | r = E( e ); |
| 2079 | function o( e ) { |
| 2080 | e.includes( t.mode ) || ( t.mode = e[ 0 ] ); |
| 2081 | } |
| 2082 | if ( j( n ) || I() ) o( [ 'preview' ] ); |
| 2083 | else |
| 2084 | switch ( r.mode ) { |
| 2085 | case 'edit': |
| 2086 | o( [ 'edit', 'preview' ] ); |
| 2087 | break; |
| 2088 | case 'preview': |
| 2089 | o( [ 'preview', 'edit' ] ); |
| 2090 | break; |
| 2091 | default: |
| 2092 | o( [ 'auto' ] ); |
| 2093 | } |
| 2094 | } |
| 2095 | render() { |
| 2096 | const { |
| 2097 | name: t, |
| 2098 | attributes: n, |
| 2099 | setAttributes: r, |
| 2100 | clientId: a, |
| 2101 | } = this.props, |
| 2102 | s = E( t ), |
| 2103 | l = j( a ) || I(); |
| 2104 | let { mode: c } = n; |
| 2105 | l && ( c = 'preview' ); |
| 2106 | let p = s.supports.mode; |
| 2107 | ( 'auto' === c || l ) && ( p = ! 1 ); |
| 2108 | const f = |
| 2109 | 'preview' === c |
| 2110 | ? acf.__( 'Switch to Edit' ) |
| 2111 | : acf.__( 'Switch to Preview' ), |
| 2112 | m = 'preview' === c ? 'edit' : 'welcome-view-site'; |
| 2113 | return ( 0, e.jsxs )( h, { |
| 2114 | children: [ |
| 2115 | ( 0, e.jsx )( o, { |
| 2116 | children: |
| 2117 | p && |
| 2118 | ( 0, e.jsx )( d, { |
| 2119 | children: ( 0, e.jsx )( u, { |
| 2120 | className: |
| 2121 | 'components-icon-button components-toolbar__control', |
| 2122 | label: f, |
| 2123 | icon: m, |
| 2124 | onClick: function () { |
| 2125 | r( { |
| 2126 | mode: |
| 2127 | 'preview' === c |
| 2128 | ? 'edit' |
| 2129 | : 'preview', |
| 2130 | } ); |
| 2131 | }, |
| 2132 | } ), |
| 2133 | } ), |
| 2134 | } ), |
| 2135 | ( 0, e.jsx )( i, { |
| 2136 | children: |
| 2137 | 'preview' === c && |
| 2138 | ( 0, e.jsx )( 'div', { |
| 2139 | className: |
| 2140 | 'acf-block-component acf-block-panel', |
| 2141 | children: ( 0, e.jsx )( U, { |
| 2142 | ...this.props, |
| 2143 | } ), |
| 2144 | } ), |
| 2145 | } ), |
| 2146 | ( 0, e.jsx )( D, { ...this.props } ), |
| 2147 | ], |
| 2148 | } ); |
| 2149 | } |
| 2150 | } |
| 2151 | function D( t ) { |
| 2152 | const { |
| 2153 | attributes: n, |
| 2154 | isSelected: r, |
| 2155 | name: o, |
| 2156 | clientId: i, |
| 2157 | } = t, |
| 2158 | { mode: a } = n, |
| 2159 | l = b( ( e ) => { |
| 2160 | const t = |
| 2161 | e( 'core/block-editor' ).getBlockRootClientId( i ); |
| 2162 | return e( 'core/block-editor' ).getBlockIndex( i, t ); |
| 2163 | } ); |
| 2164 | let c = ! 0, |
| 2165 | d = 'acf-block-component acf-block-body'; |
| 2166 | return ( |
| 2167 | ( ( 'auto' === a && ! r ) || 'preview' === a ) && |
| 2168 | ( ( d += ' acf-block-preview' ), ( c = ! 1 ) ), |
| 2169 | i in acf.blockInstances || |
| 2170 | ( acf.blockInstances[ i ] = { |
| 2171 | validation_errors: ! 1, |
| 2172 | mode: a, |
| 2173 | } ), |
| 2174 | ( acf.blockInstances[ i ].mode = a ), |
| 2175 | r || |
| 2176 | ( C( o ) && |
| 2177 | acf.blockInstances[ i ].validation_errors && |
| 2178 | ( d += ' acf-block-has-validation-error' ), |
| 2179 | ( acf.blockInstances[ i ].has_been_deselected = ! 0 ) ), |
| 2180 | _( o ) > 1 |
| 2181 | ? ( 0, e.jsx )( 'div', { |
| 2182 | ...s( { className: d } ), |
| 2183 | children: c |
| 2184 | ? ( 0, e.jsx )( U, { ...t, index: l } ) |
| 2185 | : ( 0, e.jsx )( z, { ...t, index: l } ), |
| 2186 | } ) |
| 2187 | : ( 0, e.jsx )( 'div', { |
| 2188 | ...s(), |
| 2189 | children: ( 0, e.jsx )( 'div', { |
| 2190 | className: |
| 2191 | 'acf-block-component acf-block-body', |
| 2192 | children: c |
| 2193 | ? ( 0, e.jsx )( U, { ...t, index: l } ) |
| 2194 | : ( 0, e.jsx )( z, { ...t, index: l } ), |
| 2195 | } ), |
| 2196 | } ) |
| 2197 | ); |
| 2198 | } |
| 2199 | class $ extends m { |
| 2200 | render() { |
| 2201 | return ( 0, e.jsx )( 'div', { |
| 2202 | dangerouslySetInnerHTML: { |
| 2203 | __html: this.props.children, |
| 2204 | }, |
| 2205 | } ); |
| 2206 | } |
| 2207 | } |
| 2208 | class q extends m { |
| 2209 | render() { |
| 2210 | return ( 0, e.jsx )( 'div', { |
| 2211 | ref: ( e ) => ( this.el = e ), |
| 2212 | } ); |
| 2213 | } |
| 2214 | setHTML( e ) { |
| 2215 | n( this.el ).html( `<script>${ e }<\/script>` ); |
| 2216 | } |
| 2217 | componentDidUpdate() { |
| 2218 | this.setHTML( this.props.children ); |
| 2219 | } |
| 2220 | componentDidMount() { |
| 2221 | this.setHTML( this.props.children ); |
| 2222 | } |
| 2223 | } |
| 2224 | class V extends m { |
| 2225 | constructor( e ) { |
| 2226 | super( e ), |
| 2227 | ( this.setRef = this.setRef.bind( this ) ), |
| 2228 | ( this.id = '' ), |
| 2229 | ( this.el = ! 1 ), |
| 2230 | ( this.subscribed = ! 0 ), |
| 2231 | ( this.renderMethod = 'jQuery' ), |
| 2232 | ( this.passedValidation = ! 1 ), |
| 2233 | this.setup( e ), |
| 2234 | this.loadState(); |
| 2235 | } |
| 2236 | setup( e ) { |
| 2237 | const t = this.constructor.name, |
| 2238 | n = e.clientId; |
| 2239 | n in acf.blockInstances || |
| 2240 | ( acf.blockInstances[ n ] = { |
| 2241 | validation_errors: ! 1, |
| 2242 | mode: e.mode, |
| 2243 | } ), |
| 2244 | t in acf.blockInstances[ n ] || |
| 2245 | ( acf.blockInstances[ n ][ t ] = {} ); |
| 2246 | } |
| 2247 | fetch() {} |
| 2248 | maybePreload( e, t, n ) { |
| 2249 | if ( |
| 2250 | ( acf.debug( 'Preload check', e, t, n ), |
| 2251 | j( this.props.clientId ) ) |
| 2252 | ) |
| 2253 | return ( |
| 2254 | acf.debug( |
| 2255 | 'Preload failed: Block is in query loop.' |
| 2256 | ), |
| 2257 | ! 1 |
| 2258 | ); |
| 2259 | const r = acf.get( 'preloadedBlocks' ); |
| 2260 | if ( ! r || ! r[ e ] ) |
| 2261 | return ( |
| 2262 | acf.debug( 'Preload failed: Block not preloaded.' ), |
| 2263 | ! 1 |
| 2264 | ); |
| 2265 | const o = { ...r[ e ] }; |
| 2266 | return ( n && ! o.form ) || ( ! n && o.form ) |
| 2267 | ? ( acf.debug( |
| 2268 | 'Preload failed: Correct state not preloaded.', |
| 2269 | n ? 'form' : 'preview' |
| 2270 | ), |
| 2271 | ! 1 ) |
| 2272 | : ( ( o.html = o.html.replaceAll( e, t ) ), |
| 2273 | o.validation && |
| 2274 | o.validation.errors && |
| 2275 | ( o.validation.errors = o.validation.errors.map( |
| 2276 | ( n ) => ( |
| 2277 | ( n.input = n.input.replaceAll( |
| 2278 | e, |
| 2279 | t |
| 2280 | ) ), |
| 2281 | n |
| 2282 | ) |
| 2283 | ) ), |
| 2284 | acf.debug( 'Preload successful', o ), |
| 2285 | o ); |
| 2286 | } |
| 2287 | loadState() { |
| 2288 | const e = acf.blockInstances[ this.props.clientId ] || {}; |
| 2289 | this.state = e[ this.constructor.name ] || {}; |
| 2290 | } |
| 2291 | setState( e ) { |
| 2292 | ( acf.blockInstances[ this.props.clientId ][ |
| 2293 | this.constructor.name |
| 2294 | ] = { |
| 2295 | ...this.state, |
| 2296 | ...e, |
| 2297 | } ), |
| 2298 | ( this.subscribed || acf.get( 'StrictMode' ) ) && |
| 2299 | super.setState( e ), |
| 2300 | acf.debug( |
| 2301 | 'SetState', |
| 2302 | Object.assign( {}, this ), |
| 2303 | this.props.clientId, |
| 2304 | this.constructor.name, |
| 2305 | Object.assign( |
| 2306 | {}, |
| 2307 | acf.blockInstances[ this.props.clientId ][ |
| 2308 | this.constructor.name |
| 2309 | ] |
| 2310 | ) |
| 2311 | ); |
| 2312 | } |
| 2313 | setHtml( e ) { |
| 2314 | if ( ( e = e ? e.trim() : '' ) === this.state.html ) return; |
| 2315 | const t = { html: e }; |
| 2316 | if ( 'jsx' === this.renderMethod ) { |
| 2317 | if ( |
| 2318 | ( ( t.jsx = acf.parseJSX( |
| 2319 | e, |
| 2320 | _( this.props.name ) |
| 2321 | ) ), |
| 2322 | t.jsx || |
| 2323 | ( console.warn( |
| 2324 | 'Your ACF block template contains no valid HTML elements. Appending a empty div to prevent React JS errors.' |
| 2325 | ), |
| 2326 | ( t.html += '<div></div>' ), |
| 2327 | ( t.jsx = acf.parseJSX( |
| 2328 | t.html, |
| 2329 | _( this.props.name ) |
| 2330 | ) ) ), |
| 2331 | Array.isArray( t.jsx ) ) |
| 2332 | ) { |
| 2333 | let e = t.jsx.find( ( e ) => |
| 2334 | React.isValidElement( e ) |
| 2335 | ); |
| 2336 | t.ref = e.ref; |
| 2337 | } else t.ref = t.jsx.ref; |
| 2338 | t.$el = n( this.el ); |
| 2339 | } else t.$el = n( e ); |
| 2340 | this.setState( t ); |
| 2341 | } |
| 2342 | setRef( e ) { |
| 2343 | this.el = e; |
| 2344 | } |
| 2345 | render() { |
| 2346 | return this.state.jsx |
| 2347 | ? _( this.props.name ) > 1 |
| 2348 | ? ( this.setRef( this.state.jsx ), this.state.jsx ) |
| 2349 | : ( 0, e.jsx )( 'div', { |
| 2350 | ref: this.setRef, |
| 2351 | children: this.state.jsx, |
| 2352 | } ) |
| 2353 | : ( 0, e.jsx )( 'div', { |
| 2354 | ref: this.setRef, |
| 2355 | children: ( 0, e.jsx )( p, { |
| 2356 | children: ( 0, e.jsx )( f, {} ), |
| 2357 | } ), |
| 2358 | } ); |
| 2359 | } |
| 2360 | shouldComponentUpdate( { index: e }, { html: t } ) { |
| 2361 | return ( |
| 2362 | e !== this.props.index && this.componentWillMove(), |
| 2363 | t !== this.state.html |
| 2364 | ); |
| 2365 | } |
| 2366 | display( e ) { |
| 2367 | if ( 'jQuery' === this.renderMethod ) { |
| 2368 | const t = this.state.$el, |
| 2369 | r = t.parent(), |
| 2370 | o = n( this.el ); |
| 2371 | ( acf.get( 'StrictMode' ) && |
| 2372 | 'append' !== e && |
| 2373 | ! this.subscribed ) || |
| 2374 | o.html( t ), |
| 2375 | r.length && |
| 2376 | r[ 0 ] !== o[ 0 ] && |
| 2377 | r.html( t.clone() ); |
| 2378 | } |
| 2379 | switch ( |
| 2380 | ( this.getValidationErrors() && this.isNotNewlyAdded() |
| 2381 | ? this.lockBlockForSaving() |
| 2382 | : this.unlockBlockForSaving(), |
| 2383 | e ) |
| 2384 | ) { |
| 2385 | case 'append': |
| 2386 | this.componentDidAppend(); |
| 2387 | break; |
| 2388 | case 'remount': |
| 2389 | this.componentDidRemount(); |
| 2390 | } |
| 2391 | } |
| 2392 | validate() {} |
| 2393 | componentDidMount() { |
| 2394 | this.state.html === r |
| 2395 | ? this.fetch() |
| 2396 | : this.display( 'remount' ); |
| 2397 | } |
| 2398 | componentDidUpdate( e, t ) { |
| 2399 | this.display( 'append' ); |
| 2400 | } |
| 2401 | componentDidAppend() { |
| 2402 | acf.doAction( 'append', this.state.$el ); |
| 2403 | } |
| 2404 | componentWillUnmount() { |
| 2405 | ( acf.get( 'StrictMode' ) && ! this.subscribed ) || |
| 2406 | acf.doAction( 'unmount', this.state.$el ), |
| 2407 | ( this.subscribed = ! 1 ); |
| 2408 | } |
| 2409 | componentDidRemount() { |
| 2410 | ( this.subscribed = ! 0 ), |
| 2411 | setTimeout( () => { |
| 2412 | acf.doAction( 'remount', this.state.$el ); |
| 2413 | } ); |
| 2414 | } |
| 2415 | componentWillMove() { |
| 2416 | acf.doAction( 'unmount', this.state.$el ), |
| 2417 | setTimeout( () => { |
| 2418 | acf.doAction( 'remount', this.state.$el ); |
| 2419 | } ); |
| 2420 | } |
| 2421 | isNotNewlyAdded() { |
| 2422 | return ( |
| 2423 | acf.blockInstances[ this.props.clientId ] |
| 2424 | .has_been_deselected || ! 1 |
| 2425 | ); |
| 2426 | } |
| 2427 | hasShownValidation() { |
| 2428 | return ( |
| 2429 | acf.blockInstances[ this.props.clientId ] |
| 2430 | .shown_validation || ! 1 |
| 2431 | ); |
| 2432 | } |
| 2433 | setShownValidation() { |
| 2434 | acf.blockInstances[ this.props.clientId ].shown_validation = |
| 2435 | ! 0; |
| 2436 | } |
| 2437 | setValidationErrors( e ) { |
| 2438 | acf.blockInstances[ |
| 2439 | this.props.clientId |
| 2440 | ].validation_errors = e; |
| 2441 | } |
| 2442 | getValidationErrors() { |
| 2443 | return acf.blockInstances[ this.props.clientId ] |
| 2444 | .validation_errors; |
| 2445 | } |
| 2446 | getMode() { |
| 2447 | return acf.blockInstances[ this.props.clientId ].mode; |
| 2448 | } |
| 2449 | lockBlockForSaving() { |
| 2450 | wp.data.dispatch( 'core/editor' ) && |
| 2451 | wp.data |
| 2452 | .dispatch( 'core/editor' ) |
| 2453 | .lockPostSaving( |
| 2454 | 'acf/block/' + this.props.clientId |
| 2455 | ); |
| 2456 | } |
| 2457 | unlockBlockForSaving() { |
| 2458 | wp.data.dispatch( 'core/editor' ) && |
| 2459 | wp.data |
| 2460 | .dispatch( 'core/editor' ) |
| 2461 | .unlockPostSaving( |
| 2462 | 'acf/block/' + this.props.clientId |
| 2463 | ); |
| 2464 | } |
| 2465 | displayValidation( e ) { |
| 2466 | if ( ! C( this.props.name ) ) |
| 2467 | return void acf.debug( |
| 2468 | 'Block does not support validation' |
| 2469 | ); |
| 2470 | if ( ! e || e.hasClass( 'acf-empty-block-fields' ) ) |
| 2471 | return void acf.debug( |
| 2472 | 'There is no edit form available to validate.' |
| 2473 | ); |
| 2474 | const t = this.getValidationErrors(); |
| 2475 | acf.debug( |
| 2476 | 'Starting handle validation', |
| 2477 | Object.assign( {}, this ), |
| 2478 | Object.assign( {}, e ), |
| 2479 | t |
| 2480 | ), |
| 2481 | this.setShownValidation(); |
| 2482 | let n = acf.getBlockFormValidator( e ); |
| 2483 | n.clearErrors(), |
| 2484 | acf.doAction( 'blocks/validation/pre_apply', t ), |
| 2485 | t |
| 2486 | ? ( n.addErrors( t ), |
| 2487 | n.showErrors( 'after' ), |
| 2488 | this.lockBlockForSaving() ) |
| 2489 | : ( n.has( 'notice' ) && |
| 2490 | ( n.get( 'notice' ).update( { |
| 2491 | type: 'success', |
| 2492 | text: acf.__( 'Validation successful' ), |
| 2493 | timeout: 1e3, |
| 2494 | } ), |
| 2495 | n.set( 'notice', null ) ), |
| 2496 | this.unlockBlockForSaving() ), |
| 2497 | acf.doAction( 'blocks/validation/post_apply', t ); |
| 2498 | } |
| 2499 | } |
| 2500 | class U extends V { |
| 2501 | setup( e ) { |
| 2502 | ( this.id = `BlockForm-${ e.clientId }` ), super.setup( e ); |
| 2503 | } |
| 2504 | fetch( e = ! 1, t = ! 1 ) { |
| 2505 | const { context: n, clientId: r, name: o } = this.props; |
| 2506 | let { attributes: i } = this.props, |
| 2507 | a = { form: ! 0 }; |
| 2508 | e && ( ( a = { validate: ! 0 } ), ( i.data = t ) ); |
| 2509 | const s = G( i, n ); |
| 2510 | acf.debug( 'BlockForm fetch', i, a ); |
| 2511 | const l = this.maybePreload( s, r, ! 0 ); |
| 2512 | if ( l ) |
| 2513 | return ( |
| 2514 | this.setHtml( |
| 2515 | acf.applyFilters( |
| 2516 | 'blocks/form/render', |
| 2517 | l.html, |
| 2518 | ! 0 |
| 2519 | ) |
| 2520 | ), |
| 2521 | void ( |
| 2522 | l.validation && |
| 2523 | this.setValidationErrors( l.validation.errors ) |
| 2524 | ) |
| 2525 | ); |
| 2526 | C( o ) || ( a.validate = ! 1 ), |
| 2527 | B( { |
| 2528 | attributes: i, |
| 2529 | context: n, |
| 2530 | clientId: r, |
| 2531 | query: a, |
| 2532 | } ).done( ( { data: e } ) => { |
| 2533 | acf.debug( 'fetch block form promise' ), |
| 2534 | e |
| 2535 | ? ( e.form && |
| 2536 | this.setHtml( |
| 2537 | acf.applyFilters( |
| 2538 | 'blocks/form/render', |
| 2539 | e.form.replaceAll( |
| 2540 | e.clientId, |
| 2541 | r |
| 2542 | ), |
| 2543 | ! 1 |
| 2544 | ) |
| 2545 | ), |
| 2546 | e.validation && |
| 2547 | this.setValidationErrors( |
| 2548 | e.validation.errors |
| 2549 | ), |
| 2550 | this.isNotNewlyAdded() && |
| 2551 | ( acf.debug( |
| 2552 | "Block has already shown it's invalid. The form needs to show validation errors" |
| 2553 | ), |
| 2554 | this.validate() ) ) |
| 2555 | : this.setHtml( |
| 2556 | `<div class="acf-block-fields acf-fields acf-empty-block-fields">${ acf.__( |
| 2557 | 'Error loading block form' |
| 2558 | ) }</div>` |
| 2559 | ); |
| 2560 | } ); |
| 2561 | } |
| 2562 | validate( e = ! 0 ) { |
| 2563 | e && this.loadState(), |
| 2564 | acf.debug( |
| 2565 | 'BlockForm calling validate with state', |
| 2566 | Object.assign( {}, this ) |
| 2567 | ), |
| 2568 | super.displayValidation( this.state.$el ); |
| 2569 | } |
| 2570 | shouldComponentUpdate( e, t ) { |
| 2571 | return ( |
| 2572 | C( this.props.name ) && |
| 2573 | this.state.$el && |
| 2574 | this.isNotNewlyAdded() && |
| 2575 | ! this.hasShownValidation() && |
| 2576 | this.validate( ! 1 ), |
| 2577 | super.shouldComponentUpdate( e, t ) |
| 2578 | ); |
| 2579 | } |
| 2580 | componentWillUnmount() { |
| 2581 | super.componentWillUnmount(), |
| 2582 | acf.debug( 'BlockForm Component did unmount' ); |
| 2583 | } |
| 2584 | componentDidRemount() { |
| 2585 | super.componentDidRemount(), |
| 2586 | acf.debug( 'BlockForm component did remount' ); |
| 2587 | const { $el: e } = this.state; |
| 2588 | C( this.props.name ) && |
| 2589 | this.isNotNewlyAdded() && |
| 2590 | ( acf.debug( |
| 2591 | "Block has already shown it's invalid. The form needs to show validation errors" |
| 2592 | ), |
| 2593 | this.validate() ), |
| 2594 | ! 0 !== e.data( 'acf-events-added' ) && |
| 2595 | this.componentDidAppend(); |
| 2596 | } |
| 2597 | componentDidAppend() { |
| 2598 | super.componentDidAppend(), |
| 2599 | acf.debug( 'BlockForm component did append' ); |
| 2600 | const { |
| 2601 | attributes: e, |
| 2602 | setAttributes: t, |
| 2603 | clientId: n, |
| 2604 | name: r, |
| 2605 | } = this.props, |
| 2606 | o = this, |
| 2607 | { $el: i } = this.state; |
| 2608 | function a( a = ! 1 ) { |
| 2609 | const s = acf.serialize( i, `acf-block_${ n }` ); |
| 2610 | a ? ( e.data = s ) : t( { data: s } ), |
| 2611 | C( r ) && |
| 2612 | ! a && |
| 2613 | 'edit' === o.getMode() && |
| 2614 | ( acf.debug( |
| 2615 | 'No block preview currently available. Need to trigger a validation only fetch.' |
| 2616 | ), |
| 2617 | o.fetch( ! 0, s ) ); |
| 2618 | } |
| 2619 | let s = ! 1; |
| 2620 | i.on( 'change keyup', () => { |
| 2621 | clearTimeout( s ), ( s = setTimeout( a, 300 ) ); |
| 2622 | } ), |
| 2623 | i.data( 'acf-events-added', ! 0 ), |
| 2624 | e.data || a( ! 0 ); |
| 2625 | } |
| 2626 | } |
| 2627 | class z extends V { |
| 2628 | setup( e ) { |
| 2629 | const t = E( e.name ), |
| 2630 | n = acf.isget( this.props, 'context', 'postId' ); |
| 2631 | ( this.id = `BlockPreview-${ e.clientId }` ), |
| 2632 | super.setup( e ), |
| 2633 | n && |
| 2634 | ( this.id = `BlockPreview-${ e.clientId }-${ n }` ), |
| 2635 | t.supports.jsx && ( this.renderMethod = 'jsx' ); |
| 2636 | } |
| 2637 | fetch( e = {} ) { |
| 2638 | const { |
| 2639 | attributes: t = this.props.attributes, |
| 2640 | clientId: n = this.props.clientId, |
| 2641 | context: r = this.props.context, |
| 2642 | delay: o = 0, |
| 2643 | } = e, |
| 2644 | { name: i } = this.props; |
| 2645 | this.setState( { prevAttributes: t, prevContext: r } ); |
| 2646 | const a = G( t, r ); |
| 2647 | let s = this.maybePreload( a, n, ! 1 ); |
| 2648 | if ( s ) |
| 2649 | return ( |
| 2650 | 1 == _( i ) && |
| 2651 | ( s.html = |
| 2652 | '<div class="acf-block-preview">' + |
| 2653 | s.html + |
| 2654 | '</div>' ), |
| 2655 | this.setHtml( |
| 2656 | acf.applyFilters( |
| 2657 | 'blocks/preview/render', |
| 2658 | s.html, |
| 2659 | ! 0 |
| 2660 | ) |
| 2661 | ), |
| 2662 | void ( |
| 2663 | s.validation && |
| 2664 | this.setValidationErrors( s.validation.errors ) |
| 2665 | ) |
| 2666 | ); |
| 2667 | let l = { preview: ! 0 }; |
| 2668 | C( i ) || ( l.validate = ! 1 ), |
| 2669 | B( { |
| 2670 | attributes: t, |
| 2671 | context: r, |
| 2672 | clientId: n, |
| 2673 | query: l, |
| 2674 | delay: o, |
| 2675 | } ).done( ( { data: e } ) => { |
| 2676 | if ( ! e ) |
| 2677 | return void this.setHtml( |
| 2678 | `<div class="acf-block-fields acf-fields acf-empty-block-fields">${ acf.__( |
| 2679 | 'Error previewing block' |
| 2680 | ) }</div>` |
| 2681 | ); |
| 2682 | let t = e.preview.replaceAll( e.clientId, n ); |
| 2683 | 1 == _( i ) && |
| 2684 | ( t = |
| 2685 | '<div class="acf-block-preview">' + |
| 2686 | t + |
| 2687 | '</div>' ), |
| 2688 | acf.debug( 'fetch block render promise' ), |
| 2689 | this.setHtml( |
| 2690 | acf.applyFilters( |
| 2691 | 'blocks/preview/render', |
| 2692 | t, |
| 2693 | ! 1 |
| 2694 | ) |
| 2695 | ), |
| 2696 | e.validation && |
| 2697 | this.setValidationErrors( |
| 2698 | e.validation.errors |
| 2699 | ), |
| 2700 | this.isNotNewlyAdded() && this.validate(); |
| 2701 | } ); |
| 2702 | } |
| 2703 | validate() { |
| 2704 | const e = |
| 2705 | ( acf.blockInstances[ this.props.clientId ] || {} ) |
| 2706 | .BlockForm || ! 1; |
| 2707 | e && super.displayValidation( e.$el ); |
| 2708 | } |
| 2709 | componentDidAppend() { |
| 2710 | super.componentDidAppend(), this.renderBlockPreviewEvent(); |
| 2711 | } |
| 2712 | shouldComponentUpdate( e, t ) { |
| 2713 | const n = e.attributes, |
| 2714 | r = this.props.attributes; |
| 2715 | if ( ! F( n, r ) || ! F( e.context, this.props.context ) ) { |
| 2716 | let t = 0; |
| 2717 | n.className !== r.className && ( t = 300 ), |
| 2718 | n.anchor !== r.anchor && ( t = 300 ), |
| 2719 | acf.debug( |
| 2720 | 'Triggering fetch from block preview shouldComponentUpdate' |
| 2721 | ), |
| 2722 | this.fetch( { |
| 2723 | attributes: n, |
| 2724 | context: e.context, |
| 2725 | delay: t, |
| 2726 | } ); |
| 2727 | } |
| 2728 | return super.shouldComponentUpdate( e, t ); |
| 2729 | } |
| 2730 | renderBlockPreviewEvent() { |
| 2731 | const { attributes: e, name: t } = this.props, |
| 2732 | { $el: r, ref: o } = this.state; |
| 2733 | var i; |
| 2734 | const a = e.name.replace( 'acf/', '' ); |
| 2735 | ( i = |
| 2736 | o && o.current |
| 2737 | ? n( o.current ).parent() |
| 2738 | : 1 == _( t ) |
| 2739 | ? r |
| 2740 | : r.parents( '.acf-block-preview' ) ), |
| 2741 | acf.doAction( 'render_block_preview', i, e ), |
| 2742 | acf.doAction( |
| 2743 | `render_block_preview/type=${ a }`, |
| 2744 | i, |
| 2745 | e |
| 2746 | ); |
| 2747 | } |
| 2748 | componentDidRemount() { |
| 2749 | super.componentDidRemount(), |
| 2750 | acf.debug( |
| 2751 | 'Checking if fetch is required in BlockPreview componentDidRemount', |
| 2752 | Object.assign( {}, this.state.prevAttributes ), |
| 2753 | Object.assign( {}, this.props.attributes ), |
| 2754 | Object.assign( {}, this.state.prevContext ), |
| 2755 | Object.assign( {}, this.props.context ) |
| 2756 | ), |
| 2757 | ( F( |
| 2758 | this.state.prevAttributes, |
| 2759 | this.props.attributes |
| 2760 | ) && |
| 2761 | F( this.state.prevContext, this.props.context ) ) || |
| 2762 | ( acf.debug( |
| 2763 | 'Triggering block preview fetch from componentDidRemount' |
| 2764 | ), |
| 2765 | this.fetch() ), |
| 2766 | this.renderBlockPreviewEvent(); |
| 2767 | } |
| 2768 | } |
| 2769 | function W( e ) { |
| 2770 | return [ 'top', 'center', 'bottom' ].includes( e ) ? e : 'top'; |
| 2771 | } |
| 2772 | function J( e ) { |
| 2773 | const t = acf.get( 'rtl' ) ? 'right' : 'left'; |
| 2774 | return [ 'left', 'center', 'right' ].includes( e ) ? e : t; |
| 2775 | } |
| 2776 | function X( e ) { |
| 2777 | if ( e ) { |
| 2778 | const [ t, n ] = e.split( ' ' ); |
| 2779 | return `${ W( t ) } ${ J( n ) }`; |
| 2780 | } |
| 2781 | return 'center center'; |
| 2782 | } |
| 2783 | function Y( e, t, n ) { |
| 2784 | return ( e[ t ] = { type: n } ), e; |
| 2785 | } |
| 2786 | function G( e, n ) { |
| 2787 | return ( |
| 2788 | ( e._acf_context = K( n ) ), t( JSON.stringify( K( e ) ) ) |
| 2789 | ); |
| 2790 | } |
| 2791 | function K( e ) { |
| 2792 | return Object.keys( e ) |
| 2793 | .sort() |
| 2794 | .reduce( ( t, n ) => ( ( t[ n ] = e[ n ] ), t ), {} ); |
| 2795 | } |
| 2796 | acf.addAction( 'prepare', function () { |
| 2797 | wp.blockEditor || ( wp.blockEditor = wp.editor ); |
| 2798 | const e = acf.get( 'blockTypes' ); |
| 2799 | e && |
| 2800 | e.forEach( ( e ) => { |
| 2801 | parseInt( e.acf_block_version ) <= 2 && S( e ); |
| 2802 | } ); |
| 2803 | } ); |
| 2804 | } )( jQuery ); |
| 2805 | const r = ( e ) => { |
| 2806 | wp.data.dispatch( 'core/editor' ) && |
| 2807 | wp.data |
| 2808 | .dispatch( 'core/editor' ) |
| 2809 | .lockPostSaving( 'acf/block/' + e ); |
| 2810 | }, |
| 2811 | o = ( e ) => { |
| 2812 | wp.data.dispatch( 'core/editor' ) && |
| 2813 | wp.data |
| 2814 | .dispatch( 'core/editor' ) |
| 2815 | .unlockPostSaving( 'acf/block/' + e ); |
| 2816 | }, |
| 2817 | i = ( e ) => |
| 2818 | !! wp.data.dispatch( 'core/editor' ) && |
| 2819 | wp.data |
| 2820 | .select( 'core/editor' ) |
| 2821 | .isPostSavingLocked( `acf/block/${ e }` ), |
| 2822 | a = ( e ) => |
| 2823 | Object.keys( e ) |
| 2824 | .sort() |
| 2825 | .reduce( ( t, n ) => ( ( t[ n ] = e[ n ] ), t ), {} ), |
| 2826 | s = n( 503 ), |
| 2827 | l = ( e, t ) => { |
| 2828 | const n = { ...e }; |
| 2829 | return ( |
| 2830 | delete n.hasAcfError, |
| 2831 | ( n._acf_context = a( t ) ), |
| 2832 | s( JSON.stringify( a( n ) ) ) |
| 2833 | ); |
| 2834 | }, |
| 2835 | { InnerBlocks: c } = wp.blockEditor, |
| 2836 | d = |
| 2837 | wp.blockEditor.__experimentalUseInnerBlocksProps || |
| 2838 | wp.blockEditor.useInnerBlocksProps, |
| 2839 | { createRef: u, createElement: p, useEffect: f } = wp.element, |
| 2840 | h = ( e, t, n, r, o, i ) => |
| 2841 | m( |
| 2842 | i( |
| 2843 | ( e = ( e = '<div>' + e + '</div>' ).replace( |
| 2844 | /<InnerBlocks([^>]+)?\/>/, |
| 2845 | '<InnerBlocks$1></InnerBlocks>' |
| 2846 | ) ) |
| 2847 | )[ 0 ], |
| 2848 | 0, |
| 2849 | t, |
| 2850 | n, |
| 2851 | r, |
| 2852 | o |
| 2853 | ).props.children; |
| 2854 | function m( t, n = 0, r, o, i, a ) { |
| 2855 | const s = ( function ( e ) { |
| 2856 | switch ( e ) { |
| 2857 | case 'innerblocks': |
| 2858 | return 'ACFInnerBlocks'; |
| 2859 | case 'script': |
| 2860 | return k; |
| 2861 | case '#comment': |
| 2862 | return null; |
| 2863 | default: |
| 2864 | e = b( e ); |
| 2865 | } |
| 2866 | return e; |
| 2867 | } )( t.nodeName.toLowerCase() ); |
| 2868 | if ( ! s ) return null; |
| 2869 | const l = {}; |
| 2870 | if ( |
| 2871 | ( 1 === n && 'ACFInnerBlocks' !== s && ( l.ref = u() ), |
| 2872 | acf |
| 2873 | .arrayArgs( t.attributes ) |
| 2874 | .map( v ) |
| 2875 | .forEach( ( { name: e, value: t } ) => { |
| 2876 | l[ e ] = t; |
| 2877 | } ), |
| 2878 | t.hasAttribute( 'data-acf-inline-fields' ) && |
| 2879 | ( ( l.style = { ...y( t ), pointerEvents: 'all' } ), |
| 2880 | ( l.role = 'button' ), |
| 2881 | ( l.tabIndex = 0 ), |
| 2882 | ( l.onFocus = ( e ) => { |
| 2883 | e.stopPropagation(), |
| 2884 | r( |
| 2885 | t.attributes.getNamedItem( |
| 2886 | 'data-acf-inline-fields-uid' |
| 2887 | ).value |
| 2888 | ); |
| 2889 | } ), |
| 2890 | ( l.onMouseDown = ( e ) => e.stopPropagation() ), |
| 2891 | ( l.onClick = ( e ) => { |
| 2892 | e.stopPropagation(); |
| 2893 | const n = e.target.closest( 'a' ); |
| 2894 | n && |
| 2895 | 'A' === n.tagName && |
| 2896 | ( e.preventDefault(), |
| 2897 | acf.debug( |
| 2898 | `Navigation prevented for ${ n.href }` |
| 2899 | ) ), |
| 2900 | e.target.hasAttribute( |
| 2901 | 'data-acf-inline-contenteditable' |
| 2902 | ) || |
| 2903 | r( |
| 2904 | t.attributes.getNamedItem( |
| 2905 | 'data-acf-inline-fields-uid' |
| 2906 | ).value |
| 2907 | ); |
| 2908 | } ), |
| 2909 | ( l.onKeyDown = ( e ) => { |
| 2910 | if ( 'Tab' === e.key && e.shiftKey ) { |
| 2911 | e.preventDefault(); |
| 2912 | const n = document |
| 2913 | .querySelector( '.acf-inline-editing-toolbar' ) |
| 2914 | .querySelector( 'button' ); |
| 2915 | n && |
| 2916 | ( n.focus(), |
| 2917 | r( |
| 2918 | t.attributes.getNamedItem( |
| 2919 | 'data-acf-inline-fields-uid' |
| 2920 | ).value |
| 2921 | ) ); |
| 2922 | } |
| 2923 | if ( 'Enter' === e.key ) { |
| 2924 | e.stopPropagation(); |
| 2925 | const n = e.target.closest( 'a' ); |
| 2926 | n && |
| 2927 | 'A' === n.tagName && |
| 2928 | ( e.preventDefault(), |
| 2929 | acf.debug( |
| 2930 | `Navigation prevented for ${ n.href }` |
| 2931 | ) ), |
| 2932 | r( |
| 2933 | t.attributes.getNamedItem( |
| 2934 | 'data-acf-inline-fields-uid' |
| 2935 | ).value |
| 2936 | ); |
| 2937 | } |
| 2938 | } ) ), |
| 2939 | t.hasAttribute( 'data-acf-inline-contenteditable' ) ) |
| 2940 | ) { |
| 2941 | const e = t.attributes.getNamedItem( |
| 2942 | 'data-acf-inline-contenteditable-field-slug' |
| 2943 | ).value; |
| 2944 | ( a |
| 2945 | ? a.filter( |
| 2946 | ( t ) => |
| 2947 | t.name === e && |
| 2948 | ( 'text' === t.type || 'textarea' === t.type ) |
| 2949 | ) |
| 2950 | : [] |
| 2951 | ).length > 0 |
| 2952 | ? ( ( l.contentEditable = ! 0 ), |
| 2953 | ( l.suppressContentEditableWarning = ! 0 ), |
| 2954 | ( l.role = 'input' ), |
| 2955 | ( l.tabIndex = 0 ), |
| 2956 | ( l.onFocus = ( e ) => { |
| 2957 | const n = e.target.closest( 'a' ); |
| 2958 | n && |
| 2959 | 'A' === n.tagName && |
| 2960 | ( e.preventDefault(), |
| 2961 | acf.debug( |
| 2962 | `Navigation prevented for ${ n.href }` |
| 2963 | ) ), |
| 2964 | e.stopPropagation(), |
| 2965 | i( |
| 2966 | t.attributes.getNamedItem( |
| 2967 | 'data-acf-inline-contenteditable-field-slug' |
| 2968 | ).value |
| 2969 | ), |
| 2970 | t.hasAttribute( 'data-acf-inline-fields' ) |
| 2971 | ? r( |
| 2972 | t.attributes.getNamedItem( |
| 2973 | 'data-acf-inline-fields-uid' |
| 2974 | ).value |
| 2975 | ) |
| 2976 | : r( null ); |
| 2977 | } ), |
| 2978 | ( l.onPaste = ( e ) => { |
| 2979 | e.preventDefault(); |
| 2980 | const t = e.clipboardData.getData( 'text/plain' ); |
| 2981 | e.currentTarget.textContent = |
| 2982 | e.currentTarget.textContent + t; |
| 2983 | } ) ) |
| 2984 | : ( delete l[ |
| 2985 | 'data-acf-inline-contenteditable-field-slug' |
| 2986 | ], |
| 2987 | delete l[ 'data-acf-inline-contenteditable' ] ); |
| 2988 | } |
| 2989 | if ( |
| 2990 | ( t.hasAttribute( 'data-acf-inline-fields' ) || |
| 2991 | t.hasAttribute( 'data-acf-inline-contenteditable' ) || |
| 2992 | ( l.onClick = ( e ) => { |
| 2993 | e.target === e.currentTarget && r( null ); |
| 2994 | } ), |
| 2995 | 'ACFInnerBlocks' === s ) |
| 2996 | ) |
| 2997 | return ( 0, e.jsx )( g, { ...l } ); |
| 2998 | const c = [ s, l ]; |
| 2999 | return ( |
| 3000 | acf.arrayArgs( t.childNodes ).forEach( ( e ) => { |
| 3001 | if ( e instanceof Text ) { |
| 3002 | const t = e.textContent; |
| 3003 | t && c.push( t ); |
| 3004 | } else c.push( m( e, n + 1, r, o, i, a ) ); |
| 3005 | } ), |
| 3006 | p.apply( this, c ) |
| 3007 | ); |
| 3008 | } |
| 3009 | function b( e ) { |
| 3010 | return acf.isget( acf, 'jsxNameReplacements', e ) || e; |
| 3011 | } |
| 3012 | function g( t ) { |
| 3013 | const { className: n = 'acf-innerblocks-container' } = t, |
| 3014 | r = d( { className: n }, t ); |
| 3015 | return ( 0, e.jsx )( 'div', { ...r, children: r.children } ); |
| 3016 | } |
| 3017 | function k( { children: e } ) { |
| 3018 | return ( |
| 3019 | f( () => { |
| 3020 | const t = ( function () { |
| 3021 | const e = document.querySelector( |
| 3022 | '[name="editor-canvas"]' |
| 3023 | ); |
| 3024 | return e |
| 3025 | ? e.contentDocument || e.contentWindow.document |
| 3026 | : document; |
| 3027 | } )(), |
| 3028 | n = t.createElement( 'script' ); |
| 3029 | return ( |
| 3030 | ( n.textContent = e ), |
| 3031 | t.body.appendChild( n ), |
| 3032 | () => { |
| 3033 | n.remove(); |
| 3034 | } |
| 3035 | ); |
| 3036 | }, [ e ] ), |
| 3037 | null |
| 3038 | ); |
| 3039 | } |
| 3040 | function v( e ) { |
| 3041 | let t = e.name, |
| 3042 | n = e.value, |
| 3043 | r = acf.applyFilters( 'acf_blocks_parse_node_attr', ! 1, e ); |
| 3044 | if ( r ) return r; |
| 3045 | switch ( t ) { |
| 3046 | case 'class': |
| 3047 | t = 'className'; |
| 3048 | break; |
| 3049 | case 'style': |
| 3050 | const e = {}; |
| 3051 | n.split( ';' ).forEach( ( t ) => { |
| 3052 | const n = t.indexOf( ':' ); |
| 3053 | if ( n > 0 ) { |
| 3054 | let r = t.substr( 0, n ).trim(); |
| 3055 | const o = t.substr( n + 1 ).trim(); |
| 3056 | '-' !== r.charAt( 0 ) && |
| 3057 | ( r = acf.strCamelCase( r ) ), |
| 3058 | ( e[ r ] = o ); |
| 3059 | } |
| 3060 | } ), |
| 3061 | ( n = e ); |
| 3062 | break; |
| 3063 | default: |
| 3064 | if ( 0 === t.indexOf( 'data-' ) ) break; |
| 3065 | t = b( t ); |
| 3066 | const r = n.charAt( 0 ); |
| 3067 | ( '[' !== r && '{' !== r ) || ( n = JSON.parse( n ) ), |
| 3068 | ( 'true' !== n && 'false' !== n ) || |
| 3069 | ( n = 'true' === n ); |
| 3070 | } |
| 3071 | return { name: t, value: n }; |
| 3072 | } |
| 3073 | function y( e ) { |
| 3074 | const t = JSON.parse( JSON.stringify( e.style ) ), |
| 3075 | n = {}, |
| 3076 | r = Object.keys( t ); |
| 3077 | for ( let e = 0; e < r.length; e++ ) { |
| 3078 | const o = r[ e ]; |
| 3079 | if ( Number.isInteger( parseInt( o ) ) ) continue; |
| 3080 | const i = t[ r[ e ] ], |
| 3081 | a = o.replace( /-([a-z])/g, ( e ) => e[ 1 ].toUpperCase() ); |
| 3082 | i && ( n[ a ] = i ); |
| 3083 | } |
| 3084 | return n; |
| 3085 | } |
| 3086 | const { useState: x, useEffect: w } = wp.element, |
| 3087 | { subscribe: E, select: _ } = wp.data; |
| 3088 | function C() { |
| 3089 | return ( |
| 3090 | 'edit-post/block' === |
| 3091 | _( 'core/interface' ).getActiveComplementaryArea( 'core' ) |
| 3092 | ); |
| 3093 | } |
| 3094 | const { useEffect: j } = wp.element, |
| 3095 | I = ( { |
| 3096 | inspectorBlockFormRef: t, |
| 3097 | setCurrentBlockFormContainer: n, |
| 3098 | } ) => ( |
| 3099 | j( () => { |
| 3100 | n( t.current ); |
| 3101 | }, [] ), |
| 3102 | ( 0, e.jsx )( 'div', { ref: t } ) |
| 3103 | ), |
| 3104 | { useState: S, useEffect: A, useRef: T } = wp.element, |
| 3105 | B = ( { |
| 3106 | $: t, |
| 3107 | clientId: n, |
| 3108 | blockFormHtml: i, |
| 3109 | onMount: a, |
| 3110 | onChange: s, |
| 3111 | validationErrors: l, |
| 3112 | showValidationErrors: c, |
| 3113 | acfFormRef: d, |
| 3114 | userHasInteractedWithForm: u, |
| 3115 | attributes: p, |
| 3116 | hideFieldsInSidebar: f, |
| 3117 | } ) => { |
| 3118 | const [ h, m ] = S( ! 1 ), |
| 3119 | [ b, g ] = S( i ), |
| 3120 | [ k, v ] = S( ! 1 ), |
| 3121 | y = T( null ), |
| 3122 | [ x, w ] = S( ! 1 ); |
| 3123 | return ( |
| 3124 | A( () => { |
| 3125 | a(); |
| 3126 | }, [] ), |
| 3127 | A( () => { |
| 3128 | k && ( u || x ) && ( s( k ), v( ! 1 ) ); |
| 3129 | }, [ k, u, v, s ] ), |
| 3130 | A( () => { |
| 3131 | ! b && i && g( i ); |
| 3132 | }, [ i ] ), |
| 3133 | A( () => { |
| 3134 | if ( ! d?.current ) return; |
| 3135 | const e = acf.getBlockFormValidator( |
| 3136 | t( d.current ).find( '.acf-block-fields' ) |
| 3137 | ); |
| 3138 | if ( |
| 3139 | ( e.clearErrors(), |
| 3140 | e.set( 'notice', null ), |
| 3141 | acf.doAction( 'blocks/validation/pre_apply', l ), |
| 3142 | l ) |
| 3143 | ) |
| 3144 | c && |
| 3145 | ( r( n ), |
| 3146 | e.$el.find( '.acf-notice' ).remove(), |
| 3147 | e.addErrors( l ), |
| 3148 | e.showErrors( 'after' ) ); |
| 3149 | else { |
| 3150 | if ( e.$el.find( '.acf-notice' ).length > 0 && c ) { |
| 3151 | e.$el.find( '.acf-notice' ).remove(), |
| 3152 | e.addErrors( [ |
| 3153 | { |
| 3154 | message: acf.__( |
| 3155 | 'Validation successful' |
| 3156 | ), |
| 3157 | }, |
| 3158 | ] ), |
| 3159 | e.showErrors( 'after' ), |
| 3160 | e.get( 'notice' ).update( { |
| 3161 | type: 'success', |
| 3162 | text: acf.__( 'Validation successful' ), |
| 3163 | timeout: 1e3, |
| 3164 | } ), |
| 3165 | e.set( 'notice', null ), |
| 3166 | setTimeout( () => { |
| 3167 | e.$el.find( '.acf-notice' ).remove(); |
| 3168 | }, 1001 ); |
| 3169 | const i = wp.data.dispatch( 'core/notices' ); |
| 3170 | function a( e ) { |
| 3171 | return new Promise( function ( t ) { |
| 3172 | return ( |
| 3173 | e.forEach( ( e ) => { |
| 3174 | if ( |
| 3175 | ( e.innerBlocks.length > |
| 3176 | 0 && |
| 3177 | a( e.innerBlocks ).then( |
| 3178 | ( e ) => { |
| 3179 | if ( e ) |
| 3180 | return t( |
| 3181 | ! 0 |
| 3182 | ); |
| 3183 | } |
| 3184 | ), |
| 3185 | e.attributes.hasAcfError && |
| 3186 | e.clientId !== n ) |
| 3187 | ) |
| 3188 | return t( ! 0 ); |
| 3189 | } ), |
| 3190 | t( ! 1 ) |
| 3191 | ); |
| 3192 | } ); |
| 3193 | } |
| 3194 | a( |
| 3195 | wp.data |
| 3196 | .select( 'core/block-editor' ) |
| 3197 | .getBlocks() |
| 3198 | ).then( ( e ) => { |
| 3199 | e |
| 3200 | ? i.createErrorNotice( |
| 3201 | acf.__( |
| 3202 | 'An ACF Block on this page requires attention before you can save.' |
| 3203 | ), |
| 3204 | { |
| 3205 | id: 'acf-blocks-validation', |
| 3206 | isDismissible: ! 0, |
| 3207 | } |
| 3208 | ) |
| 3209 | : i.removeNotice( |
| 3210 | 'acf-blocks-validation' |
| 3211 | ); |
| 3212 | } ); |
| 3213 | } |
| 3214 | o( n ); |
| 3215 | } |
| 3216 | acf.doAction( 'blocks/validation/post_apply', l ); |
| 3217 | }, [ l, n, c ] ), |
| 3218 | A( () => { |
| 3219 | if ( ! d?.current || ! b ) return; |
| 3220 | acf.debug( 'Remounting ACF Form' ); |
| 3221 | const e = d.current, |
| 3222 | n = t( e ); |
| 3223 | let r = ! 0; |
| 3224 | acf.doAction( 'remount', n ), h || ( s( n ), m( ! 0 ) ); |
| 3225 | const o = () => { |
| 3226 | s( n ); |
| 3227 | }, |
| 3228 | i = () => { |
| 3229 | if ( ! r ) return; |
| 3230 | const t = |
| 3231 | e.querySelectorAll( 'input, textarea' ), |
| 3232 | i = e.querySelectorAll( 'select' ); |
| 3233 | t.forEach( ( e ) => { |
| 3234 | e.removeEventListener( 'input', o ), |
| 3235 | e.addEventListener( 'input', o ); |
| 3236 | } ), |
| 3237 | i.forEach( ( e ) => { |
| 3238 | e.removeEventListener( 'change', o ), |
| 3239 | e.addEventListener( 'change', o ); |
| 3240 | } ), |
| 3241 | clearTimeout( y.current ), |
| 3242 | ( y.current = setTimeout( () => { |
| 3243 | r && v( n ); |
| 3244 | }, 300 ) ); |
| 3245 | }, |
| 3246 | a = new MutationObserver( i ), |
| 3247 | l = new MutationObserver( () => { |
| 3248 | r && ( w( ! 0 ), i() ); |
| 3249 | } ), |
| 3250 | c = { |
| 3251 | attributes: ! 0, |
| 3252 | childList: ! 0, |
| 3253 | subtree: ! 0, |
| 3254 | characterData: ! 0, |
| 3255 | }; |
| 3256 | return ( |
| 3257 | a.observe( e, c ), |
| 3258 | [ ...e.querySelectorAll( 'iframe' ) ].forEach( |
| 3259 | ( e ) => { |
| 3260 | if ( e && e.contentDocument ) { |
| 3261 | const t = e.contentDocument.body; |
| 3262 | t && l.observe( t, c ); |
| 3263 | } |
| 3264 | } |
| 3265 | ), |
| 3266 | e |
| 3267 | .querySelectorAll( 'input, textarea' ) |
| 3268 | .forEach( ( e ) => { |
| 3269 | e.addEventListener( 'input', o ); |
| 3270 | } ), |
| 3271 | e.querySelectorAll( 'select' ).forEach( ( e ) => { |
| 3272 | e.addEventListener( 'change', o ); |
| 3273 | } ), |
| 3274 | () => { |
| 3275 | ( r = ! 1 ), |
| 3276 | a.disconnect(), |
| 3277 | l.disconnect(), |
| 3278 | clearTimeout( y.current ), |
| 3279 | e && |
| 3280 | ( e |
| 3281 | .querySelectorAll( |
| 3282 | 'input, textarea' |
| 3283 | ) |
| 3284 | .forEach( ( e ) => { |
| 3285 | e.removeEventListener( |
| 3286 | 'input', |
| 3287 | o |
| 3288 | ); |
| 3289 | } ), |
| 3290 | e |
| 3291 | .querySelectorAll( 'select' ) |
| 3292 | .forEach( ( e ) => { |
| 3293 | e.removeEventListener( |
| 3294 | 'change', |
| 3295 | o |
| 3296 | ); |
| 3297 | } ) ); |
| 3298 | } |
| 3299 | ); |
| 3300 | }, [ d, p, b ] ), |
| 3301 | ( 0, e.jsx )( 'div', { |
| 3302 | ref: d, |
| 3303 | className: 'acf-block-component acf-block-panel', |
| 3304 | style: { display: f ? 'none' : null }, |
| 3305 | dangerouslySetInnerHTML: { |
| 3306 | __html: acf.applyFilters( |
| 3307 | 'blocks/form/render', |
| 3308 | b, |
| 3309 | ! 0 |
| 3310 | ), |
| 3311 | }, |
| 3312 | } ) |
| 3313 | ); |
| 3314 | }; |
| 3315 | var F = n( 540 ); |
| 3316 | const O = ( 0, F.createContext )( null ), |
| 3317 | N = { didCatch: ! 1, error: null }; |
| 3318 | class R extends F.Component { |
| 3319 | constructor( e ) { |
| 3320 | super( e ), |
| 3321 | ( this.resetErrorBoundary = |
| 3322 | this.resetErrorBoundary.bind( this ) ), |
| 3323 | ( this.state = N ); |
| 3324 | } |
| 3325 | static getDerivedStateFromError( e ) { |
| 3326 | return { didCatch: ! 0, error: e }; |
| 3327 | } |
| 3328 | resetErrorBoundary() { |
| 3329 | const { error: e } = this.state; |
| 3330 | if ( null !== e ) { |
| 3331 | for ( |
| 3332 | var t, |
| 3333 | n, |
| 3334 | r = arguments.length, |
| 3335 | o = new Array( r ), |
| 3336 | i = 0; |
| 3337 | i < r; |
| 3338 | i++ |
| 3339 | ) |
| 3340 | o[ i ] = arguments[ i ]; |
| 3341 | null === ( t = ( n = this.props ).onReset ) || |
| 3342 | void 0 === t || |
| 3343 | t.call( n, { args: o, reason: 'imperative-api' } ), |
| 3344 | this.setState( N ); |
| 3345 | } |
| 3346 | } |
| 3347 | componentDidCatch( e, t ) { |
| 3348 | var n, r; |
| 3349 | null === ( n = ( r = this.props ).onError ) || |
| 3350 | void 0 === n || |
| 3351 | n.call( r, e, t ); |
| 3352 | } |
| 3353 | componentDidUpdate( e, t ) { |
| 3354 | const { didCatch: n } = this.state, |
| 3355 | { resetKeys: r } = this.props; |
| 3356 | var o, i; |
| 3357 | n && |
| 3358 | null !== t.error && |
| 3359 | ( function () { |
| 3360 | let e = |
| 3361 | arguments.length > 0 && |
| 3362 | void 0 !== arguments[ 0 ] |
| 3363 | ? arguments[ 0 ] |
| 3364 | : [], |
| 3365 | t = |
| 3366 | arguments.length > 1 && |
| 3367 | void 0 !== arguments[ 1 ] |
| 3368 | ? arguments[ 1 ] |
| 3369 | : []; |
| 3370 | return ( |
| 3371 | e.length !== t.length || |
| 3372 | e.some( ( e, n ) => ! Object.is( e, t[ n ] ) ) |
| 3373 | ); |
| 3374 | } )( e.resetKeys, r ) && |
| 3375 | ( null === ( o = ( i = this.props ).onReset ) || |
| 3376 | void 0 === o || |
| 3377 | o.call( i, { |
| 3378 | next: r, |
| 3379 | prev: e.resetKeys, |
| 3380 | reason: 'keys', |
| 3381 | } ), |
| 3382 | this.setState( N ) ); |
| 3383 | } |
| 3384 | render() { |
| 3385 | const { |
| 3386 | children: e, |
| 3387 | fallbackRender: t, |
| 3388 | FallbackComponent: n, |
| 3389 | fallback: r, |
| 3390 | } = this.props, |
| 3391 | { didCatch: o, error: i } = this.state; |
| 3392 | let a = e; |
| 3393 | if ( o ) { |
| 3394 | const e = { |
| 3395 | error: i, |
| 3396 | resetErrorBoundary: this.resetErrorBoundary, |
| 3397 | }; |
| 3398 | if ( 'function' == typeof t ) a = t( e ); |
| 3399 | else if ( n ) a = ( 0, F.createElement )( n, e ); |
| 3400 | else { |
| 3401 | if ( void 0 === r ) throw i; |
| 3402 | a = r; |
| 3403 | } |
| 3404 | } |
| 3405 | return ( 0, F.createElement )( |
| 3406 | O.Provider, |
| 3407 | { |
| 3408 | value: { |
| 3409 | didCatch: o, |
| 3410 | error: i, |
| 3411 | resetErrorBoundary: this.resetErrorBoundary, |
| 3412 | }, |
| 3413 | }, |
| 3414 | a |
| 3415 | ); |
| 3416 | } |
| 3417 | } |
| 3418 | const { Placeholder: P, Button: M, Icon: H } = wp.components, |
| 3419 | L = ( 0, e.jsx )( 'svg', { |
| 3420 | xmlns: 'http://www.w3.org/2000/svg', |
| 3421 | viewBox: '0 0 24 24', |
| 3422 | width: '24', |
| 3423 | height: '24', |
| 3424 | 'aria-hidden': 'true', |
| 3425 | focusable: 'false', |
| 3426 | children: ( 0, e.jsx )( 'path', { |
| 3427 | 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', |
| 3428 | } ), |
| 3429 | } ), |
| 3430 | D = ( { setBlockFormModalOpen: t, blockLabel: n, error: r } ) => { |
| 3431 | let o = null; |
| 3432 | return ( |
| 3433 | r && |
| 3434 | ( acf.debug( 'Block preview error:', r ), |
| 3435 | ( o = acf.__( 'Error previewing block v3' ) ) ), |
| 3436 | ( 0, e.jsx )( P, { |
| 3437 | icon: ( 0, e.jsx )( H, { icon: L } ), |
| 3438 | label: n, |
| 3439 | instructions: o, |
| 3440 | children: ( 0, e.jsx )( M, { |
| 3441 | variant: 'primary', |
| 3442 | onClick: () => { |
| 3443 | t( ! 0 ); |
| 3444 | }, |
| 3445 | children: acf.__( 'Edit Block' ), |
| 3446 | } ), |
| 3447 | } ) |
| 3448 | ); |
| 3449 | }, |
| 3450 | $ = ( { |
| 3451 | children: t, |
| 3452 | blockPreviewHtml: n, |
| 3453 | blockProps: r, |
| 3454 | blockType: o, |
| 3455 | setBlockFormModalOpen: i, |
| 3456 | } ) => |
| 3457 | ( 0, e.jsx )( |
| 3458 | 'div', |
| 3459 | { |
| 3460 | ...r, |
| 3461 | children: ( 0, e.jsx )( R, { |
| 3462 | fallbackRender: ( { error: t } ) => |
| 3463 | ( 0, e.jsx )( D, { |
| 3464 | blockLabel: |
| 3465 | o?.title || acf.__( 'ACF Block' ), |
| 3466 | setBlockFormModalOpen: i, |
| 3467 | error: t, |
| 3468 | } ), |
| 3469 | children: t, |
| 3470 | } ), |
| 3471 | }, |
| 3472 | n |
| 3473 | ), |
| 3474 | { useEffect: q, useRef: V } = wp.element, |
| 3475 | { Popover: U } = wp.components, |
| 3476 | z = ( { |
| 3477 | children: t, |
| 3478 | className: n, |
| 3479 | anchor: r, |
| 3480 | placement: o, |
| 3481 | onClose: i, |
| 3482 | focusOnMount: a, |
| 3483 | variant: s, |
| 3484 | animate: l = ! 1, |
| 3485 | gutenbergIframeOrDocument: c, |
| 3486 | hidePrimaryBlockToolbar: d = ! 1, |
| 3487 | } ) => { |
| 3488 | const u = V(); |
| 3489 | return ( |
| 3490 | q( () => { |
| 3491 | const e = ( e ) => { |
| 3492 | 'Escape' === e.key && i( e ); |
| 3493 | }, |
| 3494 | t = ( e ) => { |
| 3495 | ! r || |
| 3496 | e?.key || |
| 3497 | u?.current?.contains( e.target ) || |
| 3498 | e.target === r || |
| 3499 | ( i( e ) && |
| 3500 | ( c.removeEventListener( |
| 3501 | 'mousedown', |
| 3502 | t |
| 3503 | ), |
| 3504 | document.removeEventListener( |
| 3505 | 'mousedown', |
| 3506 | t |
| 3507 | ) ) ); |
| 3508 | }; |
| 3509 | return ( |
| 3510 | setTimeout( () => { |
| 3511 | document.addEventListener( 'keydown', e ), |
| 3512 | c.addEventListener( 'mousedown', t ), |
| 3513 | document.addEventListener( 'mousedown', t ); |
| 3514 | } ), |
| 3515 | () => { |
| 3516 | document.removeEventListener( 'keydown', e ), |
| 3517 | c.removeEventListener( 'mousedown', t ), |
| 3518 | document.removeEventListener( |
| 3519 | 'mousedown', |
| 3520 | t |
| 3521 | ); |
| 3522 | } |
| 3523 | ); |
| 3524 | }, [] ), |
| 3525 | ( 0, e.jsx )( e.Fragment, { |
| 3526 | children: ( 0, e.jsxs )( U, { |
| 3527 | ref: u, |
| 3528 | style: { |
| 3529 | position: 'absolute', |
| 3530 | top: 200, |
| 3531 | zIndex: 59899, |
| 3532 | }, |
| 3533 | className: n, |
| 3534 | anchor: r, |
| 3535 | focusOnMount: a, |
| 3536 | placement: o, |
| 3537 | variant: s, |
| 3538 | animate: l, |
| 3539 | children: [ |
| 3540 | d && |
| 3541 | ( 0, e.jsx )( 'style', { |
| 3542 | children: |
| 3543 | '\n\t\t\t\t\t.components-popover.block-editor-block-popover.block-editor-block-list__block-popover{\n\t\t\t\t\t\tdisplay: none!important;\n\t\t\t\t\t}\n\t\t\t\t', |
| 3544 | } ), |
| 3545 | t, |
| 3546 | ], |
| 3547 | } ), |
| 3548 | } ) |
| 3549 | ); |
| 3550 | }, |
| 3551 | { useState: W, useRef: J } = wp.element, |
| 3552 | { ToolbarGroup: X, ToolbarButton: Y, Modal: G } = wp.components, |
| 3553 | { BlockControls: K } = wp.blockEditor, |
| 3554 | Q = ( { |
| 3555 | blockToolbarFields: t, |
| 3556 | blockFieldInfo: n, |
| 3557 | setCurrentBlockFormContainer: r, |
| 3558 | gutenbergIframeOrDocument: o, |
| 3559 | setBlockFormModalOpen: i, |
| 3560 | blockFormModalOpen: a, |
| 3561 | } ) => { |
| 3562 | const [ s, l ] = W( null ), |
| 3563 | [ c, d ] = W(), |
| 3564 | [ u, p ] = W( ! 0 ), |
| 3565 | f = J(); |
| 3566 | function h( e ) { |
| 3567 | if ( ! e ) return ''; |
| 3568 | if ( ! n ) return ''; |
| 3569 | const t = n.find( ( t ) => t.name === e ); |
| 3570 | return t?.type.replace( '_', '-' ); |
| 3571 | } |
| 3572 | function m( e ) { |
| 3573 | return e && n ? n.find( ( t ) => t.name === e ) : ''; |
| 3574 | } |
| 3575 | function b( e ) { |
| 3576 | if ( ! e ) return ''; |
| 3577 | if ( ! n ) return ''; |
| 3578 | const t = n.find( ( t ) => t.name === e ); |
| 3579 | return t ? t.label : ''; |
| 3580 | } |
| 3581 | return ( 0, e.jsxs )( K, { |
| 3582 | children: [ |
| 3583 | ( 0, e.jsx )( X, { |
| 3584 | children: ( 0, e.jsx )( Y, { |
| 3585 | className: |
| 3586 | 'components-icon-button components-toolbar__control', |
| 3587 | label: acf.__( 'Edit Block' ), |
| 3588 | icon: 'edit', |
| 3589 | onClick: () => { |
| 3590 | i( ! 0 ); |
| 3591 | }, |
| 3592 | isPressed: a, |
| 3593 | } ), |
| 3594 | } ), |
| 3595 | t.length > 0 && |
| 3596 | ( 0, e.jsxs )( X, { |
| 3597 | children: [ |
| 3598 | ( function () { |
| 3599 | let t = `[data-name="${ s }"]{ display: block!important; }`; |
| 3600 | return ( 0, e.jsx )( 'style', { |
| 3601 | children: t, |
| 3602 | } ); |
| 3603 | } )(), |
| 3604 | t && |
| 3605 | t.map( ( t ) => { |
| 3606 | let n = '', |
| 3607 | r = null, |
| 3608 | o = null; |
| 3609 | return ( |
| 3610 | 'object' == typeof t |
| 3611 | ? ( ( n = t.fieldName |
| 3612 | ? t.fieldName |
| 3613 | : index ), |
| 3614 | ( r = t.fieldIcon |
| 3615 | ? window.atob( |
| 3616 | t.fieldIcon |
| 3617 | ) |
| 3618 | : null ), |
| 3619 | ( o = t.fieldLabel |
| 3620 | ? t.fieldLabel |
| 3621 | : n ) ) |
| 3622 | : ( n = t ), |
| 3623 | ( 0, e.jsx )( |
| 3624 | Y, |
| 3625 | { |
| 3626 | icon: r |
| 3627 | ? ( 0, e.jsx )( |
| 3628 | 'i', |
| 3629 | { |
| 3630 | dangerouslySetInnerHTML: |
| 3631 | { |
| 3632 | __html: r, |
| 3633 | }, |
| 3634 | } |
| 3635 | ) |
| 3636 | : ( 0, e.jsx )( |
| 3637 | 'i', |
| 3638 | { |
| 3639 | className: `field-type-icon field-type-icon-${ h( |
| 3640 | n |
| 3641 | ) }`, |
| 3642 | } |
| 3643 | ), |
| 3644 | label: o || b( n ), |
| 3645 | isPressed: n === s, |
| 3646 | ref: n === s ? d : null, |
| 3647 | onMouseDown: () => { |
| 3648 | s === n |
| 3649 | ? l( null ) |
| 3650 | : ( l( null ), |
| 3651 | setTimeout( |
| 3652 | () => { |
| 3653 | const e = |
| 3654 | m( |
| 3655 | n |
| 3656 | ); |
| 3657 | 'flexible_content' === |
| 3658 | e.type || |
| 3659 | 'repeater' === |
| 3660 | e.type |
| 3661 | ? p( |
| 3662 | ! 1 |
| 3663 | ) |
| 3664 | : p( |
| 3665 | ! 0 |
| 3666 | ), |
| 3667 | l( |
| 3668 | n |
| 3669 | ); |
| 3670 | } |
| 3671 | ) ); |
| 3672 | }, |
| 3673 | }, |
| 3674 | n |
| 3675 | ) |
| 3676 | ); |
| 3677 | } ), |
| 3678 | s && |
| 3679 | c && |
| 3680 | u && |
| 3681 | ( 0, e.jsx )( |
| 3682 | z, |
| 3683 | { |
| 3684 | focusOnMount: ! 1, |
| 3685 | className: |
| 3686 | 'acf-inline-fields-popover', |
| 3687 | anchor: c, |
| 3688 | animate: ! 0, |
| 3689 | onClose: ( e ) => |
| 3690 | ! ( |
| 3691 | ( 'Escape' !== e.key && |
| 3692 | ( e?.target.closest( |
| 3693 | '.media-modal' |
| 3694 | ) || |
| 3695 | e?.target.closest( |
| 3696 | '.acf-tooltip' |
| 3697 | ) || |
| 3698 | ( e?.target && |
| 3699 | f?.current && |
| 3700 | f?.current.contains( |
| 3701 | e.target |
| 3702 | ) ) || |
| 3703 | ( c?.current && |
| 3704 | c?.current.contains( |
| 3705 | e?.target |
| 3706 | ) ) ) ) || |
| 3707 | ( l( null ), 0 ) |
| 3708 | ), |
| 3709 | variant: 'unstyled', |
| 3710 | gutenbergIframeOrDocument: o, |
| 3711 | children: ( 0, e.jsx )( 'div', { |
| 3712 | ref: f, |
| 3713 | children: ( 0, e.jsx )( |
| 3714 | 'div', |
| 3715 | { |
| 3716 | className: |
| 3717 | 'acf-inline-fields-popover-inner', |
| 3718 | style: { |
| 3719 | minWidth: |
| 3720 | '300px', |
| 3721 | }, |
| 3722 | ref: r, |
| 3723 | } |
| 3724 | ), |
| 3725 | } ), |
| 3726 | }, |
| 3727 | c |
| 3728 | ), |
| 3729 | s && |
| 3730 | c && |
| 3731 | ! u && |
| 3732 | ( 0, e.jsx )( G, { |
| 3733 | className: 'acf-block-form-modal', |
| 3734 | isFullScreen: ! 0, |
| 3735 | title: m( s ).label, |
| 3736 | onRequestClose: () => { |
| 3737 | l( null ); |
| 3738 | }, |
| 3739 | children: ( 0, e.jsx )( 'div', { |
| 3740 | ref: f, |
| 3741 | children: ( 0, e.jsx )( 'div', { |
| 3742 | className: |
| 3743 | 'acf-inline-fields-popover-inner', |
| 3744 | style: { |
| 3745 | minWidth: '300px', |
| 3746 | }, |
| 3747 | ref: r, |
| 3748 | } ), |
| 3749 | } ), |
| 3750 | } ), |
| 3751 | ], |
| 3752 | } ), |
| 3753 | ], |
| 3754 | } ); |
| 3755 | }, |
| 3756 | { |
| 3757 | useState: Z, |
| 3758 | useEffect: ee, |
| 3759 | useRef: te, |
| 3760 | useMemo: ne, |
| 3761 | } = wp.element, |
| 3762 | { |
| 3763 | Toolbar: re, |
| 3764 | ToolbarGroup: oe, |
| 3765 | ToolbarButton: ie, |
| 3766 | Modal: ae, |
| 3767 | } = wp.components, |
| 3768 | se = ( { |
| 3769 | blockIcon: t, |
| 3770 | blockFieldInfo: n, |
| 3771 | setInlineEditingToolbarHasFocus: r, |
| 3772 | currentContentEditableElement: o, |
| 3773 | currentInlineEditingElement: i, |
| 3774 | currentInlineEditingElementUid: a, |
| 3775 | gutenbergIframeOrDocument: s, |
| 3776 | setCurrentBlockFormContainer: l, |
| 3777 | contentEditableChangeInProgress: c, |
| 3778 | } ) => { |
| 3779 | const [ d, u ] = Z( null ), |
| 3780 | [ p, f ] = Z(), |
| 3781 | [ h, m ] = Z(), |
| 3782 | [ b, g ] = Z( ! 0 ), |
| 3783 | k = te(), |
| 3784 | v = i ? i.getAttribute( 'data-acf-inline-fields' ) : null; |
| 3785 | let y = []; |
| 3786 | try { |
| 3787 | y = JSON.parse( v ); |
| 3788 | } catch ( e ) { |
| 3789 | acf.debug( |
| 3790 | 'Inline fields were not a properly formatted JSON array', |
| 3791 | v |
| 3792 | ); |
| 3793 | } |
| 3794 | function x( e ) { |
| 3795 | if ( ! e ) return ''; |
| 3796 | if ( ! n ) return ''; |
| 3797 | const t = n.find( ( t ) => t.name === e ); |
| 3798 | return t?.type.replace( '_', '-' ); |
| 3799 | } |
| 3800 | function w( e ) { |
| 3801 | if ( ! e ) return ''; |
| 3802 | if ( ! n ) return ''; |
| 3803 | const t = n.find( ( t ) => t.name === e ); |
| 3804 | return t ? t.label : ''; |
| 3805 | } |
| 3806 | ee( () => { |
| 3807 | u( null ); |
| 3808 | }, [ c ] ); |
| 3809 | const E = ne( |
| 3810 | () => |
| 3811 | ( function () { |
| 3812 | let n = |
| 3813 | o && ! i |
| 3814 | ? o.getAttribute( |
| 3815 | 'data-acf-toolbar-icon' |
| 3816 | ) |
| 3817 | : null; |
| 3818 | if ( |
| 3819 | ( ! n && |
| 3820 | i && |
| 3821 | ( n = i |
| 3822 | ? i.getAttribute( |
| 3823 | 'data-acf-toolbar-icon' |
| 3824 | ) |
| 3825 | : null ), |
| 3826 | n && |
| 3827 | ( n = ( 0, e.jsx )( 'i', { |
| 3828 | dangerouslySetInnerHTML: { |
| 3829 | __html: n, |
| 3830 | }, |
| 3831 | } ) ), |
| 3832 | ! n && o && ! i ) |
| 3833 | ) { |
| 3834 | const t = o.getAttribute( |
| 3835 | 'data-acf-inline-contenteditable-field-slug' |
| 3836 | ); |
| 3837 | n = ( 0, e.jsx )( 'i', { |
| 3838 | className: `field-type-icon field-type-icon-${ x( |
| 3839 | t |
| 3840 | ) }`, |
| 3841 | } ); |
| 3842 | } |
| 3843 | return ( |
| 3844 | n || |
| 3845 | ( n = React.isValidElement( t ) |
| 3846 | ? t |
| 3847 | : ( 0, e.jsx )( 'span', { |
| 3848 | className: `dashicon dashicons dashicons-${ t }`, |
| 3849 | } ) ), |
| 3850 | n |
| 3851 | ); |
| 3852 | } )(), |
| 3853 | [ n, o, i ] |
| 3854 | ), |
| 3855 | _ = ne( |
| 3856 | () => |
| 3857 | ( function () { |
| 3858 | let e; |
| 3859 | if ( o && ! i ) { |
| 3860 | const t = o.getAttribute( |
| 3861 | 'data-acf-toolbar-title' |
| 3862 | ); |
| 3863 | if ( t ) return t; |
| 3864 | e = o.getAttribute( |
| 3865 | 'data-acf-inline-contenteditable-field-slug' |
| 3866 | ); |
| 3867 | } else if ( i ) { |
| 3868 | const t = i.getAttribute( |
| 3869 | 'data-acf-toolbar-title' |
| 3870 | ); |
| 3871 | if ( t ) return t; |
| 3872 | if ( y.length > 1 ) |
| 3873 | return { |
| 3874 | A: 'Link', |
| 3875 | DIV: 'Division', |
| 3876 | P: 'Paragraph', |
| 3877 | SPAN: 'Span', |
| 3878 | INPUT: 'Input', |
| 3879 | BUTTON: 'Button', |
| 3880 | IMG: 'Image', |
| 3881 | UL: 'Unordered List', |
| 3882 | OL: 'Ordered List', |
| 3883 | LI: 'List Item', |
| 3884 | H1: 'Heading 1', |
| 3885 | H2: 'Heading 2', |
| 3886 | H3: 'Heading 3', |
| 3887 | H4: 'Heading 4', |
| 3888 | H5: 'Heading 5', |
| 3889 | H6: 'Heading 6', |
| 3890 | TABLE: 'Table', |
| 3891 | TR: 'Table Row', |
| 3892 | TD: 'Table Cell', |
| 3893 | TH: 'Table Header', |
| 3894 | FORM: 'Form', |
| 3895 | TEXTAREA: 'Text Area', |
| 3896 | SELECT: 'Select', |
| 3897 | OPTION: 'Option', |
| 3898 | }[ i.tagName ]; |
| 3899 | e = |
| 3900 | 'object' == typeof y[ 0 ] |
| 3901 | ? y[ 0 ].fieldName |
| 3902 | : y[ 0 ]; |
| 3903 | } |
| 3904 | return w( e ); |
| 3905 | } )(), |
| 3906 | [ n, o, i ] |
| 3907 | ); |
| 3908 | return ( 0, e.jsxs )( e.Fragment, { |
| 3909 | children: [ |
| 3910 | d && |
| 3911 | h && |
| 3912 | b && |
| 3913 | a && |
| 3914 | ( 0, e.jsx )( |
| 3915 | z, |
| 3916 | { |
| 3917 | focusOnMount: ! 1, |
| 3918 | className: 'acf-inline-fields-popover', |
| 3919 | anchor: h, |
| 3920 | onClose: ( e ) => |
| 3921 | 'Escape' === e.key |
| 3922 | ? ( u( null ), ! 0 ) |
| 3923 | : ! ( |
| 3924 | ( e?.target && |
| 3925 | k?.current && |
| 3926 | k?.current.contains( |
| 3927 | e.target |
| 3928 | ) ) || |
| 3929 | ( h?.current && |
| 3930 | h?.current.contains( |
| 3931 | e?.target |
| 3932 | ) ) |
| 3933 | ) && void 0, |
| 3934 | variant: i ? 'toolbar' : 'unstyled', |
| 3935 | gutenbergIframeOrDocument: s, |
| 3936 | hidePrimaryBlockToolbar: ! 0, |
| 3937 | animate: ! 0, |
| 3938 | children: ( 0, e.jsx )( 'div', { |
| 3939 | ref: k, |
| 3940 | onClick: () => { |
| 3941 | r( ! 0 ); |
| 3942 | }, |
| 3943 | children: ( 0, e.jsx )( 'div', { |
| 3944 | className: |
| 3945 | 'acf-inline-fields-popover-inner', |
| 3946 | style: { |
| 3947 | minWidth: p?.popoverMinWidth |
| 3948 | ? p?.popoverMinWidth |
| 3949 | : '300px', |
| 3950 | }, |
| 3951 | ref: l, |
| 3952 | } ), |
| 3953 | } ), |
| 3954 | }, |
| 3955 | d || null |
| 3956 | ), |
| 3957 | d && |
| 3958 | h && |
| 3959 | ! b && |
| 3960 | a && |
| 3961 | ( 0, e.jsx )( ae, { |
| 3962 | className: 'acf-block-form-modal', |
| 3963 | isFullScreen: ! 0, |
| 3964 | title: ( ( C = d ), |
| 3965 | C && n ? n.find( ( e ) => e.name === C ) : '' ) |
| 3966 | .label, |
| 3967 | onRequestClose: () => { |
| 3968 | u( null ); |
| 3969 | }, |
| 3970 | children: ( 0, e.jsx )( 'div', { |
| 3971 | ref: k, |
| 3972 | onClick: () => { |
| 3973 | r( ! 0 ); |
| 3974 | }, |
| 3975 | children: ( 0, e.jsx )( 'div', { |
| 3976 | className: |
| 3977 | 'acf-inline-fields-popover-inner', |
| 3978 | style: { |
| 3979 | minWidth: p?.popoverMinWidth |
| 3980 | ? p?.popoverMinWidth |
| 3981 | : '300px', |
| 3982 | }, |
| 3983 | ref: l, |
| 3984 | } ), |
| 3985 | } ), |
| 3986 | } ), |
| 3987 | ( 0, e.jsx )( re, { |
| 3988 | orientation: 'horizontal', |
| 3989 | className: |
| 3990 | 'components-accessible-toolbar block-editor-block-contextual-toolbar', |
| 3991 | style: { width: 'max-content' }, |
| 3992 | children: ( 0, e.jsxs )( 'div', { |
| 3993 | className: 'block-editor-block-toolbar', |
| 3994 | children: [ |
| 3995 | ( 0, e.jsx )( oe, { |
| 3996 | style: { alignItems: 'center' }, |
| 3997 | children: ( 0, e.jsxs )( 'div', { |
| 3998 | className: |
| 3999 | 'acf-blocks-toolbar-icon components-toolbar-group block-editor-block-toolbar__block-controls', |
| 4000 | label: _, |
| 4001 | children: [ |
| 4002 | E, |
| 4003 | ( 0, e.jsx )( 'span', { |
| 4004 | children: _, |
| 4005 | } ), |
| 4006 | ], |
| 4007 | } ), |
| 4008 | } ), |
| 4009 | ( 0, e.jsx )( oe, { |
| 4010 | children: ( function () { |
| 4011 | if ( ! y || 0 === y.length ) |
| 4012 | return ''; |
| 4013 | let t = []; |
| 4014 | return ( |
| 4015 | ( t = y.map( ( t, n ) => { |
| 4016 | let o = '', |
| 4017 | i = null, |
| 4018 | a = null; |
| 4019 | return ( |
| 4020 | 'object' == typeof t |
| 4021 | ? ( ( o = |
| 4022 | t.fieldName |
| 4023 | ? t.fieldName |
| 4024 | : n ), |
| 4025 | ( i = t.fieldIcon |
| 4026 | ? ( 0, |
| 4027 | e.jsx )( |
| 4028 | 'i', |
| 4029 | { |
| 4030 | dangerouslySetInnerHTML: |
| 4031 | { |
| 4032 | __html: window.atob( |
| 4033 | t.fieldIcon |
| 4034 | ), |
| 4035 | }, |
| 4036 | } |
| 4037 | ) |
| 4038 | : null ), |
| 4039 | ( a = t.fieldLabel |
| 4040 | ? t.fieldLabel |
| 4041 | : o ) ) |
| 4042 | : ( o = t ), |
| 4043 | ! i && |
| 4044 | t?.useExpandedEditor && |
| 4045 | ( i = 'edit' ), |
| 4046 | ( 0, e.jsx )( |
| 4047 | ie, |
| 4048 | { |
| 4049 | disabled: c, |
| 4050 | className: |
| 4051 | 'acf-toolbar-button', |
| 4052 | icon: |
| 4053 | i || |
| 4054 | ( 0, |
| 4055 | e.jsx )( |
| 4056 | 'i', |
| 4057 | { |
| 4058 | className: `field-type-icon field-type-icon-${ x( |
| 4059 | o |
| 4060 | ) }`, |
| 4061 | } |
| 4062 | ), |
| 4063 | label: |
| 4064 | a || w( o ), |
| 4065 | isPressed: |
| 4066 | o === d, |
| 4067 | ref: |
| 4068 | o === d |
| 4069 | ? m |
| 4070 | : null, |
| 4071 | onClick: () => { |
| 4072 | r( ! 0 ), |
| 4073 | d === o |
| 4074 | ? u( |
| 4075 | null |
| 4076 | ) |
| 4077 | : ( g( |
| 4078 | ! t?.useExpandedEditor |
| 4079 | ), |
| 4080 | u( |
| 4081 | o |
| 4082 | ), |
| 4083 | f( |
| 4084 | t |
| 4085 | ) ); |
| 4086 | }, |
| 4087 | }, |
| 4088 | o |
| 4089 | ) |
| 4090 | ); |
| 4091 | } ) ), |
| 4092 | t |
| 4093 | ); |
| 4094 | } )(), |
| 4095 | } ), |
| 4096 | ], |
| 4097 | } ), |
| 4098 | } ), |
| 4099 | ( function () { |
| 4100 | let t = `[data-name="${ d }"]{ display: block!important; }`; |
| 4101 | return ( 0, e.jsx )( 'style', { children: t } ); |
| 4102 | } )(), |
| 4103 | ], |
| 4104 | } ); |
| 4105 | var C; |
| 4106 | }, |
| 4107 | { |
| 4108 | useState: le, |
| 4109 | useEffect: ce, |
| 4110 | useRef: de, |
| 4111 | createPortal: ue, |
| 4112 | useMemo: pe, |
| 4113 | } = wp.element, |
| 4114 | { |
| 4115 | InspectorControls: fe, |
| 4116 | useBlockProps: he, |
| 4117 | useBlockEditContext: me, |
| 4118 | } = wp.blockEditor, |
| 4119 | { |
| 4120 | ToolbarGroup: be, |
| 4121 | ToolbarButton: ge, |
| 4122 | Placeholder: ke, |
| 4123 | Spinner: ve, |
| 4124 | Modal: ye, |
| 4125 | Button: xe, |
| 4126 | PanelBody: we, |
| 4127 | } = wp.components, |
| 4128 | Ee = ( t ) => { |
| 4129 | const { |
| 4130 | attributes: n, |
| 4131 | setAttributes: i, |
| 4132 | context: a, |
| 4133 | isSelected: s, |
| 4134 | $: c, |
| 4135 | blockType: d, |
| 4136 | } = t, |
| 4137 | u = d.validate, |
| 4138 | { clientId: p } = me(), |
| 4139 | [ f, h ] = le( null ), |
| 4140 | [ m, b ] = le( '' ), |
| 4141 | [ g, k ] = le( '' ), |
| 4142 | v = pe( () => ue( l( n, a ), p, s ), [] ), |
| 4143 | [ y, _ ] = le( () => |
| 4144 | v?.html |
| 4145 | ? acf.applyFilters( |
| 4146 | 'blocks/preview/render', |
| 4147 | v.html, |
| 4148 | ! 0 |
| 4149 | ) |
| 4150 | : 'acf-block-preview-loading' |
| 4151 | ), |
| 4152 | [ j, I ] = le( () => { |
| 4153 | var e; |
| 4154 | return null !== ( e = v?.validation?.errors ) && |
| 4155 | void 0 !== e |
| 4156 | ? e |
| 4157 | : null; |
| 4158 | } ), |
| 4159 | [ S, A ] = le( v?.fields ? v.fields : null ), |
| 4160 | [ T, B ] = le( null ), |
| 4161 | [ F, O ] = le( ! 1 ), |
| 4162 | [ N, R ] = le(), |
| 4163 | [ P, M ] = le( ! 1 ), |
| 4164 | [ H, L ] = le( ! 1 ), |
| 4165 | D = de( null ), |
| 4166 | $ = de( null ), |
| 4167 | [ q, V ] = le( [] ), |
| 4168 | [ U, z ] = le( null ), |
| 4169 | [ W, J ] = le( null ), |
| 4170 | [ X, Y ] = le( null ), |
| 4171 | [ G, K ] = le( ! 1 ), |
| 4172 | [ Q, Z ] = le( |
| 4173 | ( function () { |
| 4174 | const e = document.querySelector( |
| 4175 | '[name="editor-canvas"]' |
| 4176 | ); |
| 4177 | return e |
| 4178 | ? e.contentDocument || e.contentWindow.document |
| 4179 | : document; |
| 4180 | } )() |
| 4181 | ), |
| 4182 | [ ee, te ] = le(), |
| 4183 | [ ne, re ] = le( '' ), |
| 4184 | oe = de( null ), |
| 4185 | ie = ( function () { |
| 4186 | const [ e, t ] = x( () => C() ); |
| 4187 | return ( |
| 4188 | w( () => { |
| 4189 | const e = E( () => { |
| 4190 | t( C() ); |
| 4191 | } ); |
| 4192 | return () => e(); |
| 4193 | }, [] ), |
| 4194 | e |
| 4195 | ); |
| 4196 | } )(); |
| 4197 | ce( () => { |
| 4198 | s || ( J( null ), z( null ), Y( null ), g && _( g ) ); |
| 4199 | }, [ s ] ), |
| 4200 | ce( () => { |
| 4201 | if ( Q ) { |
| 4202 | let e = Q.getElementById( 'acf-dynamic-styles' ); |
| 4203 | e || |
| 4204 | ( ( e = document.createElement( 'style' ) ), |
| 4205 | ( e.id = 'acf-dynamic-styles' ), |
| 4206 | Q.head.appendChild( e ) ), |
| 4207 | te( e ); |
| 4208 | } |
| 4209 | }, [ Q ] ); |
| 4210 | const ae = pe( () => { |
| 4211 | const { hasAcfError: e, ...t } = n; |
| 4212 | return t; |
| 4213 | }, [ n ] ); |
| 4214 | function se( e, t ) { |
| 4215 | if ( ! D?.current || ! t ) return; |
| 4216 | const n = D.current.querySelector( `[data-name=${ t }]` ); |
| 4217 | if ( ! n ) return; |
| 4218 | const r = n.attributes.getNamedItem( 'data-key' )?.value; |
| 4219 | if ( ! r ) return; |
| 4220 | const o = D.current.querySelector( |
| 4221 | `[name="acf-block_${ p }[${ r }]"` |
| 4222 | ); |
| 4223 | if ( ! o ) return; |
| 4224 | e && L( ! 0 ), K( ! 1 ), ( o.value = e ); |
| 4225 | const i = c( D?.current ), |
| 4226 | a = acf.serialize( i, `acf-block_${ p }` ); |
| 4227 | a ? h( JSON.stringify( a ) ) : L( ! 1 ); |
| 4228 | } |
| 4229 | function ue( e, t, n ) { |
| 4230 | if ( n ) return ! 1; |
| 4231 | if ( |
| 4232 | ( acf.debug( 'Preload check', e, t ), |
| 4233 | ( ( e ) => { |
| 4234 | const t = wp.data |
| 4235 | .select( 'core/block-editor' ) |
| 4236 | .getBlockParents( e ); |
| 4237 | return wp.data |
| 4238 | .select( 'core/block-editor' ) |
| 4239 | .getBlocksByClientId( t ) |
| 4240 | .filter( ( e ) => 'core/query' === e.name ) |
| 4241 | .length; |
| 4242 | } )( t ) ) |
| 4243 | ) |
| 4244 | return ! 1; |
| 4245 | const r = acf.get( 'preloadedBlocks' ); |
| 4246 | return r && r[ e ] |
| 4247 | ? ( ( r[ e ].html = r[ e ].html.replaceAll( e, t ) ), |
| 4248 | r[ e ]?.validation && |
| 4249 | r[ e ]?.validation.errors && |
| 4250 | ( r[ e ].validation.errors = r[ |
| 4251 | e |
| 4252 | ]?.validation.errors.map( |
| 4253 | ( n ) => ( |
| 4254 | ( n.input = n.input.replaceAll( |
| 4255 | e, |
| 4256 | t |
| 4257 | ) ), |
| 4258 | n |
| 4259 | ) |
| 4260 | ) ), |
| 4261 | acf.debug( 'Preload successful', r[ e ] ), |
| 4262 | r[ e ] ) |
| 4263 | : ( acf.debug( 'Preload failed: not preloaded.' ), |
| 4264 | ! 1 ); |
| 4265 | } |
| 4266 | function fe( { |
| 4267 | theAttributes: e, |
| 4268 | theClientId: t, |
| 4269 | theContext: n, |
| 4270 | isSelected: i, |
| 4271 | } ) { |
| 4272 | if ( ! e ) return; |
| 4273 | N && N.abort(); |
| 4274 | const s = ue( l( e, a ), t, i ); |
| 4275 | if ( s ) |
| 4276 | return ( |
| 4277 | X || |
| 4278 | ( s.html |
| 4279 | ? _( |
| 4280 | acf.applyFilters( |
| 4281 | 'blocks/preview/render', |
| 4282 | s.html, |
| 4283 | ! 0 |
| 4284 | ) |
| 4285 | ) |
| 4286 | : _( |
| 4287 | acf.applyFilters( |
| 4288 | 'blocks/preview/render', |
| 4289 | 'acf-block-preview-no-html', |
| 4290 | ! 0 |
| 4291 | ) |
| 4292 | ), |
| 4293 | s?.blockToolbarFields && |
| 4294 | V( s?.blockToolbarFields ), |
| 4295 | s?.fields && A( s.fields ) ), |
| 4296 | void ( s?.validation && |
| 4297 | ! s.validation.valid && |
| 4298 | s.validation.errors |
| 4299 | ? I( s.validation.errors ) |
| 4300 | : I( null ) ) |
| 4301 | ); |
| 4302 | const d = { preview: ! 0, form: ! 0, validate: ! 0 }; |
| 4303 | m || ( d.validate = ! 1 ), u || ( d.validate = ! 1 ); |
| 4304 | const p = { ...e }; |
| 4305 | r( 'acf-fetching-block' ); |
| 4306 | const f = c |
| 4307 | .ajax( { |
| 4308 | url: acf.get( 'ajaxurl' ), |
| 4309 | dataType: 'json', |
| 4310 | type: 'post', |
| 4311 | cache: ! 1, |
| 4312 | data: acf.prepareForAjax( { |
| 4313 | action: 'acf/ajax/fetch-block', |
| 4314 | block: JSON.stringify( p ), |
| 4315 | clientId: t, |
| 4316 | context: JSON.stringify( n ), |
| 4317 | query: d, |
| 4318 | } ), |
| 4319 | } ) |
| 4320 | .done( ( e ) => { |
| 4321 | L( ! 1 ), |
| 4322 | o( 'acf-fetching-block' ), |
| 4323 | A( e.data.fields ), |
| 4324 | b( e.data.form ); |
| 4325 | const t = acf.applyFilters( |
| 4326 | 'blocks/preview/render', |
| 4327 | e.data.preview |
| 4328 | ? e.data.preview |
| 4329 | : 'acf-block-preview-no-html', |
| 4330 | ! 1 |
| 4331 | ); |
| 4332 | k( t ), |
| 4333 | e.data?.validation && |
| 4334 | ! e.data.validation.valid && |
| 4335 | e.data.validation.errors |
| 4336 | ? I( e.data.validation.errors ) |
| 4337 | : I( null ), |
| 4338 | e.data?.blockToolbarFields && |
| 4339 | V( e.data?.blockToolbarFields ), |
| 4340 | M( ! 0 ); |
| 4341 | } ) |
| 4342 | .fail( function () { |
| 4343 | M( ! 0 ), L( ! 1 ), o( 'acf-fetching-block' ); |
| 4344 | } ); |
| 4345 | R( f ); |
| 4346 | } |
| 4347 | return ( |
| 4348 | ce( () => { |
| 4349 | function e() { |
| 4350 | O( ! 0 ), |
| 4351 | window.removeEventListener( 'click', e ), |
| 4352 | window.removeEventListener( 'keydown', e ); |
| 4353 | } |
| 4354 | return ( |
| 4355 | window.addEventListener( 'click', e ), |
| 4356 | window.addEventListener( 'keydown', e ), |
| 4357 | () => { |
| 4358 | window.removeEventListener( 'click', e ), |
| 4359 | window.removeEventListener( 'keydown', e ); |
| 4360 | } |
| 4361 | ); |
| 4362 | }, [] ), |
| 4363 | ce( () => { |
| 4364 | i( j ? { hasAcfError: ! 0 } : { hasAcfError: ! 1 } ); |
| 4365 | }, [ j, i ] ), |
| 4366 | ce( () => { |
| 4367 | const e = ( e ) => { |
| 4368 | p === e.detail.acfBlockWithValidationErrors && |
| 4369 | ( r( p ), B( ! 0 ), J( null ) ); |
| 4370 | }; |
| 4371 | return ( |
| 4372 | document.addEventListener( |
| 4373 | 'acf/block/has-error', |
| 4374 | e |
| 4375 | ), |
| 4376 | () => { |
| 4377 | document.removeEventListener( |
| 4378 | 'acf/block/has-error', |
| 4379 | e |
| 4380 | ), |
| 4381 | o( p ); |
| 4382 | } |
| 4383 | ); |
| 4384 | }, [] ), |
| 4385 | ce( |
| 4386 | () => ( |
| 4387 | clearTimeout( oe.current ), |
| 4388 | r( 'acf-fetching-block' ), |
| 4389 | ( oe.current = setTimeout( () => { |
| 4390 | ! ( function () { |
| 4391 | const e = JSON.parse( f ); |
| 4392 | if ( ! e ) |
| 4393 | return ( |
| 4394 | fe( { |
| 4395 | theAttributes: ae, |
| 4396 | theClientId: p, |
| 4397 | theContext: a, |
| 4398 | isSelected: s, |
| 4399 | } ), |
| 4400 | void o( 'acf-fetching-block' ) |
| 4401 | ); |
| 4402 | if ( f === JSON.stringify( ae.data ) ) |
| 4403 | return ( |
| 4404 | fe( { |
| 4405 | theAttributes: ae, |
| 4406 | theClientId: p, |
| 4407 | theContext: a, |
| 4408 | isSelected: s, |
| 4409 | } ), |
| 4410 | void o( 'acf-fetching-block' ) |
| 4411 | ); |
| 4412 | const t = { ...n, data: { ...e } }; |
| 4413 | i( t ); |
| 4414 | } )(); |
| 4415 | }, 200 ) ), |
| 4416 | () => { |
| 4417 | clearTimeout( oe.current ), |
| 4418 | o( 'acf-fetching-block' ); |
| 4419 | } |
| 4420 | ), |
| 4421 | [ f, ae ] |
| 4422 | ), |
| 4423 | ce( () => { |
| 4424 | if ( $.current && y ) { |
| 4425 | const e = n.name.replace( 'acf/', '' ), |
| 4426 | t = c( $.current ); |
| 4427 | if ( |
| 4428 | ( acf.doAction( 'render_block_preview', t, n ), |
| 4429 | acf.doAction( |
| 4430 | `render_block_preview/type=${ e }`, |
| 4431 | t, |
| 4432 | n |
| 4433 | ), |
| 4434 | W ) |
| 4435 | ) { |
| 4436 | const e = $?.current.querySelector( |
| 4437 | `[data-acf-inline-fields-uid="${ W }"]` |
| 4438 | ); |
| 4439 | z( e ); |
| 4440 | } |
| 4441 | } |
| 4442 | }, [ y ] ), |
| 4443 | ce( () => { |
| 4444 | if ( ( X && ! G ) || ! g ) return; |
| 4445 | const e = document.querySelector( |
| 4446 | '.acf-inline-editing-toolbar' |
| 4447 | ); |
| 4448 | e && |
| 4449 | e.style && |
| 4450 | e.style.cssText && |
| 4451 | re( |
| 4452 | e.style.cssText.replaceAll( ';', '!important;' ) |
| 4453 | ), |
| 4454 | setTimeout( () => { |
| 4455 | _( g ), |
| 4456 | setTimeout( () => { |
| 4457 | re( null ); |
| 4458 | }, 0 ); |
| 4459 | }, 0 ); |
| 4460 | }, [ g ] ), |
| 4461 | ce( () => { |
| 4462 | const e = new MutationObserver( ( e ) => { |
| 4463 | for ( const t of e ) |
| 4464 | if ( 'characterData' === t.type ) { |
| 4465 | let e = t.target.parentNode; |
| 4466 | const n = e?.closest( '[data-block]' ), |
| 4467 | r = n?.getAttribute( 'data-block' ); |
| 4468 | if ( ! e || ! n || r !== p ) return; |
| 4469 | if ( |
| 4470 | ( e && |
| 4471 | ! e.hasAttribute( |
| 4472 | 'data-acf-inline-contenteditable' |
| 4473 | ) && |
| 4474 | ( e = e.closest( |
| 4475 | '[data-acf-inline-contenteditable]' |
| 4476 | ) ), |
| 4477 | e && |
| 4478 | e.hasAttribute( |
| 4479 | 'data-acf-inline-contenteditable' |
| 4480 | ) ) |
| 4481 | ) { |
| 4482 | const t = e.attributes.getNamedItem( |
| 4483 | 'data-acf-inline-contenteditable-field-slug' |
| 4484 | ).value; |
| 4485 | let n = e.innerHTML.trim(); |
| 4486 | n || ( n = '' ), se( n, t ); |
| 4487 | } |
| 4488 | } else { |
| 4489 | const e = t.target.closest( |
| 4490 | '[data-acf-inline-contenteditable]' |
| 4491 | ), |
| 4492 | n = e?.closest( '[data-block]' ); |
| 4493 | if ( |
| 4494 | ! e || |
| 4495 | ! n || |
| 4496 | n.getAttribute( 'data-block' ) !== p |
| 4497 | ) |
| 4498 | return; |
| 4499 | if ( e ) { |
| 4500 | const t = e.attributes.getNamedItem( |
| 4501 | 'data-acf-inline-contenteditable-field-slug' |
| 4502 | ).value; |
| 4503 | let n = e.innerHTML.trim(); |
| 4504 | ( ! n || |
| 4505 | ( 0 === |
| 4506 | e.textContent.trim().length && |
| 4507 | 1 === e.children.length && |
| 4508 | e.firstElementChild && |
| 4509 | 'BR' === |
| 4510 | e.firstElementChild |
| 4511 | .nodeName ) ) && |
| 4512 | ( ( e.innerHTML = '' ), |
| 4513 | ( n = '' ) ), |
| 4514 | se( n, t ); |
| 4515 | } |
| 4516 | } |
| 4517 | } ); |
| 4518 | return ( |
| 4519 | e.observe( Q, { |
| 4520 | attributes: ! 0, |
| 4521 | childList: ! 0, |
| 4522 | subtree: ! 0, |
| 4523 | characterData: ! 0, |
| 4524 | attributeFilter: [ |
| 4525 | 'data-acf-inline-contenteditable', |
| 4526 | ], |
| 4527 | } ), |
| 4528 | () => { |
| 4529 | e.disconnect(); |
| 4530 | } |
| 4531 | ); |
| 4532 | }, [ y ] ), |
| 4533 | ( 0, e.jsx )( _e, { |
| 4534 | ...t, |
| 4535 | validationErrors: j, |
| 4536 | showValidationErrors: T, |
| 4537 | theSerializedAcfData: f, |
| 4538 | setTheSerializedAcfData: h, |
| 4539 | acfFormRef: D, |
| 4540 | blockFormHtml: m, |
| 4541 | blockPreviewHtml: y, |
| 4542 | blockFetcher: fe, |
| 4543 | userHasInteractedWithForm: F, |
| 4544 | setUserHasInteractedWithForm: O, |
| 4545 | previewRef: $, |
| 4546 | setInlineEditingToolbarHasFocus: K, |
| 4547 | currentContentEditableElement: X, |
| 4548 | setCurrentContentEditableElement: Y, |
| 4549 | currentInlineEditingElement: U, |
| 4550 | setCurrentInlineEditingElement: z, |
| 4551 | currentInlineEditingElementUid: W, |
| 4552 | onNewInlineEditingElementSelected: function ( e ) { |
| 4553 | setTimeout( () => { |
| 4554 | J( e ); |
| 4555 | const t = $?.current.querySelector( |
| 4556 | `[data-acf-inline-fields-uid="${ e }"]` |
| 4557 | ); |
| 4558 | z( t ), |
| 4559 | t && |
| 4560 | t.scrollIntoView( { |
| 4561 | behavior: 'smooth', |
| 4562 | block: 'nearest', |
| 4563 | } ); |
| 4564 | }, 1 ); |
| 4565 | }, |
| 4566 | onContentEditableChange: se, |
| 4567 | onNewContentEditableElementSelected: function ( e ) { |
| 4568 | if ( e ) { |
| 4569 | const t = $?.current.querySelector( |
| 4570 | `[data-acf-inline-contenteditable-field-slug="${ e }"]` |
| 4571 | ); |
| 4572 | Y( t ); |
| 4573 | } else Y( null ); |
| 4574 | }, |
| 4575 | gutenbergIframeOrDocument: Q, |
| 4576 | acfDynamicStylesElement: ee, |
| 4577 | blockFieldInfo: S, |
| 4578 | blockEditorInspectorSidebarOpen: ie, |
| 4579 | blockToolbarFields: q, |
| 4580 | hasFetchedOnce: P, |
| 4581 | contentEditableChangeInProgress: H, |
| 4582 | freezeInlineToolbarDuringReRender: ne, |
| 4583 | } ) |
| 4584 | ); |
| 4585 | }; |
| 4586 | function _e( t ) { |
| 4587 | const { |
| 4588 | $: n, |
| 4589 | isSelected: r, |
| 4590 | blockType: o, |
| 4591 | attributes: a, |
| 4592 | context: s, |
| 4593 | validationErrors: l, |
| 4594 | showValidationErrors: c, |
| 4595 | theSerializedAcfData: d, |
| 4596 | setTheSerializedAcfData: u, |
| 4597 | acfFormRef: p, |
| 4598 | blockFormHtml: f, |
| 4599 | blockPreviewHtml: m, |
| 4600 | blockFetcher: b, |
| 4601 | userHasInteractedWithForm: g, |
| 4602 | previewRef: k, |
| 4603 | setInlineEditingToolbarHasFocus: v, |
| 4604 | currentContentEditableElement: y, |
| 4605 | setCurrentContentEditableElement: x, |
| 4606 | currentInlineEditingElement: w, |
| 4607 | currentInlineEditingElementUid: E, |
| 4608 | setCurrentInlineEditingElement: _, |
| 4609 | onNewInlineEditingElementSelected: C, |
| 4610 | onContentEditableChange: j, |
| 4611 | onNewContentEditableElementSelected: S, |
| 4612 | gutenbergIframeOrDocument: A, |
| 4613 | acfDynamicStylesElement: T, |
| 4614 | blockFieldInfo: F, |
| 4615 | blockEditorInspectorSidebarOpen: O, |
| 4616 | blockToolbarFields: N, |
| 4617 | hasFetchedOnce: R, |
| 4618 | contentEditableChangeInProgress: P, |
| 4619 | freezeInlineToolbarDuringReRender: M, |
| 4620 | } = t, |
| 4621 | { clientId: H } = me(), |
| 4622 | L = de(), |
| 4623 | [ q, V ] = le( ! 1 ), |
| 4624 | U = de(), |
| 4625 | [ W, J ] = le( ! 1 ), |
| 4626 | [ X, Y ] = le(), |
| 4627 | [ G, K ] = le(); |
| 4628 | ce( () => { |
| 4629 | let e = document.getElementById( 'invisible-acf-form-element' ); |
| 4630 | e || |
| 4631 | ( ( e = document.createElement( 'div' ) ), |
| 4632 | ( e.id = 'invisible-acf-form-element' ), |
| 4633 | ( e.style.display = 'none' ), |
| 4634 | document.body.appendChild( e ) ), |
| 4635 | K( e ); |
| 4636 | }, [ O ] ), |
| 4637 | ce( () => { |
| 4638 | Y( W && U?.current ? U.current : O ? L.current : G ); |
| 4639 | }, [ W, U ] ), |
| 4640 | ce( () => { |
| 4641 | O ? W || Y( L.current ) : Y( G ); |
| 4642 | }, [ O, G ] ), |
| 4643 | ce( () => { |
| 4644 | r && L?.current && L.current |
| 4645 | ? V( ! 0 ) |
| 4646 | : r && |
| 4647 | ! L?.current && |
| 4648 | setTimeout( () => { |
| 4649 | V( ! 0 ); |
| 4650 | }, 1 ); |
| 4651 | }, [ r, L, L.current ] ), |
| 4652 | ce( () => { |
| 4653 | r && l && c && o?.hide_fields_in_sidebar && J( ! 0 ); |
| 4654 | }, [ r, c, l, o ] ); |
| 4655 | let Z = 'acf-block-component acf-block-body'; |
| 4656 | ( Z += ' acf-block-preview' ), |
| 4657 | l && c && ( Z += ' acf-block-has-validation-error' ); |
| 4658 | const ee = { ...he( { className: Z, ref: k } ) }; |
| 4659 | let te = O && L?.current ? L.current : G; |
| 4660 | X && ( te = X ); |
| 4661 | let ne = null; |
| 4662 | return ( |
| 4663 | w && y && ( ne = w ), |
| 4664 | w && ! y && ( ne = w ), |
| 4665 | ! w && y && ( ne = y ), |
| 4666 | ne?.isConnected || ( ne = null ), |
| 4667 | ( 0, e.jsxs )( e.Fragment, { |
| 4668 | children: [ |
| 4669 | ( 0, e.jsx )( Q, { |
| 4670 | blockToolbarFields: N, |
| 4671 | blockFieldInfo: F, |
| 4672 | setCurrentBlockFormContainer: Y, |
| 4673 | gutenbergIframeOrDocument: A, |
| 4674 | setBlockFormModalOpen: J, |
| 4675 | blockFormModalOpen: W, |
| 4676 | invisibleBlockFormContainer: G, |
| 4677 | } ), |
| 4678 | ( 0, e.jsxs )( fe, { |
| 4679 | children: [ |
| 4680 | ( 0, e.jsx )( we, { |
| 4681 | children: ( 0, e.jsx )( xe, { |
| 4682 | icon: 'edit', |
| 4683 | className: |
| 4684 | 'acf-blocks-open-expanded-editor-btn', |
| 4685 | variant: 'secondary', |
| 4686 | onClick: () => { |
| 4687 | J( ! 0 ); |
| 4688 | }, |
| 4689 | children: acf.__( |
| 4690 | 'Open Expanded Editor' |
| 4691 | ), |
| 4692 | } ), |
| 4693 | } ), |
| 4694 | ( 0, e.jsx )( I, { |
| 4695 | inspectorBlockFormRef: L, |
| 4696 | setCurrentBlockFormContainer: Y, |
| 4697 | } ), |
| 4698 | ], |
| 4699 | } ), |
| 4700 | te && |
| 4701 | q && |
| 4702 | ue( |
| 4703 | ( 0, e.jsxs )( e.Fragment, { |
| 4704 | children: [ |
| 4705 | ( 0, e.jsx )( B, { |
| 4706 | $: n, |
| 4707 | clientId: H, |
| 4708 | blockFormHtml: f, |
| 4709 | onMount: () => { |
| 4710 | R || |
| 4711 | b( { |
| 4712 | theAttributes: a, |
| 4713 | theClientId: H, |
| 4714 | theContext: s, |
| 4715 | isSelected: r, |
| 4716 | } ); |
| 4717 | }, |
| 4718 | onChange: function ( e ) { |
| 4719 | const t = acf.serialize( |
| 4720 | e, |
| 4721 | `acf-block_${ H }` |
| 4722 | ); |
| 4723 | t && u( JSON.stringify( t ) ); |
| 4724 | }, |
| 4725 | validationErrors: l, |
| 4726 | showValidationErrors: c, |
| 4727 | acfFormRef: p, |
| 4728 | blockFormPortalElement: te, |
| 4729 | theSerializedAcfData: d, |
| 4730 | userHasInteractedWithForm: g, |
| 4731 | attributes: a, |
| 4732 | hideFieldsInSidebar: |
| 4733 | ( o?.auto_inline_editing && |
| 4734 | void 0 === |
| 4735 | o?.hide_fields_in_sidebar && |
| 4736 | L.current === X ) || |
| 4737 | ( o?.hide_fields_in_sidebar && |
| 4738 | L.current === X ), |
| 4739 | } ), |
| 4740 | M && |
| 4741 | ( 0, e.jsx )( 'style', { |
| 4742 | children: `.acf-inline-editing-toolbar{${ M }}`, |
| 4743 | } ), |
| 4744 | ], |
| 4745 | } ), |
| 4746 | te |
| 4747 | ), |
| 4748 | ( 0, e.jsxs )( e.Fragment, { |
| 4749 | children: [ |
| 4750 | T && |
| 4751 | E && |
| 4752 | ue( |
| 4753 | ( 0, e.jsx )( e.Fragment, { |
| 4754 | children: `\n\t\t\t\t[data-acf-inline-fields-uid="${ E }"]{\n\t\t\t\t\toutline: 2px solid var( --wp-admin-theme-color );\n\t\t\t\t\toutline-offset: 2px;\n\t\t\t\t}\n\t\t\t`, |
| 4755 | } ), |
| 4756 | T |
| 4757 | ), |
| 4758 | W && |
| 4759 | ( 0, e.jsx )( ye, { |
| 4760 | className: 'acf-block-form-modal', |
| 4761 | isFullScreen: ! 0, |
| 4762 | title: o.title, |
| 4763 | onRequestClose: () => { |
| 4764 | i( 'acf-fetching-block' ) || |
| 4765 | J( ! 1 ); |
| 4766 | }, |
| 4767 | isDismissible: ! 1, |
| 4768 | headerActions: [ |
| 4769 | ( 0, e.jsx )( |
| 4770 | xe, |
| 4771 | { |
| 4772 | variant: 'primary', |
| 4773 | disabled: |
| 4774 | i( |
| 4775 | 'acf-fetching-block' |
| 4776 | ), |
| 4777 | onClick: () => { |
| 4778 | Y( null ), J( ! 1 ); |
| 4779 | }, |
| 4780 | children: acf.__( 'Done' ), |
| 4781 | }, |
| 4782 | 'done' |
| 4783 | ), |
| 4784 | ], |
| 4785 | children: ( 0, e.jsx )( 'div', { |
| 4786 | className: |
| 4787 | 'acf-modal-block-form-container', |
| 4788 | ref: U, |
| 4789 | } ), |
| 4790 | } ), |
| 4791 | ], |
| 4792 | } ), |
| 4793 | ( 0, e.jsxs )( e.Fragment, { |
| 4794 | children: [ |
| 4795 | ne && |
| 4796 | ( 0, e.jsx )( |
| 4797 | z, |
| 4798 | { |
| 4799 | focusOnMount: ( () => { |
| 4800 | const e = |
| 4801 | document.activeElement; |
| 4802 | return ( |
| 4803 | e && e.isContentEditable, |
| 4804 | ! 1 |
| 4805 | ); |
| 4806 | } )(), |
| 4807 | variant: 'unstyled', |
| 4808 | anchor: ne, |
| 4809 | className: |
| 4810 | 'acf-inline-editing-toolbar block-editor-block-list__block-popover', |
| 4811 | placement: 'top-start', |
| 4812 | onClose: ( e ) => { |
| 4813 | if ( |
| 4814 | 'Escape' !== e.key && |
| 4815 | e.target.closest( |
| 4816 | '.acf-toolbar-button' |
| 4817 | ) |
| 4818 | ) |
| 4819 | return ! 1; |
| 4820 | if ( 'Escape' === e.key ) |
| 4821 | return ( |
| 4822 | ! document.querySelector( |
| 4823 | '.acf-inline-fields-popover-inner' |
| 4824 | ) && |
| 4825 | ! y && |
| 4826 | ( w && w.focus(), |
| 4827 | x( null ), |
| 4828 | _( null ), |
| 4829 | ! 0 ) |
| 4830 | ); |
| 4831 | if ( |
| 4832 | e.target.getAttribute( |
| 4833 | 'data-acf-inline-contenteditable' |
| 4834 | ) |
| 4835 | ) |
| 4836 | return ! 1; |
| 4837 | const t = e.target.closest( |
| 4838 | '.acf-inline-fields-popover-inner' |
| 4839 | ), |
| 4840 | n = e.target.closest( |
| 4841 | '.components-modal__content' |
| 4842 | ); |
| 4843 | return ( |
| 4844 | t || |
| 4845 | n || |
| 4846 | ( x( null ), |
| 4847 | _( null ) ), |
| 4848 | ! 0 |
| 4849 | ); |
| 4850 | }, |
| 4851 | gutenbergIframeOrDocument: A, |
| 4852 | hidePrimaryBlockToolbar: ! 0, |
| 4853 | children: ( 0, e.jsx )( |
| 4854 | se, |
| 4855 | { |
| 4856 | blockIcon: o.icon, |
| 4857 | blockFieldInfo: F, |
| 4858 | acfFormRef: p, |
| 4859 | setInlineEditingToolbarHasFocus: |
| 4860 | v, |
| 4861 | currentContentEditableElement: |
| 4862 | y, |
| 4863 | currentInlineEditingElement: |
| 4864 | w, |
| 4865 | currentInlineEditingElementUid: |
| 4866 | E, |
| 4867 | gutenbergIframeOrDocument: |
| 4868 | A, |
| 4869 | setCurrentBlockFormContainer: |
| 4870 | Y, |
| 4871 | contentEditableChangeInProgress: |
| 4872 | P, |
| 4873 | }, |
| 4874 | E |
| 4875 | ), |
| 4876 | }, |
| 4877 | y |
| 4878 | ), |
| 4879 | ( 0, e.jsxs )( $, { |
| 4880 | blockPreviewHtml: m, |
| 4881 | blockProps: ee, |
| 4882 | blockType: o, |
| 4883 | setBlockFormModalOpen: J, |
| 4884 | children: [ |
| 4885 | 'acf-block-preview-no-html' === m |
| 4886 | ? ( 0, e.jsx )( D, { |
| 4887 | setBlockFormModalOpen: J, |
| 4888 | blockLabel: o.title, |
| 4889 | } ) |
| 4890 | : null, |
| 4891 | 'acf-block-preview-loading' === m && |
| 4892 | ( 0, e.jsx )( ke, { |
| 4893 | children: ( 0, e.jsx )( |
| 4894 | ve, |
| 4895 | {} |
| 4896 | ), |
| 4897 | } ), |
| 4898 | 'acf-block-preview-loading' !== m && |
| 4899 | 'acf-block-preview-no-html' !== m && |
| 4900 | m && |
| 4901 | h( m, C, j, S, F, n ), |
| 4902 | ], |
| 4903 | } ), |
| 4904 | ], |
| 4905 | } ), |
| 4906 | ], |
| 4907 | } ) |
| 4908 | ); |
| 4909 | } |
| 4910 | const Ce = ( e, t, n ) => ( ( e[ t ] = { type: n } ), e ), |
| 4911 | je = ( e ) => { |
| 4912 | const t = acf.get( 'rtl' ) ? 'right' : 'left'; |
| 4913 | return [ 'left', 'center', 'right' ].includes( e ) ? e : t; |
| 4914 | }, |
| 4915 | { Fragment: Ie, Component: Se } = wp.element, |
| 4916 | { BlockControls: Ae, AlignmentToolbar: Te } = wp.blockEditor, |
| 4917 | Be = ( t, n ) => { |
| 4918 | const r = je; |
| 4919 | return ( |
| 4920 | ( n.alignText = r( n.alignText ) ), |
| 4921 | class extends Se { |
| 4922 | render() { |
| 4923 | const { attributes: n, setAttributes: o } = |
| 4924 | this.props, |
| 4925 | { alignText: i } = n; |
| 4926 | return ( 0, e.jsxs )( Ie, { |
| 4927 | children: [ |
| 4928 | ( 0, e.jsx )( Ae, { |
| 4929 | group: 'block', |
| 4930 | children: ( 0, e.jsx )( Te, { |
| 4931 | value: r( i ), |
| 4932 | onChange: function ( e ) { |
| 4933 | o( { alignText: r( e ) } ); |
| 4934 | }, |
| 4935 | } ), |
| 4936 | } ), |
| 4937 | ( 0, e.jsx )( t, { ...this.props } ), |
| 4938 | ], |
| 4939 | } ); |
| 4940 | } |
| 4941 | } |
| 4942 | ); |
| 4943 | }, |
| 4944 | Fe = ( e ) => |
| 4945 | [ 'top', 'center', 'bottom' ].includes( e ) ? e : 'top', |
| 4946 | Oe = ( e ) => { |
| 4947 | if ( e ) { |
| 4948 | const [ t, n ] = e.split( ' ' ); |
| 4949 | return `${ Fe( t ) } ${ je( n ) }`; |
| 4950 | } |
| 4951 | return 'center center'; |
| 4952 | }, |
| 4953 | { Fragment: Ne, Component: Re } = wp.element, |
| 4954 | { BlockControls: Pe, BlockVerticalAlignmentToolbar: Me } = |
| 4955 | wp.blockEditor, |
| 4956 | He = |
| 4957 | wp.blockEditor.__experimentalBlockAlignmentMatrixToolbar || |
| 4958 | wp.blockEditor.BlockAlignmentMatrixToolbar, |
| 4959 | Le = |
| 4960 | wp.blockEditor.__experimentalBlockAlignmentMatrixControl || |
| 4961 | wp.blockEditor.BlockAlignmentMatrixControl, |
| 4962 | De = ( t, n ) => { |
| 4963 | let r, o; |
| 4964 | return ( |
| 4965 | 'matrix' === |
| 4966 | ( n.supports.align_content || n.supports.alignContent ) |
| 4967 | ? ( ( r = Le || He ), ( o = Oe ) ) |
| 4968 | : ( ( r = Me ), ( o = Fe ) ), |
| 4969 | void 0 === r |
| 4970 | ? t |
| 4971 | : ( ( n.alignContent = o( n.alignContent ) ), |
| 4972 | class extends Re { |
| 4973 | render() { |
| 4974 | const { attributes: n, setAttributes: i } = |
| 4975 | this.props, |
| 4976 | { alignContent: a } = n; |
| 4977 | return ( 0, e.jsxs )( Ne, { |
| 4978 | children: [ |
| 4979 | ( 0, e.jsx )( Pe, { |
| 4980 | group: 'block', |
| 4981 | children: ( 0, e.jsx )( r, { |
| 4982 | label: acf.__( |
| 4983 | 'Change content alignment' |
| 4984 | ), |
| 4985 | value: o( a ), |
| 4986 | onChange: function ( e ) { |
| 4987 | i( { |
| 4988 | alignContent: |
| 4989 | o( e ), |
| 4990 | } ); |
| 4991 | }, |
| 4992 | } ), |
| 4993 | } ), |
| 4994 | ( 0, e.jsx )( t, { |
| 4995 | ...this.props, |
| 4996 | } ), |
| 4997 | ], |
| 4998 | } ); |
| 4999 | } |
| 5000 | } ) |
| 5001 | ); |
| 5002 | }, |
| 5003 | { Fragment: $e, Component: qe } = wp.element, |
| 5004 | { BlockControls: Ve } = wp.blockEditor, |
| 5005 | Ue = |
| 5006 | wp.blockEditor.__experimentalBlockFullHeightAligmentControl || |
| 5007 | wp.blockEditor.__experimentalBlockFullHeightAlignmentControl || |
| 5008 | wp.blockEditor.BlockFullHeightAlignmentControl, |
| 5009 | ze = ( t ) => |
| 5010 | Ue |
| 5011 | ? class extends qe { |
| 5012 | render() { |
| 5013 | const { attributes: n, setAttributes: r } = |
| 5014 | this.props, |
| 5015 | { fullHeight: o } = n; |
| 5016 | return ( 0, e.jsxs )( $e, { |
| 5017 | children: [ |
| 5018 | ( 0, e.jsx )( Ve, { |
| 5019 | group: 'block', |
| 5020 | children: ( 0, e.jsx )( Ue, { |
| 5021 | isActive: o, |
| 5022 | onToggle: function ( e ) { |
| 5023 | r( { fullHeight: e } ); |
| 5024 | }, |
| 5025 | } ), |
| 5026 | } ), |
| 5027 | ( 0, e.jsx )( t, { ...this.props } ), |
| 5028 | ], |
| 5029 | } ); |
| 5030 | } |
| 5031 | } |
| 5032 | : t; |
| 5033 | ( ( t, n ) => { |
| 5034 | const { InnerBlocks: r } = wp.blockEditor, |
| 5035 | { Component: o } = wp.element, |
| 5036 | { createHigherOrderComponent: i } = wp.compose, |
| 5037 | a = {}; |
| 5038 | function s( n ) { |
| 5039 | const o = n.post_types || []; |
| 5040 | if ( o.length ) { |
| 5041 | o.push( 'wp_block' ); |
| 5042 | const e = acf.get( 'postType' ); |
| 5043 | if ( ! o.includes( e ) ) return ! 1; |
| 5044 | } |
| 5045 | if ( |
| 5046 | 'string' == typeof n.icon && |
| 5047 | '<svg' === n.icon.substr( 0, 4 ) |
| 5048 | ) { |
| 5049 | const t = n.icon; |
| 5050 | n.icon = ( 0, e.jsx )( 'div', { |
| 5051 | dangerouslySetInnerHTML: { __html: t }, |
| 5052 | } ); |
| 5053 | } |
| 5054 | n.icon || delete n.icon, |
| 5055 | wp.blocks |
| 5056 | .getCategories() |
| 5057 | .filter( ( { slug: e } ) => e === n.category ) |
| 5058 | .pop() || ( n.category = 'common' ), |
| 5059 | ( n = acf.parseArgs( n, { |
| 5060 | title: '', |
| 5061 | name: '', |
| 5062 | category: '', |
| 5063 | api_version: 2, |
| 5064 | acf_block_version: 3, |
| 5065 | } ) ); |
| 5066 | for ( const e in n.attributes ) |
| 5067 | 'default' in n.attributes[ e ] && |
| 5068 | 0 === n.attributes[ e ].default.length && |
| 5069 | delete n.attributes[ e ].default; |
| 5070 | n.supports.anchor && |
| 5071 | ( n.attributes.anchor = { type: 'string' } ), |
| 5072 | ( n.attributes.hasAcfError = { |
| 5073 | type: 'boolean', |
| 5074 | default: ! 1, |
| 5075 | } ); |
| 5076 | let i = Ee; |
| 5077 | ( n.supports.alignText || n.supports.align_text ) && |
| 5078 | ( ( n.attributes = Ce( |
| 5079 | n.attributes, |
| 5080 | 'align_text', |
| 5081 | 'string' |
| 5082 | ) ), |
| 5083 | ( i = Be( i, n ) ) ), |
| 5084 | ( n.supports.alignContent || n.supports.align_content ) && |
| 5085 | ( ( n.attributes = Ce( |
| 5086 | n.attributes, |
| 5087 | 'align_content', |
| 5088 | 'string' |
| 5089 | ) ), |
| 5090 | ( i = De( i, n ) ) ), |
| 5091 | ( n.supports.fullHeight || n.supports.full_height ) && |
| 5092 | ( ( n.attributes = Ce( |
| 5093 | n.attributes, |
| 5094 | 'full_height', |
| 5095 | 'boolean' |
| 5096 | ) ), |
| 5097 | ( i = ze( i ) ) ), |
| 5098 | ( n.edit = function ( r ) { |
| 5099 | return ( 0, e.jsx )( i, { ...r, blockType: n, $: t } ); |
| 5100 | } ), |
| 5101 | ( n.save = () => ( 0, e.jsx )( r.Content, {} ) ), |
| 5102 | ( a[ n.name ] = n ); |
| 5103 | const s = wp.blocks.registerBlockType( n.name, n ); |
| 5104 | return ( |
| 5105 | s.attributes.anchor && |
| 5106 | ( s.attributes.anchor = { type: 'string' } ), |
| 5107 | s |
| 5108 | ); |
| 5109 | } |
| 5110 | acf.addAction( 'prepare', function () { |
| 5111 | wp.blockEditor || ( wp.blockEditor = wp.editor ); |
| 5112 | const e = acf.get( 'blockTypes' ); |
| 5113 | e && |
| 5114 | e.forEach( ( e ) => { |
| 5115 | parseInt( e.acf_block_version ) >= 3 && s( e ); |
| 5116 | } ); |
| 5117 | } ); |
| 5118 | const l = i( |
| 5119 | ( t ) => |
| 5120 | class extends o { |
| 5121 | constructor( e ) { |
| 5122 | super( e ); |
| 5123 | const { name: t, attributes: r } = this.props, |
| 5124 | o = ( function ( e ) { |
| 5125 | return a[ e ] || ! 1; |
| 5126 | } )( t ); |
| 5127 | if ( ! o ) return; |
| 5128 | Object.keys( r ).forEach( ( e ) => { |
| 5129 | '' === r[ e ] && delete r[ e ]; |
| 5130 | } ); |
| 5131 | const i = { |
| 5132 | full_height: 'fullHeight', |
| 5133 | align_content: 'alignContent', |
| 5134 | align_text: 'alignText', |
| 5135 | }; |
| 5136 | Object.keys( i ).forEach( ( e ) => { |
| 5137 | r[ e ] !== n |
| 5138 | ? ( r[ i[ e ] ] = r[ e ] ) |
| 5139 | : r[ i[ e ] ] === n && |
| 5140 | o[ e ] !== n && |
| 5141 | ( r[ i[ e ] ] = o[ e ] ), |
| 5142 | delete o[ e ], |
| 5143 | delete r[ e ]; |
| 5144 | } ); |
| 5145 | for ( let e in o.attributes ) |
| 5146 | r[ e ] === n && |
| 5147 | o[ e ] !== n && |
| 5148 | ( r[ e ] = o[ e ] ); |
| 5149 | } |
| 5150 | render() { |
| 5151 | return ( 0, e.jsx )( t, { ...this.props } ); |
| 5152 | } |
| 5153 | }, |
| 5154 | 'withDefaultAttributes' |
| 5155 | ); |
| 5156 | wp.hooks.addFilter( |
| 5157 | 'editor.BlockListBlock', |
| 5158 | 'acf/with-default-attributes', |
| 5159 | l |
| 5160 | ); |
| 5161 | } )( jQuery ); |
| 5162 | } )(); |
| 5163 | } )(); |
| 5164 |