golden hour
/home/godaofbq/oxyrevive.com/wp-includes/js/dist
⬆️ Go Up
Upload
File/Folder
Size
Actions
a11y.js
5.45 KB
Del
OK
a11y.min.js
2.44 KB
Del
OK
annotations.js
15.13 KB
Del
OK
annotations.min.js
5.62 KB
Del
OK
api-fetch.js
17.46 KB
Del
OK
api-fetch.min.js
6.32 KB
Del
OK
autop.js
9.73 KB
Del
OK
autop.min.js
5.5 KB
Del
OK
base-styles.js
48 B
Del
OK
base-styles.min.js
75 B
Del
OK
blob.js
2.3 KB
Del
OK
blob.min.js
1.16 KB
Del
OK
block-directory.js
55.67 KB
Del
OK
block-directory.min.js
21.96 KB
Del
OK
block-editor.js
2.7 MB
Del
OK
block-editor.min.js
1.01 MB
Del
OK
block-library.js
2.57 MB
Del
OK
block-library.min.js
1.09 MB
Del
OK
block-serialization-default-parser.js
6.54 KB
Del
OK
block-serialization-default-parser.min.js
2.39 KB
Del
OK
block-serialization-spec-parser.js
50.48 KB
Del
OK
block-serialization-spec-parser.min.js
10.38 KB
Del
OK
blocks.js
381.06 KB
Del
OK
blocks.min.js
180.62 KB
Del
OK
commands.js
151.71 KB
Del
OK
commands.min.js
63.14 KB
Del
OK
components.js
3.83 MB
Del
OK
components.min.js
786.28 KB
Del
OK
compose.js
80.75 KB
Del
OK
compose.min.js
28.18 KB
Del
OK
core-commands.js
28.68 KB
Del
OK
core-commands.min.js
11.87 KB
Del
OK
core-data.js
612.03 KB
Del
OK
core-data.min.js
210.46 KB
Del
OK
customize-widgets.js
91.57 KB
Del
OK
customize-widgets.min.js
36.62 KB
Del
OK
data-controls.js
4.13 KB
Del
OK
data-controls.min.js
1.77 KB
Del
OK
data.js
82.78 KB
Del
OK
data.min.js
25.92 KB
Del
OK
date.js
176.34 KB
Del
OK
date.min.js
141.22 KB
Del
OK
deprecated.js
3.04 KB
Del
OK
deprecated.min.js
1.28 KB
Del
OK
development
-
Del
OK
dom-ready.js
1.47 KB
Del
OK
dom-ready.min.js
818 B
Del
OK
dom.js
34.61 KB
Del
OK
dom.min.js
12.65 KB
Del
OK
edit-post.js
117.4 KB
Del
OK
edit-post.min.js
49.11 KB
Del
OK
edit-site.js
1.69 MB
Del
OK
edit-site.min.js
684.45 KB
Del
OK
edit-widgets.js
160.25 KB
Del
OK
edit-widgets.min.js
61.86 KB
Del
OK
editor.js
2.5 MB
Del
OK
editor.min.js
1021.63 KB
Del
OK
element.js
27.93 KB
Del
OK
element.min.js
12.17 KB
Del
OK
escape-html.js
2.29 KB
Del
OK
escape-html.min.js
1.07 KB
Del
OK
format-library.js
73.34 KB
Del
OK
format-library.min.js
28.88 KB
Del
OK
hooks.js
11.96 KB
Del
OK
hooks.min.js
4.93 KB
Del
OK
html-entities.js
1.65 KB
Del
OK
html-entities.min.js
879 B
Del
OK
i18n.js
15.3 KB
Del
OK
i18n.min.js
5.6 KB
Del
OK
is-shallow-equal.js
2.69 KB
Del
OK
is-shallow-equal.min.js
1.1 KB
Del
OK
keyboard-shortcuts.js
9.68 KB
Del
OK
keyboard-shortcuts.min.js
3.44 KB
Del
OK
keycodes.js
8.3 KB
Del
OK
keycodes.min.js
2.91 KB
Del
OK
list-reusable-blocks.js
13.06 KB
Del
OK
list-reusable-blocks.min.js
5.24 KB
Del
OK
media-utils.js
637.15 KB
Del
OK
media-utils.min.js
237.64 KB
Del
OK
notices.js
10.11 KB
Del
OK
notices.min.js
4.38 KB
Del
OK
nux.js
10.32 KB
Del
OK
nux.min.js
3.95 KB
Del
OK
patterns.js
58.25 KB
Del
OK
patterns.min.js
21.63 KB
Del
OK
plugins.js
11.67 KB
Del
OK
plugins.min.js
4.76 KB
Del
OK
preferences-persistence.js
17.22 KB
Del
OK
preferences-persistence.min.js
5.49 KB
Del
OK
preferences.js
21.07 KB
Del
OK
preferences.min.js
7.71 KB
Del
OK
primitives.js
5.08 KB
Del
OK
primitives.min.js
1.98 KB
Del
OK
priority-queue.js
10.02 KB
Del
OK
priority-queue.min.js
3.35 KB
Del
OK
private-apis.js
4.09 KB
Del
OK
private-apis.min.js
2.66 KB
Del
OK
react-i18n.js
3.91 KB
Del
OK
react-i18n.min.js
1.53 KB
Del
OK
redux-routine.js
24.68 KB
Del
OK
redux-routine.min.js
9.65 KB
Del
OK
reusable-blocks.js
20.51 KB
Del
OK
reusable-blocks.min.js
7.22 KB
Del
OK
rich-text.js
97.04 KB
Del
OK
rich-text.min.js
39.89 KB
Del
OK
router.js
36.12 KB
Del
OK
router.min.js
14.13 KB
Del
OK
script-modules
-
Del
OK
server-side-render.js
10.97 KB
Del
OK
server-side-render.min.js
3.94 KB
Del
OK
server-sied-renders.min.js
17.32 KB
Del
OK
shortcode.js
7.96 KB
Del
OK
shortcode.min.js
3.28 KB
Del
OK
style-engine.js
17.62 KB
Del
OK
style-engine.min.js
6.42 KB
Del
OK
theme.js
127.65 KB
Del
OK
theme.min.js
56.12 KB
Del
OK
token-list.js
6.12 KB
Del
OK
token-list.min.js
1.62 KB
Del
OK
undo-manager.js
5.29 KB
Del
OK
undo-manager.min.js
1.7 KB
Del
OK
upload-media.js
55.67 KB
Del
OK
upload-media.min.js
23.05 KB
Del
OK
url.js
23.39 KB
Del
OK
url.min.js
10.13 KB
Del
OK
vendor
-
Del
OK
viewport.js
6.61 KB
Del
OK
viewport.min.js
2.24 KB
Del
OK
warning.js
1.52 KB
Del
OK
warning.min.js
755 B
Del
OK
widgets.js
50.08 KB
Del
OK
widgets.min.js
20.83 KB
Del
OK
wordcount.js
6.93 KB
Del
OK
wordcount.min.js
2.45 KB
Del
OK
Edit: patterns.min.js
/*! This file is auto-generated */ var wp;(wp||={}).patterns=(()=>{var wa=Object.create;var bt=Object.defineProperty;var ka=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var xa=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var k=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports),jt=(t,a)=>{for(var r in a)bt(t,r,{get:a[r],enumerable:!0})},le=(t,a,r,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of Ca(a))!Ta.call(t,o)&&o!==r&&bt(t,o,{get:()=>a[o],enumerable:!(f=ka(a,o))||f.enumerable});return t};var e=(t,a,r)=>(r=t!=null?wa(xa(t)):{},le(a||!t||!t.__esModule?bt(r,"default",{value:t,enumerable:!0}):r,t)),Pa=t=>le(bt({},"__esModule",{value:!0}),t);var R=k((Va,fe)=>{fe.exports=window.wp.data});var _t=k((qa,de)=>{de.exports=window.wp.blocks});var q=k((Ha,ue)=>{ue.exports=window.wp.coreData});var J=k((Ga,ne)=>{ne.exports=window.wp.blockEditor});var be=k((Qa,ye)=>{ye.exports=window.wp.privateApis});var M=k((ar,Se)=>{Se.exports=window.wp.components});var I=k((rr,we)=>{we.exports=window.wp.element});var B=k((or,ke)=>{ke.exports=window.wp.i18n});var C=k((lr,Ce)=>{Ce.exports=window.ReactJSXRuntime});var ft=k((dr,Re)=>{Re.exports=window.wp.notices});var De=k((ur,Be)=>{Be.exports=window.wp.compose});var Tt=k((nr,Ne)=>{Ne.exports=window.wp.htmlEntities});var $e=k((Tr,Qe)=>{Qe.exports=window.wp.primitives});var aa=k((Mr,ea)=>{ea.exports=window.wp.url});var te=k((Yr,ma)=>{ma.exports=window.wp.a11y});var za={};jt(za,{privateApis:()=>va,store:()=>L});var Ct=e(R(),1);var ie=e(R(),1);function Ea(t={},a){return a?.type==="SET_EDITING_PATTERN"?{...t,[a.clientId]:a.isEditing}:t}var me=(0,ie.combineReducers)({isEditingPattern:Ea});var zt={};jt(zt,{convertSyncedPatternToStatic:()=>Da,createPattern:()=>Ra,createPatternFromFile:()=>Ba,setEditingPattern:()=>Na});var kt=e(_t(),1),he=e(q(),1),wt=e(J(),1);var et={theme:"pattern",user:"wp_block"},vt="all-patterns",pe="my-patterns",ce=["core","pattern-directory/core","pattern-directory/featured"],S={full:"fully",unsynced:"unsynced"},St="core/pattern-overrides";var Ra=(t,a,r,f)=>async({registry:o})=>{let d=a===S.unsynced?{wp_pattern_sync_status:a}:void 0,i={title:t,content:r,status:"publish",meta:d,wp_pattern_category:f};return await o.dispatch(he.store).saveEntityRecord("postType","wp_block",i)},Ba=(t,a)=>async({dispatch:r})=>{let f=await t.text(),o;try{o=JSON.parse(f)}catch{throw new Error("Invalid JSON file")}if(o.__file!=="wp_block"||!o.title||!o.content||typeof o.title!="string"||typeof o.content!="string"||o.syncStatus&&typeof o.syncStatus!="string")throw new Error("Invalid pattern JSON file");return await r.createPattern(o.title,o.syncStatus,o.content,a)},Da=t=>({registry:a})=>{let r=a.select(wt.store).getBlock(t),f=r.attributes?.content;function o(i){return i.map(s=>{let l=s.attributes.metadata;if(l&&(l={...l},delete l.id,delete l.bindings,f?.[l.name]))for(let[m,n]of Object.entries(f[l.name]))(0,kt.getBlockType)(s.name)?.attributes[m]&&(s.attributes[m]=n);return(0,kt.cloneBlock)(s,{metadata:l&&Object.keys(l).length>0?l:void 0},o(s.innerBlocks))})}let d=a.select(wt.store).getBlocks(r.clientId);a.dispatch(wt.store).replaceBlocks(r.clientId,o(d))};function Na(t,a){return{type:"SET_EDITING_PATTERN",clientId:t,isEditing:a}}var ge="core/patterns";var Ft={};jt(Ft,{isEditingPattern:()=>Aa});function Aa(t,a){return t.isEditingPattern[a]}var _e=e(be(),1),{lock:ve,unlock:O}=(0,_e.__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/patterns");var Oa={reducer:me},L=(0,Ct.createReduxStore)(ge,{...Oa});(0,Ct.register)(L);O(L).registerPrivateActions(zt);O(L).registerPrivateSelectors(Ft);var lt=e(J(),1),xe=e(M(),1),Vt=e(R(),1),Te=e(I(),1),Pe=e(B(),1);function xt(t){return!!t.attributes.metadata?.name&&!!t.attributes.metadata?.bindings&&Object.values(t.attributes.metadata.bindings).some(a=>a.source==="core/pattern-overrides")}var Yt=e(C(),1),{BlockQuickNavigation:La}=O(lt.privateApis);function Ee(){let{allClientIds:t,supportedBlockTypesRaw:a}=(0,Vt.useSelect)(o=>({allClientIds:o(lt.store).getClientIdsWithDescendants(),supportedBlockTypesRaw:o(lt.store).getSettings()?.__experimentalBlockBindingsSupportedAttributes}),[]),{getBlock:r}=(0,Vt.useSelect)(lt.store),f=(0,Te.useMemo)(()=>{let o=Object.keys(a??{});return t.filter(d=>{let i=r(d);return o.includes(i.name)&&xt(i)})},[t,r,a]);return f?.length?(0,Yt.jsx)(xe.PanelBody,{title:(0,Pe.__)("Overrides"),children:(0,Yt.jsx)(La,{clientIds:f})}):null}var P=e(M(),1),X=e(B(),1),ut=e(I(),1),nt=e(R(),1),ze=e(ft(),1),Fe=e(q(),1);var Ae=e(B(),1),Pt=e(I(),1),Oe=e(M(),1),Le=e(De(),1),Me=e(Tt(),1),Ie=e(C(),1),Ma=t=>(0,Me.decodeEntities)(t),Et="wp_pattern_category";function Ue({categoryTerms:t,onChange:a,categoryMap:r}){let[f,o]=(0,Pt.useState)(""),d=(0,Le.useDebounce)(o,500),i=(0,Pt.useMemo)(()=>Array.from(r.values()).map(l=>Ma(l.label)).filter(l=>f!==""?l.toLowerCase().includes(f.toLowerCase()):!0).sort((l,m)=>l.localeCompare(m)),[f,r]);function s(l){let m=l.reduce((n,p)=>(n.some(h=>h.toLowerCase()===p.toLowerCase())||n.push(p),n),[]);a(m)}return(0,Ie.jsx)(Oe.FormTokenField,{className:"patterns-menu-items__convert-modal-categories",value:t,suggestions:i,onChange:s,onInputChange:d,label:(0,Ae.__)("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0})}var Rt=e(R(),1),qt=e(q(),1),je=e(I(),1);function Bt(){let{saveEntityRecord:t,invalidateResolution:a}=(0,Rt.useDispatch)(qt.store),{corePatternCategories:r,userPatternCategories:f}=(0,Rt.useSelect)(i=>{let{getUserPatternCategories:s,getBlockPatternCategories:l}=i(qt.store);return{corePatternCategories:l(),userPatternCategories:s()}},[]),o=(0,je.useMemo)(()=>{let i=new Map;return f.forEach(s=>{i.set(s.label.toLowerCase(),{label:s.label,name:s.name,id:s.id})}),r.forEach(s=>{!i.has(s.label.toLowerCase())&&s.name!=="query"&&i.set(s.label.toLowerCase(),{label:s.label,name:s.name})}),i},[f,r]);async function d(i){try{let s=o.get(i.toLowerCase());if(s?.id)return s.id;let l=s?{name:s.label,slug:s.name}:{name:i},m=await t("taxonomy",Et,l,{throwOnError:!0});return a("getUserPatternCategories"),m.id}catch(s){if(s.code!=="term_exists")throw s;return s.data.term_id}}return{categoryMap:o,findOrCreateTerm:d}}var D=e(C(),1);function it({className:t="patterns-menu-items__convert-modal",modalTitle:a,...r}){let f=(0,nt.useSelect)(o=>o(Fe.store).getPostType(et.user)?.labels?.add_new_item,[]);return(0,D.jsx)(P.Modal,{title:a||f,onRequestClose:r.onClose,overlayClassName:t,focusOnMount:"firstContentElement",size:"small",children:(0,D.jsx)(Ht,{...r})})}function Ht({confirmLabel:t=(0,X.__)("Add"),defaultCategories:a=[],content:r,onClose:f,onError:o,onSuccess:d,defaultSyncType:i=S.full,defaultTitle:s=""}){let[l,m]=(0,ut.useState)(i),[n,p]=(0,ut.useState)(a),[h,_]=(0,ut.useState)(s),[u,c]=(0,ut.useState)(!1),{createPattern:T}=O((0,nt.useDispatch)(L)),{createErrorNotice:v}=(0,nt.useDispatch)(ze.store),{categoryMap:z,findOrCreateTerm:A}=Bt();async function w(E,tt){if(!(!h||u))try{c(!0);let y=await Promise.all(n.map(W=>A(W))),oe=await T(E,tt,typeof r=="function"?r():r,y);d({pattern:oe,categoryId:vt})}catch(y){v(y.message,{type:"snackbar",id:"pattern-create"}),o?.()}finally{c(!1),p([]),_("")}}return(0,D.jsx)("form",{onSubmit:E=>{E.preventDefault(),w(h,l)},children:(0,D.jsxs)(P.__experimentalVStack,{spacing:"5",children:[(0,D.jsx)(P.TextControl,{label:(0,X.__)("Name"),value:h,onChange:_,placeholder:(0,X.__)("My pattern"),className:"patterns-create-modal__name-input",__next40pxDefaultSize:!0}),(0,D.jsx)(Ue,{categoryTerms:n,onChange:p,categoryMap:z}),(0,D.jsx)(P.ToggleControl,{label:(0,X._x)("Synced","pattern (singular)"),help:(0,X.__)("Sync this pattern across multiple locations."),checked:l===S.full,onChange:()=>{m(l===S.full?S.unsynced:S.full)}}),(0,D.jsxs)(P.__experimentalHStack,{justify:"right",children:[(0,D.jsx)(P.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{f(),_("")},children:(0,X.__)("Cancel")}),(0,D.jsx)(P.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!h||u,isBusy:u,children:t})]})]})})}var Ve=e(q(),1),Dt=e(R(),1),H=e(B(),1),Ye=e(ft(),1);var qe=e(C(),1);function Ia(t,a){return t.type!==et.user?a.core?.filter(r=>t.categories?.includes(r.name)).map(r=>r.label):a.user?.filter(r=>t.wp_pattern_category?.includes(r.id)).map(r=>r.label)}function Gt({pattern:t,onSuccess:a}){let{createSuccessNotice:r}=(0,Dt.useDispatch)(Ye.store),f=(0,Dt.useSelect)(o=>{let{getUserPatternCategories:d,getBlockPatternCategories:i}=o(Ve.store);return{core:i(),user:d()}});return t?{content:t.content,defaultCategories:Ia(t,f),defaultSyncType:t.type!==et.user?S.unsynced:t.wp_pattern_sync_status||S.full,defaultTitle:(0,H.sprintf)((0,H._x)("%s (Copy)","pattern"),typeof t.title=="string"?t.title:t.title.raw),onSuccess:({pattern:o})=>{r((0,H.sprintf)((0,H._x)('"%s" duplicated.',"pattern"),o.title.raw),{type:"snackbar",id:"patterns-create"}),a?.({pattern:o})}}:null}function He({pattern:t,onClose:a,onSuccess:r}){let f=Gt({pattern:t,onSuccess:r});return t?(0,qe.jsx)(it,{modalTitle:(0,H.__)("Duplicate pattern"),confirmLabel:(0,H.__)("Duplicate"),onClose:a,onError:a,...f}):null}var U=e(M(),1),Ge=e(q(),1),Wt=e(R(),1),Jt=e(I(),1),We=e(Tt(),1),at=e(B(),1),Je=e(ft(),1),G=e(C(),1);function Xe({onClose:t,onError:a,onSuccess:r,pattern:f,...o}){let d=(0,We.decodeEntities)(f.title),[i,s]=(0,Jt.useState)(d),[l,m]=(0,Jt.useState)(!1),{editEntityRecord:n,__experimentalSaveSpecifiedEntityEdits:p}=(0,Wt.useDispatch)(Ge.store),{createSuccessNotice:h,createErrorNotice:_}=(0,Wt.useDispatch)(Je.store),u=async T=>{if(T.preventDefault(),!(!i||i===f.title||l))try{await n("postType",f.type,f.id,{title:i}),m(!0),s(""),t?.();let v=await p("postType",f.type,f.id,["title"],{throwOnError:!0});r?.(v),h((0,at.__)("Pattern renamed"),{type:"snackbar",id:"pattern-update"})}catch(v){a?.();let z=v.message&&v.code!=="unknown_error"?v.message:(0,at.__)("An error occurred while renaming the pattern.");_(z,{type:"snackbar",id:"pattern-update"})}finally{m(!1),s("")}},c=()=>{t?.(),s("")};return(0,G.jsx)(U.Modal,{title:(0,at.__)("Rename"),...o,onRequestClose:t,focusOnMount:"firstContentElement",size:"small",children:(0,G.jsx)("form",{onSubmit:u,children:(0,G.jsxs)(U.__experimentalVStack,{spacing:"5",children:[(0,G.jsx)(U.TextControl,{__next40pxDefaultSize:!0,label:(0,at.__)("Name"),value:i,onChange:s,required:!0}),(0,G.jsxs)(U.__experimentalHStack,{justify:"right",children:[(0,G.jsx)(U.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:c,children:(0,at.__)("Cancel")}),(0,G.jsx)(U.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,at.__)("Save")})]})]})})})}var fa=e(J(),1);var F=e(_t(),1),pt=e(J(),1),At=e(I(),1),Ke=e(M(),1);var Nt=e($e(),1),Xt=e(C(),1),Qt=(0,Xt.jsx)(Nt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Xt.jsx)(Nt.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});var Q=e(R(),1),$t=e(q(),1),rt=e(B(),1),Ze=e(ft(),1);var ot=e(C(),1);function ta({clientIds:t,rootClientId:a,closeBlockSettingsMenu:r}){let{createSuccessNotice:f}=(0,Q.useDispatch)(Ze.store),{replaceBlocks:o,updateBlockAttributes:d}=(0,Q.useDispatch)(pt.store),{setEditingPattern:i}=O((0,Q.useDispatch)(L)),[s,l]=(0,At.useState)(!1),{getBlockAttributes:m}=(0,Q.useSelect)(pt.store),n=(0,Q.useSelect)(u=>{let{canUser:c}=u($t.store),{getBlocksByClientId:T,canInsertBlockType:v,getBlockRootClientId:z}=u(pt.store),A=a||(t.length>0?z(t[0]):void 0),w=T(t)??[],E=W=>{let se=(0,F.getBlockType)(W),Sa=se&&"parent"in se;return(0,F.hasBlockSupport)(W,"reusable",!Sa)},tt=w.length===1&&w[0]&&(0,F.isReusableBlock)(w[0])&&!!u($t.store).getEntityRecord("postType","wp_block",w[0].attributes.ref);return!(w.length===1&&w?.[0]?.attributes?.metadata?.patternName)&&!tt&&v("core/block",A)&&w.every(W=>!!W&&W.isValid&&E(W.name))&&!!c("create",{kind:"postType",name:"wp_block"})},[t,a]),{getBlocksByClientId:p}=(0,Q.useSelect)(pt.store),h=(0,At.useCallback)(()=>(0,F.serialize)(p(t)),[p,t]);if(!n)return null;let _=({pattern:u})=>{if(u.wp_pattern_sync_status===S.unsynced){if(t?.length===1){let c=m(t[0]);d(t[0],{metadata:{...c?.metadata?c.metadata:{},patternName:`core/block/${u.id}`,name:u.title.raw}})}}else{let c=(0,F.createBlock)("core/block",{ref:u.id});o(t,c),i(c.clientId,!0)}f(u.wp_pattern_sync_status===S.unsynced?(0,rt.sprintf)((0,rt.__)("Unsynced pattern created: %s"),u.title.raw):(0,rt.sprintf)((0,rt.__)("Synced pattern created: %s"),u.title.raw),{type:"snackbar",id:"convert-to-pattern-success"}),l(!1),r()};return(0,ot.jsxs)(ot.Fragment,{children:[(0,ot.jsx)(Ke.MenuItem,{icon:Qt,onClick:()=>l(!0),"aria-expanded":s,"aria-haspopup":"dialog",children:(0,rt.__)("Create pattern")}),s&&(0,ot.jsx)(it,{content:h,onSuccess:u=>{_(u)},onError:()=>{l(!1)},onClose:()=>{l(!1),r()}})]})}var ct=e(M(),1),st=e(B(),1),ra=e(_t(),1),ht=e(R(),1),oa=e(I(),1),Kt=e(J(),1),Zt=e(aa(),1),sa=e(q(),1);var V=e(C(),1);function Ua({clientId:t,onClose:a}){let[r,f]=(0,oa.useState)(!1),{attributes:o,canDetach:d,isVisible:i,managePatternsUrl:s,isSyncedPattern:l,isUnsyncedPattern:m,canEdit:n}=(0,ht.useSelect)(u=>{let{canRemoveBlock:c,getBlock:T,canEditBlock:v}=u(Kt.store),{canUser:z}=u(sa.store),A=T(t),w=!!A?.attributes?.metadata?.patternName,E=!!A&&(0,ra.isReusableBlock)(A)&&!!z("update",{kind:"postType",name:"wp_block",id:A.attributes.ref});return{attributes:A.attributes,canEdit:v(t),canDetach:w||E&&c(t),isUnsyncedPattern:w,isSyncedPattern:E,isVisible:w||E,managePatternsUrl:z("create",{kind:"postType",name:"wp_template"})?(0,Zt.addQueryArgs)("site-editor.php",{p:"/pattern"}):(0,Zt.addQueryArgs)("edit.php",{post_type:"wp_block"})}},[t]),{updateBlockAttributes:p}=(0,ht.useDispatch)(Kt.store),{convertSyncedPatternToStatic:h}=O((0,ht.useDispatch)(L));if(!i||!n)return null;let _=()=>{if(l&&h(t),m){let{patternName:u,...c}=o?.metadata??{};p(t,{metadata:c})}a?.(),f(!1)};return(0,V.jsxs)(V.Fragment,{children:[d&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ct.MenuItem,{onClick:()=>f(!0),children:(0,st.__)("Detach")}),(0,V.jsx)(ct.__experimentalConfirmDialog,{isOpen:r,onConfirm:_,onCancel:()=>f(!1),confirmButtonText:(0,st.__)("Detach"),size:"medium",title:(0,st.__)("Detach pattern?"),__experimentalHideHeader:!1,children:l?(0,st.__)("The blocks will be separated from the original pattern and will be fully editable. Future changes to the pattern will not apply here."):(0,st.__)("Blocks will no longer be associated with this pattern and will be fully editable.")})]}),(0,V.jsx)(ct.MenuItem,{href:s,children:(0,st.__)("Manage patterns")})]})}var la=Ua;var $=e(C(),1);function ia({rootClientId:t}){return(0,$.jsx)(fa.BlockSettingsMenuControls,{children:({selectedClientIds:a,onClose:r})=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ta,{clientIds:a,rootClientId:t,closeBlockSettingsMenu:r}),a.length===1&&(0,$.jsx)(la,{clientId:a[0],onClose:r})]})})}var N=e(M(),1),da=e(q(),1),ee=e(R(),1),Z=e(I(),1),ua=e(Tt(),1),K=e(B(),1),na=e(ft(),1),ae=e(te(),1);var j=e(C(),1);function pa({category:t,existingCategories:a,onClose:r,onError:f,onSuccess:o,...d}){let i=(0,Z.useId)(),s=(0,Z.useRef)(),[l,m]=(0,Z.useState)((0,ua.decodeEntities)(t.name)),[n,p]=(0,Z.useState)(!1),[h,_]=(0,Z.useState)(!1),u=h?`patterns-rename-pattern-category-modal__validation-message-${i}`:void 0,{saveEntityRecord:c,invalidateResolution:T}=(0,ee.useDispatch)(da.store),{createErrorNotice:v,createSuccessNotice:z}=(0,ee.useDispatch)(na.store),A=tt=>{h&&_(void 0),m(tt)},w=async tt=>{if(tt.preventDefault(),!n){if(!l||l===t.name){let y=(0,K.__)("Please enter a new name for this category.");(0,ae.speak)(y,"assertive"),_(y),s.current?.focus();return}if(a.patternCategories.find(y=>y.id!==t.id&&y.label.toLowerCase()===l.toLowerCase())){let y=(0,K.__)("This category already exists. Please use a different name.");(0,ae.speak)(y,"assertive"),_(y),s.current?.focus();return}try{p(!0);let y=await c("taxonomy",Et,{id:t.id,slug:t.slug,name:l});T("getUserPatternCategories"),o?.(y),r(),z((0,K.__)("Pattern category renamed."),{type:"snackbar",id:"pattern-category-update"})}catch(y){f?.(),v(y.message,{type:"snackbar",id:"pattern-category-update"})}finally{p(!1),m("")}}},E=()=>{r(),m("")};return(0,j.jsx)(N.Modal,{title:(0,K.__)("Rename"),onRequestClose:E,...d,children:(0,j.jsx)("form",{onSubmit:w,children:(0,j.jsxs)(N.__experimentalVStack,{spacing:"5",children:[(0,j.jsxs)(N.__experimentalVStack,{spacing:"2",children:[(0,j.jsx)(N.TextControl,{ref:s,__next40pxDefaultSize:!0,label:(0,K.__)("Name"),value:l,onChange:A,"aria-describedby":u,required:!0}),h&&(0,j.jsx)("span",{className:"patterns-rename-pattern-category-modal__validation-message",id:u,children:h})]}),(0,j.jsxs)(N.__experimentalHStack,{justify:"right",children:[(0,j.jsx)(N.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:E,children:(0,K.__)("Cancel")}),(0,j.jsx)(N.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!l||l===t.name||n,isBusy:n,children:(0,K.__)("Save")})]})]})})})}var yt=e(I(),1),Ot=e(J(),1),Lt=e(M(),1),mt=e(B(),1);var g=e(M(),1),x=e(B(),1),gt=e(I(),1),ca=e(te(),1),b=e(C(),1);function ha({placeholder:t,initialName:a="",onClose:r,onSave:f}){let[o,d]=(0,gt.useState)(a),i=(0,gt.useId)(),s=!!o.trim(),l=()=>{if(o!==a){let m=(0,x.sprintf)((0,x.__)('Block name changed to: "%s".'),o);(0,ca.speak)(m,"assertive")}f(o),r()};return(0,b.jsx)(g.Modal,{title:(0,x.__)("Enable overrides"),onRequestClose:r,focusOnMount:"firstContentElement",aria:{describedby:i},size:"small",children:(0,b.jsx)("form",{onSubmit:m=>{m.preventDefault(),s&&l()},children:(0,b.jsxs)(g.__experimentalVStack,{spacing:"6",children:[(0,b.jsx)(g.__experimentalText,{id:i,children:(0,x.__)("Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.")}),(0,b.jsx)(g.TextControl,{__next40pxDefaultSize:!0,value:o,label:(0,x.__)("Name"),help:(0,x.__)('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),placeholder:t,onChange:d}),(0,b.jsxs)(g.__experimentalHStack,{justify:"right",children:[(0,b.jsx)(g.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:r,children:(0,x.__)("Cancel")}),(0,b.jsx)(g.Button,{__next40pxDefaultSize:!0,"aria-disabled":!s,variant:"primary",type:"submit",children:(0,x.__)("Enable")})]})]})})})}function ga({onClose:t,onSave:a}){let r=(0,gt.useId)();return(0,b.jsx)(g.Modal,{title:(0,x.__)("Disable overrides"),onRequestClose:t,aria:{describedby:r},size:"small",children:(0,b.jsx)("form",{onSubmit:f=>{f.preventDefault(),a(),t()},children:(0,b.jsxs)(g.__experimentalVStack,{spacing:"6",children:[(0,b.jsx)(g.__experimentalText,{id:r,children:(0,x.__)("Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.")}),(0,b.jsxs)(g.__experimentalHStack,{justify:"right",children:[(0,b.jsx)(g.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,x.__)("Cancel")}),(0,b.jsx)(g.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,x.__)("Disable")})]})]})})})}var Y=e(C(),1);function ja({attributes:t,setAttributes:a,name:r}){let f=(0,yt.useId)(),[o,d]=(0,yt.useState)(!1),[i,s]=(0,yt.useState)(!1),l=!!t.metadata?.name,m=t.metadata?.bindings?.__default,n=l&&m?.source===St,p=m?.source&&m.source!==St,{updateBlockBindings:h}=(0,Ot.useBlockBindingsUtils)();function _(T,v){v&&a({metadata:{...t.metadata,name:v}}),h({__default:T?{source:St}:void 0})}if(p)return null;let u=r==="core/image"&&!!t.href?.length,c=!n&&u?(0,mt.__)("Overrides currently don't support image links. Remove the link first before enabling overrides."):(0,mt.__)("Allow changes to this block throughout instances of this pattern.");return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ot.InspectorControls,{group:"advanced",children:(0,Y.jsx)(Lt.BaseControl,{id:f,label:(0,mt.__)("Overrides"),help:c,children:(0,Y.jsx)(Lt.Button,{__next40pxDefaultSize:!0,className:"pattern-overrides-control__allow-overrides-button",variant:"secondary","aria-haspopup":"dialog",onClick:()=>{n?s(!0):d(!0)},disabled:!n&&u,accessibleWhenDisabled:!0,children:n?(0,mt.__)("Disable overrides"):(0,mt.__)("Enable overrides")})})}),o&&(0,Y.jsx)(ha,{initialName:t.metadata?.name,onClose:()=>d(!1),onSave:T=>{_(!0,T)}}),i&&(0,Y.jsx)(ga,{onClose:()=>s(!1),onSave:()=>_(!1)})]})}var ya=ja;var dt=e(J(),1),It=e(M(),1),Ut=e(R(),1),ba=e(B(),1),Mt=e(C(),1),re="content";function _a(t){let a=t.attributes.metadata?.name,r=(0,Ut.useRegistry)(),f=(0,Ut.useSelect)(d=>{if(!a)return;let{getBlockAttributes:i,getBlockParentsByBlockName:s}=d(dt.store),[l]=s(t.clientId,"core/block",!0);if(!l)return;let m=i(l)[re];if(m)return m.hasOwnProperty(a)},[t.clientId,a]);function o(){let{getBlockAttributes:d,getBlockParentsByBlockName:i}=r.select(dt.store),[s]=i(t.clientId,"core/block",!0);if(!s)return;let l=d(s)[re];if(!l.hasOwnProperty(a))return;let{updateBlockAttributes:m,__unstableMarkLastChangeAsPersistent:n}=r.dispatch(dt.store);n();let p={...l};delete p[a],Object.keys(p).length||(p=void 0),m(s,{[re]:p})}return(0,Mt.jsx)(dt.__unstableBlockToolbarLastItem,{children:(0,Mt.jsx)(It.ToolbarGroup,{children:(0,Mt.jsx)(It.ToolbarButton,{onClick:o,disabled:!f,children:(0,ba.__)("Reset")})})})}var va={};ve(va,{OverridesPanel:Ee,CreatePatternModal:it,CreatePatternModalContents:Ht,DuplicatePatternModal:He,isOverridableBlock:xt,useDuplicatePatternProps:Gt,RenamePatternModal:Xe,PatternsMenuItems:ia,RenamePatternCategoryModal:pa,PatternOverridesControls:ya,ResetOverridesControl:_a,useAddPatternCategory:Bt,PATTERN_TYPES:et,PATTERN_DEFAULT_CATEGORY:vt,PATTERN_USER_CATEGORY:pe,EXCLUDED_PATTERN_SOURCES:ce,PATTERN_SYNC_TYPES:S});return Pa(za);})();
Save