| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /*! This file is auto-generated */ 2 var wp;(wp||={}).customizeWidgets=(()=>{var ka=Object.create;var ve=Object.defineProperty;var xa=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var Ia=Object.getPrototypeOf,Ea=Object.prototype.hasOwnProperty;var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),tt=(e,t)=>{for(var r in t)ve(e,r,{get:t[r],enumerable:!0})},jt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ca(t))!Ea.call(e,a)&&a!==r&&ve(e,a,{get:()=>t[a],enumerable:!(o=xa(t,a))||o.enumerable});return e};var s=(e,t,r)=>(r=e!=null?ka(Ia(e)):{},jt(t||!e||!e.__esModule?ve(r,"default",{value:e,enumerable:!0}):r,e)),Ba=e=>jt(ve({},"__esModule",{value:!0}),e);var g=h((Ss,Ft)=>{Ft.exports=window.wp.element});var rt=h((_s,Dt)=>{Dt.exports=window.wp.blockLibrary});var K=h((ks,Vt)=>{Vt.exports=window.wp.widgets});var ot=h((xs,Ht)=>{Ht.exports=window.wp.blocks});var y=h((Cs,Ut)=>{Ut.exports=window.wp.data});var ie=h((Is,Gt)=>{Gt.exports=window.wp.preferences});var N=h((Es,$t)=>{$t.exports=window.wp.components});var A=h((Bs,Kt)=>{Kt.exports=window.wp.i18n});var R=h((Ws,qt)=>{qt.exports=window.wp.blockEditor});var q=h((As,Yt)=>{Yt.exports=window.wp.compose});var ne=h((Rs,Zt)=>{Zt.exports=window.wp.hooks});var c=h((zs,Jt)=>{Jt.exports=window.ReactJSXRuntime});var sr=h((Ns,ar)=>{ar.exports=window.wp.coreData});var st=h((Ms,ir)=>{ir.exports=window.wp.mediaUtils});var Y=h((js,hr)=>{hr.exports=window.wp.keycodes});var U=h((Fs,gr)=>{gr.exports=window.wp.primitives});var le=h((li,Ir)=>{Ir.exports=window.wp.keyboardShortcuts});var Z=h((di,Er)=>{Er.exports=window.React});var Yr=h((Pi,qr)=>{qr.exports=window.wp.privateApis});var wo=h((dn,go)=>{"use strict";go.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,a,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(a=o;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;for(a of t.entries())if(!e(a[1],r.get(a[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(a=o;a--!==0;)if(t[a]!==r[a])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(a=o;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;a--!==0;){var n=i[a];if(!e(t[n],r[n]))return!1}return!0}return t!==t&&r!==r}});var yo=h((fn,bo)=>{bo.exports=window.wp.isShallowEqual});var da=h((Xn,la)=>{la.exports=window.wp.dom});var ys={};tt(ys,{initialize:()=>bs,store:()=>C});var Ze=s(g(),1),Je=s(rt(),1),se=s(K(),1),Xe=s(ot(),1),Pt=s(y(),1),_a=s(ie(),1);var F=s(g(),1),Ke=s(N(),1);var Xt=s(g(),1),at=s(A(),1),Qt=s(N(),1),er=s(R(),1),tr=s(q(),1),rr=s(ne(),1),Se=s(c(),1);function Wa({text:e,children:t}){let r=(0,tr.useCopyToClipboard)(e);return(0,Se.jsx)(Qt.Button,{size:"compact",variant:"secondary",ref:r,children:t})}var or=class extends Xt.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),(0,rr.doAction)("editor.ErrorBoundary.errorLogged",e)}render(){let{error:e}=this.state;return e?(0,Se.jsx)(er.Warning,{className:"customize-widgets-error-boundary",actions:[(0,Se.jsx)(Wa,{text:e.stack,children:(0,at.__)("Copy Error")},"copy-error")],children:(0,at.__)("The editor has encountered an unexpected error.")}):this.props.children}};var Ho=s(q(),1),Uo=s(sr(),1),Go=s(y(),1),Ue=s(g(),1),T=s(R(),1),$o=s(st(),1),Ko=s(ie(),1),qo=s(rt(),1);var nr=s(g(),1),lr=s(A(),1),dr=s(N(),1),fr=s(y(),1),ur=s(R(),1),mr=s(c(),1);function Aa({inspector:e,closeMenu:t,...r}){let o=(0,fr.useSelect)(i=>i(ur.store).getSelectedBlockClientId(),[]),a=(0,nr.useMemo)(()=>document.getElementById(`block-$o}`),[o]);return(0,mr.jsx)(dr.MenuItem,{onClick:()=>{e.open({returnFocusWhenClose:a}),t()},...r,children:(0,lr.__)("Show more settings")})}var cr=Aa;function pr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=pr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Ra(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=pr(e))&&(o&&(o+=" "),o+=t);return o}var _e=Ra;var Pe=s(N(),1),co=s(R(),1),Q=s(g(),1),X=s(Y(),1),O=s(A(),1);var ke=s(U(),1),it=s(c(),1),nt=(0,it.jsx)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,it.jsx)(ke.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});var xe=s(U(),1),lt=s(c(),1),dt=(0,lt.jsx)(xe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,lt.jsx)(xe.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Ce=s(U(),1),ft=s(c(),1),ut=(0,ft.jsx)(Ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ft.jsx)(Ce.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var Ie=s(U(),1),mt=s(c(),1),ct=(0,mt.jsx)(Ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,mt.jsx)(Ie.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var Ee=s(U(),1),pt=s(c(),1),Be=(0,pt.jsx)(Ee.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,pt.jsx)(Ee.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})});var We=s(U(),1),ht=s(c(),1),Ae=(0,ht.jsx)(We.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ht.jsx)(We.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});var bt=s(A(),1),vr=s(R(),1),Sr=s(N(),1),_r=s(q(),1),kr=s(y(),1);var Re=s(y(),1);var wr=s(y(),1);function za(e=!1,t){return t.type==="SET_IS_INSERTER_OPENED"?t.value:e}var br=(0,wr.combineReducers)({blockInserterPanel:za});var gt={};tt(gt,{__experimentalGetInsertionPoint:()=>Na,isInserterOpened:()=>La});var Ta={rootClientId:void 0,insertionIndex:void 0};function La(e){return!!e.blockInserterPanel}function Na(e){return typeof e.blockInserterPanel=="boolean"?Ta:e.blockInserterPanel}var wt={};tt(wt,{setIsInserterOpened:()=>Ma});function Ma(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}var yr="core/customize-widgets";var Pa={reducer:br,selectors:gt,actions:wt},C=(0,Re.createReduxStore)(yr,Pa);(0,Re.register)(C);var D=s(c(),1);function xr({setIsOpened:e}){let t=(0,_r.useInstanceId)(xr,"customize-widget-layout__inserter-panel-title"),r=(0,kr.useSelect)(o=>o(C).__experimentalGetInsertionPoint(),[]);return(0,D.jsxs)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":t,children:[(0,D.jsxs)("div",{className:"customize-widgets-layout__inserter-panel-header",children:[(0,D.jsx)("h2",{id:t,className:"customize-widgets-layout__inserter-panel-header-title",children:(0,bt.__)("Add a block")}),(0,D.jsx)(Sr.Button,{size:"small",icon:nt,onClick:()=>e(!1),"aria-label":(0,bt.__)("Close inserter")})]}),(0,D.jsx)("div",{className:"customize-widgets-layout__inserter-panel-content",children:(0,D.jsx)(vr.__experimentalLibrary,{rootClientId:r.rootClientId,__experimentalInsertionIndex:r.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>e(!1)})})]})}var Cr=xr;var P=s(N(),1),lo=s(g(),1),w=s(A(),1);var fo=s(Y(),1),uo=s(le(),1),Me=s(ie(),1);var Wr=s(Z(),1),Br={};function yt(e,t){let r=Wr.useRef(Br);return r.current===Br&&(r.current=e(t)),r}function Oa(e,t){return function(o,...a){let i=new URL(e);return i.searchParams.set("code",o.toString()),a.forEach(n=>i.searchParams.append("args[]",n)),`$t} error #$o}; visit $i} for the full message.`}}var ja=Oa("https://base-ui.com/production-error","Base UI"),Ar=ja;var G=s(Z(),1);function vt(e,t,r,o){let a=yt(zr).current;return Fa(a,e,t,r,o)&&Tr(a,[e,t,r,o]),a.callback}function Rr(e){let t=yt(zr).current;return Da(t,e)&&Tr(t,e),t.callback}function zr(){return{callback:null,cleanup:null,refs:[]}}function Fa(e,t,r,o,a){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==o||e.refs[3]!==a}function Da(e,t){return e.refs.length!==t.length||e.refs.some((r,o)=>r!==t[o])}function Tr(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){let o=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){let i=t[a];if(i!=null)switch(typeof i){case"function":{let n=i(r);typeof n=="function"&&(o[a]=n);break}case"object":{i.current=r;break}default:}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){let i=t[a];if(i!=null)switch(typeof i){case"function":{let n=o[a];typeof n=="function"?n():i(null);break}case"object":{i.current=null;break}default:}}}}}}var Mr=s(Z(),1);var Lr=s(Z(),1),Va=parseInt(Lr.version,10);function Nr(e){return Va>=e}function St(e){if(!Mr.isValidElement(e))return null;let t=e,r=t.props;return(Nr(19)?r?.ref:t.ref)??null}function de(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var bi=Object.freeze([]),J=Object.freeze({});function Pr(e,t){let r={};for(let o in e){let a=e[o];if(t?.hasOwnProperty(o)){let i=t[o](a);i!=null&&Object.assign(r,i);continue}a===!0?r[`data-$o.toLowerCase()}`]="":a&&(r[`data-$o.toLowerCase()}`]=a.toString())}return r}function Or(e,t){return typeof e=="function"?e(t):e}function jr(e,t){return typeof e=="function"?e(t):e}var _t={};function ue(e,t,r,o,a){if(!r&&!o&&!a&&!e)return ze(t);let i=ze(e);return t&&(i=fe(i,t)),r&&(i=fe(i,r)),o&&(i=fe(i,o)),a&&(i=fe(i,a)),i}function Fr(e){if(e.length===0)return _t;if(e.length===1)return ze(e[0]);let t=ze(e[0]);for(let r=1;r<e.length;r+=1)t=fe(t,e[r]);return t}function ze(e){return kt(e)?{...Vr(e,_t)}:Ha(e)}function fe(e,t){return kt(t)?Vr(t,e):Ua(e,t)}function Ha(e){let t={...e};for(let r in t){let o=t[r];Dr(r,o)&&(t[r]=Hr(o))}return t}function Ua(e,t){if(!t)return e;for(let r in t){let o=t[r];switch(r){case"style":{e[r]=de(e.style,o);break}case"className":{e[r]=xt(e.className,o);break}default:Dr(r,o)?e[r]=Ga(e[r],o):e[r]=o}}return e}function Dr(e,t){let r=e.charCodeAt(0),o=e.charCodeAt(1),a=e.charCodeAt(2);return r===111&&o===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function kt(e){return typeof e=="function"}function Vr(e,t){return kt(e)?e(t):e??_t}function Ga(e,t){return t?e?(...r)=>{let o=r[0];if(Gr(o)){let i=o;Ur(i);let n=t(...r);return i.baseUIHandlerPrevented||e?.(...r),n}let a=t(...r);return e?.(...r),a}:Hr(t):e}function Hr(e){return e&&((...t)=>{let r=t[0];return Gr(r)&&Ur(r),e(...t)})}function Ur(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function xt(e,t){return t?e?t+" "+e:t:e}function Gr(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var Ct=s(Z(),1);function $r(e,t,r={}){let o=t.render,a=$a(t,r);if(r.enabled===!1)return null;let i=r.state??J;return Ya(e,o,a,i)}function $a(e,t={}){let{className:r,style:o,render:a}=e,{state:i=J,ref:n,props:d,stateAttributesMapping:u,enabled:l=!0}=t,f=l?Or(r,i):void 0,p=l?jr(o,i):void 0,m=l?Pr(i,u):J,S=l&&d?Ka(d):void 0,x=l?de(m,S)??{}:J;return typeof document<"u"&&(l?Array.isArray(n)?x.ref=Rr([x.ref,St(a),...n]):x.ref=vt(x.ref,St(a),n):vt(null,null)),l?(f!==void 0&&(x.className=xt(x.className,f)),p!==void 0&&(x.style=de(x.style,p)),x):J}function Ka(e){return Array.isArray(e)?Fr(e):ue(void 0,e)}var qa=Symbol.for("react.lazy");function Ya(e,t,r,o){if(t){if(typeof t=="function")return t(r,o);let a=ue(r,t.props);a.ref=r.ref;let i=t;return i?.$$typeof===qa&&(i=G.Children.toArray(t)[0]),G.cloneElement(i,a)}if(e&&typeof e=="string")return Za(e,r);throw new Error(Ar(8))}function Za(e,t){return e==="button"?(0,Ct.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,Ct.createElement)("img",{alt:"",...t,key:t.key}):G.createElement(e,t)}function Kr(e){return $r(e.defaultTagName??"div",e,e)}var Zr=s(g(),1),It="data-wp-hash";function Et(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&Xa(document)),e.__wpStyleRuntime}function Ja(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[$It}]`))if(r.getAttribute(It)===t)return!0;return!1}function Jr(e,t,r){if(!e.head)return;let o=Et(),a=o.injectedStyles.get(e);if(a||(a=new Set,o.injectedStyles.set(e,a)),a.has(t))return;if(Ja(e,t)){a.add(t);return}let i=e.createElement("style");i.setAttribute(It,t),i.appendChild(e.createTextNode(r)),e.head.appendChild(i),a.add(t)}function Xa(e){let t=Et();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)Jr(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function Qa(e,t){let r=Et();r.styles.set(e,t);for(let o of r.documents.keys())Jr(o,e,t)}typeof process>"u",Qa("fa606a57ae","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");var es={"visually-hidden":"f37b9e2e191ebd66__visually-hidden"},Bt=(0,Zr.forwardRef)(function({render:t,...r},o){return Kr({render:t,ref:o,props:ue({className:es["visually-hidden"]},r,{"data-visually-hidden":""})})});var so=s(N(),1),M=s(A(),1),me=s(le(),1),Ne=s(y(),1),io=s(g(),1);var I=s(A(),1),Xr=[{keyCombination:{modifier:"primary",character:"b"},description:(0,I.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,I.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,I.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,I.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,I.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,I.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,I.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,I.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,I.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,I.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,I.__)("Add non breaking space.")}];var eo=s(g(),1),Te=s(Y(),1),E=s(c(),1);function Qr({keyCombination:e,forceAriaLabel:t}){let r=e.modifier?Te.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?Te.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,E.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(r)?r:[r]).map((a,i)=>a==="+"?(0,E.jsx)(eo.Fragment,{children:a},i):(0,E.jsx)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key",children:a},i))})}function ts({description:e,keyCombination:t,aliases:r=[],ariaLabel:o}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,E.jsxs)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,E.jsx)(Qr,{keyCombination:t,forceAriaLabel:o}),r.map((a,i)=>(0,E.jsx)(Qr,{keyCombination:a,forceAriaLabel:o},i))]})]})}var Le=ts;var to=s(y(),1),ro=s(le(),1);var oo=s(c(),1);function rs({name:e}){let{keyCombination:t,description:r,aliases:o}=(0,to.useSelect)(a=>{let{getShortcutKeyCombination:i,getShortcutDescription:n,getShortcutAliases:d}=a(ro.store);return{keyCombination:i(e),aliases:d(e),description:n(e)}},[e]);return t?(0,oo.jsx)(Le,{keyCombination:t,description:r,aliases:o}):null}var ao=rs;var k=s(c(),1),os=({shortcuts:e})=>(0,k.jsx)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map((t,r)=>(0,k.jsx)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",children:typeof t=="string"?(0,k.jsx)(ao,{name:t}):(0,k.jsx)(Le,{...t})},r))}),At=({title:e,shortcuts:t,className:r})=>(0,k.jsxs)("section",{className:_e("customize-widgets-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,k.jsx)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,k.jsx)(os,{shortcuts:t})]}),Wt=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{let o=(0,Ne.useSelect)(a=>a(me.store).getCategoryShortcuts(t),[t]);return(0,k.jsx)(At,{title:e,shortcuts:o.concat(r)})};function no({isModalActive:e,toggleModal:t}){let{registerShortcut:r}=(0,Ne.useDispatch)(me.store);return(0,io.useEffect)(()=>{r({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:(0,M.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}})},[r]),(0,me.useShortcut)("core/customize-widgets/keyboard-shortcuts",t),e?(0,k.jsxs)(so.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:(0,M.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,k.jsx)(At,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),(0,k.jsx)(Wt,{title:(0,M.__)("Global shortcuts"),categoryName:"global"}),(0,k.jsx)(Wt,{title:(0,M.__)("Selection shortcuts"),categoryName:"selection"}),(0,k.jsx)(Wt,{title:(0,M.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,M.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,M.__)("Forward-slash")}]}),(0,k.jsx)(At,{title:(0,M.__)("Text formatting"),shortcuts:Xr})]}):null}var b=s(c(),1);function mo(){let[e,t]=(0,lo.useState)(!1),r=()=>t(!e);return(0,uo.useShortcut)("core/customize-widgets/keyboard-shortcuts",r),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.ToolbarDropdownMenu,{icon:ut,label:(0,w.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:()=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.MenuGroup,{label:(0,w._x)("View","noun"),children:(0,b.jsx)(Me.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"fixedToolbar",label:(0,w.__)("Top toolbar"),info:(0,w.__)("Access all block and document tools in a single place"),messageActivated:(0,w.__)("Top toolbar activated"),messageDeactivated:(0,w.__)("Top toolbar deactivated")})}),(0,b.jsxs)(P.MenuGroup,{label:(0,w.__)("Tools"),children:[(0,b.jsx)(P.MenuItem,{onClick:()=>{t(!0)},shortcut:fo.displayShortcut.access("h"),children:(0,w.__)("Keyboard shortcuts")}),(0,b.jsx)(Me.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"welcomeGuide",label:(0,w.__)("Welcome Guide")}),(0,b.jsxs)(P.MenuItem,{role:"menuitem",icon:dt,href:(0,w.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener",children:[(0,w.__)("Help"),(0,b.jsx)(Bt,{render:(0,b.jsx)("span",{}),children:(0,w.__)("(opens in a new tab)")})]})]}),(0,b.jsx)(P.MenuGroup,{label:(0,w.__)("Preferences"),children:(0,b.jsx)(Me.PreferenceToggleMenuItem,{scope:"core/customize-widgets",name:"keepCaretInsideBlock",label:(0,w.__)("Contain text cursor inside block"),info:(0,w.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,w.__)("Contain text cursor inside block activated"),messageDeactivated:(0,w.__)("Contain text cursor inside block deactivated")})})]})}),(0,b.jsx)(no,{isModalActive:e,toggleModal:r})]})}var B=s(c(),1);function as({sidebar:e,inserter:t,isInserterOpened:r,setIsInserterOpened:o,isFixedToolbarActive:a}){let[[i,n],d]=(0,Q.useState)([e.hasUndo(),e.hasRedo()]),u=(0,X.isAppleOS)()?X.displayShortcut.primaryShift("z"):X.displayShortcut.primary("y");return(0,Q.useEffect)(()=>e.subscribeHistory(()=>{d([e.hasUndo(),e.hasRedo()])}),[e]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:_e("customize-widgets-header",{"is-fixed-toolbar-active":a}),children:(0,B.jsxs)(co.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":(0,O.__)("Document tools"),children:[(0,B.jsx)(Pe.ToolbarButton,{icon:(0,O.isRTL)()?Be:Ae,label:(0,O.__)("Undo"),shortcut:X.displayShortcut.primary("z"),disabled:!i,onClick:e.undo,className:"customize-widgets-editor-history-button undo-button"}),(0,B.jsx)(Pe.ToolbarButton,{icon:(0,O.isRTL)()?Ae:Be,label:(0,O.__)("Redo"),shortcut:u,disabled:!n,onClick:e.redo,className:"customize-widgets-editor-history-button redo-button"}),(0,B.jsx)(Pe.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:r,variant:"primary",icon:ct,label:(0,O._x)("Add block","Generic label for block inserter button"),onClick:()=>{o(l=>!l)}}),(0,B.jsx)(mo,{})]})}),(0,Q.createPortal)((0,B.jsx)(Cr,{setIsOpened:o}),t.contentContainer[0])]})}var po=as;var Oe=s(g(),1),ee=s(y(),1);function ho(e){let t=(0,ee.useSelect)(o=>o(C).isInserterOpened(),[]),{setIsInserterOpened:r}=(0,ee.useDispatch)(C);return(0,Oe.useEffect)(()=>{t?e.open():e.close()},[e,t]),[t,(0,Oe.useCallback)(o=>{let a=o;typeof o=="function"&&(a=o((0,ee.select)(C).isInserterOpened())),r(a)},[r])]}var Ao=s(R(),1);var So=s(wo(),1),re=s(g(),1),je=s(yo(),1),te=s(K(),1);var V=s(ot(),1),vo=s(K(),1);function ce(e){let t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){let r=t[1],o=parseInt(t[2],10);return`$r}-$o}`}return e}function pe(e,t=null){let r;if(e.name==="core/legacy-widget"&&(e.attributes.id||e.attributes.instance))if(e.attributes.id)r={id:e.attributes.id};else{let{encoded:d,hash:u,raw:l,...f}=e.attributes.instance;r={idBase:e.attributes.idBase,instance:{...t?.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:d,instance_hash_key:u,raw_instance:l,...f}}}else r={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:(0,V.serialize)(e)}}};let{form:a,rendered:i,...n}=t||{};return{...n,...r}}function Rt({id:e,idBase:t,number:r,instance:o}){let a,{encoded_serialized_instance:i,instance_hash_key:n,raw_instance:d,...u}=o;if(t==="block"){let l=(0,V.parse)(d.content??"",{__unstableSkipAutop:!0});a=l.length?l[0]:(0,V.createBlock)("core/paragraph",{})}else r?a=(0,V.createBlock)("core/legacy-widget",{idBase:t,instance:{encoded:i,hash:n,raw:d,...u}}):a=(0,V.createBlock)("core/legacy-widget",{id:e});return(0,vo.addWidgetIdToBlock)(a,e)}function ss(e){return e.map(t=>Rt(t))}function _o(e){let[t,r]=(0,re.useState)(()=>ss(e.getWidgets()));(0,re.useEffect)(()=>e.subscribe((a,i)=>{r(n=>{let d=new Map(a.map(f=>[f.id,f])),u=new Map(n.map(f=>[(0,te.getWidgetIdFromBlock)(f),f])),l=i.map(f=>{let p=d.get(f.id);return p&&p===f?u.get(f.id):Rt(f)});return(0,je.isShallowEqual)(n,l)?n:l})}),[e]);let o=(0,re.useCallback)(a=>{r(i=>{if((0,je.isShallowEqual)(i,a))return i;let n=new Map(i.map(l=>[(0,te.getWidgetIdFromBlock)(l),l])),d=a.map(l=>{let f=(0,te.getWidgetIdFromBlock)(l);if(f&&n.has(f)){let p=n.get(f),m=e.getWidget(f);return(0,So.default)(l,p)&&m?m:pe(l,m)}return pe(l)});if((0,je.isShallowEqual)(e.getWidgets(),d))return i;let u=e.setWidgets(d);return a.reduce((l,f,p)=>{let m=u[p];return m!==null&&(l===a&&(l=a.slice()),l[p]=(0,te.addWidgetIdToBlock)(f,m)),l},a)})},[e]);return[t,o,o]}var he=s(g(),1),Co=s(y(),1),Io=s(R(),1),Eo=s(K(),1);var W=s(g(),1);var ko=s(c(),1),zt=(0,W.createContext)();zt.displayName="FocusControlContext";function xo({api:e,sidebarControls:t,children:r}){let[o,a]=(0,W.useState)({current:null}),i=(0,W.useCallback)(d=>{for(let u of t)if(u.setting.get().includes(d)){u.sectionInstance.expand({completeCallback(){a({current:d})}});break}},[t]);(0,W.useEffect)(()=>{function d(f){let p=ce(f);i(p)}let u=!1;function l(){e.previewer.preview.bind("focus-control-for-setting",d),u=!0}return e.previewer.bind("ready",l),()=>{e.previewer.unbind("ready",l),u&&e.previewer.preview.unbind("focus-control-for-setting",d)}},[e,i]);let n=(0,W.useMemo)(()=>[o,i],[o,i]);return(0,ko.jsx)(zt.Provider,{value:n,children:r})}var Fe=()=>(0,W.useContext)(zt);function Bo(e){let{selectBlock:t}=(0,Co.useDispatch)(Io.store),[r]=Fe(),o=(0,he.useRef)(e);(0,he.useEffect)(()=>{o.current=e},[e]),(0,he.useEffect)(()=>{if(r.current){let a=o.current.find(i=>(0,Eo.getWidgetIdFromBlock)(i)===r.current);a&&(t(a.clientId),document.querySelector(`[data-block="$a.clientId}"]`)?.focus())}},[r,t])}var Wo=s(Yr(),1),{lock:bn,unlock:ge}=(0,Wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/customize-widgets");var Ro=s(c(),1),{ExperimentalBlockEditorProvider:is}=ge(Ao.privateApis);function zo({sidebar:e,settings:t,children:r}){let[o,a,i]=_o(e);return Bo(o),(0,Ro.jsx)(is,{value:o,onInput:a,onChange:i,settings:t,useSubRegistry:!1,children:r})}var z=s(A(),1),we=s(N(),1),To=s(y(),1),Lo=s(ie(),1),_=s(c(),1);function No({sidebar:e}){let{toggle:t}=(0,To.useDispatch)(Lo.store),r=e.getWidgets().every(o=>o.id.startsWith("block-"));return(0,_.jsxs)("div",{className:"customize-widgets-welcome-guide",children:[(0,_.jsx)("div",{className:"customize-widgets-welcome-guide__image__wrapper",children:(0,_.jsxs)("picture",{children:[(0,_.jsx)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),(0,_.jsx)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""})]})}),(0,_.jsx)("h1",{className:"customize-widgets-welcome-guide__heading",children:(0,z.__)("Welcome to block Widgets")}),(0,_.jsx)("p",{className:"customize-widgets-welcome-guide__text",children:r?(0,z.__)("Your theme provides different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site."):(0,z.__)("You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly.")}),(0,_.jsx)(we.Button,{size:"compact",variant:"primary",onClick:()=>t("core/customize-widgets","welcomeGuide"),children:(0,z.__)("Got it")}),(0,_.jsx)("hr",{className:"customize-widgets-welcome-guide__separator"}),!r&&(0,_.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,z.__)("Want to stick with the old widgets?"),(0,_.jsx)("br",{}),(0,_.jsx)(we.ExternalLink,{href:(0,z.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,z.__)("Get the Classic Widgets plugin.")})]}),(0,_.jsxs)("p",{className:"customize-widgets-welcome-guide__more-info",children:[(0,z.__)("New to the block editor?"),(0,_.jsx)("br",{}),(0,_.jsx)(we.ExternalLink,{href:(0,z.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,z.__)("Here's a detailed guide.")})]})]})}var Mo=s(g(),1),oe=s(le(),1),Po=s(Y(),1),Oo=s(y(),1),De=s(A(),1);function jo({undo:e,redo:t,save:r}){return(0,oe.useShortcut)("core/customize-widgets/undo",o=>{e(),o.preventDefault()}),(0,oe.useShortcut)("core/customize-widgets/redo",o=>{t(),o.preventDefault()}),(0,oe.useShortcut)("core/customize-widgets/save",o=>{o.preventDefault(),r()}),null}function ns(){let{registerShortcut:e,unregisterShortcut:t}=(0,Oo.useDispatch)(oe.store);return(0,Mo.useEffect)(()=>(e({name:"core/customize-widgets/undo",category:"global",description:(0,De.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:(0,De.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,Po.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/customize-widgets/save",category:"global",description:(0,De.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")}),[e]),null}jo.Register=ns;var Tt=jo;var Ve=s(g(),1),He=s(R(),1),Fo=s(y(),1),Do=s(c(),1);function Vo(e){let t=(0,Ve.useRef)(),r=(0,Fo.useSelect)(o=>o(He.store).getBlockCount()===0);return(0,Ve.useEffect)(()=>{if(r&&t.current){let{ownerDocument:o}=t.current;(!o.activeElement||o.activeElement===o.body)&&t.current.focus()}},[r]),(0,Do.jsx)(He.ButtonBlockAppender,{...e,ref:t})}var v=s(c(),1),{ExperimentalBlockCanvas:ls}=ge(T.privateApis),{BlockKeyboardShortcuts:ds}=ge(qo.privateApis);function Yo({blockEditorSettings:e,sidebar:t,inserter:r,inspector:o}){let[a,i]=ho(r),n=(0,Ho.useViewportMatch)("small"),{hasUploadPermissions:d,isFixedToolbarActive:u,keepCaretInsideBlock:l,isWelcomeGuideActive:f}=(0,Go.useSelect)(m=>{let{get:S}=m(Ko.store);return{hasUploadPermissions:m(Uo.store).canUser("create",{kind:"postType",name:"attachment"})??!0,isFixedToolbarActive:!!S("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:!!S("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:!!S("core/customize-widgets","welcomeGuide")}},[]),p=(0,Ue.useMemo)(()=>{let m;return d&&(m=({onError:S,...x})=>{(0,$o.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:L})=>S(L),...x})}),{...e,__experimentalSetIsInserterOpened:i,mediaUpload:m,hasFixedToolbar:u||!n,keepCaretInsideBlock:l,editorTool:"edit",__unstableHasCustomAppender:!0}},[d,e,u,n,l,i]);return f?(0,v.jsx)(No,{sidebar:t}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Tt.Register,{}),(0,v.jsx)(ds,{}),(0,v.jsxs)(zo,{sidebar:t,settings:p,children:[(0,v.jsx)(Tt,{undo:t.undo,redo:t.redo,save:t.save}),(0,v.jsx)(po,{sidebar:t,inserter:r,isInserterOpened:a,setIsInserterOpened:i,isFixedToolbarActive:u||!n}),(u||!n)&&(0,v.jsx)(T.BlockToolbar,{hideDragHandle:!0}),(0,v.jsx)(ls,{shouldIframe:!1,styles:p.defaultEditorStyles,height:"100%",children:(0,v.jsx)(T.BlockList,{renderAppender:Vo})}),(0,Ue.createPortal)((0,v.jsx)("form",{onSubmit:m=>m.preventDefault(),children:(0,v.jsx)(T.BlockInspector,{})}),o.contentContainer[0])]}),(0,v.jsx)(T.__unstableBlockSettingsMenuFirstItem,{children:({onClose:m})=>(0,v.jsx)(cr,{inspector:o,closeMenu:m})})]})}var $=s(g(),1),Zo=s(c(),1),Ge=(0,$.createContext)();Ge.displayName="SidebarControlsContext";function Jo({sidebarControls:e,activeSidebarControl:t,children:r}){let o=(0,$.useMemo)(()=>({sidebarControls:e,activeSidebarControl:t}),[e,t]);return(0,Zo.jsx)(Ge.Provider,{value:o,children:r})}function Xo(){let{sidebarControls:e}=(0,$.useContext)(Ge);return e}function Qo(){let{activeSidebarControl:e}=(0,$.useContext)(Ge);return e}var ea=s(g(),1),$e=s(y(),1),Lt=s(R(),1);function ta(e,t){let{hasSelectedBlock:r,hasMultiSelection:o}=(0,$e.useSelect)(Lt.store),{clearSelectedBlock:a}=(0,$e.useDispatch)(Lt.store);(0,ea.useEffect)(()=>{if(t.current&&e){let i=function(m){(r()||o())&&m&&f.contains(m)&&!l.contains(m)&&!t.current.contains(m)&&!m.closest('[role="dialog"]')&&!u.expanded()&&a()},n=function(m){i(m.target)},d=function(){i(f.activeElement)},u=e.inspector,l=e.container[0],f=l.ownerDocument,p=f.defaultView;return f.addEventListener("mousedown",n),p.addEventListener("blur",d),()=>{f.removeEventListener("mousedown",n),p.removeEventListener("blur",d)}}},[t,e,r,o,a])}var j=s(c(),1);function ra({api:e,sidebarControls:t,blockEditorSettings:r}){let[o,a]=(0,F.useState)(null),i=document.getElementById("customize-theme-controls"),n=(0,F.useRef)();ta(o,n),(0,F.useEffect)(()=>{let l=t.map(f=>f.subscribe(p=>{p&&a(f)}));return()=>{l.forEach(f=>f())}},[t]);let d=o&&(0,F.createPortal)((0,j.jsx)(or,{children:(0,j.jsx)(Yo,{blockEditorSettings:r,sidebar:o.sidebarAdapter,inserter:o.inserter,inspector:o.inspector},o.id)}),o.container[0]),u=i&&(0,F.createPortal)((0,j.jsx)("div",{className:"customize-widgets-popover",ref:n,children:(0,j.jsx)(Ke.Popover.Slot,{})}),i);return(0,j.jsx)(Ke.SlotFillProvider,{children:(0,j.jsx)(Jo,{sidebarControls:t,activeSidebarControl:o,children:(0,j.jsxs)(xo,{api:e,sidebarControls:t,children:[d,u]})})})}var qe=s(A(),1);function oa(){let{wp:{customize:e}}=window;return class extends e.Section{constructor(r,o){super(r,o),this.parentSection=o.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(r){this._isOpen=r,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(r,o){super.onChangeExpanded(r,o),this.parentSection&&!o.unchanged&&(r?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open({returnFocusWhenClose:r}={}){this.isOpen=!0,this.returnFocusWhenClose=r,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(r){this.isOpen=!1,super.collapse(r)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}var fs=e=>`widgets-inspector-$e}`;function aa(){let{wp:{customize:e}}=window,t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=t.matches;return t.addEventListener("change",o=>{r=o.matches}),class extends e.Section{ready(){let a=oa();this.inspector=new a(fs(this.id),{title:(0,qe.__)("Block Settings"),parentSection:this,customizeAction:[(0,qe.__)("Customizing"),(0,qe.__)("Widgets"),this.params.title].join(" \u25B8 ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(a,i){let n=this.controls(),d={...i,completeCallback(){n.forEach(u=>{u.onChangeSectionExpanded?.(a,d)}),i.completeCallback?.()}};if(d.manualTransition){a?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open")):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"));let u=()=>{this.contentContainer.removeClass("busy"),d.completeCallback()};r?u():this.contentContainer.one("transitionend",u)}else super.onChangeExpanded(a,d)}}}var ca=s(y(),1);var{wp:sa}=window;function ia(e){let t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function Nt(e){let{idBase:t,number:r}=ia(e);return r?`widget_$t}[$r}]`:`widget_$t}`}function us(e,t,r){let o=!1,a;function i(...n){let d=(o?t:e).apply(this,n);return o=!0,clearTimeout(a),a=setTimeout(()=>{o=!1},r),d}return i.cancel=()=>{o=!1,clearTimeout(a)},i}var na=class{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map(r=>this.getWidget(r))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=us(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(...e){for(let t of this.subscribers)t(...e)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map(e=>this.getWidget(e))],this.historyIndex+=1,this.historySubscribers.forEach(e=>e())}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map(e=>this.getWidget(e))}_handleSettingChange(){if(this.locked)return;let e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked||!e.id.startsWith("widget_"))return;let t=ce(e.id);if(!this.setting.get().includes(t))return;let r=this.getWidgets();this._pushHistory(),this._emit(r,this.getWidgets())}_createWidget(e){let t=sa.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase}),r=e.number;t.get("is_multi")&&!r&&(t.set("multi_number",t.get("multi_number")+1),r=t.get("multi_number"));let o=r?`widget_$e.idBase}[$r}]`:`widget_$e.idBase}`,a={transport:sa.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};return this.api.create(o,o,"",a).set(e.instance),ce(o)}_removeWidget(e){let t=Nt(e.id),r=this.api(t);if(r){let o=r.get();this.widgetsCache.delete(o)}this.api.remove(t)}_updateWidget(e){let t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){let r=Nt(e.id);return this.api(r).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;let{idBase:t,number:r}=ia(e),o=Nt(e),a=this.api(o);if(!a)return null;let i=a.get();if(this.widgetsCache.has(i))return this.widgetsCache.get(i);let n={id:e,idBase:t,number:r,instance:i};return this.widgetsCache.set(i,n),n}_updateWidgets(e){this.locked=!0;let t=[],r=e.map(a=>{if(a.id&&this.getWidget(a.id))return t.push(null),this._updateWidget(a);let i=this._createWidget(a);return t.push(i),i});return this.getWidgets().filter(a=>!r.includes(a.id)).forEach(a=>this._removeWidget(a)),this.setting.set(r),this.locked=!1,t}setWidgets(e){let t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndex<this.history.length-1}_seek(e){let t=this.getWidgets();this.historyIndex=e;let r=this.history[this.historyIndex];this._updateWidgets(r),this._emit(t,this.getWidgets()),this.historySubscribers.forEach(o=>o()),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}};var fa=s(Y(),1),ua=s(da(),1),Mt=s(y(),1);function ma(){let{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(r,o){return r&&e.section.each(a=>{a.params.type==="outer"&&a.id!==this.id&&a.expanded()&&a.collapse()}),super.onChangeExpanded(r,o)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(...o){super(...o),this.params.type="outer",this.activeElementBeforeExpanded=null,this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",i=>{this.expanded()&&(i.keyCode===fa.ESCAPE||i.code==="Escape")&&!i.defaultPrevented&&(i.preventDefault(),i.stopPropagation(),(0,Mt.dispatch)(C).setIsInserterOpened(!1))},!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind(()=>{this.isFromInternalAction||(0,Mt.dispatch)(C).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1})}open(){if(!this.expanded()){let o=this.contentContainer[0];this.activeElementBeforeExpanded=o.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){let a=ua.focus.tabbable.find(o)[1];a&&a.focus()}})}}close(){if(this.expanded()){let o=this.contentContainer[0],a=o.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){o.contains(a)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}var ms=e=>`widgets-inserter-$e}`;function pa(){let{wp:{customize:e}}=window;return class extends e.Control{constructor(...r){super(...r),this.subscribers=new Set}ready(){let r=ma();this.inserter=new r(ms(this.id),{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new na(this.setting,e)}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}onChangeSectionExpanded(r,o){o.unchanged||(r||(0,ca.dispatch)(C).setIsInserterOpened(!1),this.subscribers.forEach(a=>a(r,o)))}}}var ae=s(R(),1),ha=s(q(),1),be=s(y(),1),ga=s(ne(),1),Ye=s(K(),1);var H=s(c(),1),cs=(0,ha.createHigherOrderComponent)(e=>t=>{let r=(0,Ye.getWidgetIdFromBlock)(t),o=Xo(),a=Qo(),i=o?.length>1,n=t.name,d=t.clientId,u=(0,be.useSelect)(S=>S(ae.store).canInsertBlockType(n,""),[n]),l=(0,be.useSelect)(S=>S(ae.store).getBlock(d),[d]),{removeBlock:f}=(0,be.useDispatch)(ae.store),[,p]=Fe();function m(S){let x=o.find(L=>L.id===S);if(r){let L=a.setting,Qe=x.setting;L(L().filter(et=>et!==r)),Qe([...Qe(),r])}else{let L=x.sidebarAdapter;f(d),r=L.setWidgets([...L.getWidgets(),pe(l)]).reverse().find(et=>!!et)}p(r)}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(e,{...t},"edit"),i&&u&&(0,H.jsx)(ae.BlockControls,{children:(0,H.jsx)(Ye.MoveToWidgetArea,{widgetAreas:o.map(S=>({id:S.id,name:S.params.label,description:S.params.description})),currentWidgetAreaId:a?.id,onSelect:m})})]})},"withMoveToSidebarToolbarItem");(0,ga.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",cs);var wa=s(ne(),1),ba=s(st(),1),ps=()=>ba.MediaUpload;(0,wa.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",ps);var ya=s(q(),1),va=s(ne(),1),Sa=s(c(),1),{wp:hs}=window,gs=(0,ya.createHigherOrderComponent)(e=>t=>{let{idBase:r}=t.attributes,o=hs.customize.Widgets.data.availableWidgets.find(a=>a.id_base===r)?.is_wide??!1;return(0,Sa.jsx)(e,{...t,isWide:o},"edit")},"withWideWidgetDisplay");(0,va.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",gs);var Ot=s(c(),1),{wp:ye}=window,ws=["core/more","core/block","core/freeform","core/template-part"];function bs(e,t){(0,Pt.dispatch)(_a.store).setDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),(0,Pt.dispatch)(Xe.store).reapplyBlockTypeFilters();let r=(0,Je.__experimentalGetCoreBlocks)().filter(i=>!(ws.includes(i.name)||i.name.startsWith("core/post")||i.name.startsWith("core/query")||i.name.startsWith("core/site")||i.name.startsWith("core/navigation")||i.name.startsWith("core/term")));(0,Je.registerCoreBlocks)(r),(0,se.registerLegacyWidgetBlock)(),(0,se.registerLegacyWidgetVariations)(t),(0,se.registerWidgetGroupBlock)(),(0,Xe.setFreeformContentHandlerName)("core/html");let o=pa(t);ye.customize.sectionConstructor.sidebar=aa(),ye.customize.controlConstructor.sidebar_block_editor=o;let a=document.createElement("div");document.body.appendChild(a),ye.customize.bind("ready",()=>{let i=[];ye.customize.control.each(n=>{n instanceof o&&i.push(n)}),(0,Ze.createRoot)(a).render((0,Ot.jsx)(Ze.StrictMode,{children:(0,Ot.jsx)(ra,{api:ye.customize,sidebarControls:i,blockEditorSettings:t})}))})}return Ba(ys);})();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Fri Jul 10 08:20:14 2026 | Cross-referenced by PHPXref |