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

2 lines
45 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{var e={6007:e=>{var t=1,n=.9,r=.3,o=.1,a=0,c=.999,u=.9999,i=.99,l=/[\\\/\-_+.# \t"@\[\(\{&]/,s=/[\\\/\-_+.# \t"@\[\(\{&]/g;function d(e,f,m,p,v,h){if(h===f.length)return v===e.length?t:i;for(var g,E,b,y=p.charAt(h),w=m.indexOf(y,v),C=0;w>=0;)(g=d(e,f,m,p,w+1,h+1))>C&&(w===v?g*=t:l.test(e.charAt(w-1))?(g*=n,(b=e.slice(v,w-1).match(s))&&v>0&&(g*=Math.pow(c,b.length))):l.test(e.slice(v,w-1))?(g*=a,v>0&&(g*=Math.pow(c,w-v))):(g*=r,v>0&&(g*=Math.pow(c,w-v))),e.charAt(w)!==f.charAt(h)&&(g*=u)),g<o&&m.charAt(w-1)===p.charAt(h+1)&&m.charAt(w-1)!==p.charAt(h)&&(E=d(e,f,m,p,w+1,h+2))*o>g&&(g=E*o),g>C&&(C=g),w=m.indexOf(y,w+1);return C}e.exports=function(e,t){return d(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{CommandMenu:()=>Rn,privateApis:()=>kn,store:()=>bn,useCommand:()=>xn,useCommandLoader:()=>Ln});var e={};n.r(e),n.d(e,{close:()=>sn,open:()=>ln,registerCommand:()=>on,registerCommandLoader:()=>cn,unregisterCommand:()=>an,unregisterCommandLoader:()=>un});var t={};n.r(t),n.d(t,{getCommandLoaders:()=>fn,getCommands:()=>dn,getContext:()=>pn,isOpen:()=>mn});var o={};n.r(o),n.d(o,{setContext:()=>vn});const a=window.React;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function u(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function i(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function l(...e){return(0,a.useCallback)(i(...e),e)}function s(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return(0,a.useMemo)((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}const d=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?a.useLayoutEffect:()=>{},f=a["useId".toString()]||(()=>{});let m=0;function p(e){const[t,n]=a.useState(f());return d((()=>{e||n((e=>null!=e?e:String(m++)))}),[e]),e||(t?`radix-${t}`:"")}function v(e){const t=(0,a.useRef)(e);return(0,a.useEffect)((()=>{t.current=e})),(0,a.useMemo)((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function h({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=(0,a.useState)(e),[r]=n,o=(0,a.useRef)(r),c=v(t);return(0,a.useEffect)((()=>{o.current!==r&&(c(r),o.current=r)}),[r,o,c]),n}({defaultProp:t,onChange:n}),c=void 0!==e,u=c?e:r,i=v(n);return[u,(0,a.useCallback)((t=>{if(c){const n="function"==typeof t?t(e):t;n!==e&&i(n)}else o(t)}),[c,e,o,i])]}const g=window.ReactDOM;var E=n.n(g);const b=(0,a.forwardRef)(((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),u=o.find(C);if(u){const e=u.props.children,n=o.map((t=>t===u?a.Children.count(e)>1?a.Children.only(null):(0,a.isValidElement)(e)?e.props.children:null:t));return(0,a.createElement)(y,c({},r,{ref:t}),(0,a.isValidElement)(e)?(0,a.cloneElement)(e,void 0,n):null)}return(0,a.createElement)(y,c({},r,{ref:t}),n)}));b.displayName="Slot";const y=(0,a.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,a.isValidElement)(n)?(0,a.cloneElement)(n,{...S(r,n.props),ref:i(t,n.ref)}):a.Children.count(n)>1?a.Children.only(null):null}));y.displayName="SlotClone";