2024-09-23 02:52:26 -04:00
|
|
|
*/o=[e,t],s=function(e,t){"use strict";var s,o,n="function"==typeof Map?new Map:(s=[],o=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return o[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),o.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),o.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t=null,s=null,o=null,r=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",r,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",r,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var o=d(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),n&&(document.documentElement.scrollTop=n)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),n="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(n<t?"hidden"===s.overflowY&&(c("scroll"),u(),n="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),n="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==n){o=n;var r=i("autosize:resized");try{e.dispatchEvent(r)}catch(e){}}}}function a(e){var t=n.get(e);t&&t.destroy()}function l(e){var t=n.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return r(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(n="function"==typeof s?s.apply(t,o):s)||(e.exports=n)},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function n(e,t,s){return e.concat(t).map((function(e){return o(e,s)}))}function i(e){return Object.keys(e).concat(f
|
2024-09-23 02:52:26 -04:00
|
|
|
function Np(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ap(e){var t,s;return!1!==Np(e)&&(void 0===(t=e.constructor)||!1!==Np(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Dp,cleanEmptyObject:Rp}=sn(m.privateApis);function Mp(e,t){return Ip()(e,t,{isMergeableObject:Ap,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Op(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:o,_links:n}=(0,c.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:o,canUser:n}=e(d.store),i=e(d.store).__experimentalGetCurrentGlobalStylesId();let r;const a=n("update",{kind:"root",name:"globalStyles",id:i});i&&(r=a?s("root","globalStyles",i):t("root","globalStyles",i,{context:"view"}));let l=!1;return o("__experimentalGetCurrentGlobalStylesId")&&(l=!i||(a?o("getEditedEntityRecord",["root","globalStyles",i]):o("getEntityRecord",["root","globalStyles",i,{context:"view"}]))),{globalStylesId:i,isReady:l,settings:r?.settings,styles:r?.styles,_links:r?._links}}),[]),{getEditedEntityRecord:i}=(0,c.useSelect)(d.store),{editEntityRecord:r}=(0,c.useDispatch)(d.store);return[t,(0,u.useMemo)((()=>({settings:null!=s?s:{},styles:null!=o?o:{},_links:null!=n?n:{}})),[s,o,n]),(0,u.useCallback)(((t,s={})=>{var o,n,a;const l=i("root","globalStyles",e),c={styles:null!==(o=l?.styles)&&void 0!==o?o:{},settings:null!==(n=l?.settings)&&void 0!==n?n:{},_links:null!==(a=l?._links)&&void 0!==a?a:{}},d="function"==typeof t?t(c):t;r("root","globalStyles",e,{styles:Rp(d.styles)||{},settings:Rp(d.settings)||{},_links:Rp(d._links)||{}},s)}),[e,r,i])]}(),[o,n]=function(){const e=(0,c.useSelect)((e=>e(d.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),i=(0,u.useMemo)((()=>n&&t?Mp(n,t):{}),[t,n]);return(0,u.useMemo)((()=>({isReady:e&&o,user:t,base:n,merged:i,setUserConfig:s})),[i,t,n,s,e,o])}const Lp={};function Fp(e){const{getEntityRecords:t,hasFinishedResolution:s}=e(d.store),o=t("postType","wp_block",{per_page:-1});return s("getEntityRecords",["postType","wp_block",{per_page:-1}])?o:void 0}const Vp=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Up,globalStylesLinksDataKey:zp,selectBlockPatternsKey:Hp,reusableBlocksSelectKey:Gp,sectionRootClientIdKey:$p}=sn(m.privateApis);const Wp=function(e,t,s,o){var n,i,r,a;const l=(0,p.useViewportMatch)("medium"),{allowRightClickOverrides:h,blockTypes:g,focusMode:_,hasFixedToolbar:f,isDistractionFree:b,keepCaretInsideBlock:x,hasUploadPermissions:v,hiddenBlockTypes:w,canUseUnfilteredHTML:S,userCanCreatePages:k,pageOnFront:P,pageForPosts:C,userPatternCategories:E,restBlockPatternCategories:T,sectionRootClientId:B}=(0,c.useSelect)((e=>{var n;const{canUser:i,getRawEntityRecord:r,getEntityRecord:a,getUserPatternCategories:c,getBlockPatternCategories:u}=e(d.store),{get:p}=e(j.store),{getBlockTypes:h}=e(y.store),{getBlocksByName:g,getBlockAttributes:_}=e(m.store),f=i("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:h(),canUseUnfilteredHTML:r("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltere
|