wp-go/static/wp-includes/js/dist/block-library.min.js

14 lines
641 KiB
JavaScript
Raw Permalink Normal View History

2022-09-13 03:23:28 +00:00
/*! This file is auto-generated */
!function(){var e={3827:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o=function(){function e(){}function t(e,t){for(var n=t.length,o=0;o<n;++o)r(e,t[o])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var o=/\s+/;function r(e,r){if(r){var a=typeof r;"string"===a?function(e,t){for(var n=t.split(o),r=n.length,a=0;a<r;++a)e[n[a]]=!0}(e,r):Array.isArray(r)?t(e,r):"object"===a?function(e,t){if(t.toString===Object.prototype.toString)for(var o in t)n.call(t,o)&&(e[o]=!!t[o]);else e[t.toString()]=!0}(e,r):"number"===a&&function(e,t){e[t]=!0}(e,r)}}return function(){for(var n=arguments.length,o=Array(n),r=0;r<n;r++)o[r]=arguments[r];var a=new e;t(a,o);var l=[];for(var i in a)a[i]&&l.push(i);return l.join(" ")}}();e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var l=r.apply(null,n);l&&e.push(l)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)o.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},5027:function(e){
/*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function n(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}function o(e,t){return r(e)||a(e,t)||l()}function r(e){if(Array.isArray(e))return e}function a(e,t){var n=[],o=!0,r=!1,a=void 0;try{for(var l,i=e[Symbol.iterator]();!(o=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);o=!0);}catch(e){r=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw a}}return n}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}return function(){function t(){e(this,t)}return n(t,[{key:"getColorAsync",value:function(e,t,n){e.complete?t.call(e,this.getColor(e,n),n&&n.data):this._bindImageEvents(e,t,n)}},{key:"getColor",value:function(e,t){t=t||{};var n=this._getDefaultColor(t),o=this._getOriginalSize(e),r=this._prepareSizeAndPosition(o,t),a=null,l=n;if(!(r.srcWidth&&r.srcHeight&&r.destWidth&&r.destHeight))return this._prepareResult(n,new Error("FastAverageColor: Incorrect sizes."));if(!this._ctx&&(this._canvas=this._makeCanvas(),this._ctx=this._canvas.getContext&&this._canvas.getContext("2d"),!this._ctx))return this._prepareResult(n,new Error("FastAverageColor: Canvas Context 2D is not supported in this browser."));this._canvas.width=r.destWidth,this._canvas.height=r.destHeight;try{this._ctx.clearRect(0,0,r.destWidth,r.destHeight),this._ctx.drawImage(e,r.srcLeft,r.srcTop,r.srcWidth,r.srcHeight,0,0,r.destWidth,r.destHeight);var i=this._ctx.getImageData(0,0,r.destWidth,r.destHeight).data;l=this.getColorFromArray4(i,t)}catch(e){a=e}return this._prepareResult(l,a)}},{key:"getColorFromArray4",value:function(e,t){t=t||{};var n=4,o=e.length;if(o<n)return this._getDefaultColor(t);var r=o-o%n,a=(t.step||1)*n,l="_"+(t.algorithm||"sqrt")+"Algorithm";if("function"!=typeof this[l])throw new Error("FastAverageColor: ".concat(t.algorithm," is unknown algorithm."));return this[l](e,r,a)}},{key:"destroy",value:function(){delete this._canvas,delete this._ctx}},{key:"_getDefaultColor",value:function(e){return this._getOption(e,"defaultColor",[255,255,255,255])}},{key:"_getOption",value:function(e,t,n){return void 0===e[t]?n:e[t]}},{key:"_prepareSizeAndPosition",value:function(e,t){var n=this._getOption(t,"left",0),o=this._getOption(t,"top",0),r=this._getOption(t,"width",e.width),a=this._getOption(t,"height",e.height),l=r,i=a;if("precision"===t.mode)return{srcLeft:n,srcTop:o,srcWidth:r,srcHeight:a,destWidth:l,destHeight:i};var s,c=100,u=10;return r>a?(s=r/a,l=c,i=Math.round(l/s)):(s=a/r,i=c,l=Math.round(i/s)),(l>r||i>a||l<u||i<u)&&(l=r,i=a),{srcLeft:n,srcTop:o,srcWidth:r,srcHeight:a,destWidth:l,destHeight:i}}},{key:"_simpleAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,i=0,s=0;s<t;s+=n){var c=e[s+3];o+=e[s]*c,r+=e[s+1]*c,a+=e[s+2]*c,l+=c,i++}return l?[Math.round(o/l),Math.round(r/l),Math.round(a/l),Math.round(l/i)]:[0,0,0,0]}},{key:"_sqrtAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,i=0,s=0;s<t;s+=n){var c=e[s],u=e[s+1],m=e[s+2],d=e[s+3];o+=c*c*d,r+=u*u*d,a+=m*m*d,l+=d,i++}return l?[Math.round(Math.sqrt(o/l)),Math.round(Math.sqrt(r/l)),Math.round(Math.sqrt(a/l)),Math.round(l/i)]:[0,0,0,0]}},{key:"_dominantAlgorithm",value:function(e,t,n){for(var r={},a=24,l=0;l<t;l+=n){var i=e[l],s=e[l+1],c=e[l+2],u=e[l+3],m=Math.round(i/a)+","+Math.round(s/a)+","+Math.round(c/a);r[m]?r[m]=[r[m][0]+i*u,r[m][1]+s*u,r[m][2]+c*u,r[m][3]+u,r[m][4]+1]:r[m]=[i*u,s*u,c*u,u,1]}var d=Object.keys(r).map((function(e){return r[e]})).sort((function(e,t){var n=e[4],o=t[4];return n>o?-1:n===o?0:1})),p=o(d[0],5),g=p[0],h=p[1],v=p[2],b=p[3],y=p[4];return b?[Math.round(g/b),Math.round(h/b),Math.round(v/b),Math.round(b/y)]:[0,0,0,0]}},{key:"_bindImageEvents",value:function(e,t,n){var o=this,r=(n=n||{})&&n.data,a=this._getDefaultColor(n),l=function(){c(),t.call(e,o.getColor(e,n),r)},i=function(){c(),t.call(e,o._prepareResult(a,new Er