WordPress/wp-includes/js/dist/compose.min.js

9 lines
35 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.compose=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="PD33")}({"1CF3":function(e,t){e.exports=window.wp.dom},GRId:function(e,t){e.exports=window.wp.element},NMb1:function(e,t){e.exports=window.wp.deprecated},PD33:function(e,t,n){"use strict";n.r(t),n.d(t,"createHigherOrderComponent",(function(){return o})),n.d(t,"compose",(function(){return i})),n.d(t,"ifCondition",(function(){return c})),n.d(t,"pure",(function(){return l})),n.d(t,"withGlobalEvents",(function(){return v})),n.d(t,"withInstanceId",(function(){return g})),n.d(t,"withSafeTimeout",(function(){return w})),n.d(t,"withState",(function(){return E})),n.d(t,"useConstrainedTabbing",(function(){return x})),n.d(t,"useCopyOnClick",(function(){return C})),n.d(t,"useCopyToClipboard",(function(){return D})),n.d(t,"__experimentalUseDialog",(function(){return N})),n.d(t,"__experimentalUseDragging",(function(){return H})),n.d(t,"useFocusOnMount",(function(){return R})),n.d(t,"__experimentalUseFocusOutside",(function(){return P})),n.d(t,"useFocusReturn",(function(){return _})),n.d(t,"useInstanceId",(function(){return y})),n.d(t,"useIsomorphicLayoutEffect",(function(){return F})),n.d(t,"useKeyboardShortcut",(function(){return K})),n.d(t,"useMediaQuery",(function(){return V})),n.d(t,"usePrevious",(function(){return G})),n.d(t,"useReducedMotion",(function(){return W})),n.d(t,"useViewportMatch",(function(){return Q})),n.d(t,"useResizeObserver",(function(){return ee})),n.d(t,"useAsyncList",(function(){return re})),n.d(t,"useWarnOnChange",(function(){return oe})),n.d(t,"useDebounce",(function(){return ue})),n.d(t,"useThrottle",(function(){return ce})),n.d(t,"useMergeRefs",(function(){return I})),n.d(t,"useRefEffect",(function(){return j})),n.d(t,"__experimentalUseDropZone",(function(){return ae})),n.d(t,"useFocusableIframe",(function(){return le})),n.d(t,"__experimentalUseFixedWindowList",(function(){return fe}));var r=n("YLtl");var o=function(e,t){return n=>{const o=e(n),i=n.displayName||n.name||"Component";return o.displayName=`${Object(r.upperFirst)(Object(r.camelCase)(t))}(${i})`,o}},i=r.flowRight,u=n("GRId");var c=e=>o(t=>n=>e(n)?Object(u.createElement)(t,n):null,"ifCondition"),s=n("rl8x"),a=n.n(s);var l=o(e=>e.prototype instanceof u.Component?class extends e{shouldComponentUpdate(e,t){return!a()(e,this.props)||!a()(t,this.state)}}:class extends u.Component{shouldComponentUpdate(e){return!a()(e,this.props)}render(){return Object(u.createElement)(e,this.props)}},"pure"),f=n("wx14"),d=n("NMb1"),p=n.n(d);const h=new class{constructor(){this.listeners={},this.handleEvent=this.handleEvent.bind(this)}add(e,t){this.listeners[e]||(window.addEventListener(e,this.handleEvent),this.listeners[e]=[]),this.listeners[e].push(t)}remove(e,t){this.listeners[e]=Object(r.without)(this.listeners[e],t),this.listeners[e].length||(window.removeEventListener(e,this.handleEvent),delete this.listeners[e])}handleEvent(e){Object(r.forEach)(this.listeners[e.type],t=>{t.handleEvent(e)})}};function v(e){return p()("wp.compose.withGlobalEvents",{since:"5.7",alternative:"useEffect"}),o(t=>{class n extends u.Component{constructor(e){super(e),this.handleEvent=this.handleEvent.bind(this),this.handleRef=this.handleRef.bind(this)}compo
/*!
* clipboard.js v2.0.8
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
var r;r=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return g}});var r=n(279),o=n.n(r),i=n(370),u=n.n(i),c=n(817),s=n.n(c);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}var t,n,r;return t=e,(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=s()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=s()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==a(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}])&&l(t.prototype,n),r&&l(t,r),e}();function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.definePropert