403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.15.10.64
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js//form_editor.js
/*! For license information please see form_editor.js.LICENSE.txt */
(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[514],{89504:(e,t,n)=>{e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},17121:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.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 l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,l=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.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",d,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(s=window.getComputedStyle(e,null)).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),d()}var s;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(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}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o<t?"hidden"===n.overflowY&&(c("scroll"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),r!==o){r=o;var l=i("autosize:resized");try{e.dispatchEvent(l)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function s(e){var t=o.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 l(e)})),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],s),e}),t.default=c,e.exports=t.default},void 0===(r=n.apply(t,[e,t]))||(e.exports=r)},93574:(e,t,n)=>{"use strict";var r={};n.r(r),n.d(r,{__experimentalBatch:()=>se,__experimentalReceiveCurrentGlobalStylesId:()=>X,__experimentalReceiveThemeBaseGlobalStyles:()=>Q,__experimentalReceiveThemeGlobalStyleVariations:()=>J,__experimentalSaveSpecifiedEntityEdits:()=>ue,__unstableCreateUndoLevel:()=>le,addEntities:()=>q,deleteEntityRecord:()=>ne,editEntityRecord:()=>re,receiveAutosaves:()=>me,receiveCurrentTheme:()=>Y,receiveCurrentUser:()=>G,receiveEmbedPreview:()=>te,receiveEntityRecords:()=>K,receiveThemeSupports:()=>ee,receiveUploadPermissions:()=>de,receiveUserPermission:()=>pe,receiveUserQuery:()=>$,redo:()=>ie,saveEditedEntityRecord:()=>ce,saveEntityRecord:()=>ae,undo:()=>oe});var o={};n.r(o),n.d(o,{__experimentalGetCurrentGlobalStylesId:()=>ht,__experimentalGetCurrentThemeBaseGlobalStyles:()=>Et,__experimentalGetCurrentThemeGlobalStylesVariations:()=>St,__experimentalGetDirtyEntityRecords:()=>Xe,__experimentalGetEntitiesBeingSaved:()=>Qe,__experimentalGetEntityRecordNoResolver:()=>Ge,__experimentalGetTemplateForLink:()=>Ct,canUser:()=>bt,canUserEditEntityRecord:()=>yt,getAuthors:()=>Ze,getAutosave:()=>kt,getAutosaves:()=>_t,getBlockPatternCategories:()=>Tt,getBlockPatterns:()=>It,getCurrentTheme:()=>mt,getCurrentUser:()=>je,getEditedEntityRecord:()=>nt,getEmbedPreview:()=>gt,getEntitiesByKind:()=>He,getEntitiesConfig:()=>Ve,getEntity:()=>We,getEntityConfig:()=>Ue,getEntityRecord:()=>$e,getEntityRecordEdits:()=>Je,getEntityRecordNonTransientEdits:()=>et,getEntityRecords:()=>Ye,getLastEntityDeleteError:()=>at,getLastEntitySaveError:()=>lt,getRawEntityRecord:()=>qe,getRedoEdit:()=>ut,getReferenceByDistinctEdits:()=>wt,getThemeSupports:()=>ft,getUndoEdit:()=>ct,getUserQueryResults:()=>ze,hasEditsForEntityRecord:()=>tt,hasEntityRecords:()=>Ke,hasFetchedAutosaves:()=>xt,hasRedo:()=>pt,hasUndo:()=>dt,isAutosavingEntityRecord:()=>rt,isDeletingEntityRecord:()=>it,isPreviewEmbedFallback:()=>vt,isRequestingEmbedPreview:()=>Fe,isSavingEntityRecord:()=>ot});var i={};n.r(i),n.d(i,{__experimentalGetCurrentGlobalStylesId:()=>Gt,__experimentalGetCurrentThemeBaseGlobalStyles:()=>qt,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Kt,__experimentalGetTemplateForLink:()=>$t,canUser:()=>Ht,canUserEditEntityRecord:()=>Vt,getAuthors:()=>Lt,getAutosave:()=>Ut,getAutosaves:()=>Wt,getBlockPatternCategories:()=>Xt,getBlockPatterns:()=>Yt,getCurrentTheme:()=>Zt,getCurrentUser:()=>Rt,getEditedEntityRecord:()=>Ot,getEmbedPreview:()=>zt,getEntityRecord:()=>Dt,getEntityRecords:()=>Ft,getRawEntityRecord:()=>Mt,getThemeSupports:()=>jt});var l={};n.r(l),n.d(l,{__experimentalGetUnprocessedBlockTypes:()=>Dr,__experimentalHasContentRoleAttribute:()=>eo,getActiveBlockVariation:()=>jr,getBlockStyles:()=>Fr,getBlockSupport:()=>Kr,getBlockType:()=>Or,getBlockTypes:()=>Mr,getBlockVariations:()=>Zr,getCategories:()=>Hr,getChildBlockNames:()=>qr,getCollections:()=>Vr,getDefaultBlockName:()=>Wr,getDefaultBlockVariation:()=>zr,getFreeformFallbackBlockName:()=>Ur,getGroupingBlockName:()=>Gr,getUnregisteredFallbackBlockName:()=>$r,hasBlockSupport:()=>Yr,hasChildBlocks:()=>Qr,hasChildBlocksWithInserterSupport:()=>Jr,isMatchingSearchTerm:()=>Xr});var a={};n.r(a),n.d(a,{getSupportedStyles:()=>ro});var s={};n.r(s),n.d(s,{__experimentalReapplyBlockTypeFilters:()=>mo,__experimentalRegisterBlockType:()=>po,addBlockCollection:()=>Eo,addBlockStyles:()=>fo,addBlockTypes:()=>uo,addBlockVariations:()=>vo,removeBlockCollection:()=>So,removeBlockStyles:()=>go,removeBlockTypes:()=>ho,removeBlockVariations:()=>bo,setCategories:()=>wo,setDefaultBlockName:()=>yo,setFreeformFallbackBlockName:()=>_o,setGroupingBlockName:()=>xo,setUnregisteredFallbackBlockName:()=>ko,updateCategory:()=>Co});var c={};n.r(c),n.d(c,{__experimentalGetActiveBlockIdByBlockNames:()=>Oc,__experimentalGetAllowedBlocks:()=>fc,__experimentalGetAllowedPatterns:()=>yc,__experimentalGetBlockListSettingsForBlocks:()=>Sc,__experimentalGetDirectInsertBlock:()=>gc,__experimentalGetGlobalBlocksByName:()=>Ka,__experimentalGetLastBlockAttributeChanges:()=>Nc,__experimentalGetParsedPattern:()=>vc,__experimentalGetPatternTransformItems:()=>xc,__experimentalGetPatternsByBlockTypes:()=>kc,__experimentalGetReusableBlockTitle:()=>Ic,__unstableGetBlockWithoutInnerBlocks:()=>Ha,__unstableGetClientIdWithClientIdsTree:()=>Wa,__unstableGetClientIdsTree:()=>Ua,__unstableGetContentLockingParent:()=>zc,__unstableGetEditorMode:()=>Ac,__unstableGetSelectedBlocksWithPartialSelection:()=>Bs,__unstableGetTemporarilyEditingAsBlocks:()=>Hc,__unstableGetVisibleBlocks:()=>jc,__unstableHasActiveBlockOverlayActive:()=>Vc,__unstableIsFullySelected:()=>Ss,__unstableIsLastBlockChangeIgnored:()=>Tc,__unstableIsSelectionCollapsed:()=>Is,__unstableIsSelectionMergeable:()=>Ns,__unstableIsWithinBlockOverlay:()=>Wc,__unstableSelectionHasUnmergeableBlock:()=>Ts,areInnerBlocksControlled:()=>Mc,canEditBlock:()=>ic,canInsertBlockType:()=>Js,canInsertBlocks:()=>ec,canLockBlockType:()=>lc,canMoveBlock:()=>rc,canMoveBlocks:()=>oc,canRemoveBlock:()=>tc,canRemoveBlocks:()=>nc,didAutomaticChange:()=>Rc,getAdjacentBlockClientId:()=>ps,getAllowedBlocks:()=>hc,getBlock:()=>za,getBlockAttributes:()=>ja,getBlockCount:()=>Qa,getBlockHierarchyRootClientId:()=>us,getBlockIndex:()=>As,getBlockInsertionPoint:()=>$s,getBlockListSettings:()=>wc,getBlockMode:()=>Zs,getBlockName:()=>Fa,getBlockNamesByClientId:()=>Xa,getBlockOrder:()=>Ps,getBlockParents:()=>ss,getBlockParentsByBlockName:()=>cs,getBlockRootClientId:()=>as,getBlockSelectionEnd:()=>ns,getBlockSelectionStart:()=>ts,getBlockTransformItems:()=>pc,getBlocks:()=>Va,getBlocksByClientId:()=>Ya,getClientIdsOfDescendants:()=>$a,getClientIdsWithDescendants:()=>Ga,getDraggedBlockClientIds:()=>Hs,getFirstMultiSelectedBlockClientId:()=>ys,getGlobalBlockCount:()=>qa,getInserterItems:()=>dc,getLastMultiSelectedBlockClientId:()=>_s,getLowestCommonAncestorWithSelectedBlock:()=>ds,getMultiSelectedBlockClientIds:()=>vs,getMultiSelectedBlocks:()=>bs,getMultiSelectedBlocksEndClientId:()=>Es,getMultiSelectedBlocksStartClientId:()=>Cs,getNextBlockClientId:()=>hs,getPatternsByBlockTypes:()=>_c,getPreviousBlockClientId:()=>ms,getSelectedBlock:()=>ls,getSelectedBlockClientId:()=>is,getSelectedBlockClientIds:()=>gs,getSelectedBlockCount:()=>rs,getSelectedBlocksInitialCaretPosition:()=>fs,getSelectionEnd:()=>es,getSelectionStart:()=>Ja,getSettings:()=>Cc,getTemplate:()=>Ks,getTemplateLock:()=>Ys,hasBlockMovingClientId:()=>Lc,hasInserterItems:()=>mc,hasMultiSelection:()=>Ms,hasSelectedBlock:()=>os,hasSelectedInnerBlock:()=>Rs,isAncestorBeingDragged:()=>Ws,isAncestorMultiSelected:()=>ws,isBlockBeingDragged:()=>Vs,isBlockHighlighted:()=>Dc,isBlockInsertionPointVisible:()=>Gs,isBlockMultiSelected:()=>xs,isBlockSelected:()=>Ls,isBlockValid:()=>Za,isBlockVisible:()=>Zc,isBlockWithinSelection:()=>Ds,isCaretWithinFormattedText:()=>Us,isDraggingBlocks:()=>zs,isFirstMultiSelectedBlock:()=>ks,isLastBlockChangePersistent:()=>Ec,isMultiSelecting:()=>Os,isNavigationMode:()=>Pc,isSelectionEnabled:()=>Fs,isTyping:()=>js,isValidTemplate:()=>qs,wasBlockJustInserted:()=>Fc});var u={};n.r(u),n.d(u,{__experimentalUpdateSettings:()=>$c,hideBlockInterface:()=>Gc,showBlockInterface:()=>qc});var d={};n.r(d),n.d(d,{getLastInsertedBlocksClientIds:()=>Yc,isBlockInterfaceHidden:()=>Kc});var p={};n.r(p),n.d(p,{__unstableDeleteSelection:()=>Nu,__unstableExpandSelection:()=>Pu,__unstableMarkAutomaticChange:()=>Yu,__unstableMarkLastChangeAsPersistent:()=>qu,__unstableMarkNextChangeAsNotPersistent:()=>Ku,__unstableSaveReusableBlock:()=>Gu,__unstableSetEditorMode:()=>Qu,__unstableSetTemporarilyEditingAsBlocks:()=>ad,__unstableSplitSelection:()=>Bu,clearSelectedBlock:()=>mu,duplicateBlocks:()=>ed,enterFormattedText:()=>zu,exitFormattedText:()=>Hu,flashBlock:()=>od,hideInsertionPoint:()=>Su,insertAfterBlock:()=>nd,insertBeforeBlock:()=>td,insertBlock:()=>wu,insertBlocks:()=>Cu,insertDefaultBlock:()=>Wu,mergeBlocks:()=>Au,moveBlockToPosition:()=>xu,moveBlocksDown:()=>yu,moveBlocksToPosition:()=>ku,moveBlocksUp:()=>_u,multiSelect:()=>pu,receiveBlocks:()=>ou,removeBlock:()=>Ru,removeBlocks:()=>Lu,replaceBlock:()=>vu,replaceBlocks:()=>gu,replaceInnerBlocks:()=>Du,resetBlocks:()=>tu,resetSelection:()=>ru,selectBlock:()=>au,selectNextBlock:()=>cu,selectPreviousBlock:()=>su,selectionChange:()=>Vu,setBlockMovingClientId:()=>Ju,setBlockVisibility:()=>ld,setHasControlledInnerBlocks:()=>id,setNavigationMode:()=>Xu,setTemplateValidity:()=>Iu,showInsertionPoint:()=>Eu,startDraggingBlocks:()=>Zu,startMultiSelect:()=>uu,startTyping:()=>Ou,stopDraggingBlocks:()=>ju,stopMultiSelect:()=>du,stopTyping:()=>Fu,synchronizeTemplate:()=>Tu,toggleBlockHighlight:()=>rd,toggleBlockMode:()=>Mu,toggleSelection:()=>hu,updateBlock:()=>lu,updateBlockAttributes:()=>iu,updateBlockListSettings:()=>Uu,updateSettings:()=>$u,validateBlocksToTemplate:()=>nu});var m={};n.r(m),n.d(m,{ButtonContentView:()=>yp,LabelView:()=>hp,buttonView:()=>gp,labelBlock:()=>fp});var h={};n.r(h),n.d(h,{TooltipContent:()=>BN,TooltipPopoverView:()=>PN,TooltipShortcut:()=>LN,noOutline:()=>AN});var f={};n.r(f),n.d(f,{applyStylesToAllTextInputs:()=>Wj,blocksChangedInBlockEditor:()=>Vj,changeActiveSidebar:()=>Pj,changeFormBlocks:()=>hj,changeFormName:()=>fj,changeFormSettings:()=>Ij,changeFormStyles:()=>yj,changePreviewSettings:()=>Aj,createCustomField:()=>zj,createCustomFieldDone:()=>Cj,createCustomFieldFailed:()=>Sj,createCustomFieldStarted:()=>Ej,customFieldEdited:()=>_j,deleteCustomField:()=>Hj,deleteCustomFieldDone:()=>vj,deleteCustomFieldFailed:()=>bj,deleteCustomFieldStarted:()=>gj,hidePreview:()=>Dj,historyRedo:()=>$j,historyUndo:()=>Uj,removeNotice:()=>Mj,saveCustomField:()=>jj,saveCustomFieldDone:()=>kj,saveCustomFieldFailed:()=>wj,saveCustomFieldStarted:()=>xj,saveForm:()=>Zj,saveFormDone:()=>Tj,saveFormFailed:()=>Bj,saveFormStarted:()=>Nj,showPlacementSettings:()=>Lj,showPreview:()=>Rj,switchDefaultSidebarTab:()=>Oj,toggleForm:()=>pj,toggleFullscreen:()=>mj,toggleInserter:()=>dj,toggleSidebar:()=>uj,toggleSidebarPanel:()=>Fj,tutorialDismissed:()=>Gj});var g={};n.r(g),n.d(g,{selectCategory:()=>e0,selectTemplate:()=>JJ});var v={};n.r(v),n.d(v,{CALL_API:()=>az.t,TRACK_EVENT:()=>t0.L});var b=n(70079),y=n(99581),_=n(77159),k=n(45833),x=n(33943),w=n(65443),C=n.n(w),E=n(8263),S=n(81433),I=n(55701),T=n.n(I),N=n(61888),B=n(27897),P=n(91207);const A=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,L=e=>t=>(n,r)=>t(n,e(r)),R=e=>t=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;const o=r[e];if(void 0===o)return n;const i=t(n[o],r);return i===n[o]?n:{...n,[o]:i}};var D=n(66863),M=n(61387),O=n(7936),F=n(95024),Z=n(15312),j=n(67492);function z(e,t){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t}}let H=null;async function V(e){if(null===H){const e=await(0,_.Z)({path:"/batch/v1",method:"OPTIONS"});H=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,H)){const e=await(0,_.Z)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:null==e?void 0:e.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}class W{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const U="core";function $(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function G(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function q(e){return{type:"ADD_ENTITIES",entities:e}}function K(e,t,n,r){let o,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5?arguments[5]:void 0;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),o=r?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{...z(e,arguments.length>2?arguments[2]:void 0),query:t}}(n,r,l):z(n,l),{...o,kind:e,name:t,invalidateCache:i}}function Y(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function X(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function Q(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function J(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function ee(){return(0,j.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function te(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ne=function(e,t,n,r){let{__unstableFetch:o=_.Z,throwOnError:i=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return async l=>{let{dispatch:a}=l;const s=(await a(_e(e))).find((n=>n.kind===e&&n.name===t));let c,u=!1;if(!s||null!=s&&s.__experimentalNoFetch)return;const d=await a.__unstableAcquireStoreLock(U,["entities","records",e,t,n],{exclusive:!0});try{a({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let l=!1;try{let i=`${s.baseURL}/${n}`;r&&(i=(0,Z.f)(i,r)),u=await o({path:i,method:"DELETE"}),await a(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){l=!0,c=e}if(a({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:c}),l&&i)throw c;return u}finally{a.__unstableReleaseStoreLock(d)}}},re=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return i=>{let{select:l,dispatch:a}=i;const s=l.getEntityConfig(e,t);if(!s)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{transientEdits:c={},mergedEdits:u={}}=s,d=l.getRawEntityRecord(e,t,n),p=l.getEditedEntityRecord(e,t,n),m={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=d[t],o=p[t],i=u[t]?{...o,...r[t]}:r[t];return e[t]=T()(n,i)?void 0:i,e}),{}),transientEdits:c};a({type:"EDIT_ENTITY_RECORD",...m,meta:{undo:!o.undoIgnore&&{...m,edits:Object.keys(r).reduce(((e,t)=>(e[t]=p[t],e)),{})}}})}},oe=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getUndoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isUndo:!0}})},ie=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getRedoEdit();r&&n({type:"EDIT_ENTITY_RECORD",...r,meta:{isRedo:!0}})};function le(){return{type:"CREATE_UNDO_LEVEL"}}const ae=function(e,t,n){let{isAutosave:r=!1,__unstableFetch:o=_.Z,throwOnError:i=!1}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return async l=>{let{select:a,resolveSelect:s,dispatch:c}=l;const u=(await c(_e(e))).find((n=>n.kind===e&&n.name===t));if(!u||null!=u&&u.__experimentalNoFetch)return;const d=u.key||he,p=n[d],m=await c.__unstableAcquireStoreLock(U,["entities","records",e,t,p||(0,F.Z)()],{exclusive:!0});try{for(const[r,o]of Object.entries(n))if("function"==typeof o){const i=o(a.getEditedEntityRecord(e,t,p));c.editEntityRecord(e,t,p,{[r]:i},{undoIgnore:!0}),n[r]=i}let l,d;c({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:p,isAutosave:r});let m=!1;try{const i=`${u.baseURL}${p?"/"+p:""}`,d=a.getRawEntityRecord(e,t,p);if(r){const r=a.getCurrentUser(),u=r?r.id:void 0,p=await s.getAutosave(d.type,d.id,u);let m={...d,...p,...n};if(m=Object.keys(m).reduce(((e,t)=>(["title","excerpt","content"].includes(t)&&(e[t]=m[t]),e)),{status:"auto-draft"===m.status?"draft":m.status}),l=await o({path:`${i}/autosaves`,method:"POST",data:m}),d.id===l.id){let n={...d,...m,...l};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===d.status&&"draft"===n.status?n.status:d.status:d[t],e)),{}),c.receiveEntityRecords(e,t,n,void 0,!0)}else c.receiveAutosaves(d.id,l)}else{let r=n;u.__unstablePrePersist&&(r={...r,...u.__unstablePrePersist(d,r)}),l=await o({path:i,method:p?"PUT":"POST",data:r}),c.receiveEntityRecords(e,t,l,void 0,!0,r)}}catch(e){m=!0,d=e}if(c({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:p,error:d,isAutosave:r}),m&&i)throw d;return l}finally{c.__unstableReleaseStoreLock(m)}}},se=e=>async t=>{let{dispatch:n}=t;const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V,t=0,n=[];const r=new W;return{add(e){const o=++t;r.add(o);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(o)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(o)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((e=>{let{input:t}=e;return t}))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let o=!0;return t.forEach(((e,t)=>{const r=n[t];var i;null!=e&&e.error?(null==r||r.reject(e.error),o=!1):null==r||r.resolve(null!==(i=null==e?void 0:e.output)&&void 0!==i?i:e)})),n=[],o}}}(),o={saveEntityRecord:(e,t,o,i)=>r.add((r=>n.saveEntityRecord(e,t,o,{...i,__unstableFetch:r}))),saveEditedEntityRecord:(e,t,o,i)=>r.add((r=>n.saveEditedEntityRecord(e,t,o,{...i,__unstableFetch:r}))),deleteEntityRecord:(e,t,o,i,l)=>r.add((r=>n.deleteEntityRecord(e,t,o,i,{...l,__unstableFetch:r})))},i=e.map((e=>e(o))),[,...l]=await Promise.all([r.run(),...i]);return l},ce=(e,t,n,r)=>async o=>{let{select:i,dispatch:l}=o;if(!i.hasEditsForEntityRecord(e,t,n))return;const a=(await l(_e(e))).find((n=>n.kind===e&&n.name===t));if(!a)return;const s=a.key||he,c=i.getEntityRecordNonTransientEdits(e,t,n),u={[s]:n,...c};return await l.saveEntityRecord(e,t,u,r)},ue=(e,t,n,r,o)=>async i=>{let{select:l,dispatch:a}=i;if(!l.hasEditsForEntityRecord(e,t,n))return;const s=l.getEntityRecordNonTransientEdits(e,t,n),c={};for(const e in s)r.some((t=>t===e))&&(c[e]=s[e]);return await a.saveEntityRecord(e,t,c,o)};function de(e){return(0,j.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),pe("create/media",e)}function pe(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function me(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}const he="id",fe=["title","excerpt","content"],ge=[{label:(0,O.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")}},{label:(0,O.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",getTitle:e=>{var t;return null!==(t=null==e?void 0:e.title)&&void 0!==t?t:(0,O.__)("Site Title")}},{label:(0,O.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"}},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,O.__)("Media"),rawAttributes:["caption","title","description"]},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,O.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,O.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,O.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,O.__)("Widget types")},{label:(0,O.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,O.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,O.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,O.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,O.__)("Menu Location"),key:"name"},{label:(0,O.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>{var t;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0:e.title)}},{label:(0,O.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},key:"stylesheet"},{label:(0,O.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},key:"plugin"}],ve=[{kind:"postType",loadEntities:async function(){const e=await(0,_.Z)({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((e=>{var t;let[n,r]=e;const o=["wp_template","wp_template_part"].includes(n);return{kind:"postType",baseURL:`/${null!==(t=null==r?void 0:r.rest_namespace)&&void 0!==t?t:"wp/v2"}/${r.rest_base}`,baseURLParams:{context:"edit"},name:n,label:r.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:fe,getTitle:e=>{var t,n;return(null==e||null===(t=e.title)||void 0===t?void 0:t.rendered)||(null==e?void 0:e.title)||(o?(0,D.I)(null!==(n=e.slug)&&void 0!==n?n:""):String(e.id))},__unstablePrePersist:o?void 0:be,__unstable_rest_base:r.rest_base}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,_.Z)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((e=>{var t;let[n,r]=e;return{kind:"taxonomy",baseURL:`/${null!==(t=null==r?void 0:r.rest_namespace)&&void 0!==t?t:"wp/v2"}/${r.rest_base}`,baseURLParams:{context:"edit"},name:n,label:r.name}}))}}],be=(e,t)=>{const n={};return"auto-draft"===(null==e?void 0:e.status)&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||null!=e&&e.title&&"Auto Draft"!==(null==e?void 0:e.title)||(n.title="")),n},ye=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=ge.find((n=>n.kind===e&&n.name===t)),i="root"===e?"":(0,M.Ho)(e),l=(0,M.Ho)(t)+(r?"s":"");return`${n}${i}${r&&"plural"in o&&null!=o&&o.plural?(0,M.Ho)(o.plural):l}`},_e=e=>async t=>{let{select:n,dispatch:r}=t,o=n.getEntitiesConfig(e);if(o&&0!==o.length)return o;const i=ve.find((t=>t.kind===e));return i?(o=await i.loadEntities(),r(q(o)),o):[]},ke=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},xe=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i<n.length;i++){const l=n[i];let a=e[l];switch(l){case"page":t[l]=Number(a);break;case"per_page":t.perPage=Number(a);break;case"context":t.context=a;break;default:var r,o;"_fields"===l&&(t.fields=null!==(r=ke(a))&&void 0!==r?r:[],a=t.fields.join()),"include"===l&&("number"==typeof a&&(a=a.toString()),t.include=(null!==(o=ke(a))&&void 0!==o?o:[]).map(Number),a=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,Z.f)("",{[l]:a}).slice(1)}}return t}));function we(e){const{query:t}=e;return t?xe(t).context:"default"}function Ce(e,t){return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.some((e=>Number.isInteger(e)?e===+n:e===n))})))}const Ee=(0,B.Z)([A((e=>"query"in e)),L((e=>e.query?{...e,...xe(e.query)}:e)),R("context"),R("stableKey")])((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;const{type:n,page:r,perPage:o,key:i=he}=t;return"RECEIVE_ITEMS"!==n?e:function(e,t,n,r){var o;if(1===n&&-1===r)return t;const i=(n-1)*r,l=Math.max(null!==(o=null==e?void 0:e.length)&&void 0!==o?o:0,i+t.length),a=new Array(l);for(let n=0;n<l;n++){const r=n>=i&&n<i+t.length;a[n]=r?t[n-i]:null==e?void 0:e[n]}return a}(e||[],t.items.map((e=>e[i])),r,o)})),Se=(0,S.combineReducers)({items:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=we(t),r=t.key||he;return{...e,[n]:{...e[n],...t.items.reduce(((t,o)=>{var i;const l=o[r];return t[l]=function(e,t){if(!e)return t;let n=!1;const r={};for(const o in t)T()(e[o],t[o])?r[o]=e[o]:(n=!0,r[o]=t[o]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(null==e||null===(i=e[n])||void 0===i?void 0:i[l],o),t}),{})}}}case"REMOVE_ITEMS":return(0,N.mapValues)(e,(e=>Ce(e,t.itemIds)))}return e},itemIsComplete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":{const n=we(t),{query:r,key:o=he}=t,i=r?xe(r):{},l=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{var i;const a=r[o];return t[a]=(null==e||null===(i=e[n])||void 0===i?void 0:i[a])||l,t}),{})}}}case"REMOVE_ITEMS":return(0,N.mapValues)(e,(e=>Ce(e,t.itemIds)))}return e},queries:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ITEMS":return Ee(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return(0,N.mapValues)(e,(e=>(0,N.mapValues)(e,(e=>e.filter((e=>!n[e]))))));default:return e}}});function Ie(e){return(0,B.Z)([A((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),L((t=>({...t,key:e.key||he})))])((0,S.combineReducers)({queriedData:Se,edits:function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"RECEIVE_ITEMS":if("default"!==(null!==(e=null==r||null===(t=r.query)||void 0===t?void 0:t.context)&&void 0!==e?e:"default"))return n;const o={...n};for(const e of r.items){const t=e[r.key],n=o[t];if(!n)continue;const i=Object.keys(n).reduce(((t,o)=>{var i,l;return T()(n[o],null!==(i=null===(l=e[o])||void 0===l?void 0:l.raw)&&void 0!==i?i:e[o])||r.persistedEdits&&T()(n[o],r.persistedEdits[o])||(t[o]=n[o]),t}),{});Object.keys(i).length?o[t]=i:delete o[t]}return o;case"EDIT_ENTITY_RECORD":const i={...n[r.recordId],...r.edits};return Object.keys(i).forEach((e=>{void 0===i[e]&&delete i[e]})),{...n,[r.recordId]:i}}return n},saving:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e}}))}const Te=Object.assign([],{offset:0});let Ne;const Be=(0,S.combineReducers)({terms:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{byId:{},queries:{}},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},taxonomies:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge,t=arguments.length>1?arguments[1]:void 0;return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=(0,N.groupBy)(n,"kind");r=(0,S.combineReducers)(Object.entries(e).reduce(((e,t)=>{let[n,r]=t;const o=(0,S.combineReducers)(r.reduce(((e,t)=>({...e,[t.name]:Ie(t)})),{}));return e[n]=o,e}),{}))}const o=r(e.records,t);return o===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:o,config:n}},undo:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Te,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"EDIT_ENTITY_RECORD":case"CREATE_UNDO_LEVEL":let n="CREATE_UNDO_LEVEL"===t.type;const r=!n&&(t.meta.isUndo||t.meta.isRedo);let o;if(n?t=Ne:r||(Ne=Object.keys(t.edits).some((e=>!t.transientEdits[e]))?t:{...t,edits:{...Ne&&Ne.edits,...t.edits}}),r){if(o=[...e],o.offset=e.offset+(t.meta.isUndo?-1:1),!e.flattenedUndo)return o;n=!0,Ne.meta.undo||(Ne.meta.undo={edits:{}}),t=Ne}if(!t.meta.undo)return e;if(!n&&!Object.keys(t.edits).some((e=>!t.transientEdits[e])))return o=[...e],o.flattenedUndo={...e.flattenedUndo,...t.edits},o.offset=e.offset,o;o=o||e.slice(0,e.offset||void 0),o.offset=o.offset||0,o.pop(),n||o.push({kind:t.meta.undo.kind,name:t.meta.undo.name,recordId:t.meta.undo.recordId,edits:{...e.flattenedUndo,...t.meta.undo.edits}});const i=Object.values(t.meta.undo.edits).filter((e=>"function"!=typeof e)),l=Object.values(t.edits).filter((e=>"function"!=typeof e));return(0,P.default)(i,l)||o.push({kind:t.kind,name:t.name,recordId:t.recordId,edits:n?{...e.flattenedUndo,...t.edits}:t.edits}),o}return e},embedPreviews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e}});var Pe=n(32407),Ae=n(56894),Le=n(24627),Re=n.n(Le);const De=new WeakMap,Me=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=De.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(Re()),De.set(e,n);const r=function(e,t){var n,r;const{stableKey:o,page:i,perPage:l,include:a,fields:s,context:c}=xe(t);let u;if(null!==(n=e.queries)&&void 0!==n&&null!==(r=n[c])&&void 0!==r&&r[o]&&(u=e.queries[c][o]),!u)return null;const d=-1===l?0:(i-1)*l,p=-1===l?u.length:Math.min(d+l,u.length),m=[];for(let t=d;t<p;t++){var h;const n=u[t];if(Array.isArray(a)&&!a.includes(n))continue;if(null===(h=e.items[c])||void 0===h||!h.hasOwnProperty(n))return null;const r=e.items[c][n];let o;if(Array.isArray(s)){o={};for(let e=0;e<s.length;e++){const t=s[e].split(".");let n=r;t.forEach((e=>{n=n[e]})),(0,N.set)(o,t,n)}}else{var f;if(null===(f=e.itemIsComplete[c])||void 0===f||!f[n])return null;o=r}m.push(o)}return m}(e,t);return n.set(t,r),r})),Oe={},Fe=(0,Ae.M)((e=>(t,n)=>e(U).isResolving("getEmbedPreview",[n])));function Ze(e,t){(0,j.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,Z.f)("/wp/v2/users/?who=authors&per_page=100",t);return ze(e,n)}function je(e){return e.currentUser}const ze=(0,Pe.Z)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function He(e,t){return(0,j.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),Ve(e,t)}function Ve(e,t){return e.entities.config.filter((e=>e.kind===t))}function We(e,t,n){return(0,j.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Ue(e,t,n)}function Ue(e,t,n){var r;return null===(r=e.entities.config)||void 0===r?void 0:r.find((e=>e.kind===t&&e.name===n))}const $e=(0,Pe.Z)(((e,t,n,r,o)=>{var i,l,a,s,c;const u=null===(i=e.entities.records)||void 0===i||null===(l=i[t])||void 0===l||null===(a=l[n])||void 0===a?void 0:a.queriedData;if(!u)return;const d=null!==(s=null==o?void 0:o.context)&&void 0!==s?s:"default";if(void 0===o){var p;if(null===(p=u.itemIsComplete[d])||void 0===p||!p[r])return;return u.items[d][r]}const m=null===(c=u.items[d])||void 0===c?void 0:c[r];if(m&&o._fields){var h;const e={},t=null!==(h=ke(o._fields))&&void 0!==h?h:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let o=m;r.forEach((e=>{o=o[e]})),(0,N.set)(e,r,o)}return e}return m}),((e,t,n,r,o)=>{var i,l,a,s,c,u,d,p,m,h,f;const g=null!==(i=null==o?void 0:o.context)&&void 0!==i?i:"default";return[null===(l=e.entities.records)||void 0===l||null===(a=l[t])||void 0===a||null===(s=a[n])||void 0===s||null===(c=s.queriedData)||void 0===c||null===(u=c.items[g])||void 0===u?void 0:u[r],null===(d=e.entities.records)||void 0===d||null===(p=d[t])||void 0===p||null===(m=p[n])||void 0===m||null===(h=m.queriedData)||void 0===h||null===(f=h.itemIsComplete[g])||void 0===f?void 0:f[r]]}));function Ge(e,t,n,r){return $e(e,t,n,r)}const qe=(0,Pe.Z)(((e,t,n,r)=>{const o=$e(e,t,n,r);return o&&Object.keys(o).reduce(((r,i)=>{var l,a;return!function(e,t){return(e.rawAttributes||[]).includes(t)}(Ue(e,t,n),i)?r[i]=o[i]:r[i]=null!==(l=null===(a=o[i])||void 0===a?void 0:a.raw)&&void 0!==l?l:o[i],r}),{})}),((e,t,n,r,o)=>{var i,l,a,s,c,u,d,p,m,h,f;const g=null!==(i=null==o?void 0:o.context)&&void 0!==i?i:"default";return[e.entities.config,null===(l=e.entities.records)||void 0===l||null===(a=l[t])||void 0===a||null===(s=a[n])||void 0===s||null===(c=s.queriedData)||void 0===c||null===(u=c.items[g])||void 0===u?void 0:u[r],null===(d=e.entities.records)||void 0===d||null===(p=d[t])||void 0===p||null===(m=p[n])||void 0===m||null===(h=m.queriedData)||void 0===h||null===(f=h.itemIsComplete[g])||void 0===f?void 0:f[r]]}));function Ke(e,t,n,r){return Array.isArray(Ye(e,t,n,r))}const Ye=(e,t,n,r)=>{var o,i,l;const a=null===(o=e.entities.records)||void 0===o||null===(i=o[t])||void 0===i||null===(l=i[n])||void 0===l?void 0:l.queriedData;return a?Me(a,r):null},Xe=(0,Pe.Z)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].edits).filter((t=>$e(e,r,o,t)&&tt(e,r,o,t)));if(i.length){const t=Ue(e,r,o);i.forEach((i=>{var l;const a=nt(e,r,o,i);n.push({key:a?a[t.key||he]:void 0,title:(null==t||null===(l=t.getTitle)||void 0===l?void 0:l.call(t,a))||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records])),Qe=(0,Pe.Z)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].saving).filter((t=>ot(e,r,o,t)));if(i.length){const t=Ue(e,r,o);i.forEach((i=>{var l;const a=nt(e,r,o,i);n.push({key:a?a[t.key||he]:void 0,title:(null==t||null===(l=t.getTitle)||void 0===l?void 0:l.call(t,a))||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function Je(e,t,n,r){var o,i,l,a;return null===(o=e.entities.records)||void 0===o||null===(i=o[t])||void 0===i||null===(l=i[n])||void 0===l||null===(a=l.edits)||void 0===a?void 0:a[r]}const et=(0,Pe.Z)(((e,t,n,r)=>{const{transientEdits:o}=Ue(e,t,n)||{},i=Je(e,t,n,r)||{};return o?Object.keys(i).reduce(((e,t)=>(o[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>{var o,i,l,a;return[e.entities.config,null===(o=e.entities.records)||void 0===o||null===(i=o[t])||void 0===i||null===(l=i[n])||void 0===l||null===(a=l.edits)||void 0===a?void 0:a[r]]}));function tt(e,t,n,r){return ot(e,t,n,r)||Object.keys(et(e,t,n,r)).length>0}const nt=(0,Pe.Z)(((e,t,n,r)=>({...qe(e,t,n,r),...Je(e,t,n,r)})),((e,t,n,r,o)=>{var i,l,a,s,c,u,d,p,m,h,f,g,v;const b=null!==(i=null==o?void 0:o.context)&&void 0!==i?i:"default";return[e.entities.config,null===(l=e.entities.records)||void 0===l||null===(a=l[t])||void 0===a||null===(s=a[n])||void 0===s||null===(c=s.queriedData.items[b])||void 0===c?void 0:c[r],null===(u=e.entities.records)||void 0===u||null===(d=u[t])||void 0===d||null===(p=d[n])||void 0===p||null===(m=p.queriedData.itemIsComplete[b])||void 0===m?void 0:m[r],null===(h=e.entities.records)||void 0===h||null===(f=h[t])||void 0===f||null===(g=f[n])||void 0===g||null===(v=g.edits)||void 0===v?void 0:v[r]]}));function rt(e,t,n,r){var o,i,l,a,s;const{pending:c,isAutosave:u}=null!==(o=null===(i=e.entities.records)||void 0===i||null===(l=i[t])||void 0===l||null===(a=l[n])||void 0===a||null===(s=a.saving)||void 0===s?void 0:s[r])&&void 0!==o?o:{};return Boolean(c&&u)}function ot(e,t,n,r){var o,i,l,a,s,c;return null!==(o=null===(i=e.entities.records)||void 0===i||null===(l=i[t])||void 0===l||null===(a=l[n])||void 0===a||null===(s=a.saving)||void 0===s||null===(c=s[r])||void 0===c?void 0:c.pending)&&void 0!==o&&o}function it(e,t,n,r){var o,i,l,a,s,c;return null!==(o=null===(i=e.entities.records)||void 0===i||null===(l=i[t])||void 0===l||null===(a=l[n])||void 0===a||null===(s=a.deleting)||void 0===s||null===(c=s[r])||void 0===c?void 0:c.pending)&&void 0!==o&&o}function lt(e,t,n,r){var o,i,l,a,s;return null===(o=e.entities.records)||void 0===o||null===(i=o[t])||void 0===i||null===(l=i[n])||void 0===l||null===(a=l.saving)||void 0===a||null===(s=a[r])||void 0===s?void 0:s.error}function at(e,t,n,r){var o,i,l,a,s;return null===(o=e.entities.records)||void 0===o||null===(i=o[t])||void 0===i||null===(l=i[n])||void 0===l||null===(a=l.deleting)||void 0===a||null===(s=a[r])||void 0===s?void 0:s.error}function st(e){return e.undo.offset}function ct(e){return e.undo[e.undo.length-2+st(e)]}function ut(e){return e.undo[e.undo.length+st(e)]}function dt(e){return Boolean(ct(e))}function pt(e){return Boolean(ut(e))}function mt(e){return $e(e,"root","theme",e.currentTheme)}function ht(e){return e.currentGlobalStylesId}function ft(e){var t,n;return null!==(t=null===(n=mt(e))||void 0===n?void 0:n.theme_supports)&&void 0!==t?t:Oe}function gt(e,t){return e.embedPreviews[t]}function vt(e,t){const n=e.embedPreviews[t],r='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===r}function bt(e,t,n,r){const o=[t,n,r].filter(Boolean).join("/");return e.userPermissions[o]}function yt(e,t,n,r){const o=Ue(e,t,n);return!!o&&bt(e,"update",o.__unstable_rest_base,r)}function _t(e,t,n){return e.autosaves[n]}function kt(e,t,n,r){if(void 0===r)return;const o=e.autosaves[n];return null==o?void 0:o.find((e=>e.author===r))}const xt=(0,Ae.M)((e=>(t,n,r)=>e(U).hasFinishedResolution("getAutosaves",[n,r]))),wt=(0,Pe.Z)((e=>[]),(e=>[e.undo.length,e.undo.offset,e.undo.flattenedUndo]));function Ct(e,t){const n=Ye(e,"postType","wp_template",{"find-template":t});return null!=n&&n.length?nt(e,"postType","wp_template",n[0].id):null}function Et(e){const t=mt(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function St(e){const t=mt(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function It(e){return e.blockPatterns}function Tt(e){return e.blockPatternCategories}var Nt=n(39889);function Bt(e,t){return 0===t?e.toLowerCase():(0,M.By)(e,t)}function Pt(e,t){return void 0===t&&(t={}),(0,M.Ho)(e,(0,Nt.pi)({transform:Bt},t))}const At=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return async t=>{let{resolveSelect:r}=t;await r[e](...n)}},Lt=e=>async t=>{let{dispatch:n}=t;const r=(0,Z.f)("/wp/v2/users/?who=authors&per_page=100",e),o=await(0,_.Z)({path:r});n.receiveUserQuery(r,o)},Rt=()=>async e=>{let{dispatch:t}=e;const n=await(0,_.Z)({path:"/wp/v2/users/me"});t.receiveCurrentUser(n)},Dt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return async o=>{let{select:i,dispatch:l}=o;const a=(await l(_e(e))).find((n=>n.name===t&&n.kind===e));if(!a||null!=a&&a.__experimentalNoFetch)return;const s=await l.__unstableAcquireStoreLock(U,["entities","records",e,t,n],{exclusive:!1});try{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...ke(r._fields)||[],a.key||he])].join()});const o=(0,Z.f)(a.baseURL+(n?"/"+n:""),{...a.baseURLParams,...r});if(void 0!==r&&(r={...r,include:[n]},i.hasEntityRecords(e,t,r)))return;const s=await(0,_.Z)({path:o});l.receiveEntityRecords(e,t,s,r)}finally{l.__unstableReleaseStoreLock(s)}}},Mt=At("getEntityRecord"),Ot=At("getEntityRecord"),Ft=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async r=>{let{dispatch:o}=r;const i=(await o(_e(e))).find((n=>n.name===t&&n.kind===e));if(!i||null!=i&&i.__experimentalNoFetch)return;const l=await o.__unstableAcquireStoreLock(U,["entities","records",e,t],{exclusive:!1});try{var a;n._fields&&(n={...n,_fields:[...new Set([...ke(n._fields)||[],i.key||he])].join()});const r=(0,Z.f)(i.baseURL,{...i.baseURLParams,...n});let l=Object.values(await(0,_.Z)({path:r}));if(n._fields&&(l=l.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.receiveEntityRecords(e,t,l,n),!(null!==(a=n)&&void 0!==a&&a._fields||n.context)){const n=i.key||he,r=l.filter((e=>e[n])).map((r=>[e,t,r[n]]));o({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:r}),o({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:r})}}finally{o.__unstableReleaseStoreLock(l)}}};Ft.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const Zt=()=>async e=>{let{dispatch:t,resolveSelect:n}=e;const r=await n.getEntityRecords("root","theme",{status:"active"});t.receiveCurrentTheme(r[0])},jt=At("getCurrentTheme"),zt=e=>async t=>{let{dispatch:n}=t;try{const t=await(0,_.Z)({path:(0,Z.f)("/oembed/1.0/proxy",{url:e})});n.receiveEmbedPreview(e,t)}catch(t){n.receiveEmbedPreview(e,!1)}},Ht=(e,t,n)=>async r=>{var o;let{dispatch:i,registry:l}=r;const{hasStartedResolution:a}=l.select(U),s=n?`${t}/${n}`:t,c=["create","read","update","delete"];if(!c.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of c)if(r!==e&&a("canUser",[r,t,n]))return;let u;try{u=await(0,_.Z)({path:`/wp/v2/${s}`,method:"OPTIONS",parse:!1})}catch(e){return}const d=null===(o=u.headers)||void 0===o?void 0:o.get("allow"),p=(null==d?void 0:d.allow)||d||"",m={},h={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(h))m[e]=p.includes(t);for(const e of c)i.receiveUserPermission(`${e}/${s}`,m[e])},Vt=(e,t,n)=>async r=>{let{dispatch:o}=r;const i=(await o(_e(e))).find((n=>n.name===t&&n.kind===e));if(!i)return;const l=i.__unstable_rest_base;await o(Ht("update",l,n))},Wt=(e,t)=>async n=>{let{dispatch:r,resolveSelect:o}=n;const{rest_base:i,rest_namespace:l="wp/v2"}=await o.getPostType(e),a=await(0,_.Z)({path:`/${l}/${i}/${t}/autosaves?context=edit`});a&&a.length&&r.receiveAutosaves(t,a)},Ut=(e,t)=>async n=>{let{resolveSelect:r}=n;await r.getAutosaves(e,t)},$t=e=>async t=>{let n,{dispatch:r,resolveSelect:o}=t;try{n=await window.fetch((0,Z.f)(e,{"_wp-find-template":!0})).then((e=>e.json())).then((e=>{let{data:t}=e;return t}))}catch(e){}if(!n)return;const i=await o.getEntityRecord("postType","wp_template",n.id);i&&r.receiveEntityRecords("postType","wp_template",[i],{"find-template":e})};$t.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const Gt=()=>async e=>{var t,n,r,o;let{dispatch:i,resolveSelect:l}=e;const a=await l.getEntityRecords("root","theme",{status:"active"}),s=null==a||null===(t=a[0])||void 0===t||null===(n=t._links)||void 0===n||null===(r=n["wp:user-global-styles"])||void 0===r||null===(o=r[0])||void 0===o?void 0:o.href;if(s){const e=await(0,_.Z)({url:s});i.__experimentalReceiveCurrentGlobalStylesId(e.id)}},qt=()=>async e=>{let{resolveSelect:t,dispatch:n}=e;const r=await t.getCurrentTheme(),o=await(0,_.Z)({path:`/wp/v2/global-styles/themes/${r.stylesheet}`});n.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,o)},Kt=()=>async e=>{let{resolveSelect:t,dispatch:n}=e;const r=await t.getCurrentTheme(),o=await(0,_.Z)({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations`});n.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,o)},Yt=()=>async e=>{let{dispatch:t}=e;const n=await(0,_.Z)({path:"/wp/v2/block-patterns/patterns"});t({type:"RECEIVE_BLOCK_PATTERNS",patterns:null==n?void 0:n.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[Pt(t),n]})))))})},Xt=()=>async e=>{let{dispatch:t}=e;t({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,_.Z)({path:"/wp/v2/block-patterns/categories"})})};function Qt(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function Jt(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function en(e,t){let{exclusive:n}=e;return!(!n||!t.length)||!(n||!t.filter((e=>e.exclusive)).length)}const tn={requests:[],tree:{locks:[],children:{}}};function nn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:o,path:i}=r,l=[o,...i],a=Qt(e.tree,l),s=Jt(a,l);return s.locks=[...s.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],o=Qt(e.tree,r),i=Jt(o,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:o}}}return e}function rn(e,t,n,r){let{exclusive:o}=r;const i=[t,...n],l=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(l,i))if(en({exclusive:o},e.locks))return!1;const a=Jt(l,i);if(!a)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(a))if(en({exclusive:o},e.locks))return!1;return!0}function on(){let e=nn(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:o,notifyAcquired:i}=t;if(rn(e,n,r,{exclusive:o})){const l={store:n,path:r,exclusive:o};e=nn(e,{type:"GRANT_LOCK_REQUEST",lock:l,request:t}),i(l)}}}return{acquire:function(n,r,o){return new Promise((i=>{e=nn(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:o,notifyAcquired:i}}),t()}))},release:function(n){e=nn(e,{type:"RELEASE_LOCK",lock:n}),t()}}}const ln=ge.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[ye(n,r)]=(e,t,o)=>$e(e,n,r,t,o),e[ye(n,r,"get",!0)]=(e,t)=>Ye(e,n,r,t),e}),{}),an=ge.reduce(((e,t)=>{const{kind:n,name:r}=t;e[ye(n,r)]=(e,t)=>Dt(n,r,e,t);const o=ye(n,r,"get",!0);return e[o]=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return Ft(n,r,...t)},e[o].shouldInvalidate=e=>Ft.shouldInvalidate(e,n,r),e}),{}),sn=ge.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[ye(n,r,"save")]=e=>ae(n,r,e),e[ye(n,r,"delete")]=(e,t)=>ne(n,r,e,t),e}),{}),cn=(0,E.Z)(U,{reducer:Be,actions:{...r,...sn,...function(){const e=on();return{__unstableAcquireStoreLock:function(t,n,r){let{exclusive:o}=r;return()=>e.acquire(t,n,o)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...o,...ln},resolvers:{...i,...an}});(0,S.register)(cn);var un=n(10159),dn=n(48405),pn=n(93850),mn=n(59216);const hn=[],fn=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},gn=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},vn=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(null!=e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),bn=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class yn extends b.Component{constructor(e){let{allowedTypes:t,gallery:n=!1,unstableFeaturedImageFlow:r=!1,modalClass:o,multiple:i=!1,title:l=(0,O.__)("Select or Upload Media")}=e;super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this);const{wp:a}=window;if(n)this.buildAndSetGalleryFrame();else{const e={title:l,multiple:i};t&&(e.library={type:t}),this.frame=a.media(e)}o&&this.frame.$el.addClass(o),r&&this.buildAndSetFeatureImageFrame(),this.initializeListeners()}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=hn}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=gn());const l=bn(r),a=new o.media.model.Selection(l.models,{props:l.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:a,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,t=fn(),n=bn(this.props.value),r=new e.media.model.Selection(n.models,{props:n.props.toJSON()});this.frame=new t({mimeType:this.props.allowedTypes,state:"featured-image",multiple:this.props.multiple,selection:r,editing:!!this.props.value}),e.media.frame=this.frame}componentWillUnmount(){this.frame.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>vn(e.toJSON()))):vn(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?null!=t&&t.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=bn(o);i.more().done((function(){var e;n&&null!=i&&null!==(e=i.models)&&void 0!==e&&e.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){this.props.gallery&&this.buildAndSetGalleryFrame(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const _n=yn,kn={};function xn(e){const t=window.URL.createObjectURL(e);return kn[t]=e,t}function wn(e){kn[e]&&window.URL.revokeObjectURL(e),delete kn[e]}function Cn(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const En=()=>{};async function Sn(e){let{allowedTypes:t,additionalData:n={},filesList:r,maxUploadFileSize:o,onError:i=En,onFileChange:l,wpAllowedMimeTypes:a=null}=e;const s=[...r],c=[],u=(e,t)=>{var n;wn(null===(n=c[e])||void 0===n?void 0:n.url),c[e]=t,l(c.filter(Boolean))},d=e=>!t||t.some((t=>t.includes("/")?t===e:e.startsWith(`${t}/`))),p=(m=a)?Object.entries(m).map((e=>{let[t,n]=e;const[r]=n.split("/");return[n,...t.split("|").map((e=>`${r}/${e}`))]})).flat():m;var m;const h=[];for(const e of s)p&&e.type&&(f=e.type,!p.includes(f))?i({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,O.sprintf)((0,O.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||d(e.type)?o&&e.size>o?i({code:"SIZE_ABOVE_LIMIT",message:(0,O.sprintf)((0,O.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?i({code:"EMPTY_FILE",message:(0,O.sprintf)((0,O.__)("%s: This file is empty."),e.name),file:e}):(h.push(e),c.push({url:xn(e)}),l(c)):i({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,O.sprintf)((0,O.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var f;for(let e=0;e<h.length;++e){const t=h[e];try{var g,v;const r=await In(t,n),{alt_text:o,source_url:i,...l}=r;u(e,{...l,alt:r.alt_text,caption:null!==(g=null===(v=r.caption)||void 0===v?void 0:v.raw)&&void 0!==g?g:"",title:r.title.raw,url:r.source_url})}catch(n){let r;u(e,null),r=n.message?n.message:(0,O.sprintf)((0,O.__)("Error while uploading file %s to the media library."),t.name),i({code:"GENERAL",message:r,file:t})}}}function In(e,t){const n=new window.FormData;return n.append("file",e,e.name||e.type.replace("/",".")),t&&Object.entries(t).forEach((e=>{let[t,r]=e;return n.append(t,r)})),(0,_.Z)({path:"/wp/v2/media",body:n,method:"POST"})}var Tn=n(85799),Nn=n(46688),Bn=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Pn=function(e){return.2126*Bn(e.r)+.7152*Bn(e.g)+.0722*Bn(e.b)};function An(e){e.prototype.luminance=function(){return e=Pn(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,l,a,s,c=t instanceof e?t:new e(t);return i=this.rgba,l=c.toRgb(),n=(a=Pn(i))>(s=Pn(l))?(a+.05)/(s+.05):(s+.05)/(a+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(l=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===l?7:"AA"===o&&"large"===l?3:4.5);var n,r,o,i,l}}var Ln=n(84217);const Rn="block-default",Dn=["attributes","supports","save","migrate","isEligible","apiVersion"],Mn={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},filter:{value:["filter","duotone"],support:["color","__experimentalDuotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},On={link:"a",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},Fn={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},Zn={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]},jn={};function zn(e){return null!==e&&"object"==typeof e}function Hn(e){let{textdomain:t,...n}=e;const r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"],o=Object.fromEntries(Object.entries(n).filter((e=>{let[t]=e;return r.includes(t)})));return t&&Object.keys(Zn).forEach((e=>{o[e]&&(o[e]=Wn(Zn[e],o[e],t))})),o}function Vn(e,t){const n=zn(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,S.select)(Bo).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');zn(e)&&function(e){for(const t of Object.keys(e))jn[t]?(void 0===jn[t].apiVersion&&e[t].apiVersion&&(jn[t].apiVersion=e[t].apiVersion),void 0===jn[t].ancestor&&e[t].ancestor&&(jn[t].ancestor=e[t].ancestor)):jn[t]=Object.fromEntries(Object.entries(e[t]).filter((e=>{let[,t]=e;return null!=t})).map((e=>{let[t,n]=e;return[Pt(t),n]})))}({[n]:Hn(e)});const r={name:n,icon:Rn,keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==jn?void 0:jn[n],...t};return(0,S.dispatch)(Bo).__experimentalRegisterBlockType(r),(0,S.select)(Bo).getBlockType(n)}function Wn(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,O._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>Wn(e[0],t,n))):zn(e)&&Object.entries(e).length&&zn(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=Wn(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function Un(){return(0,S.select)(Bo).getFreeformFallbackBlockName()}function $n(){return(0,S.select)(Bo).getUnregisteredFallbackBlockName()}function Gn(){return(0,S.select)(Bo).getDefaultBlockName()}function qn(e){var t;return null===(t=(0,S.select)(Bo))||void 0===t?void 0:t.getBlockType(e)}function Kn(){return(0,S.select)(Bo).getBlockTypes()}function Yn(e,t,n){return(0,S.select)(Bo).getBlockSupport(e,t,n)}function Xn(e,t,n){return(0,S.select)(Bo).hasBlockSupport(e,t,n)}function Qn(e){return"core/block"===(null==e?void 0:e.name)}function Jn(e){return"core/template-part"===(null==e?void 0:e.name)}const er=(e,t)=>(0,S.select)(Bo).getBlockVariations(e,t);var tr=n(62925);function nr(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=_r(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return{clientId:(0,F.Z)(),name:e,isValid:!0,attributes:n,innerBlocks:t}}function rr(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return nr(n,r,rr(o))}))}function or(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,F.Z)(),o=_r(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>or(e)))}}function ir(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,F.Z)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>ir(e)))}}const lr=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!ar(e)&&r&&!e.isMultiBlock)return!1;if(!ar(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!ar(e)||!r&&"from"===t&&sr(i.name)&&sr(e.blockName)||!dr(e,n)||e.usingMobileTransformations&&ar(e)&&!sr(i.name))},ar=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),sr=e=>e===(0,S.select)(Bo).getGroupingBlockName();function cr(e,t){const n=(0,tr.createHooks)();for(let r=0;r<e.length;r++){const o=e[r];t(o)&&n.addFilter("transform","transform/"+r.toString(),(e=>e||o),o.priority)}return n.applyFilters("transform",null)}function ur(e,t){if(void 0===t)return Kn().map((t=>{let{name:n}=t;return ur(e,n)})).flat();const n=br(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),l=i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!ar(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e];return l.map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function dr(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function pr(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,l=ur("from",t),a=cr(ur("to",i),(e=>"block"===e.type&&-1!==e.blocks.indexOf(t)&&(!r||e.isMultiBlock)&&dr(e,n)))||cr(l,(e=>"block"===e.type&&(ar(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&dr(e,n)));if(!a)return null;let s;return s=a.isMultiBlock?"__experimentalConvert"in a?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in a?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===s||"object"!=typeof s?null:(s=Array.isArray(s)?s:[s],s.some((e=>!qn(e.name)))?null:"*"===t?s:s.some((e=>e.name===t))?s.map(((t,n,r)=>(0,tr.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const mr=(e,t)=>{var n;return nr(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>mr(e.name,e))))};(0,Tn.l7)([Nn.Z,An]);const hr=["#191e23","#f8f9f9"];function fr(e){var t;fr[e.name]||(fr[e.name]=nr(e.name));const n=fr[e.name],r=qn(e.name);return Object.keys(null!==(t=null==r?void 0:r.attributes)&&void 0!==t?t:{}).every((t=>n.attributes[t]===e.attributes[t]))}function gr(e){return e.name===Gn()&&fr(e)}function vr(e){return!!e&&("string"==typeof e||(0,b.isValidElement)(e)||"function"==typeof e||e instanceof b.Component)}function br(e){return"string"==typeof e?qn(e):e}function yr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?(0,Ln.Z)(i):o}function _r(e,t){const n=qn(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,n)=>{let[r,o]=n;const i=t[r];return void 0!==i?e[r]=i:o.hasOwnProperty("default")&&(e[r]=o.default),-1!==["node","children"].indexOf(o.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}function kr(e,t){return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.includes(n)})))}const xr=[{slug:"text",title:(0,O.__)("Text")},{slug:"media",title:(0,O.__)("Media")},{slug:"design",title:(0,O.__)("Design")},{slug:"widgets",title:(0,O.__)("Widgets")},{slug:"theme",title:(0,O.__)("Theme")},{slug:"embed",title:(0,O.__)("Embeds")},{slug:"reusable",title:(0,O.__)("Reusable blocks")}];function wr(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function Cr(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function Er(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const Sr=Er("SET_DEFAULT_BLOCK_NAME"),Ir=Er("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Tr=Er("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Nr=Er("SET_GROUPING_BLOCK_NAME"),Br=(0,S.combineReducers)({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return kr(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...wr(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return kr(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,N.mapValues)(wr(t.blockTypes),(t=>Cr([...(0,N.get)(t,["styles"],[]).map((e=>({...e,source:"block"}))),...(0,N.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))])))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:Cr([...(0,N.get)(e,[t.blockName],[]),...t.styles])};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(0,N.get)(e,[t.blockName],[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,N.mapValues)(wr(t.blockTypes),(t=>Cr([...(0,N.get)(t,["variations"],[]).map((e=>({...e,source:"block"}))),...(0,N.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))])))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Cr([...(0,N.get)(e,[t.blockName],[]),...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,N.get)(e,[t.blockName],[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:Sr,freeformFallbackBlockName:Ir,unregisteredFallbackBlockName:Tr,groupingBlockName:Nr,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||(0,N.isEmpty)(t.category))return e;if(e.find((e=>{let{slug:n}=e;return n===t.slug})))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return kr(e,t.namespace)}return e}});var Pr=n(68457),Ar=n.n(Pr),Lr=n(70845);const Rr=(e,t)=>"string"==typeof t?Or(e,t):t;function Dr(e){return e.unprocessedBlockTypes}const Mr=(0,Pe.Z)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function Or(e,t){return e.blockTypes[t]}function Fr(e,t){return e.blockStyles[t]}const Zr=(0,Pe.Z)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function jr(e,t,n,r){const o=Zr(e,t,r);return null==o?void 0:o.find((r=>{var o;if(Array.isArray(r.isActive)){const o=Or(e,t),i=Object.keys((null==o?void 0:o.attributes)||{}),l=r.isActive.filter((e=>i.includes(e)));return 0!==l.length&&l.every((e=>n[e]===r.attributes[e]))}return null===(o=r.isActive)||void 0===o?void 0:o.call(r,n,r.attributes)}))}function zr(e,t,n){const r=Zr(e,t,n),o=[...r].reverse().find((e=>{let{isDefault:t}=e;return!!t}));return o||r[0]}function Hr(e){return e.categories}function Vr(e){return e.collections}function Wr(e){return e.defaultBlockName}function Ur(e){return e.freeformFallbackBlockName}function $r(e){return e.unregisteredFallbackBlockName}function Gr(e){return e.groupingBlockName}const qr=(0,Pe.Z)(((e,t)=>Mr(e).filter((e=>{var n;return null===(n=e.parent)||void 0===n?void 0:n.includes(t)})).map((e=>{let{name:t}=e;return t}))),(e=>[e.blockTypes])),Kr=(e,t,n,r)=>{const o=Rr(e,t);return null!=o&&o.supports?(0,N.get)(o.supports,n,r):r};function Yr(e,t,n,r){return!!Kr(e,t,n,r)}function Xr(e,t,n){var r;const o=Rr(e,t),i=(0,Lr.Z)([e=>Ar()(null!=e?e:""),e=>e.toLowerCase(),e=>e.trim()]),l=i(n),a=(0,Lr.Z)([i,e=>e.includes(l)]);return a(o.title)||(null===(r=o.keywords)||void 0===r?void 0:r.some(a))||a(o.category)||"string"==typeof o.description&&a(o.description)}const Qr=(e,t)=>qr(e,t).length>0,Jr=(e,t)=>qr(e,t).some((t=>Yr(e,t,"inserter",!0))),eo=(0,Pe.Z)(((e,t)=>{const n=Or(e,t);return!!n&&Object.entries(n.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))}),((e,t)=>{var n;return[null===(n=e.blockTypes[t])||void 0===n?void 0:n.attributes]})),to=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function no(e,t,n){return e.filter((e=>!("fontSize"===e&&"heading"===n||"textDecoration"===e&&!t&&"link"!==n||"textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n))))}const ro=(0,Pe.Z)(((e,t,n)=>{var r,o,i,l,a,s,c,u,d;if(!t)return no(to,t,n);const p=Or(e,t);if(!p)return[];const m=[];return null==p||null===(r=p.supports)||void 0===r||null===(o=r.spacing)||void 0===o||!o.blockGap||!0===(null==p||null===(i=p.supports)||void 0===i||null===(l=i.spacing)||void 0===l?void 0:l.__experimentalSkipSerialization)||null!=p&&null!==(a=p.supports)&&void 0!==a&&null!==(s=a.spacing)&&void 0!==s&&null!==(c=s.__experimentalSkipSerialization)&&void 0!==c&&null!==(u=c.some)&&void 0!==u&&u.call(c,(e=>"blockGap"===e))||m.push("blockGap"),null!=p&&null!==(d=p.supports)&&void 0!==d&&d.shadow&&m.push("shadow"),Object.keys(Mn).forEach((e=>{Mn[e].support&&(Mn[e].requiresOptOut&&Mn[e].support[0]in p.supports&&!1!==(0,N.get)(p.supports,Mn[e].support)||(0,N.get)(p.supports,Mn[e].support,!1))&&m.push(e)})),no(m,t,n)}),((e,t)=>[e.blockTypes[t]]));var oo=n(85628);const{error:io,warn:lo}=window.console,ao={common:"text",formatting:"text",layout:"design"};function so(e){return"function"==typeof e}const co=(e,t)=>{let{select:n}=t;const{name:r}=e,o=(0,tr.applyFilters)("blocks.registerBlockType",{...e},r,null);if(o.description&&"string"!=typeof o.description&&(0,j.default)("Declaring non-string block descriptions",{since:"6.2"}),o.deprecated&&(o.deprecated=o.deprecated.map((t=>Object.fromEntries(Object.entries((0,tr.applyFilters)("blocks.registerBlockType",{...kr(e,Dn),...t},r,t)).filter((e=>{let[t]=e;return Dn.includes(t)})))))),(0,oo.P)(o))if(so(o.save))if(!("edit"in o)||so(o.edit))if(ao.hasOwnProperty(o.category)&&(o.category=ao[o.category]),"category"in o&&!n.getCategories().some((e=>{let{slug:t}=e;return t===o.category}))&&(lo('The block "'+r+'" is registered with an invalid category "'+o.category+'".'),delete o.category),"title"in o&&""!==o.title)if("string"==typeof o.title){if(o.icon=function(e){if(vr(e=e||Rn))return{src:e};if("background"in e){const t=(0,Tn.Vi)(e.background),n=e=>t.contrast(e),r=Math.max(...hr.map(n));return{...e,foreground:e.foreground?e.foreground:hr.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(o.icon),vr(o.icon.src))return o;io("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else io("Block titles must be strings.");else io('The block "'+r+'" must have a title.');else io('The "edit" property must be a valid function.');else io('The "save" property must be a valid function.');else io("Block settings must be a valid object.")};function uo(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}const po=e=>t=>{let{dispatch:n,select:r}=t;n({type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e});const o=co(e,{select:r});o&&n.addBlockTypes(o)},mo=()=>e=>{let{dispatch:t,select:n}=e;const r=n.__experimentalGetUnprocessedBlockTypes(),o=Object.keys(r).reduce(((e,t)=>{const o=co(r[t],{select:n});return o&&e.push(o),e}),[]);o.length&&t.addBlockTypes(o)};function ho(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function fo(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockName:e}}function go(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function vo(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function bo(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function yo(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function _o(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function ko(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function xo(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function wo(e){return{type:"SET_CATEGORIES",categories:e}}function Co(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Eo(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function So(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}var Io=n(86066);const{lock:To,unlock:No}=(0,Io.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/blocks"),Bo=(0,E.Z)("core/blocks",{reducer:Br,selectors:l,actions:s});let Po,Ao,Lo,Ro;(0,S.register)(Bo),No(Bo).registerPrivateSelectors(a);const Do=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function Mo(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function Oo(e){return Mo(null,{},[],e,[e])}const Fo=e=>{Po=e,Ao=0,Lo=[],Ro=[],Do.lastIndex=0;do{}while(Zo());return Lo};function Zo(){const e=Ro.length,t=function(){const e=Do.exec(Po);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,l,,a]=e,s=n.length,c=!!r,u=!!a,d=(o||"core/")+i,p=!!l?function(e){try{return JSON.parse(e)}catch(e){return null}}(l):{};return u?["void-block",d,p,t,s]:c?["block-closer",d,null,t,s]:["block-opener",d,p,t,s]}(),[n,r,o,i,l]=t,a=i>Ao?Ao:null;switch(n){case"no-more-tokens":if(0===e)return jo(),!1;if(1===e)return Ho(),!1;for(;0<Ro.length;)Ho();return!1;case"void-block":return 0===e?(null!==a&&Lo.push(Oo(Po.substr(a,i-a))),Lo.push(Mo(r,o,[],"",[])),Ao=i+l,!0):(zo(Mo(r,o,[],"",[]),i,l),Ao=i+l,!0);case"block-opener":return Ro.push(function(e,t,n,r,o){return{block:e,tokenStart:t,tokenLength:n,prevOffset:r||t+n,leadingHtmlStart:o}}(Mo(r,o,[],"",[]),i,l,i+l,a)),Ao=i+l,!0;case"block-closer":if(0===e)return jo(),!1;if(1===e)return Ho(i),Ao=i+l,!0;const t=Ro.pop(),n=Po.substr(t.prevOffset,i-t.prevOffset);return t.block.innerHTML+=n,t.block.innerContent.push(n),t.prevOffset=i+l,zo(t.block,t.tokenStart,t.tokenLength,i+l),Ao=i+l,!0;default:return jo(),!1}}function jo(e){const t=e||Po.length-Ao;0!==t&&Lo.push(Oo(Po.substr(Ao,t)))}function zo(e,t,n,r){const o=Ro[Ro.length-1];o.block.innerBlocks.push(e);const i=Po.substr(o.prevOffset,t-o.prevOffset);i&&(o.block.innerHTML+=i,o.block.innerContent.push(i)),o.block.innerContent.push(null),o.prevOffset=r||t+n}function Ho(e){const{block:t,leadingHtmlStart:n,prevOffset:r,tokenStart:o}=Ro.pop(),i=e?Po.substr(r,e-r):Po.substr(r);i&&(t.innerHTML+=i,t.innerContent.push(i)),null!==n&&Lo.push(Oo(Po.substr(n,o-n))),Lo.push(t)}const Vo=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Wo=n(12850),Uo=n(98377);function $o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:l=[]}=e;let a=0;const s=l.map((e=>null!==e?e:$o(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?Jo(r,o,s):s}function Go(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,tr.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function qo(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,tr.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Ko={},Yo={};function Xo(e,t,n){const r=br(e);return(0,Uo.ZP)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=br(e);let{save:o}=r;if(o.prototype instanceof b.Component){const e=new o({attributes:t});o=e.render.bind(e)}Ko.blockType=r,Ko.attributes=t,Yo.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,tr.hasFilter)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,tr.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,P.default)(e,i.props)||(i=(0,b.cloneElement)(i,e))}return(0,tr.applyFilters)("blocks.getSaveElement",i,r,t)}(r,t,n))}function Qo(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Xo(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Jo(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=null!=e&&e.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function ei(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isValid&&e.__unstableBlockSource)return $o(e.__unstableBlockSource);const n=e.name,r=Qo(e);if(n===$n()||!t&&n===Un())return r;const o=qn(n);if(!o)return r;const i=function(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,n)=>{let[r,o]=n;const i=t[r];return void 0===i||void 0!==o.source||"default"in o&&o.default===i||(e[r]=i),e}),{})}(o,e.attributes);return Jo(n,i,r)}(e,t))).join("\n\n")}var ti=/[\t\n\f ]/,ni=/[A-Za-z]/,ri=/\r\n?/g;function oi(e){return ti.test(e)}function ii(e){return ni.test(e)}var li=function(){function e(e,t,n){void 0===n&&(n="precompile"),this.delegate=e,this.entityParser=t,this.mode=n,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||ii(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){oi(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();oi(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();oi(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!oi(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();oi(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();oi(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();oi(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();oi(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();oi(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();oi(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();oi(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();oi(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();oi(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();oi(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();oi(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();oi(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||ii(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(ri,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),n=this.entityParser.parse(t);if(n){for(var r=t.length;r;)this.consume(),r--;return this.consume(),n}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),ai=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new li(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}(),si=n(64942);function ci(){function e(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return e("Block validation: "+t,...r)}}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const ui=/[\t\n\r\v\f ]+/g,di=/^[\t\n\r\v\f ]*$/,pi=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,mi=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],hi=[...mi,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],fi=[e=>e,function(e){return _i(e).join(" ")}],gi=/^[\da-z]+$/i,vi=/^#\d+$/,bi=/^#x[\da-f]+$/i;class yi{parse(e){if(t=e,gi.test(t)||vi.test(t)||bi.test(t))return(0,si.decodeEntities)("&"+e+";");var t}}function _i(e){return e.trim().split(ui)}function ki(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||hi.includes(t)}))}function xi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ci(),r=e.chars,o=t.chars;for(let e=0;e<fi.length;e++){const t=fi[e];if(r=t(r),o=t(o),r===o)return!0}return n.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function wi(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function Ci(e){return _i(e).map(wi).join(" ").replace(pi,"url($1)")}function Ei(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),Ci(r.trim())]}));return Object.fromEntries(t)}const Si={class:(e,t)=>{const[n,r]=[e,t].map(_i),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>T()(...[e,t].map(Ei)),...Object.fromEntries(mi.map((e=>[e,()=>!0])))},Ii={StartTag:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ci();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ci();if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;e<t.length;e++)r[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[o,i]=e[t],l=o.toLowerCase();if(!r.hasOwnProperty(l))return n.warning("Encountered unexpected attribute `%s`.",o),!1;const a=r[l],s=Si[l];if(s){if(!s(i,a))return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}else if(i!==a)return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}return!0}(...[e,t].map(ki),n)},Chars:xi,Comment:xi};function Ti(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!di.test(t.chars))return t}}function Ni(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function Bi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name;if(e.name===Un()||e.name===$n())return[!0,[]];const n=function(){const e=[],t=ci();return{error(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.push({log:t.error,args:r})},warning(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.push({log:t.warning,args:r})},getItems:()=>e}}(),r=br(t);let o;try{o=Xo(r,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ci();if(e===t)return!0;const[r,o]=[e,t].map((e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ci();try{return new ai(new yi).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,n)));if(!r||!o)return!1;let i,l;for(;i=Ti(r);){if(l=Ti(o),!l)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==l.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",l.type,l,i.type,i),!1;const e=Ii[i.type];if(e&&!e(i,l,n))return!1;Ni(i,o[0])?Ti(o):Ni(l,r[0])&&Ti(r)}return!(l=Ti(o))||(n.warning("Expected %o, instead saw end of content.",l),!1)}(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,o,e.originalContent),[i,n.getItems()]}function Pi(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}return"core/post-comments"===e&&(e="core/comments",n.legacy=!0),[e,n]}var Ai,Li=function(){return Ai||(Ai=document.implementation.createHTMLDocument("")),Ai};function Ri(e,t){if(t){if("string"==typeof e){var n=Li();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){return n[r]=Ri(e,t[r]),n}),{})}}function Di(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=n;if(e&&(r=n.querySelector(e)),r)return function(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}(r,t)}}var Mi=n(35721),Oi=n.n(Mi);function Fi(e){const t={};for(let n=0;n<e.length;n++){const{name:r,value:o}=e[n];t[r]=o}return t}function Zi(e){if((0,j.default)("wp.blocks.node.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...Fi(e.attributes),children:ji(e.childNodes)}}}function ji(e){(0,j.default)("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n<e.length;n++)try{t.push(Zi(e[n]))}catch(e){}return t}function zi(e){return(0,j.default)("wp.blocks.children.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let n=t;return e&&(n=t.querySelector(e)),n?ji(n.childNodes):[]}}const Hi={concat:function(){(0,j.default)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const e=[];for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(let t=0;t<n.length;t++){const r=Array.isArray(n[t])?n[t]:[n[t]];for(let t=0;t<r.length;t++){const n=r[t];"string"==typeof n&&"string"==typeof e[e.length-1]?e[e.length-1]+=n:e.push(n)}}return e},getChildrenArray:function(e){return(0,j.default)("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e},fromDOM:ji,toHTML:function(e){(0,j.default)("wp.blocks.children.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=e;return(0,Uo.ZP)(t)},matcher:zi};function Vi(e,t,n,r,o){let i;switch(t.source){case void 0:i=r?r[e]:void 0;break;case"raw":i=o;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":i=$i(n,t)}return function(e,t){return void 0===t||function(e,t){return t.some((t=>function(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=t.default),i}const Wi=Oi()((e=>{switch(e.source){case"attribute":let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=Di(e,"attributes")(n);if(r&&r.hasOwnProperty(t))return r[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>(0,Lr.Z)([e,e=>void 0!==e]))(t)),t;case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;o<n;o++){const n=r.children[o];n.nodeName.toLowerCase()===t&&(e+=n.outerHTML)}return e}return r.innerHTML}}(e.selector,e.multiline);case"text":return function(e){return Di(e,"textContent")}(e.selector);case"children":return zi(e.selector);case"node":return function(e){return(0,j.default)("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let n=t;e&&(n=t.querySelector(e));try{return Zi(n)}catch(e){return null}}}(e.selector);case"query":const n=(0,N.mapValues)(e.query,Wi);return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return Ri(e,t)}))}}(e.selector,n);case"tag":return(0,Lr.Z)([Di(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}}));function Ui(e){return Ri(e,(e=>e))}function $i(e,t){return Wi(t)(Ui(e))}function Gi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ui(t),o=br(e),i=(0,N.mapValues)(o.attributes,((e,o)=>Vi(o,e,r,n,t)));return(0,tr.applyFilters)("blocks.getBlockAttributes",i,o,t,n)}const qi={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Ki(e){const t=$i(`<div data-custom-class-name>${e}</div>`,qi);return t?t.trim().split(/\s+/):[]}function Yi(e,t){const n=function(e,t,n){if(Xn(t,"customClassName",!0)){const{className:r,...o}=e,i=Xo(t,o),l=Ki(i),a=Ki(n).filter((e=>!l.includes(e)));a.length?e.className=a.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Xi(){return!1}function Qi(e,t){const n=Un(),r=e.blockName||Un(),o=e.attrs||{},i=e.innerBlocks||[];let l=e.innerHTML.trim();return r!==n||null!=t&&t.__unstableSkipAutop||(l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const t=e.split("</pre>"),r=t.pop();e="";for(let r=0;r<t.length;r++){const o=t[r],i=o.indexOf("<pre");if(-1===i){e+=o;continue}const l="<pre wp-pre-tag-"+r+"></pre>";n.push([l,o.substr(i)+"</pre>"]),e+=o.substr(0,i)+l}e+=r}const r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=function(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(Vo);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e<n.length;e+=2)for(let i=0;i<o.length;i++){const l=o[i];if(-1!==n[e].indexOf(l)){n[e]=n[e].replace(new RegExp(l,"g"),t[l]),r=!0;break}}return r&&(e=n.join("")),e}(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+r+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));const o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.forEach((t=>{e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+r+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+r+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+r+"[^>]*>)\\s*</p>","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,"<WPPreserveNewline />"))),e=(e=e.replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,((e,t)=>t?e:"<br />\n")),e=e.replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(new RegExp("(</?"+r+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach((t=>{const[n,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}(l).trim()),{...e,blockName:r,attrs:o,innerHTML:l,innerBlocks:i}}function Ji(e,t){let n=Qi(e,t);n=function(e){const[t,n]=Pi(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=qn(n.blockName);r||(n=function(e){const t=$n()||Un(),n=$o(e,{isCommentDelimited:!1}),r=$o(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=qn(n.blockName));const o=n.blockName===Un()||n.blockName===$n();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Ji(e,t))).filter((e=>!!e)),l=nr(n.blockName,Gi(r,n.innerHTML,n.attrs),i);l.originalContent=n.innerHTML;const a=function(e,t){const[n]=Bi(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Yi(e,t),[o,i]=Bi(e,t);return{...r,isValid:o,validationIssues:i}}(l,r),{validationIssues:s}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let t=0;t<o.length;t++){const{isEligible:i=Xi}=o[t];if(e.isValid&&!i(r,e.innerBlocks))continue;const l=Object.assign(kr(n,Dn),o[t]);let a={...e,attributes:Gi(l,e.originalContent,r)},[s]=Bi(a,l);if(s||(a=Yi(a,l),[s]=Bi(a,l)),!s)continue;let c=a.innerBlocks,u=a.attributes;const{migrate:d}=l;if(d){let t=d(u,e.innerBlocks);Array.isArray(t)||(t=[t]),[u=r,c=e.innerBlocks]=t}e={...e,attributes:u,innerBlocks:c,isValid:!0,validationIssues:[]}}return e}(a,n,r);return c.isValid||(c.__unstableBlockSource=e),a.isValid||!c.isValid||null!=t&&t.__unstableSkipMigrationLogs?a.isValid||c.isValid||s.forEach((e=>{let{log:t,args:n}=e;return t(...n)})):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,Xo(r,c.attributes),c.originalContent),console.groupEnd()),c}function el(e,t){return Fo(e).reduce(((e,n)=>{const r=Ji(n,t);return r&&e.push(r),e}),[])}function tl(){return ur("from").filter((e=>{let{type:t}=e;return"raw"===t})).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function nl(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=cr(tl(),(t=>{let{isMatch:n}=t;return n(e)}));if(!n)return nr("core/html",Gi("core/html",e.outerHTML));const{transform:r,blockName:o}=n;return r?r(e,t):nr(o,Gi(o,e.outerHTML))}))}var rl=n(95657),ol=n(76119);function il(e){const t=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),r=t.body,o=n.body;for(r.innerHTML=e;r.firstChild;){const e=r.firstChild;e.nodeType===e.TEXT_NODE?(0,rl.Z)(e)?r.removeChild(e):(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(o.appendChild(n.createElement("P")),r.removeChild(e.nextSibling)),o.lastChild&&"P"===o.lastChild.nodeName&&o.lastChild.hasChildNodes()?o.lastChild.appendChild(e):r.removeChild(e)):"P"===e.nodeName?(0,rl.Z)(e)?r.removeChild(e):o.appendChild(e):(0,ol.V2)(e)?(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):o.appendChild(e):r.removeChild(e)}return o.innerHTML}var ll=n(78747),al=n(56205);function sl(e,t){e.nodeType===e.COMMENT_NODE&&("nextpage"!==e.nodeValue?0===e.nodeValue.indexOf("more")&&function(e,t){const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,(0,al.Z)(r);break}const i=function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t);if(e.parentNode&&"P"===e.parentNode.nodeName&&1!==e.parentNode.childNodes.length){const n=Array.from(e.parentNode.childNodes),r=n.indexOf(e),o=e.parentNode.parentNode||t.body,l=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[n.slice(0,r).reduce(l,null),i,n.slice(r+1).reduce(l,null)].forEach((t=>t&&o.insertBefore(t,e.parentNode))),(0,al.Z)(e.parentNode)}else(0,ll.Z)(e,i)}(e,t):(0,ll.Z)(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t)))}var cl=n(7391);function ul(e){return"OL"===e.nodeName||"UL"===e.nodeName}function dl(e){if(!ul(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((e=>{let{nodeValue:t=""}=e;return t})).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&ul(r)){const t=e.previousElementSibling;t?t.appendChild(e):(0,cl.Z)(e)}}function pl(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=il(e.innerHTML))}function ml(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function hl(e,t,n){if(!function(e,t){var n,r;const o=e.nodeName.toLowerCase();return"figcaption"!==o&&!(0,ol.my)(e)&&o in(null!==(n=null==t||null===(r=t.figure)||void 0===r?void 0:r.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n,r,o,i;return e.nodeName.toLowerCase()in(null!==(n=null==t||null===(r=t.figure)||void 0===r||null===(o=r.children)||void 0===o||null===(i=o.a)||void 0===i?void 0:i.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&ml(r,i):ml(r,i):"BODY"===r.parentNode.nodeName&&ml(r)}function fl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=gl(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return fl(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:bl(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function gl(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const vl=Oi()((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function bl(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new yl({tag:e[2],attrs:e[3],type:t,content:e[5]})}const yl=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=vl(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((e=>{let[t,n]=e;this.set(t,n)}))}),{next:fl,replace:function(e,t,n){return t.replace(gl(e),(function(e,t,r,o,i,l,a,s){if("["===t&&"]"===s)return e;const c=n(bl(arguments));return c||""===c?t+c+s:e}))},string:function(e){return new yl(e).string()},regexp:gl,attrs:vl,fromMatch:bl});Object.assign(yl.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach((t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t})),Object.entries(this.attrs.named).forEach((t=>{let[n,r]=t;e+=" "+n+'="'+r+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const _l=e=>Array.isArray(e)?e:[e],kl=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=cr(ur("from"),(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&_l(e.tag).some((e=>gl(e).test(t)))));if(!o)return[t];const i=_l(o.tag).find((e=>gl(e).test(t)));let l;const a=n;if(l=fl(i,t,n)){var s;n=l.index+l.content.length;const i=t.substr(0,l.index),c=t.substr(n);if(!(null!==(s=l.shortcode.content)&&void 0!==s&&s.includes("<")||/(\n|<p>)\s*$/.test(i)&&/^\s*(\n|<\/p>)/.test(c)))return e(t,n);if(o.isMatch&&!o.isMatch(l.shortcode.attrs))return e(t,a,[...r,o.blockName]);let u=[];if("function"==typeof o.transform)u=[].concat(o.transform(l.shortcode.attrs,l)),u=u.map((e=>(e.originalContent=l.shortcode.content,Yi(e,qn(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((e=>{let[,t]=e;return t.shortcode})).map((e=>{let[t,n]=e;return[t,n.shortcode(l.shortcode.attrs,l)]}))),n=qn(o.blockName);if(!n)return[t];const r={...n,attributes:o.attributes};let i=nr(o.blockName,Gi(r,l.shortcode.content,e));i.originalContent=l.shortcode.content,i=Yi(i,r),u=[i]}return[...e(i),...u,...e(c)]}return[t]};function xl(e){return function(e,t){const n={phrasingContentSchema:(0,ol.s3)(t),isPaste:"paste"===t},r=e.map((e=>{let{isMatch:t,blockName:r,schema:o}=e;const i=Xn(r,"anchor");return o="function"==typeof o?o(n):o,i||t?(0,N.mapValues)(o,(e=>{let n=e.attributes||[];return i&&(n=[...n,"id"]),{...e,attributes:n,isMatch:t||void 0}})):o}));return(0,N.mergeWith)({},...r,((e,t,n)=>{switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return function(){return e(...arguments)||t(...arguments)}}}))}(tl(),e)}function wl(e,t,n,r){Array.from(e).forEach((e=>{wl(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function Cl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,wl(r.body.childNodes,t,r,n),r.body.innerHTML}function El(e,t){const n=e[`${t}Sibling`];if(n&&(0,ol.V2)(n))return n;const{parentNode:r}=e;return r&&(0,ol.V2)(r)?El(r,t):void 0}function Sl(e){let{HTML:t=""}=e;if(-1!==t.indexOf("\x3c!-- wp:"))return el(t);const n=kl(t),r=xl();return n.map((e=>"string"!=typeof e?e:nl(e=il(e=Cl(e,[dl,sl,hl,pl],r)),Sl))).flat().filter(Boolean)}var Il=n(47534);function Tl(e){e.nodeType===e.COMMENT_NODE&&(0,al.Z)(e)}function Nl(e,t){return e.every((e=>function(e,t){if((0,ol.my)(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[n,t].filter((t=>!e.includes(t))).length))}(e,t)&&Nl(Array.from(e.children),t)))}function Bl(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}var Pl=n(4599),Al=n(26750);function Ll(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:l}=e.style;"bold"!==n&&"700"!==n||(0,Pl.Z)(t.createElement("strong"),e),"italic"===r&&(0,Pl.Z)(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&(0,Pl.Z)(t.createElement("s"),e),"super"===l?(0,Pl.Z)(t.createElement("sup"),e):"sub"===l&&(0,Pl.Z)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,Al.Z)(e,"strong"):"I"===e.nodeName?e=(0,Al.Z)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Rl(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}const{parseInt:Dl}=window;function Ml(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ol(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n)return;if(-1===n.indexOf("mso-list"))return;const r=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);if(!r)return;let o=Dl(r[1],10)-1||0;const i=e.previousElementSibling;if(!i||!Ml(i)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const l=e.previousElementSibling,a=l.nodeName,s=t.createElement("li");let c=l;for(e.removeChild(e.firstChild);e.firstChild;)s.appendChild(e.firstChild);for(;o--;)c=c.lastChild||c,Ml(c)&&(c=c.lastChild||c);Ml(c)||(c=c.appendChild(t.createElement(a))),c.appendChild(s),e.parentNode.removeChild(e)}const{atob:Fl,File:Zl}=window;function jl(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=Fl(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;e<i.length;e++)i[e]=o.charCodeAt(e);const l=r.replace("/","."),a=new Zl([i],l,{type:r});e.src=xn(a)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function zl(e){"DIV"===e.nodeName&&(e.innerHTML=il(e.innerHTML))}var Hl=n(52965);const Vl=new(n.n(Hl)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function Wl(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function Ul(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&("B"===e.tagName?(0,cl.Z)(e):e.removeAttribute("id"))}function $l(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(" "===n[0]){const t=El(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(n=n.slice(1))}if(" "===n[n.length-1]){const t=El(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&function(e){return" "===e||"\r"===e||"\n"===e||"\t"===e}(t.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Gl(e){"BR"===e.nodeName&&(El(e,"next")||e.parentNode.removeChild(e))}function ql(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function Kl(e){if("SPAN"!==e.nodeName)return;if("paragraph-break"!==e.getAttribute("data-stringify-type"))return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const{console:Yl}=window;function Xl(e,t){return e=Cl(e,[Rl,Ul,Ll,Tl]),e=(0,Il.Z)(e,(0,ol.s3)("paste"),{inline:!0}),t||(e=Cl(e,[$l,Gl])),Yl.log("Processed inline HTML:\n\n",e),e}function Ql(e){let{HTML:t="",plainText:n="",mode:r="AUTO",tagName:o,preserveWhiteSpace:i}=e;if(t=t.replace(/<meta[^>]+>/g,""),t=t.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,""),t=t.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const e=t||n;if(-1!==e.indexOf("\x3c!-- wp:"))return el(e)}var l;if(String.prototype.normalize&&(t=t.normalize()),!n||t&&!function(e){return!/<(?!br[ />])/i.test(e)}(t)||(t=n,/^\s+$/.test(n)||(l=t,t=Vl.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(l)))),"AUTO"===r&&-1===n.indexOf("\n")&&0!==n.indexOf("<p>")&&0===t.indexOf("<p>")&&(r="INLINE")),"INLINE"===r)return Xl(t,i);t=Cl(t,[Kl]);const a=kl(t),s=a.length>1;if("AUTO"===r&&!s&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(Bl)&&Nl(r,t)}(t,o))return Xl(t,i);const c=(0,ol.s3)("paste"),u=xl("paste"),d=a.map((e=>{if("string"!=typeof e)return e;const t=[Ul,Ol,Rl,dl,jl,Ll,sl,Tl,Wl,hl,pl,zl],n={...u,...c};return e=Cl(e,t,u),e=Cl(e=il(e=(0,Il.Z)(e,n)),[$l,Gl,ql],u),Yl.log("Processed HTML piece:\n\n",e),nl(e,Ql)})).flat().filter(Boolean);if("AUTO"===r&&1===d.length&&Xn(d[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,t=n.replace(e,"");if(""!==t&&-1===t.indexOf("\n"))return(0,Il.Z)(Qo(d[0]),c).replace(e,"")}return d}function Jl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&t.every(((t,n)=>{let[r,,o]=t;const i=e[n];return r===i.name&&Jl(i.innerBlocks,o)}))}function ea(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?t.map(((t,n)=>{var r;let[o,i,l]=t;const a=e[n];if(a&&a.name===o){const e=ea(a.innerBlocks,l);return{...a,innerBlocks:e}}const s=qn(o),c=(e,t)=>t?Object.fromEntries(Object.entries(t).map((t=>{let[n,r]=t;return[n,u(e[n],r)]}))):{},u=(e,t)=>{return"html"===(null==(n=e)?void 0:n.source)&&Array.isArray(t)?(0,Uo.ZP)(t):(e=>"query"===(null==e?void 0:e.source))(e)&&t?t.map((t=>c(e.query,t))):t;var n},d=c(null!==(r=null==s?void 0:s.attributes)&&void 0!==r?r:{},i);let[p,m]=Pi(o,d);return void 0===qn(p)&&(m={originalName:o,originalContent:"",originalUndelimitedContent:""},p="core/missing"),nr(p,m,ea([],l))})):e}(0,tr.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Xn(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var ta=n(48041),na=n(56662),ra=n(68759),oa=n(87532),ia=n(3939),la=n(23315);const aa=e=>(0,b.createElement)("div",{className:e.className},e.children),sa=(0,b.forwardRef)((function(e,t){let{containerClassName:n,className:r,extraProps:o,children:i,title:l,isActive:a,isDisabled:s,...c}=e;return(0,b.useContext)(oa.Z)?(0,b.createElement)(la.Z,(0,ta.Z)({className:C()("components-toolbar-button",r)},o,c,{ref:t}),(e=>(0,b.createElement)(ia.ZP,(0,ta.Z)({label:l,isPressed:a,disabled:s},e),i))):(0,b.createElement)(aa,{className:n},(0,b.createElement)(ia.ZP,(0,ta.Z)({ref:t,icon:c.icon,label:l,shortcut:c.shortcut,"data-subscript":c.subscript,onClick:e=>{e.stopPropagation(),c.onClick&&c.onClick(e)},className:C()("components-toolbar__control",r),isPressed:a,disabled:s,"data-toolbar-item":!0},o,c),i))})),ca=e=>{let{className:t,children:n,...r}=e;return(0,b.createElement)("div",(0,ta.Z)({className:t},r),n)};var ua=n(66510);const da=function(e){let{controls:t=[],toggleProps:n,...r}=e;const o=e=>(0,b.createElement)(ua.Z,(0,ta.Z)({controls:t,toggleProps:{...e,"data-toolbar-item":!0}},r));return(0,b.useContext)(oa.Z)?(0,b.createElement)(la.Z,n,o):o(n)},pa=function(e){var t;let{controls:n=[],children:r,className:o,isCollapsed:i,title:l,...a}=e;const s=(0,b.useContext)(oa.Z);if(!(n&&n.length||r))return null;const c=C()(s?"components-toolbar-group":"components-toolbar",o);let u=n;return Array.isArray(u[0])||(u=[u]),i?(0,b.createElement)(da,(0,ta.Z)({label:l,controls:u,className:c,children:r},a)):(0,b.createElement)(ca,(0,ta.Z)({className:c},a),null===(t=u)||void 0===t?void 0:t.flatMap(((e,t)=>e.map(((e,n)=>(0,b.createElement)(sa,(0,ta.Z)({key:[t,n].join(),containerClassName:t>0&&0===n?"has-left-divider":null},e)))))),r)},ma={default:(0,pn.up)("BlockControls"),block:(0,pn.up)("BlockControlsBlock"),inline:(0,pn.up)("BlockFormatControls"),other:(0,pn.up)("BlockControlsOther"),parent:(0,pn.up)("BlockControlsParent")},ha={insertUsage:{}},fa={alignWide:!1,supportsLayout:!0,colors:[{name:(0,O.__)("Black"),slug:"black",color:"#000000"},{name:(0,O.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,O.__)("White"),slug:"white",color:"#ffffff"},{name:(0,O.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,O.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,O.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,O.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,O.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,O.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,O.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,O.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,O.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,O._x)("Small","font size name"),size:13,slug:"small"},{name:(0,O._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,O._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,O._x)("Large","font size name"),size:36,slug:"large"},{name:(0,O._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,O.__)("Thumbnail")},{slug:"medium",name:(0,O.__)("Medium")},{slug:"large",name:(0,O.__)("Large")},{slug:"full",name:(0,O.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,O.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,O.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,O.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,O.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,O.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,O.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,O.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,O.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,O.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,O.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,O.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,O.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function ga(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function va(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=[...e];return o.splice(t,r),ga(o,e.slice(t,t+r),n)}const ba=e=>e;function ya(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),ya(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function _a(e){const t=[],n=[[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e]];for(;n.length;){const[e,r]=n.shift();r.forEach((r=>{let{innerBlocks:o,...i}=r;t.push([i.clientId,e]),null!=o&&o.length&&n.push([i.clientId,o])}))}return t}function ka(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ba;const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function xa(e){return ka(e,(e=>{const{attributes:t,...n}=e;return n}))}function wa(e){return ka(e,(e=>e.attributes))}function Ca(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&T()(e.clientIds,t.clientIds)&&function(e,t){return T()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function Ea(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function Sa(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const Ia=(0,Lr.Z)(S.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),Ea(r,n.blocks),Sa(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),Sa(r,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),Sa(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),Ea(r,n.blocks),Sa(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!r.byClientId.get(t.parents.get(e))||o.push(t.parents.get(e));Sa(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds)void 0===t.parents.get(o)||""!==t.parents.get(o)&&!r.byClientId.get(t.parents.get(o))||e.push(t.parents.get(o));r.tree=new Map(r.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),Sa(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),Sa(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),Sa(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),Sa(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o<r.length;o++)!t.order.get(r[o])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[r[o]]||(r===e&&(r=[...r]),r.push(...t.order.get(r[o])));return r};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:r(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:r(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(xa(n.blocks)),attributes:new Map(wa(n.blocks)),order:ya(n.blocks),parents:new Map(_a(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),Ea(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(r,o)=>{let i=e(r,o);const l="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||n;if(r===i&&!l){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type;const e=null===(a=null==r?void 0:r.isPersistentChange)||void 0===a||a;return r.isPersistentChange===e?r:{...i,isPersistentChange:e}}return i={...i,isPersistentChange:l?!n:!Ca(o,t)},t=o,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,i}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return xa(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),xa(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return wa(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const l=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===l.length)continue;let a=!1;const s=e.get(i),c={};l.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),r=r||a,a&&o.set(i,{...s,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),wa(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=ya(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=ya(t.blocks,n),{index:i=r.length}=t,l=new Map(e);return o.forEach(((e,t)=>{l.set(t,e)})),l.set(n,ga(r,o.get(n),i)),l}case"MOVE_BLOCKS_TO_POSITION":{var r,o;const{fromRootClientId:n="",toRootClientId:i="",clientIds:l}=t,{index:a=e.get(i).length}=t;if(n===i){const t=e.get(i).indexOf(l[0]),n=new Map(e);return n.set(i,va(e.get(i),t,a,l.length)),n}const s=new Map(e);return s.set(n,null!==(r=null===(o=e.get(n))||void 0===o?void 0:o.filter((e=>!l.includes(e))))&&void 0!==r?r:[]),s.set(i,ga(e.get(i),l,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const l=i.indexOf(o),a=new Map(e);return a.set(r,va(i,l,l-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],l=e.get(r);if(!l.length||i===l[l.length-1])return e;const a=l.indexOf(o),s=new Map(e);return s.set(r,va(l,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=ya(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return _a(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return _a(t.blocks,t.rootClientId||"").forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),_a(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:r}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e}});function Ta(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const Na=(0,S.combineReducers)({blocks:Ia,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;switch(i.type){case"SELECTION_CHANGE":return i.clientId?{selectionStart:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.startOffset},selectionEnd:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.endOffset}}:{selectionStart:i.start||o.selectionStart,selectionEnd:i.end||o.selectionEnd};case"RESET_SELECTION":const{selectionStart:l,selectionEnd:a}=i;return{selectionStart:l,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=i;return s===(null===(e=o.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=o.selectionEnd)||void 0===t?void 0:t.clientId)?o:{selectionStart:{clientId:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==o||null===(n=o.selectionStart)||void 0===n?void 0:n.clientId,d=null==o||null===(r=o.selectionEnd)||void 0===r?void 0:r.clientId;if(!u&&!d)return o;if(!i.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!i.blocks.some((e=>e.clientId===d)))return{...o,selectionEnd:o.selectionStart}}const l=Ta(o.selectionStart,i),a=Ta(o.selectionEnd,i);return l===o.selectionStart&&a===o.selectionEnd?o:{selectionStart:l,selectionEnd:a}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...r}=e;return r}return e}return T()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i}=t,l={rootClientId:n,index:r,__unstableWithInserter:o,operation:i};return T()(e,l)?e:l}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fa,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ha,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n,i=(0,S.select)(Bo).getActiveBlockVariation(o,r);let l=null!=i&&i.name?`${o}/${i.name}`:o;const a={name:l};return"core/block"===o&&(a.ref=r.ref,l+="/"+r.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const r=n.blocks.map((e=>e.clientId));return{clientIds:r,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}}),Ba=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(Na);var Pa=n(37392),Aa=n(23353),La=n(62530);function Ra(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:r}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:r}}function Da(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(((e,t,n)=>(r,o)=>{let i,l;if("function"==typeof e?(i=e(r),l=e(o)):(i=r[e],l=o[e]),i>l)return"asc"===n?1:-1;if(l>i)return"asc"===n?-1:1;const a=t.findIndex((e=>e===r)),s=t.findIndex((e=>e===o));return a>s?1:s>a?-1:0})(t,e,n))}const Ma=[],Oa=new Set;function Fa(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==Pa.Z.OS&&(null==n?void 0:n.name)===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`${r}-${o}`:r}return n?n.name:null}function Za(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function ja(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function za(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Ha=(0,Pe.Z)(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:ja(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function Va(e,t){var n;const r=t&&Mc(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(r))||void 0===n?void 0:n.innerBlocks)||Ma}const Wa=(0,Pe.Z)(((e,t)=>({clientId:t,innerBlocks:Ua(e,t)})),(e=>[e.blocks.order])),Ua=(0,Pe.Z)((function(e){return Ps(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").map((t=>Wa(e,t)))}),(e=>[e.blocks.order])),$a=(0,Pe.Z)(((e,t)=>{const n=[];for(const r of t)for(const t of Ps(e,r))n.push(t,...$a(e,[t]));return n}),(e=>[e.blocks.order])),Ga=(0,Pe.Z)((e=>{const t=[];for(const n of Ps(e))t.push(n,...$a(e,[n]));return t}),(e=>[e.blocks.order])),qa=(0,Pe.Z)(((e,t)=>{const n=Ga(e);return t?n.reduce(((n,r)=>e.blocks.byClientId.get(r).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),Ka=(0,Pe.Z)(((e,t)=>{if(!t)return Ma;const n=Ga(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Ma}),(e=>[e.blocks.order,e.blocks.byClientId])),Ya=(0,Pe.Z)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>za(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),Xa=(0,Pe.Z)(((e,t)=>Ya(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>Ya(e,t)));function Qa(e,t){return Ps(e,t).length}function Ja(e){return e.selection.selectionStart}function es(e){return e.selection.selectionEnd}function ts(e){return e.selection.selectionStart.clientId}function ns(e){return e.selection.selectionEnd.clientId}function rs(e){return vs(e).length||(e.selection.selectionStart.clientId?1:0)}function os(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function is(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function ls(e){const t=is(e);return t?za(e,t):null}function as(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ss=(0,Pe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=t;for(;e.blocks.parents.get(o);)o=e.blocks.parents.get(o),r.push(o);return r.length?n?r:r.reverse():Ma}),(e=>[e.blocks.parents])),cs=(0,Pe.Z)((function(e,t,n){return ss(e,t,arguments.length>3&&void 0!==arguments[3]&&arguments[3]).map((t=>({id:t,name:Fa(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function us(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function ds(e,t){const n=is(e),r=[...ss(e,t),t],o=[...ss(e,n),n];let i;const l=Math.min(r.length,o.length);for(let e=0;e<l&&r[e]===o[e];e++)i=r[e];return i}function ps(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=is(e)),void 0===t&&(t=n<0?ys(e):_s(e)),!t)return null;const r=as(e,t);if(null===r)return null;const{order:o}=e.blocks,i=o.get(r),l=i.indexOf(t)+1*n;return l<0||l===i.length?null:i[l]}function ms(e,t){return ps(e,t,-1)}function hs(e,t){return ps(e,t,1)}function fs(e){return e.initialPosition}const gs=(0,Pe.Z)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Ma;if(t.clientId===n.clientId)return[t.clientId];const r=as(e,t.clientId);if(null===r)return Ma;const o=Ps(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId);return i>l?o.slice(l,i+1):o.slice(i,l+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function vs(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Ma:gs(e)}const bs=(0,Pe.Z)((e=>{const t=vs(e);return t.length?t.map((t=>za(e,t))):Ma}),(e=>[...gs.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ys(e){return vs(e)[0]||null}function _s(e){const t=vs(e);return t[t.length-1]||null}function ks(e,t){return ys(e)===t}function xs(e,t){return-1!==vs(e).indexOf(t)}const ws=(0,Pe.Z)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=as(e,n),r=xs(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Cs(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Es(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ss(e){const t=Ja(e),n=es(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Is(e){const t=Ja(e),n=es(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Ts(e){return gs(e).some((t=>!qn(Fa(e,t)).merge))}function Ns(e,t){const n=Ja(e),r=es(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=as(e,n.clientId);if(o!==as(e,r.clientId))return!1;const i=Ps(e,o);let l,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(l=r,a=n):(l=n,a=r);const s=t?a.clientId:l.clientId,c=t?l.clientId:a.clientId,u=Fa(e,s);if(!qn(u).merge)return!1;const d=za(e,c);if(d.name===u)return!0;const p=pr(d,u);return p&&p.length}const Bs=e=>{const t=Ja(e),n=es(e);if(t.clientId===n.clientId)return Ma;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Ma;const r=as(e,t.clientId);if(r!==as(e,n.clientId))return Ma;const o=Ps(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId),[a,s]=i>l?[n,t]:[t,n],c=za(e,a.clientId),u=qn(c.name),d=za(e,s.clientId),p=qn(d.name),m=c.attributes[a.attributeKey],h=d.attributes[s.attributeKey],f=u.attributes[a.attributeKey],g=p.attributes[s.attributeKey];let v=(0,La.create)({html:m,...Ra(f)}),b=(0,La.create)({html:h,...Ra(g)});return v=(0,La.remove)(v,0,a.offset),b=(0,La.remove)(b,s.offset,b.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:(0,La.toHTMLString)({value:v,...Ra(f)})}},{...d,attributes:{...d.attributes,[s.attributeKey]:(0,La.toHTMLString)({value:b,...Ra(g)})}}]};function Ps(e,t){return e.blocks.order.get(t||"")||Ma}function As(e,t){return Ps(e,as(e,t)).indexOf(t)}function Ls(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function Rs(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Ps(e,t).some((t=>Ls(e,t)||xs(e,t)||n&&Rs(e,t,n)))}function Ds(e,t){if(!t)return!1;const n=vs(e),r=n.indexOf(t);return r>-1&&r<n.length-1}function Ms(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Os(e){return e.isMultiSelecting}function Fs(e){return e.isSelectionEnabled}function Zs(e,t){return e.blocksMode[t]||"visual"}function js(e){return e.isTyping}function zs(e){return!!e.draggedBlocks.length}function Hs(e){return e.draggedBlocks}function Vs(e,t){return e.draggedBlocks.includes(t)}function Ws(e,t){return!!zs(e)&&ss(e,t).some((t=>Vs(e,t)))}function Us(){return(0,j.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const $s=(0,Pe.Z)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=as(e,i)||void 0,n=As(e,o.clientId)+1):n=Ps(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function Gs(e){return null!==e.insertionPoint}function qs(e){return e.template.isValid}function Ks(e){return e.settings.template}function Ys(e,t){var n,r,o;return t?null!==(n=null===(r=wc(e,t))||void 0===r?void 0:r.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const Xs=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Qs=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=qn(t),!n)return!1;const{allowedBlockTypes:o}=Cc(e);if(!Xs(o,t,!0))return!1;if(Ys(e,r))return!1;const i=wc(e,r);if(r&&void 0===i)return!1;const l=null==i?void 0:i.allowedBlocks,a=Xs(l,t),s=n.parent,c=Fa(e,r),u=Xs(s,c);let d=!0;const p=n.ancestor;p&&(d=[r,...ss(e,r)].some((t=>Xs(p,Fa(e,t)))));const m=d&&(null===a&&null===u||!0===a||!0===u);return m?(0,tr.applyFilters)("blockEditor.__unstableCanInsertBlockType",m,n,r,{getBlock:za.bind(null,e),getBlockParentsByBlockName:cs.bind(null,e)}):m},Js=(0,Pe.Z)(Qs,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function ec(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Js(e,Fa(e,t),n)))}function tc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=ja(e,t);if(null===r)return!0;const{lock:o}=r,i=!!Ys(e,n);return void 0===o||void 0===(null==o?void 0:o.remove)?!i:!(null!=o&&o.remove)}function nc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tc(e,t,n)))}function rc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=ja(e,t);if(null===r)return;const{lock:o}=r,i="all"===Ys(e,n);return void 0===o||void 0===(null==o?void 0:o.move)?!i:!(null!=o&&o.move)}function oc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rc(e,t,n)))}function ic(e,t){const n=ja(e,t);if(null===n)return!0;const{lock:r}=n;return!(null!=r&&r.edit)}function lc(e,t){var n;return!!Xn(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ac(e,t){var n,r;return null!==(n=null===(r=e.preferences.insertUsage)||void 0===r?void 0:r[t])&&void 0!==n?n:null}const sc=(e,t,n)=>!!Xn(t,"inserter",!0)&&Qs(e,t.name,n),cc=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},uc=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const r=t.name;let o=!1;Xn(t.name,"multiple",!0)||(o=Ya(e,Ga(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:i,count:l=0}=ac(e,r)||{},a={id:r,name:t.name,title:t.title,icon:t.icon,isDisabled:o,frecency:cc(i,l)};if("transform"===n)return a;const s=er(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:s,example:t.example,utility:1}}},dc=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=uc(e,{buildScope:"inserter"}),r=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,o=Kn().filter((n=>sc(e,n,t))).map(n),i=Qs(e,"core/block",t)?Bc(e).map((t=>{let n=Aa.Z;if("web"===Pa.Z.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(r);if(e){const[,,t="core/",r]=e,o=qn(t+r);o&&(n=o.icon)}}const o=`core/block/${t.id}`,{time:i,count:l=0}=ac(e,o)||{},a=cc(i,l);return{id:o,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}})):[],l=o.reduce(((t,n)=>{const{variations:r=[]}=n;if(r.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),r.length){const o=((e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=ac(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:cc(o,i)}})(e,n);t.push(...r.map(o))}return t}),[]),{core:a,noncore:s}=l.reduce(((e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e}),{core:[],noncore:[]});return[...a,...s,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Bc(e),Kn()])),pc=(0,Pe.Z)((function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=Array.isArray(t)?t:[t],[i]=o,l=uc(e,{buildScope:"transform"}),a=Kn().filter((t=>sc(e,t,r))).map(l),s=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,O.__)("Unwrap"),icon:null===(n=s[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const c=function(e){if(!e.length)return[];const t=(e=>e.length?Kn().filter((t=>!!cr(ur("from",t.name),(t=>lr(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=qn(e[0].name);return(t?ur("to",t.name):[]).filter((t=>t&&lr(t,"to",e))).map((e=>e.blocks)).flat().map((e=>"*"===e?e:qn(e)))})(e);return[...new Set([...t,...n])]}(o).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return Da(c,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Kn()])),mc=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return!!Kn().some((n=>sc(e,n,t)))||Qs(e,"core/block",t)&&Bc(e).length>0}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Bc(e),Kn()])),hc=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return Kn().filter((n=>sc(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Kn()])),fc=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,j.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),hc(e,t)}),((e,t)=>[...hc.getDependants(e,t)])),gc=(0,Pe.Z)((function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!r)return;const o=null===(t=e.blockListSettings[r])||void 0===t?void 0:t.__experimentalDefaultBlock,i=null===(n=e.blockListSettings[r])||void 0===n?void 0:n.__experimentalDirectInsert;return o&&i?"function"==typeof i?i(za(e,r))?o:null:o:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),vc=(0,Pe.Z)(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:el(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),bc=(0,Pe.Z)((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Cc(e),r=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return vc(e,n)})),o=r.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var r;const e=n.shift();if(!Xs(t,e.name||e.blockName,!0))return!1;null===(r=e.innerBlocks)||void 0===r||r.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return o}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),yc=(0,Pe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=bc(e).filter((n=>{let{blocks:r}=n;return r.every((n=>{let{name:r}=n;return Js(e,r,t)}))}));return n}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),_c=(0,Pe.Z)((function(e,t){if(!t)return Ma;const n=yc(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null),r=Array.isArray(t)?t:[t],o=n.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}));return 0===o.length?Ma:o}),((e,t,n)=>[...yc.getDependants(e,n)])),kc=(0,Pe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,j.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),_c(e,t,n)}),((e,t,n)=>[...yc.getDependants(e,n)])),xc=(0,Pe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Ma;if(t.some((t=>{let{clientId:n,innerBlocks:r}=t;return r.length||Mc(e,n)})))return Ma;const r=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return _c(e,r,n)}),((e,t,n)=>[..._c.getDependants(e,n)]));function wc(e,t){return e.blockListSettings[t]}function Cc(e){return e.settings}function Ec(e){return e.blocks.isPersistentChange}const Sc=(0,Pe.Z)((function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Ic=(0,Pe.Z)(((e,t)=>{var n;const r=Bc(e).find((e=>e.id===t));return r?null===(n=r.title)||void 0===n?void 0:n.raw:null}),(e=>[Bc(e)]));function Tc(e){return e.blocks.isIgnoredChange}function Nc(e){return e.lastBlockAttributesChange}function Bc(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Ma}function Pc(e){return"navigation"===e.editorMode}function Ac(e){return e.editorMode}function Lc(e){return e.hasBlockMovingClientId}function Rc(e){return!!e.automaticChangeStatus}function Dc(e,t){return e.highlightedBlock===t}function Mc(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Oc=(0,Pe.Z)(((e,t)=>{if(!t.length)return null;const n=is(e);if(t.includes(Fa(e,n)))return n;const r=vs(e),o=cs(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Fc(e,t,n){var r;const{lastBlockInserted:o}=e;return(null===(r=o.clientIds)||void 0===r?void 0:r.includes(t))&&o.source===n}function Zc(e,t){var n,r;return null===(n=null===(r=e.blockVisibility)||void 0===r?void 0:r[t])||void 0===n||n}const jc=(0,Pe.Z)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Oa:t}),(e=>[e.blockVisibility])),zc=(0,Pe.Z)(((e,t)=>{let n,r=t;for(;e.blocks.parents.has(r);)r=e.blocks.parents.get(r),r&&"contentOnly"===Ys(e,r)&&(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function Hc(e){return e.temporarilyEditingAsBlocks}function Vc(e,t){if(!ic(e,t))return!0;const n=Ac(e);if("zoom-out"===n&&t&&!as(e,t))return!0;const r=Xn(Fa(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&Mc(e,t))&&!Ls(e,t)&&!Rs(e,t,!0)}function Wc(e,t){let n=e.blocks.parents[t];for(;n;){if(Vc(e,n))return!0;n=e.blocks.parents[n]}return!1}const Uc=["inserterMediaCategories","blockInspectorAnimation"];function $c(e){let t=e;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&"web"===Pa.Z.OS){t={};for(const n in e)Uc.includes(n)||(t[n]=e[n])}return{type:"UPDATE_SETTINGS",settings:t}}function Gc(){return{type:"HIDE_BLOCK_INTERFACE"}}function qc(){return{type:"SHOW_BLOCK_INTERFACE"}}function Kc(e){return e.isBlockInterfaceHidden}function Yc(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var Xc=n(15439);const Qc="†";function Jc(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Qc)}))}const eu=e=>Array.isArray(e)?e:[e],tu=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(nu(e))},nu=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getTemplate(),i=n.getTemplateLock(),l=!o||"all"!==i||Jl(e,o);if(l!==n.isValidTemplate())return r.setTemplateValidity(l),l};function ru(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function ou(e){return(0,j.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function iu(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:eu(e),attributes:t,uniqueByBlock:n}}function lu(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function au(e){return{type:"SELECT_BLOCK",initialPosition:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,clientId:e}}const su=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:r,dispatch:o}=n;const i=r.getPreviousBlockClientId(e);if(i)o.selectBlock(i,-1);else if(t){const t=r.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}}},cu=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getNextBlockClientId(e);o&&r.selectBlock(o)};function uu(){return{type:"START_MULTI_SELECT"}}function du(){return{type:"STOP_MULTI_SELECT"}}const pu=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return r=>{let{select:o,dispatch:i}=r;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;i({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,Xc.speak)((0,O.sprintf)((0,O._n)("%s block selected.","%s blocks selected.",l),l),"assertive")}};function mu(){return{type:"CLEAR_SELECTED_BLOCK"}}function hu(){return{type:"TOGGLE_SELECTION",isSelectionEnabled:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]}}function fu(e,t){var n,r;const o=null!==(n=null==t||null===(r=t.__experimentalPreferredStyleVariations)||void 0===r?void 0:r.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!Xn(n,"defaultStylePicker",!0))return e;if(!o[n])return e;const r=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=r&&r.includes("is-style-"))return e;const{attributes:i={}}=e,l=o[n];return{...e,attributes:{...i,className:`${r||""} is-style-${l}`.trim()}}}))}const gu=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;return i=>{let{select:l,dispatch:a}=i;e=eu(e),t=fu(eu(t),l.getSettings());const s=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,s))return}a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),a((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()}))}};function vu(e,t){return gu(e,t)}const bu=e=>(t,n)=>r=>{let{select:o,dispatch:i}=r;o.canMoveBlocks(t,n)&&i({type:e,clientIds:eu(t),rootClientId:n})},yu=bu("MOVE_BLOCKS_DOWN"),_u=bu("MOVE_BLOCKS_UP"),ku=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return o=>{let{select:i,dispatch:l}=o;if(i.canMoveBlocks(e,t)){if(t!==n){if(!i.canRemoveBlocks(e,t))return;if(!i.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}}};function xu(e){return ku([e],arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",arguments.length>3?arguments[3]:void 0)}function wu(e,t,n,r,o){return Cu([e],t,n,r,0,o)}const Cu=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5?arguments[5]:void 0;return l=>{let{select:a,dispatch:s}=l;null!==o&&"object"==typeof o&&(i=o,o=0,(0,j.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=fu(eu(e),a.getSettings());const c=[];for(const t of e)a.canInsertBlockType(t.name,n)&&c.push(t);c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})}};function Eu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:r,operation:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o}}const Su=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Iu(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Tu=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const r=ea(t.getBlocks(),t.getTemplate());n.resetBlocks(r)},Nu=e=>t=>{let{registry:n,select:r,dispatch:o}=t;const i=r.getSelectionStart(),l=r.getSelectionEnd();if(i.clientId===l.clientId)return;if(!i.attributeKey||!l.attributeKey||void 0===i.offset||void 0===l.offset)return!1;const a=r.getBlockRootClientId(i.clientId);if(a!==r.getBlockRootClientId(l.clientId))return;const s=r.getBlockOrder(a);let c,u;s.indexOf(i.clientId)>s.indexOf(l.clientId)?(c=l,u=i):(c=i,u=l);const d=e?u:c,p=r.getBlock(d.clientId),m=qn(p.name);if(!m.merge)return;const h=c,f=u,g=r.getBlock(h.clientId),v=qn(g.name),b=r.getBlock(f.clientId),y=qn(b.name),_=g.attributes[h.attributeKey],k=b.attributes[f.attributeKey],x=v.attributes[h.attributeKey],w=y.attributes[f.attributeKey];let C=(0,La.create)({html:_,...Ra(x)}),E=(0,La.create)({html:k,...Ra(w)});C=(0,La.remove)(C,h.offset,C.text.length),E=(0,La.insert)(E,Qc,0,f.offset);const S=ir(g,{[h.attributeKey]:(0,La.toHTMLString)({value:C,...Ra(x)})}),I=ir(b,{[f.attributeKey]:(0,La.toHTMLString)({value:E,...Ra(w)})}),T=e?S:I,N=g.name===b.name?[T]:pr(T,m.name);if(!N||!N.length)return;let B;if(e){const e=N.pop();B=m.merge(e.attributes,I.attributes)}else{const e=N.shift();B=m.merge(S.attributes,e.attributes)}const P=Jc(B),A=B[P],L=(0,La.create)({html:A,...Ra(m.attributes[P])}),R=L.text.indexOf(Qc),D=(0,La.remove)(L,R,R+1),M=(0,La.toHTMLString)({value:D,...Ra(m.attributes[P])});B[P]=M;const O=r.getSelectedBlockClientIds(),F=[...e?N:[],{...p,attributes:{...p.attributes,...B}},...e?[]:N];n.batch((()=>{o.selectionChange(p.clientId,P,R,R),o.replaceBlocks(O,F,0,r.getSelectedBlocksInitialCaretPosition())}))},Bu=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();if(r.clientId===o.clientId)return;if(!r.attributeKey||!o.attributeKey||void 0===r.offset||void 0===o.offset)return;const i=t.getBlockRootClientId(r.clientId);if(i!==t.getBlockRootClientId(o.clientId))return;const l=t.getBlockOrder(i);let a,s;l.indexOf(r.clientId)>l.indexOf(o.clientId)?(a=o,s=r):(a=r,s=o);const c=a,u=s,d=t.getBlock(c.clientId),p=qn(d.name),m=t.getBlock(u.clientId),h=qn(m.name),f=d.attributes[c.attributeKey],g=m.attributes[u.attributeKey],v=p.attributes[c.attributeKey],b=h.attributes[u.attributeKey];let y=(0,La.create)({html:f,...Ra(v)}),_=(0,La.create)({html:g,...Ra(b)});y=(0,La.remove)(y,c.offset,y.text.length),_=(0,La.remove)(_,0,u.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,La.toHTMLString)({value:y,...Ra(v)})}},nr(Gn()),{...m,attributes:{...m.attributes,[u.attributeKey]:(0,La.toHTMLString)({value:_,...Ra(b)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Pu=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();n.selectionChange({start:{clientId:r.clientId},end:{clientId:o.clientId}})},Au=(e,t)=>n=>{let{registry:r,select:o,dispatch:i}=n;const l=[e,t];i({type:"MERGE_BLOCKS",blocks:l});const[a,s]=l,c=o.getBlock(a),u=qn(c.name);if(!u)return;const d=o.getBlock(s);if(u&&!u.merge){const e=pr(d,u.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(c.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(c.clientId):void r.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(s),i.selectBlock(t.innerBlocks[0].clientId)}))}const p=qn(d.name),{clientId:m,attributeKey:h,offset:f}=o.getSelectionStart(),g=(m===a?u:p).attributes[h],v=(m===a||m===s)&&void 0!==h&&void 0!==f&&!!g;g||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=ir(c),y=ir(d);if(v){const e=m===a?b:y,t=e.attributes[h],n=(0,La.insert)((0,La.create)({html:t,...Ra(g)}),Qc,f,f);e.attributes[h]=(0,La.toHTMLString)({value:n,...Ra(g)})}const _=c.name===d.name?[y]:pr(y,c.name);if(!_||!_.length)return;const k=u.merge(b.attributes,_[0].attributes);if(v){const e=Jc(k),t=k[e],n=(0,La.create)({html:t,...Ra(u.attributes[e])}),r=n.text.indexOf(Qc),o=(0,La.remove)(n,r,r+1),l=(0,La.toHTMLString)({value:o,...Ra(u.attributes[e])});k[e]=l,i.selectionChange(c.clientId,e,r,r)}i.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...k}},..._.slice(1)],0)},Lu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;e=eu(e);const i=r.getBlockRootClientId(e[0]);if(r.canRemoveBlocks(e,i)){if(t){const t=!0;o.selectPreviousBlock(e[0],t)}o({type:"REMOVE_BLOCKS",clientIds:e}),o((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()}))}}};function Ru(e,t){return Lu([e],t)}function Du(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?arguments.length>3&&void 0!==arguments[3]?arguments[3]:0:null,time:Date.now()}}function Mu(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Ou(){return{type:"START_TYPING"}}function Fu(){return{type:"STOP_TYPING"}}function Zu(){return{type:"START_DRAGGING_BLOCKS",clientIds:arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]}}function ju(){return{type:"STOP_DRAGGING_BLOCKS"}}function zu(){return(0,j.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hu(){return(0,j.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vu(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const Wu=(e,t,n)=>r=>{let{dispatch:o}=r;const i=Gn();if(!i)return;const l=nr(i,e);return o.insertBlock(l,n,t)};function Uu(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $u(e){return $c(e,!0)}function Gu(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function qu(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ku(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yu=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Xu=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},Qu=e=>t=>{let{dispatch:n,select:r}=t;if("zoom-out"===e){const e=r.getBlockSelectionStart();e&&n.selectBlock(r.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Xc.speak)((0,O.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Xc.speak)((0,O.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Xc.speak)((0,O.__)("You are currently in zoom-out mode."))},Ju=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Xc.speak)((0,O.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},ed=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;const i=r.getBlocksByClientId(e);if(i.some((e=>!e)))return;const l=i.map((e=>e.name));if(l.some((e=>!Xn(e,"multiple",!0))))return;const a=r.getBlockRootClientId(e[0]),s=eu(e),c=r.getBlockIndex(s[s.length-1]),u=i.map((e=>or(e)));return o.insertBlocks(u,c+1,a,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},td=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i)},nd=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i+1)};function rd(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const od=e=>async t=>{let{dispatch:n}=t;n(rd(e,!0)),await new Promise((e=>setTimeout(e,150))),n(rd(e,!1))};function id(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function ld(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function ad(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const sd="core/block-editor",{lock:cd,unlock:ud}=(0,Io.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),dd={reducer:Ba,selectors:c,actions:p},pd=(0,E.Z)(sd,{...dd,persist:["preferences"]}),md=(0,S.registerStore)(sd,{...dd,persist:["preferences"]});ud(md).registerPrivateActions(u),ud(md).registerPrivateSelectors(d);const hd={name:"",isSelected:!1},fd=(0,b.createContext)(hd),{Provider:gd}=fd;function vd(){return(0,b.useContext)(fd)}function bd(){const{isSelected:e,clientId:t,name:n}=vd();return(0,un.Z)((r=>{if(e)return!0;const{getBlockName:o,isFirstMultiSelectedBlock:i,getMultiSelectedBlockClientIds:l}=r(pd);return!!i(t)&&l().every((e=>o(e)===n))}),[t,e,n])}function yd(e){let{group:t="default",controls:n,children:r,__experimentalShareWithChildBlocks:o=!1}=e;const i=function(e,t){const n=bd(),{clientId:r}=vd(),o=(0,un.Z)((e=>{const{getBlockName:n,hasSelectedInnerBlock:o}=e(pd),{hasBlockSupport:i}=e(Bo);return t&&i(n(r),"__experimentalExposeControlsToChildren",!1)&&o(r)}),[t,r]);var i;return n?null===(i=ma[e])||void 0===i?void 0:i.Fill:o?ma.parent.Fill:null}(t,o);return i?(0,b.createElement)(ra.Z,{document},(0,b.createElement)(i,null,(e=>{const o=(0,N.isEmpty)(e)?null:e;return(0,b.createElement)(oa.Z.Provider,{value:o},"default"===t&&(0,b.createElement)(pa,{controls:n}),r)}))):null}var _d=n(5784),kd=n(33110);function xd(e){const t=(0,b.useContext)(kd.Z);return(0,_d.useSnapshot)(t.fills,{sync:!0}).get(e)}function wd(e){let{group:t="default",...n}=e;const r=(0,b.useContext)(oa.Z),o=ma[t].Slot,i=xd(o.__unstableName);return Boolean(i&&i.length)?"default"===t?(0,b.createElement)(o,(0,ta.Z)({},n,{bubblesVirtually:!0,fillProps:r})):(0,b.createElement)(pa,null,(0,b.createElement)(o,(0,ta.Z)({},n,{bubblesVirtually:!0,fillProps:r}))):null}const Cd=yd;Cd.Slot=wd;const Ed=e=>(0,b.createElement)(yd,(0,ta.Z)({group:"inline"},e));Ed.Slot=e=>(0,b.createElement)(wd,(0,ta.Z)({group:"inline"},e));const Sd=Cd,Id=(0,b.forwardRef)((function(e,t){return(0,b.useContext)(oa.Z)?(0,b.createElement)(la.Z,(0,ta.Z)({ref:t},e.toggleProps),(t=>(0,b.createElement)(ua.Z,(0,ta.Z)({},e,{popoverProps:{variant:"toolbar",...e.popoverProps},toggleProps:t})))):(0,b.createElement)(ua.Z,e)}));var Td=n(26013),Nd=n(44612),Bd=n(19542),Pd=n(18316),Ad=n(80914),Ld=n(13097),Rd=n(3946),Dd=n(27121),Md=n(75104),Od=n(16951),Fd=n(79259),Zd=n(1360),jd=n(68178),zd=n(35193),Hd=n(8241),Vd=n(20969),Wd=n(10697),Ud=n(26372),$d=n(5103),Gd=n(62404);const qd={name:"7whenc",styles:"display:flex;width:100%"},Kd=(0,Vd.default)("div",{target:"eakva831"})("background:",Ud.D.gray[900],";border-radius:",$d.Z.controlBorderRadius,";left:0;position:absolute;top:2px;bottom:2px;transition:transform ",$d.Z.transitionDurationFast," ease;",(0,Gd.r)("transition")," z-index:1;"),Yd=(0,Vd.default)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var Xd=n(85761),Qd=n(27920),Jd=n(9787),ep=n(40618),tp=n(55703),np=n(90552),rp=n(34714);const op=(0,b.memo)((function(e){let{containerRef:t,containerWidth:n,isAdaptiveWidth:r,state:o}=e;const[i,l]=(0,b.useState)(0),[a,s]=(0,b.useState)(0),[c,u]=(0,b.useState)(!1),[d,p]=(0,b.useState)(!1);return(0,b.useEffect)((()=>{const e=null==t?void 0:t.current;if(!e)return;const n=e.querySelector(`[data-value="${o}"]`);if(p(!!n),!n)return;const r=window.setTimeout((()=>{const{width:t,x:r}=n.getBoundingClientRect(),{x:o}=e.getBoundingClientRect();l(r-o-1),s(t)}),100);let i;return c||(i=window.requestAnimationFrame((()=>{u(!0)}))),()=>{window.clearTimeout(r),window.cancelAnimationFrame(i)}}),[c,t,n,o,r]),d?(0,b.createElement)(Kd,{role:"presentation",style:{transform:`translateX(${i}px)`,transition:c?void 0:"none",width:a}}):null})),ip=(0,b.createContext)({}),lp=ip;var ap=n(8133);const sp=(0,b.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:a,...s}=e;const c=(0,b.useRef)(),[u,d]=(0,Jd.Z)(),p=(0,ep.Z)(sp,"toggle-group-control-as-radio-group").toString(),m=(0,Xd.i)({baseId:p,state:a}),h=(0,tp.Z)(a);return(0,ap.Z)((()=>{h!==m.state&&i(m.state)}),[m.state]),(0,ap.Z)((()=>{a!==m.state&&m.setState(a)}),[a]),(0,b.createElement)(lp.Provider,{value:{...m,isBlock:!r,size:l}},(0,b.createElement)(Qd.E,(0,ta.Z)({},m,{"aria-label":o,as:rp.Z},s,{ref:(0,np.Z)([c,t])}),u,(0,b.createElement)(op,{state:m.state,containerRef:c,containerWidth:d.width,isAdaptiveWidth:r}),n))})),cp=(0,b.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:a,...s}=e;const c=(0,b.useRef)(),[u,d]=(0,Jd.Z)(),p=(0,ep.Z)(cp,"toggle-group-control-as-button-group").toString(),[m,h]=(0,b.useState)(a),f={baseId:p,state:m,setState:h},g=(0,tp.Z)(a);return(0,ap.Z)((()=>{g!==f.state&&i(f.state)}),[f.state]),(0,ap.Z)((()=>{a!==f.state&&f.setState(a)}),[a]),(0,b.createElement)(lp.Provider,{value:{...f,isBlock:!r,isDeselectable:!0,size:l}},(0,b.createElement)(rp.Z,(0,ta.Z)({"aria-label":o},s,{ref:(0,np.Z)([c,t]),role:"group"}),u,(0,b.createElement)(op,{state:f.state,containerRef:c,containerWidth:d.width,isAdaptiveWidth:r}),n))})),up=()=>{},dp=(0,jd.Iq)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,isAdaptiveWidth:o=!1,isBlock:i=!1,isDeselectable:l=!1,label:a,hideLabelFromVision:s=!1,help:c,onChange:u=up,size:d="default",value:p,children:m,...h}=(0,Zd.y)(e,"ToggleGroupControl"),f=(0,zd.I)(),g=(0,b.useMemo)((()=>f((e=>{let{isBlock:t,isDeselectable:n,size:r}=e;return(0,Wd.css)("background:",Ud.D.ui.background,";border:1px solid transparent;border-radius:",$d.Z.controlBorderRadius,";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ",$d.Z.transitionDurationFastest," linear;",(0,Gd.r)("transition")," ",(e=>(0,Wd.css)("min-height:",{default:"36px","__unstable-large":"40px"}[e],";",""))(r)," ",!n&&(e=>{const t=(0,Wd.css)("border-color:",Ud.D.ui.border,";","");return(0,Wd.css)(e&&t," &:hover{border-color:",Ud.D.ui.borderHover,";}&:focus-within{border-color:",Ud.D.ui.borderFocus,";box-shadow:",$d.Z.controlBoxShadowFocus,";outline:none;z-index:1;}","")})(t),";","")})({isBlock:i,isDeselectable:l,size:d}),i&&qd,r)),[r,f,i,l,d]),v=l?cp:sp;return(0,b.createElement)(Hd.ZP,{help:c,__nextHasNoMarginBottom:n},!s&&(0,b.createElement)(Yd,null,(0,b.createElement)(Hd.ZP.VisualLabel,null,a)),(0,b.createElement)(v,(0,ta.Z)({},h,{children:m,className:g,isAdaptiveWidth:o,label:a,onChange:u,ref:t,size:d,value:p})))}),"ToggleGroupControl"),pp=dp;var mp=n(9106);const hp=(0,Vd.default)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),fp={name:"82a6rk",styles:"flex:1"},gp=e=>{let{isDeselectable:t,isIcon:n,isPressed:r,size:o}=e;return(0,Wd.css)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",$d.Z.controlBorderRadius,";color:",Ud.D.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ",$d.Z.transitionDurationFast," linear,color ",$d.Z.transitionDurationFast," linear,font-weight 60ms linear;",(0,Gd.r)("transition")," user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",$d.Z.toggleGroupControlBackgroundColor,";}",t&&bp," ",n&&_p({size:o})," ",r&&vp,";","")},vp=(0,Wd.css)("color:",Ud.D.white,";&:active{background:transparent;}",""),bp=(0,Wd.css)("color:",Ud.D.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",Ud.D.white,",0 0 0 ",$d.Z.borderWidthFocus," ",Ud.D.ui.theme,";outline:2px solid transparent;}",""),yp=(0,Vd.default)("div",{target:"et6ln9s0"})("display:flex;font-size:",$d.Z.fontSize,";line-height:1;"),_p=e=>{let{size:t="default"}=e;return(0,Wd.css)("color:",Ud.D.gray[900],";width:",{default:"30px","__unstable-large":"34px"}[t],";padding-left:0;padding-right:0;","")};var kp=n(650);const{ButtonContentView:xp,LabelView:wp}=m,Cp=e=>{let{showTooltip:t,text:n,children:r}=e;return t&&n?(0,b.createElement)(kp.Z,{text:n,position:"top center"},r):(0,b.createElement)(b.Fragment,null,r)},Ep=(0,jd.Iq)((function e(t,n){const r=(0,b.useContext)(ip),o=(0,ep.Z)(e,r.baseId||"toggle-group-control-option-base"),i=(0,Zd.y)({...t,id:o},"ToggleGroupControlOptionBase"),{isBlock:l=!1,isDeselectable:a=!1,size:s="default",...c}=r,{className:u,isIcon:d=!1,value:p,children:m,showTooltip:h=!1,...f}=i,g=c.state===p,v=(0,zd.I)(),y=v(l&&fp),_=v(gp({isDeselectable:a,isIcon:d,isPressed:g,size:s}),u),k={...f,className:_,"data-value":p,ref:n};return(0,b.createElement)(wp,{className:y},(0,b.createElement)(Cp,{showTooltip:h,text:f["aria-label"]},a?(0,b.createElement)("button",(0,ta.Z)({},k,{"aria-pressed":g,type:"button",onClick:()=>{a&&g?c.setState(void 0):c.setState(p)}}),(0,b.createElement)(xp,null,m)):(0,b.createElement)(mp.Y,(0,ta.Z)({},k,c,{as:"button",value:p}),(0,b.createElement)(xp,null,m))))}),"ToggleGroupControlOptionBase"),Sp=Ep;var Ip=n(82248);const Tp=(0,b.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,b.createElement)(Sp,(0,ta.Z)({},o,{isIcon:!0,"aria-label":r,showTooltip:!0,ref:t}),(0,b.createElement)(Ip.Z,{icon:n}))})),Np=Tp;var Bp=n(92519);function Pp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Ap(e,t,n,r){var o,i;let l="";return null!=t&&null!==(o=t[n])&&void 0!==o&&null!==(i=o.spacingStyles)&&void 0!==i&&i.length&&r&&t[n].spacingStyles.forEach((t=>{l+=`${Pp(e,t.selector.trim())} { `,l+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||r}`})).join("; "),l+="; }"})),l}function Lp(e){const{contentSize:t,wideSize:n}=e,r={},o=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return o.test(t)&&(r.none=(0,O.sprintf)((0,O.__)("Max %s wide"),t)),o.test(n)&&(r.wide=(0,O.sprintf)((0,O.__)("Max %s wide"),n)),r}function Rp(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Dp(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Mp(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Op={all:(0,O.__)("All sides"),top:(0,O.__)("Top"),bottom:(0,O.__)("Bottom"),left:(0,O.__)("Left"),right:(0,O.__)("Right"),mixed:(0,O.__)("Mixed"),vertical:(0,O.__)("Vertical"),horizontal:(0,O.__)("Horizontal")},Fp={top:void 0,right:void 0,bottom:void 0,left:void 0},Zp=["top","right","bottom","left"];function jp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function zp(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}function Hp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}(e);if(!n)return null;const r=Dp(null==n?void 0:n.top)||t,o=Dp(null==n?void 0:n.left)||t;return r===o?r:`${r} ${o}`}var Vp=n(78360);const Wp=(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Up=(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),$p=(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Gp=(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),qp=(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Kp={top:{icon:$p,title:(0,O._x)("Align top","Block vertical alignment setting")},center:{icon:Up,title:(0,O._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Wp,title:(0,O._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Gp,title:(0,O._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:qp,title:(0,O._x)("Space between","Block vertical alignment setting")}},Yp=["top","center","bottom"],Xp=function(e){let{value:t,onChange:n,controls:r=Yp,isCollapsed:o=!0,isToolbar:i}=e;const l=Kp[t],a=Kp.top,s=i?pa:Id,c=i?{isCollapsed:o}:{popoverProps:{variant:"toolbar"}};return(0,b.createElement)(s,(0,ta.Z)({icon:l?l.icon:a.icon,label:(0,O._x)("Change vertical alignment","Block vertical alignment setting label"),controls:r.map((e=>{return{...Kp[e],isActive:t===e,role:o?"menuitemradio":void 0,onClick:(r=e,()=>n(t===r?void 0:r))};var r}))},c))},Qp=e=>(0,b.createElement)(Xp,(0,ta.Z)({},e,{isToolbar:!1})),Jp=e=>(0,b.createElement)(Xp,(0,ta.Z)({},e,{isToolbar:!0})),em={left:Bd.Z,center:Pd.Z,right:Ad.Z,"space-between":Ld.Z,stretch:Rd.Z},tm=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:r,value:o,popoverProps:i,isToolbar:l}=e;const a=e=>{r(e===o?void 0:e)},s=o?em[o]:em.left,c=[{name:"left",icon:Bd.Z,title:(0,O.__)("Justify items left"),isActive:"left"===o,onClick:()=>a("left")},{name:"center",icon:Pd.Z,title:(0,O.__)("Justify items center"),isActive:"center"===o,onClick:()=>a("center")},{name:"right",icon:Ad.Z,title:(0,O.__)("Justify items right"),isActive:"right"===o,onClick:()=>a("right")},{name:"space-between",icon:Ld.Z,title:(0,O.__)("Space between items"),isActive:"space-between"===o,onClick:()=>a("space-between")},{name:"stretch",icon:Rd.Z,title:(0,O.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>a("stretch")}],u=l?pa:Id,d=l?{isCollapsed:n}:{};return(0,b.createElement)(u,(0,ta.Z)({icon:s,popoverProps:i,label:(0,O.__)("Change items justification"),controls:c.filter((e=>t.includes(e.name)))},d))},nm=e=>(0,b.createElement)(tm,(0,ta.Z)({},e,{isToolbar:!1})),rm=["color","border","dimensions","typography","spacing"],om={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},im={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"},lm=e=>im[e]||e;function am(e){const{name:t,clientId:n}=vd();return(0,un.Z)((r=>{if(rm.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o=(0,tr.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==o)return o;const i=lm(e),l=[n,...r(pd).getBlockParents(n,!0)];for(const e of l)if(Xn(r(pd).getBlockName(e),"__experimentalSettings",!1)){var a;const n=r(pd).getBlockAttributes(e);if(o=null!==(a=(0,N.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,N.get)(n,`settings.${i}`),void 0!==o)break}const s=r(pd).getSettings();if(void 0===o){var c;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;o=null!==(c=(0,N.get)(s,n))&&void 0!==c?c:(0,N.get)(s,e)}var u,d;if(void 0!==o)return Fn[i]?null!==(u=null!==(d=o.custom)&&void 0!==d?d:o.theme)&&void 0!==u?u:o.default:o;const p=om[i]?om[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}const sm=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,N.mapValues)(e,sm)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,N.isEmpty)(t)?void 0:t};function cm(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,cm(n)]})))}:e}function um(e,t,n){const r=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),o=e?cm(e):{};return r.reduce(((e,t,o)=>(void 0===e[t]&&(e[t]={}),o===r.length-1&&(e[t]=n),e[t])),o),o}function dm(e,t,n,r,o,i){var l;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let a=null===(l=r[0])||void 0===l?void 0:l.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;var s;a=null===(s=r[o])||void 0===s?void 0:s.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,r]=e;r&&t[n].forEach((e=>{const t=(0,N.get)(a,e);t&&(c={...c,attributes:um(c.attributes,e,t)})}))})),c}function pm(e,t,n){const r=Yn(e,t),o=null==r?void 0:r.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}function mm(e,t){const n=am("typography.fontFamilies"),r=am("typography.fontSizes"),o=am("typography.customFontSize"),i=am("typography.fontStyle"),l=am("typography.fontWeight"),a=am("typography.lineHeight"),s=am("typography.textDecoration"),c=am("typography.textTransform"),u=am("typography.letterSpacing"),d=am("spacing.padding"),p=am("spacing.margin"),m=am("spacing.blockGap"),h=am("spacing.spacingSizes"),f=am("spacing.units"),g=am("dimensions.minHeight"),v=am("layout");return function(e,t,n){const{supportedStyles:r,supports:o}=(0,un.Z)((e=>{var r;return{supportedStyles:ud(e(Bo)).getSupportedStyles(t,n),supports:null===(r=e(Bo).getBlockType(t))||void 0===r?void 0:r.supports}}),[t,n]);return(0,b.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{var n,i,l,a;r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const s=Array.isArray(null==o||null===(n=o.spacing)||void 0===n?void 0:n[e])?null==o||null===(i=o.spacing)||void 0===i?void 0:i[e]:null==o||null===(l=o.spacing)||void 0===l||null===(a=l[e])||void 0===a?void 0:a.sides;var c;null!=s&&s.length&&(t.spacing={...t.spacing,[e]:{...null===(c=t.spacing)||void 0===c?void 0:c[e],sides:s}})})),r.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),t}),[e,r,o])}((0,b.useMemo)((()=>({typography:{fontFamilies:{custom:n},fontSizes:{custom:r},customFontSize:o,fontStyle:i,fontWeight:l,lineHeight:a,textDecoration:s,textTransform:c,letterSpacing:u},spacing:{spacingSizes:{custom:h},padding:d,margin:p,blockGap:m,units:f},dimensions:{minHeight:g},layout:v,parentLayout:t})),[n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,t]),e)}const hm={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},fm={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},gm={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},vm=["wrap","nowrap"],bm={name:"flex",label:(0,O.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r={}}=e;const{allowOrientation:o=!0}=r;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Od.Z,null,(0,b.createElement)(Fd.Z,null,(0,b.createElement)(_m,{layout:t,onChange:n})),(0,b.createElement)(Fd.Z,null,o&&(0,b.createElement)(xm,{layout:t,onChange:n}))),(0,b.createElement)(km,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r}=e;if(null!=r&&r.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=r;return(0,b.createElement)(Sd,{group:"block",__experimentalShareWithChildBlocks:!0},(0,b.createElement)(_m,{layout:t,onChange:n,isToolbar:!0}),o&&(0,b.createElement)(ym,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o,style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=o,u=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!pm(l,"spacing","blockGap")?Hp(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=hm[o.justifyContent],p=vm.includes(o.flexWrap)?o.flexWrap:"wrap",m=gm[o.verticalAlignment],h=fm[o.justifyContent]||fm.left;let f="";const g=[];return p&&"wrap"!==p&&g.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&g.push(`align-items: ${m}`),d&&g.push(`justify-content: ${d}`)):(m&&g.push(`justify-content: ${m}`),g.push("flex-direction: column"),g.push(`align-items: ${h}`)),g.length&&(f=`${Pp(r)} {\n\t\t\t\t${g.join("; ")};\n\t\t\t}`),a&&u&&(f+=Ap(r,s,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function ym(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{orientation:o="horizontal"}=t,i="horizontal"===o?gm.center:gm.top,{verticalAlignment:l=i}=t,a=e=>{n({...t,verticalAlignment:e})};if(r)return(0,b.createElement)(Qp,{onChange:a,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,O.__)("Align items top")},{value:"center",label:(0,O.__)("Align items center")},{value:"flex-end",label:(0,O.__)("Align items bottom")}];return(0,b.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,b.createElement)("legend",null,(0,O.__)("Vertical alignment")),(0,b.createElement)("div",null,s.map(((e,t,n)=>(0,b.createElement)(ia.ZP,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>a(e)})))))}function _m(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{justifyContent:o="left",orientation:i="horizontal"}=t,l=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===i?a.push("space-between"):a.push("stretch"),r)return(0,b.createElement)(nm,{allowedControls:a,value:o,onChange:l,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Bd.Z,label:(0,O.__)("Justify items left")},{value:"center",icon:Pd.Z,label:(0,O.__)("Justify items center")},{value:"right",icon:Ad.Z,label:(0,O.__)("Justify items right")}];return"horizontal"===i?s.push({value:"space-between",icon:Ld.Z,label:(0,O.__)("Space between items")}):s.push({value:"stretch",icon:Rd.Z,label:(0,O.__)("Stretch items")}),(0,b.createElement)(pp,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:r}=e;return(0,b.createElement)(Np,{key:t,value:t,icon:n,label:r})})))}function km(e){let{layout:t,onChange:n}=e;const{flexWrap:r="wrap"}=t;return(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===r})}function xm(e){let{layout:t,onChange:n}=e;const{orientation:r="horizontal",verticalAlignment:o,justifyContent:i}=t;return(0,b.createElement)(pp,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,O.__)("Orientation"),value:r,onChange:e=>{let r=o,l=i;return"horizontal"===e?("space-between"===o&&(r="center"),"stretch"===i&&(l="left")):("stretch"===o&&(r="top"),"space-between"===i&&(l="left")),n({...t,orientation:e,verticalAlignment:r,justifyContent:l})}},(0,b.createElement)(Np,{icon:Dd.Z,value:"horizontal",label:(0,O.__)("Horizontal")}),(0,b.createElement)(Np,{icon:Md.Z,value:"vertical",label:(0,O.__)("Vertical")}))}const wm={name:"default",label:(0,O.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:r,blockName:o,hasBlockGapSupport:i,layoutDefinitions:l}=e;const a=Hp(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap);let s="";pm(o,"spacing","blockGap")||(null!=a&&a.top?s=Hp(null==a?void 0:a.top):"string"==typeof a&&(s=Hp(a)));let c="";return i&&s&&(c+=Ap(n,l,"default",s)),c},getOrientation:()=>"vertical",getAlignments(e,t){const n=Lp(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}},Cm="web"===Pa.Z.OS,Em={px:{value:"px",label:Cm?"px":(0,O.__)("Pixels (px)"),a11yLabel:(0,O.__)("Pixels (px)"),step:1},"%":{value:"%",label:Cm?"%":(0,O.__)("Percentage (%)"),a11yLabel:(0,O.__)("Percent (%)"),step:.1},em:{value:"em",label:Cm?"em":(0,O.__)("Relative to parent font size (em)"),a11yLabel:(0,O._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Cm?"rem":(0,O.__)("Relative to root font size (rem)"),a11yLabel:(0,O._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Cm?"vw":(0,O.__)("Viewport width (vw)"),a11yLabel:(0,O.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Cm?"vh":(0,O.__)("Viewport height (vh)"),a11yLabel:(0,O.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Cm?"vmin":(0,O.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,O.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Cm?"vmax":(0,O.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,O.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Cm?"ch":(0,O.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,O.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Cm?"ex":(0,O.__)("x-height of the font (ex)"),a11yLabel:(0,O.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Cm?"cm":(0,O.__)("Centimeters (cm)"),a11yLabel:(0,O.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Cm?"mm":(0,O.__)("Millimeters (mm)"),a11yLabel:(0,O.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Cm?"in":(0,O.__)("Inches (in)"),a11yLabel:(0,O.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Cm?"pc":(0,O.__)("Picas (pc)"),a11yLabel:(0,O.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Cm?"pt":(0,O.__)("Points (pt)"),a11yLabel:(0,O.__)("Points (pt)"),step:1}},Sm=Object.values(Em),Im=[Em.px,Em["%"],Em.em,Em.rem,Em.vw,Em.vh],Tm=Em.px;function Nm(e,t,n){return Pm(t?`${null!=e?e:""}${t}`:e,n)}function Bm(e){return Array.isArray(e)&&!!e.length}function Pm(e){var t,n;let r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sm;if(void 0!==e||null===e){r=`${e}`.trim();const t=parseFloat(r);o=isFinite(t)?t:void 0}const l=null===(t=r)||void 0===t?void 0:t.match(/[\d.\-\+]*\s*(.*)/),a=null==l||null===(n=l[1])||void 0===n?void 0:n.toLowerCase();let s;if(Bm(i)){const e=i.find((e=>e.value===a));s=null==e?void 0:e.value}else s=Tm.value;return[o,s]}function Am(e,t,n,r){const[o,i]=Pm(e,t),l=null!=o?o:n;let a=i||r;return!a&&Bm(t)&&(a=t[0].value),[l,a]}const Lm=e=>{let{units:t=Sm,availableUnits:n=[],defaultValues:r}=e;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(n,t);return r&&o.forEach(((e,t)=>{if(r[e.value]){const[n]=Pm(r[e.value]);o[t].default=n}})),o};var Rm=n(51297),Dm=n(47009),Mm=n(55865),Om=n(25885),Fm=n(74799);const Zm=(0,Vd.default)(Mm.Z,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Om.Kg,"{transition:box-shadow 0.1s linear;}}"),jm=e=>{let{selectSize:t}=e;const n={default:(0,Wd.css)("box-sizing:border-box;padding:2px 1px;width:20px;color:",Ud.D.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),large:(0,Wd.css)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,Fm.D)(2),";padding:",(0,Fm.D)(1),";color:",Ud.D.ui.theme,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")};return"__unstable-large"===t?n.large:n.default},zm=(0,Vd.default)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",jm,";color:",Ud.D.gray[900],";}"),Hm=(0,Vd.default)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",jm,";",(e=>{let{selectSize:t="default"}=e;const n={default:(0,Wd.css)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,Dm.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",Ud.D.gray[100],";}&:focus{border:1px solid ",Ud.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",$d.Z.borderWidth+" "+Ud.D.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),large:(0,Wd.css)("display:flex;justify-content:center;align-items:center;&:hover{color:",Ud.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",$d.Z.borderWidth+" "+Ud.D.ui.borderFocus,";outline:",$d.Z.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",$d.Z.borderWidthFocus+" "+Ud.D.ui.borderFocus,";outline:",$d.Z.borderWidthFocus," solid transparent;}","")};return"__unstable-large"===t?n.large:n.default}),";&:not( :disabled ){cursor:pointer;}}");function Vm(e){let{className:t,isUnitSelectTabbable:n=!0,onChange:r,size:o="default",unit:i="px",units:l=Im,...a}=e;if(!Bm(l)||1===(null==l?void 0:l.length))return(0,b.createElement)(zm,{className:"components-unit-control__unit-label",selectSize:o},i);const s=C()("components-unit-control__select",t);return(0,b.createElement)(Hm,(0,ta.Z)({className:s,onChange:e=>{const{value:t}=e.target,n=l.find((e=>e.value===t));null==r||r(t,{event:e,data:n})},selectSize:o,tabIndex:n?void 0:-1,value:i},a),l.map((e=>(0,b.createElement)("option",{value:e.value,key:e.value},e.label))))}var Wm=n(58574);const Um=(0,b.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:a=!1,isPressEnterToChange:s=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:p,onUnitChange:m,size:h="default",unit:f,units:g=Im,value:v,onBlur:y,onFocus:_,...k}=e;"unit"in e&&(0,j.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const x=null!=v?v:void 0,w=(0,b.useMemo)((()=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sm;const r=Array.isArray(n)?[...n]:[],[,o]=Nm(e,t,Sm);return o&&!r.some((e=>e.value===o))&&Em[o]&&r.unshift(Em[o]),r}(x,f,g)),[x,f,g]),[E,S]=Nm(x,f,w),[I,T]=(0,Wm.Z)(1===w.length?w[0].value:f,{initial:S,fallback:""});(0,b.useEffect)((()=>{void 0!==S&&T(S)}),[S,T]);const N=(0,b.useRef)(void 0),B=C()("components-unit-control","components-unit-control-wrapper",i),P=e=>{if(!isNaN(Number(e.currentTarget.value)))return void(N.current=void 0);const[t,n]=Am(e.currentTarget.value,w,E,I);if(N.current=t,s&&n!==I){const t=Array.isArray(w)?w.find((e=>e.value===n)):void 0;null==m||m(n,{event:e,data:t}),T(n)}},A=(e,t)=>{const n={...e};var r;return t.type===Rm.g&&void 0!==N.current&&(n.value=(null!==(r=N.current)&&void 0!==r?r:"").toString(),N.current=void 0),n};let L=A;n&&(L=(e,t)=>{const r=A(e,t);return n(r,t)});const R=a?null:(0,b.createElement)(Vm,{"aria-label":(0,O.__)("Select unit"),disabled:l,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;c&&void 0!==(null==n?void 0:n.default)&&(r=`${n.default}${e}`),null==p||p(r,t),null==m||m(e,t),T(e)},size:h,unit:I,units:w,onBlur:y,onFocus:_});let D=k.step;if(!D&&w){var M;const e=w.find((e=>e.value===I));D=null!==(M=null==e?void 0:e.step)&&void 0!==M?M:1}return(0,b.createElement)(Zm,(0,ta.Z)({type:s?"text":"number"},k,{autoComplete:r,className:B,disabled:l,spinControls:"none",isPressEnterToChange:s,label:d,onBlur:e=>{P(e),null==y||y(e)},onKeyDown:e=>{const{key:t}=e;"Enter"===t&&P(e)},onChange:(e,t)=>{if(""===e||null==e)return void(null==p||p("",t));const n=Am(e,w,E,I).join("");null==p||p(n,t)},ref:t,size:h,suffix:R,value:null!=E?E:"",step:D,__unstableStateReducer:L,onFocus:_}))})),$m=Um;var Gm=n(85180),qm=n(83295),Km=n(25538);const Ym="var:",Xm="|",Qm="--";function Jm(e,t,n,r){const o=(0,N.get)(e,n);return o?[{selector:null==t?void 0:t.selector,key:r,value:th(o)}]:[]}function eh(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const i=(0,N.get)(e,n);if(!i)return[];const l=[];if("string"==typeof i)l.push({selector:null==t?void 0:t.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=th((0,N.get)(i,[n]));return o&&e.push({selector:null==t?void 0:t.selector,key:null==r?void 0:r.individual.replace("%s",nh(n)),value:o}),e}),[]);l.push(...e)}return l}function th(e){return"string"==typeof e&&e.startsWith(Ym)?`var(--wp--${e.slice(Ym.length).split(Xm).map((e=>(0,N.kebabCase)(e))).join(Qm)})`:e}function nh(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function rh(e){return(t,n)=>Jm(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(nh).join("")}(e))}function oh(e){return(t,n)=>["color","style","width"].flatMap((r=>rh(["border",e,r])(t,n)))}const ih={name:"radius",generate:(e,t)=>eh(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},lh={name:"background",generate:(e,t)=>Jm(e,t,["color","background"],"backgroundColor")},ah={name:"gradient",generate:(e,t)=>Jm(e,t,["color","gradient"],"background")},sh={name:"text",generate:(e,t)=>Jm(e,t,["color","text"],"color")},ch={name:"minHeight",generate:(e,t)=>Jm(e,t,["dimensions","minHeight"],"minHeight")},uh={name:"shadow",generate:(e,t)=>Jm(e,t,["shadow"],"boxShadow")},dh={name:"color",generate:function(e,t){return Jm(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","color"],arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineColor")}},ph={name:"offset",generate:function(e,t){return Jm(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","offset"],arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineOffset")}},mh={name:"style",generate:function(e,t){return Jm(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","style"],arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineStyle")}},hh={name:"width",generate:function(e,t){return Jm(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","width"],arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineWidth")}},fh={name:"padding",generate:(e,t)=>eh(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},gh={name:"margin",generate:(e,t)=>eh(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},vh={name:"fontSize",generate:(e,t)=>Jm(e,t,["typography","fontSize"],"fontSize")},bh={name:"fontStyle",generate:(e,t)=>Jm(e,t,["typography","fontStyle"],"fontStyle")},yh={name:"fontWeight",generate:(e,t)=>Jm(e,t,["typography","fontWeight"],"fontWeight")},_h={name:"fontFamily",generate:(e,t)=>Jm(e,t,["typography","fontFamily"],"fontFamily")},kh={name:"letterSpacing",generate:(e,t)=>Jm(e,t,["typography","letterSpacing"],"letterSpacing")},xh={name:"lineHeight",generate:(e,t)=>Jm(e,t,["typography","lineHeight"],"lineHeight")},wh={name:"textColumns",generate:(e,t)=>Jm(e,t,["typography","textColumns"],"columnCount")},Ch={name:"textDecoration",generate:(e,t)=>Jm(e,t,["typography","textDecoration"],"textDecoration")},Eh={name:"textTransform",generate:(e,t)=>Jm(e,t,["typography","textTransform"],"textTransform")},Sh=[{name:"color",generate:rh(["border","color"])},{name:"style",generate:rh(["border","style"])},{name:"width",generate:rh(["border","width"])},ih,{name:"borderTop",generate:oh("top")},{name:"borderRight",generate:oh("right")},{name:"borderBottom",generate:oh("bottom")},{name:"borderLeft",generate:oh("left")},sh,ah,lh,ch,dh,mh,ph,hh,gh,fh,_h,vh,bh,yh,kh,xh,wh,Ch,Eh,uh];function Ih(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Th(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,N.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const r=(0,N.groupBy)(n,"selector");return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,N.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Th(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[];return Sh.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}const Nh={name:"constrained",label:(0,O.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:r,contentSize:o,justifyContent:i="center"}=t,l=[{value:"left",icon:Bd.Z,label:(0,O.__)("Justify items left")},{value:"center",icon:Pd.Z,label:(0,O.__)("Justify items center")},{value:"right",icon:Ad.Z,label:(0,O.__)("Justify items right")}],a=Lm({availableUnits:am("spacing.units")||["%","px","em","rem","vw"]});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,b.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,b.createElement)($m,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,O.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,b.createElement)(Gm.Z,{icon:qm.Z})),(0,b.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,b.createElement)($m,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,O.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,b.createElement)(Gm.Z,{icon:Km.Z}))),(0,b.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,O.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,b.createElement)(pp,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Justification"),value:i,onChange:e=>{n({...t,justifyContent:e})}},l.map((e=>{let{value:t,icon:n,label:r}=e;return(0,b.createElement)(Np,{key:t,value:t,icon:n,label:r})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o={},style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u,justifyContent:d}=o,p=Hp(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap);let m="";pm(l,"spacing","blockGap")||(null!=p&&p.top?m=Hp(null==p?void 0:p.top):"string"==typeof p&&(m=Hp(p)));const h="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let g=c||u?`\n\t\t\t\t\t${Pp(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${h};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${Pp(r,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Pp(r,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?g+=`${Pp(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${h}; }`:"right"===d&&(g+=`${Pp(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=i&&null!==(n=i.spacing)&&void 0!==n&&n.padding&&Th(i).forEach((e=>{"paddingRight"===e.key?g+=`\n\t\t\t\t\t${Pp(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(g+=`\n\t\t\t\t\t${Pp(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),a&&m&&(g+=Ap(r,s,"constrained",m)),g},getOrientation:()=>"vertical",getAlignments(e){const t=Lp(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}},Bh=[wm,bm,Nh];function Ph(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bh.find((t=>t.name===e))}const Ah={type:"default"},Lh=(0,b.createContext)(Ah),Rh=Lh.Provider;function Dh(){return(0,b.useContext)(Lh)}function Mh(e){let{layout:t={},css:n,...r}=e;const o=Ph(t.type),i=null!==am("spacing.blockGap");if(o){var l;if(n)return(0,b.createElement)("style",null,n);const e=null===(l=o.getLayoutStyle)||void 0===l?void 0:l.call(o,{hasBlockGapSupport:i,layout:t,...r});if(e)return(0,b.createElement)("style",null,e)}return null}const Oh=[],Fh=["none","left","center","right","wide","full"],Zh=["wide","full"];function jh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fh;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:r}=(0,un.Z)((e=>{const{getSettings:t}=e(pd),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),o=Dh(),i=Ph(null==o?void 0:o.type),l=i.getAlignments(o,r);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?Oh:t}if("default"!==i.name&&"constrained"!==i.name)return Oh;const{alignments:a=Fh}=o,s=e.filter((e=>(o.alignments||t||!Zh.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Oh:s}var zh=n(12674),Hh=n(17357),Vh=n(27863),Wh=n(94877);const Uh={none:{icon:zh.Z,title:(0,O._x)("None","Alignment option")},left:{icon:Hh.Z,title:(0,O.__)("Align left")},center:{icon:qm.Z,title:(0,O.__)("Align center")},right:{icon:Vh.Z,title:(0,O.__)("Align right")},wide:{icon:Km.Z,title:(0,O.__)("Wide width")},full:{icon:Wh.Z,title:(0,O.__)("Full width")}},$h={variant:"toolbar"},Gh=function(e){let{value:t,onChange:n,controls:r,isToolbar:o,isCollapsed:i=!0}=e;const l=jh(r);if(!l.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=Uh[t],c=Uh.none,u=o?pa:Id,d={icon:s?s.icon:c.icon,label:(0,O.__)("Align")},p=o?{isCollapsed:i,controls:l.map((e=>{let{name:n}=e;return{...Uh[n],isActive:t===n||!t&&"none"===n,role:i?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,O.__)("Change alignment")},popoverProps:$h,children:e=>{let{onClose:n}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Td.Z,{className:"block-editor-block-alignment-control__menu-group"},l.map((e=>{let{name:r,info:o}=e;const{icon:i,title:l}=Uh[r],s=r===t||!t&&"none"===r;return(0,b.createElement)(Nd.Z,{key:r,icon:i,iconPosition:"left",className:C()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(r),n()},role:"menuitemradio",info:o},l)}))))}};return(0,b.createElement)(u,(0,ta.Z)({},d,p))},qh=e=>(0,b.createElement)(Gh,(0,ta.Z)({},e,{isToolbar:!1})),Kh=["left","center","right","wide","full"],Yh=["wide","full"];function Xh(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Kh.filter((t=>e.includes(t))):!0===e?[...Kh]:[],!r||!0===e&&!n?t.filter((e=>!Yh.includes(e))):t}const Qh=(0,na.o)((e=>t=>{const n=(0,b.createElement)(e,(0,ta.Z)({key:"edit"},t)),{name:r}=t,o=jh(Xh(Yn(r,"align"),Xn(r,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,un.Z)((e=>e(pd).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!o.length||i?n:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,{group:"block",__experimentalShareWithChildBlocks:!0},(0,b.createElement)(qh,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const o=qn(t.name);(null==o||null===(n=o.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:o})),n)}),"withToolbarControls"),Jh=(0,na.o)((e=>t=>{const{name:n,attributes:r}=t,{align:o}=r,i=jh(Xh(Yn(n,"align"),Xn(n,"alignWide",!0)));if(void 0===o)return(0,b.createElement)(e,t);let l=t.wrapperProps;return i.some((e=>e.name===o))&&(l={...l,"data-align":o}),(0,b.createElement)(e,(0,ta.Z)({},t,{wrapperProps:l}))}));(0,tr.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||Xn(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Kh,""]}}),e})),(0,tr.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Jh),(0,tr.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Qh),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return Xh(Yn(t,"align"),Xn(t,"alignWide",!0)).includes(r)&&(e.className=C()(`align${r}`,e.className)),e})),(0,tr.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var ef=n(63983),tf=n(35360),nf=n(43876);const rf=()=>{},of=(0,b.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:rf,deregisterPanelItem:rf,flagItemCustomization:rf,registerResetAllFilter:rf,deregisterResetAllFilter:rf,areAllOptionalControlsHidden:!0}),lf=()=>(0,b.useContext)(of),af=(0,pn.up)("InspectorControls"),sf=(0,pn.up)("InspectorAdvancedControls"),cf=(0,pn.up)("InspectorControlsBorder"),uf=(0,pn.up)("InspectorControlsColor"),df=(0,pn.up)("InspectorControlsDimensions"),pf=(0,pn.up)("InspectorControlsPosition"),mf=(0,pn.up)("InspectorControlsTypography"),hf={default:af,advanced:sf,border:cf,color:uf,dimensions:df,list:(0,pn.up)("InspectorControlsListView"),settings:af,styles:(0,pn.up)("InspectorControlsStyles"),typography:mf,position:pf};function ff(e){var t;let{children:n,group:r="default",__experimentalGroup:o,resetAllFilter:i}=e;o&&((0,j.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),r=o);const l=bd(),a=null===(t=hf[r])||void 0===t?void 0:t.Fill;return a?l?(0,b.createElement)(ra.Z,{document},(0,b.createElement)(a,null,(e=>(0,b.createElement)(gf,{fillProps:e,children:n,resetAllFilter:i})))):null:("undefined"!=typeof process&&process.env,null)}function gf(e){let{children:t,resetAllFilter:n,fillProps:r}=e;const{registerResetAllFilter:o,deregisterResetAllFilter:i}=r;(0,b.useEffect)((()=>(n&&o&&o(n),()=>{n&&i&&i(n)})),[n,o,i]);const l=(0,N.isEmpty)(r)?null:r;return(0,b.createElement)(of.Provider,{value:l},t)}var vf=n(34933),bf=n(71458),yf=n(74731),_f=n(74457),kf=n(23306),xf=n(70759),wf=n(25468);const Cf={columns:e=>(0,Wd.css)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,Wd.css)("column-gap:",(0,Fm.D)(2),";row-gap:",(0,Fm.D)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},Ef={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},Sf=(0,Wd.css)(Cf.item.fullWidth," gap:",(0,Fm.D)(2),";.components-dropdown-menu{margin:",(0,Fm.D)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,Fm.D)(6),";}",""),If={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},Tf=(0,Wd.css)(Cf.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",wf.im,"{margin-bottom:0;",wf.ob,":last-child{margin-bottom:0;}}",wf.vB,"{margin-bottom:0;}&& ",Om.ub,"{label{line-height:1.4em;}}",""),Nf={name:"eivff4",styles:"display:none"},Bf={name:"16gsvie",styles:"min-width:200px"},Pf=(0,Vd.default)("span",{target:"ews648u0"})("color:",Ud.D.ui.themeDark10,";font-size:11px;font-weight:500;line-height:1.4;",(0,Dm.b)({marginLeft:(0,Fm.D)(3)})," text-transform:uppercase;"),Af=(0,Wd.css)("color:",Ud.D.gray[900],";&&[aria-disabled='true']{color:",Ud.D.gray[700],";opacity:1;&:hover{color:",Ud.D.gray[700],";}",Pf,"{opacity:0.3;}}",""),Lf=e=>{let{itemClassName:t,items:n,toggleItem:r}=e;if(!n.length)return null;const o=(0,b.createElement)(Pf,{"aria-hidden":!0},(0,O.__)("Reset"));return(0,b.createElement)(Td.Z,{label:(0,O.__)("Defaults")},n.map((e=>{let[n,i]=e;return i?(0,b.createElement)(Nd.Z,{key:n,className:t,role:"menuitem",label:(0,O.sprintf)((0,O.__)("Reset %s"),n),onClick:()=>{r(n),(0,Xc.speak)((0,O.sprintf)((0,O.__)("%s reset to default"),n),"assertive")},suffix:o},n):(0,b.createElement)(Nd.Z,{key:n,className:t,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0},n)})))},Rf=e=>{let{items:t,toggleItem:n}=e;return t.length?(0,b.createElement)(Td.Z,{label:(0,O.__)("Tools")},t.map((e=>{let[t,r]=e;const o=r?(0,O.sprintf)((0,O.__)("Hide and reset %s"),t):(0,O.sprintf)((0,O.__)("Show %s"),t);return(0,b.createElement)(Nd.Z,{key:t,icon:r&&bf.Z,isSelected:r,label:o,onClick:()=>{r?(0,Xc.speak)((0,O.sprintf)((0,O.__)("%s hidden and reset to default"),t),"assertive"):(0,Xc.speak)((0,O.sprintf)((0,O.__)("%s is now visible"),t),"assertive"),n(t)},role:"menuitemcheckbox"},t)}))):null},Df=(0,jd.Iq)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:l,headingLevel:a=2,label:s,menuItems:c,resetAll:u,toggleItem:d,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,Zd.y)(e,"ToolsPanelHeader"),o=(0,zd.I)(),i=(0,b.useMemo)((()=>o(Sf,t)),[t,o]),l=(0,b.useMemo)((()=>o(Bf)),[o]),a=(0,b.useMemo)((()=>o(If)),[o]),s=(0,b.useMemo)((()=>o(Af)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=lf();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:s,dropdownMenuClassName:l,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!s)return null;const m=Object.entries((null==c?void 0:c.default)||{}),h=Object.entries((null==c?void 0:c.optional)||{}),f=n?yf.Z:_f.Z,g=(0,O.sprintf)((0,O._x)("%s options","Button label to reveal tool panel options"),s),v=n?(0,O.__)("All options are currently hidden"):void 0,y=[...m,...h].some((e=>{let[,t]=e;return t}));return(0,b.createElement)(kf.Z,(0,ta.Z)({},p,{ref:t}),(0,b.createElement)(xf.Z,{level:a,className:l},s),i&&(0,b.createElement)(ua.Z,{icon:f,label:g,menuProps:{className:o},toggleProps:{isSmall:!0,describedBy:v}},(()=>(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Lf,{items:m,toggleItem:d,itemClassName:r}),(0,b.createElement)(Rf,{items:h,toggleItem:d}),(0,b.createElement)(Td.Z,null,(0,b.createElement)(Nd.Z,{"aria-disabled":!y,variant:"tertiary",onClick:()=>{y&&(u(),(0,Xc.speak)((0,O.__)("All options reset"),"assertive"))}},(0,O.__)("Reset all")))))))}),"ToolsPanelHeader"),Mf=e=>{let{panelItems:t,shouldReset:n,currentMenuItems:r}=e;const o={default:{},optional:{}};return t.forEach((e=>{var t;let{hasValue:i,isShownByDefault:l,label:a}=e;const s=l?"default":"optional",c=(null==r||null===(t=r[s])||void 0===t?void 0:t[a])||i();o[s][a]=!n&&c})),o},Of=e=>e&&0===Object.keys(e).length;const Ff={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var Zf=n(74575);const jf=(0,jd.Iq)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:l=3,isInline:a=!1,justify:s,rowGap:c,rows:u,templateColumns:d,templateRows:p,...m}=(0,Zd.y)(e,"Grid"),h=Array.isArray(i)?i:[i],f=(0,Zf.V)(h),g=Array.isArray(u)?u:[u],v=(0,Zf.V)(g),y=d||!!i&&`repeat( ${f}, 1fr )`,_=p||!!u&&`repeat( ${v}, 1fr )`,k=(0,zd.I)();return{...m,className:(0,b.useMemo)((()=>{const e=function(e){return e?Ff[e]:{}}(n),i=(0,Wd.css)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${$d.Z.gridBase} * ${l} )`,gridTemplateColumns:y||void 0,gridTemplateRows:_||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:s,verticalAlign:a?"middle":void 0,...e},"","");return k(i,r)}),[t,n,r,o,k,l,y,_,a,s,c])}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({},n,{ref:t}))}),"Grid"),zf=(0,jd.Iq)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:l,headingLevel:a,...s}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:l=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:s,...c}=(0,Zd.y)(e,"ToolsPanel"),u=(0,b.useRef)(!1),d=u.current;(0,b.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[p,m]=(0,b.useState)([]),[h,f]=(0,b.useState)([]),g=(0,b.useCallback)((e=>{m((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]}))}),[m]),v=(0,b.useCallback)((e=>{m((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[m]),y=(0,b.useCallback)((e=>{f((t=>[...t,e]))}),[f]),_=(0,b.useCallback)((e=>{f((t=>t.filter((t=>t!==e))))}),[f]),[k,x]=(0,b.useState)({default:{},optional:{}});(0,b.useEffect)((()=>{x((e=>Mf({panelItems:p,shouldReset:!1,currentMenuItems:e})))}),[p,x]);const w=(0,b.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";x((n=>({...n,[t]:{...n[t],[e]:!0}})))}),[x]),[C,E]=(0,b.useState)(!1);(0,b.useEffect)((()=>{if(Of(null==k?void 0:k.default)&&!Of(null==k?void 0:k.optional)){const e=!Object.entries(k.optional).some((e=>{let[,t]=e;return t}));E(e)}}),[k,E]);const S=(0,zd.I)(),I=(0,b.useMemo)((()=>{const e=i&&(0,Wd.css)(">div:not( :first-of-type ){display:grid;",Cf.columns(2)," ",Cf.spacing," ",Cf.item.fullWidth,";}",""),n=Of(null==k?void 0:k.default)&&C&&Ef;return S((0,Wd.css)(Cf.columns(2)," ",Cf.spacing," border-top:",$d.Z.borderWidth," solid ",Ud.D.gray[300],";margin-top:-1px;padding:",(0,Fm.D)(4),";",""),e,n,t)}),[C,t,S,i,k]),T=(0,b.useCallback)((e=>{const t=p.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...k,[n]:{...k[n],[e]:!k[n][e]}};x(r)}),[k,p,x]),N=(0,b.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(h));const e=Mf({panelItems:p,shouldReset:!0});x(e)}),[p,h,r,x]),B=e=>{const t=k.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return null==n?void 0:n.label},P=B(p),A=B([...p].reverse());return{...c,headingLevel:n,panelContext:(0,b.useMemo)((()=>({areAllOptionalControlsHidden:C,deregisterPanelItem:v,deregisterResetAllFilter:_,firstDisplayedItem:P,flagItemCustomization:w,hasMenuItems:!!p.length,isResetting:u.current,lastDisplayedItem:A,menuItems:k,panelId:o,registerPanelItem:g,registerResetAllFilter:y,shouldRenderPlaceholderItems:l,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:s})),[C,v,_,P,w,A,k,o,p,y,g,l,a,s]),resetAllItems:N,toggleItem:T,className:I}}(e);return(0,b.createElement)(jf,(0,ta.Z)({},s,{columns:2,ref:t}),(0,b.createElement)(of.Provider,{value:o},(0,b.createElement)(Df,{label:r,resetAll:i,toggleItem:l,headingLevel:a}),n))}),"ToolsPanel");function Hf(e){let{children:t,group:n,label:r}=e;const{updateBlockAttributes:o}=(0,dn.Z)(pd),{getBlockAttributes:i,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,un.Z)(pd),c=a(),u=(0,b.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?l():[c];n.forEach((n=>{const{style:r}=i(n);let o={style:r};e.forEach((e=>{o={...o,...e(o)}})),o={...o,style:sm(o.style)},t[n]=o})),o(n,t,!0)}),[i,l,s,c,o]);return(0,b.createElement)(zf,{className:`${n}-block-support-panel`,label:r,resetAll:u,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Vf(e){let{Slot:t,...n}=e;const r=(0,b.useContext)(of);return(0,b.createElement)(t,(0,ta.Z)({},n,{fillProps:r,bubblesVirtually:!0}))}function Wf(e){var t;let{__experimentalGroup:n,group:r="default",label:o,...i}=e;n&&((0,j.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),r=n);const l=null===(t=hf[r])||void 0===t?void 0:t.Slot,a=(0,vf.Z)(null==l?void 0:l.__unstableName),s=xd(null==l?void 0:l.__unstableName);return l&&a?Boolean(s&&s.length)?o?(0,b.createElement)(Hf,{group:r,label:o},(0,b.createElement)(Vf,(0,ta.Z)({},i,{Slot:l}))):(0,b.createElement)(l,(0,ta.Z)({},i,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Uf=ff;Uf.Slot=Wf;const $f=e=>(0,b.createElement)(ff,(0,ta.Z)({},e,{group:"advanced"}));$f.Slot=e=>(0,b.createElement)(Wf,(0,ta.Z)({},e,{group:"advanced"})),$f.slotName="InspectorAdvancedControls";const Gf=Uf,qf=/[\s#]/g,Kf={type:"string",source:"attribute",attribute:"id",selector:"*"},Yf=(0,na.o)((e=>t=>{if(Xn(t.name,"anchor")&&t.isSelected){const n="web"===Pa.Z.OS,r=(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,O.__)("HTML anchor"),help:(0,b.createElement)(b.Fragment,null,(0,O.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,b.createElement)(tf.Z,{href:(0,O.__)("https://wordpress.org/support/article/page-jumps/")},(0,O.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,O.__)("Add an anchor"),onChange:e=>{e=e.replace(qf,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(e,t),n&&(0,b.createElement)(Gf,{group:"advanced"},r),!n&&"core/heading"===t.name&&(0,b.createElement)(Gf,null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Heading settings")},r)))}return(0,b.createElement)(e,t)}),"withInspectorControl");(0,tr.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||Xn(e,"anchor")&&(e.attributes={...e.attributes,anchor:Kf}),e})),(0,tr.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Yf),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return Xn(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Xf={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,tr.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||Xn(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Xf}),e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return Xn(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Qf=(0,na.o)((e=>t=>Xn(t.name,"customClassName",!0)&&t.isSelected?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(e,t),(0,b.createElement)(Gf,{group:"advanced"},(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,O.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,O.__)("Separate multiple classes with spaces.")}))):(0,b.createElement)(e,t)),"withInspectorControl");(0,tr.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return Xn(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,tr.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Qf),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return Xn(t,"customClassName",!0)&&n.className&&(e.className=C()(e.className,n.className)),e})),(0,tr.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!Xn(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){var o;const r=null===(o=t[n])||void 0===o?void 0:o.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Xn(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([Go(t.name),...e.className.split(" ")])].join(" ").trim():e.className=Go(t.name)),e}));var Jf=n(10962),eg=n(75667),tg=n(64539),ng=n(74481),rg=n(44890);function og(e){return(0,na.o)((t=>{const n="core/with-filters/"+e;let r;class o extends b.Component{constructor(){super(...arguments),void 0===r&&(r=(0,tr.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,tr.addAction)("hookRemoved",n,l),(0,tr.addAction)("hookAdded",n,l))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,tr.removeAction)("hookRemoved",n),(0,tr.removeAction)("hookAdded",n))}render(){return(0,b.createElement)(r,this.props)}}o.instances=[];const i=(0,rg.D)((()=>{r=(0,tr.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function l(t){t===e&&i()}return o}),"withFilters")}var ig=n(53874),lg=n(19883),ag=n(72608),sg=n(73942),cg=n(92739);const ug=(0,b.createContext)({});function dg(e){let{value:t,children:n}=e;const r=(0,b.useContext)(ug),o=(0,b.useMemo)((()=>({...r,...t})),[r,t]);return(0,b.createElement)(ug.Provider,{value:o,children:n})}const pg=ug,mg={},hg=og("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,r=qn(n),o=(0,b.useContext)(pg),i=(0,b.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((e=>{let[t]=e;return r.usesContext.includes(t)}))):mg),[r,o]);if(!r)return null;const l=r.edit||r.save;if(r.apiVersion>1)return(0,b.createElement)(l,(0,ta.Z)({},e,{context:i}));const a=Xn(r,"className",!0)?Go(n):null,s=C()(a,t.className,e.className);return(0,b.createElement)(l,(0,ta.Z)({},e,{context:i,className:s}))}));function fg(e){const{name:t,isSelected:n,clientId:r,attributes:o={},__unstableLayoutClassNames:i}=e,{layout:l=null}=o,a={name:t,isSelected:n,clientId:r,layout:Xn(t,"__experimentalLayout",!1)?l:null,__unstableLayoutClassNames:i};return(0,b.createElement)(gd,{value:(0,b.useMemo)((()=>a),Object.values(a))},(0,b.createElement)(hg,e))}var gg=n(14134),vg=n(6310);const bg=function(e){let{className:t,actions:n,children:r,secondaryActions:o}=e;return(0,b.createElement)("div",{style:{display:"contents",all:"initial"}},(0,b.createElement)("div",{className:C()(t,"block-editor-warning")},(0,b.createElement)("div",{className:"block-editor-warning__contents"},(0,b.createElement)("p",{className:"block-editor-warning__message"},r),(b.Children.count(n)>0||o)&&(0,b.createElement)("div",{className:"block-editor-warning__actions"},b.Children.count(n)>0&&b.Children.map(n,((e,t)=>(0,b.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,b.createElement)(ua.Z,{className:"block-editor-warning__secondary",icon:vg.Z,label:(0,O.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,b.createElement)(Td.Z,null,o.map(((e,t)=>(0,b.createElement)(Nd.Z,{onClick:e.onClick,key:t},e.title))))))))))};var yg=n(79646);function _g(e){let{title:t,rawContent:n,renderedContent:r,action:o,actionText:i,className:l}=e;return(0,b.createElement)("div",{className:l},(0,b.createElement)("div",{className:"block-editor-block-compare__content"},(0,b.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,b.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,b.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,b.createElement)(Wo.Z,null,(0,cg.Z)(r)))),(0,b.createElement)("div",{className:"block-editor-block-compare__action"},(0,b.createElement)(ia.ZP,{variant:"secondary",tabIndex:"0",onClick:o},i)))}const kg=function(e){let{block:t,onKeep:n,onConvert:r,convertor:o,convertButtonText:i}=e;const l=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>Xo(e.name,e.attributes,e.innerBlocks)));return t.join("")}(o(t)),a=(s=t.originalContent,c=l,(0,yg.Kx)(s,c).map(((e,t)=>{const n=C()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,b.createElement)("span",{key:t,className:n},e.value)})));var s,c;return(0,b.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,b.createElement)(_g,{title:(0,O.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,O.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,b.createElement)(_g,{title:(0,O.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:i,rawContent:a,renderedContent:l}))},xg=e=>Sl({HTML:e.originalContent}),wg=(0,B.Z)([(0,ig.Z)(((e,t)=>{let{clientId:n}=t;return{block:e(pd).getBlock(n)}})),(0,lg.Z)(((e,t)=>{let{block:n}=t;const{replaceBlock:r}=e(pd);return{convertToClassic(){r(n.clientId,(e=>nr("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){r(n.clientId,(e=>nr("core/html",{content:e.originalContent}))(n))},convertToBlocks(){r(n.clientId,xg(n))},attemptBlockRecovery(){r(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:r}=e;return nr(t,n,r)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:o,block:i}=e;const l=!!qn("core/html"),[a,s]=(0,b.useState)(!1),c=(0,b.useCallback)((()=>s(!0)),[]),u=(0,b.useCallback)((()=>s(!1)),[]),d=(0,b.useMemo)((()=>[{title:(0,O._x)("Resolve","imperative verb"),onClick:c},l&&{title:(0,O.__)("Convert to HTML"),onClick:t},{title:(0,O.__)("Convert to Classic Block"),onClick:r}].filter(Boolean)),[c,t,r]);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(bg,{actions:[(0,b.createElement)(ia.ZP,{key:"recover",onClick:o,variant:"primary"},(0,O.__)("Attempt Block Recovery"))],secondaryActions:d},(0,O.__)("This block contains unexpected or invalid content.")),a&&(0,b.createElement)(gg.Z,{title:(0,O.__)("Resolve Block"),onRequestClose:u,className:"block-editor-block-compare"},(0,b.createElement)(kg,{block:i,onKeep:t,onConvert:n,convertor:xg,convertButtonText:(0,O.__)("Convert to Blocks")})))})),Cg=(0,b.createElement)(bg,{className:"block-editor-block-list__block-crash-warning"},(0,O.__)("This block has encountered an error and cannot be previewed.")),Eg=()=>Cg;class Sg extends b.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Ig=Sg;var Tg=n(49710);const Ng=function(e){let{clientId:t}=e;const[n,r]=(0,b.useState)(""),o=(0,un.Z)((e=>e(pd).getBlock(t)),[t]),{updateBlock:i}=(0,dn.Z)(pd);return(0,b.useEffect)((()=>{r(Qo(o))}),[o]),(0,b.createElement)(Tg.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=qn(o.name);if(!e)return;const l=Gi(e,n,o.attributes),a=n||Xo(e,l),[s]=n?Bi({...o,attributes:l,originalContent:a}):[!0];i(t,{attributes:l,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})};var Bg=n(24812),Pg=Gg(),Ag=e=>Vg(e,Pg),Lg=Gg();Ag.write=e=>Vg(e,Lg);var Rg=Gg();Ag.onStart=e=>Vg(e,Rg);var Dg=Gg();Ag.onFrame=e=>Vg(e,Dg);var Mg=Gg();Ag.onFinish=e=>Vg(e,Mg);var Og=[];Ag.setTimeout=(e,t)=>{let n=Ag.now()+t,r=()=>{let e=Og.findIndex((e=>e.cancel==r));~e&&Og.splice(e,1),zg-=~e?1:0},o={time:n,handler:e,cancel:r};return Og.splice(Fg(n),0,o),zg+=1,Wg(),o};var Fg=e=>~(~Og.findIndex((t=>t.time>e))||~Og.length);Ag.cancel=e=>{Rg.delete(e),Dg.delete(e),Mg.delete(e),Pg.delete(e),Lg.delete(e)},Ag.sync=e=>{Hg=!0,Ag.batchedUpdates(e),Hg=!1},Ag.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,Ag.onStart(n)}return r.handler=e,r.cancel=()=>{Rg.delete(n),t=null},r};var Zg=typeof window<"u"?window.requestAnimationFrame:()=>{};Ag.use=e=>Zg=e,Ag.now=typeof performance<"u"?()=>performance.now():Date.now,Ag.batchedUpdates=e=>e(),Ag.catch=console.error,Ag.frameLoop="always",Ag.advance=()=>{"demand"!==Ag.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):$g()};var jg=-1,zg=0,Hg=!1;function Vg(e,t){Hg?(t.delete(e),e(0)):(t.add(e),Wg())}function Wg(){jg<0&&(jg=0,"demand"!==Ag.frameLoop&&Zg(Ug))}function Ug(){~jg&&(Zg(Ug),Ag.batchedUpdates($g))}function $g(){let e=jg;jg=Ag.now();let t=Fg(jg);t&&(qg(Og.splice(0,t),(e=>e.handler())),zg-=t),zg?(Rg.flush(),Pg.flush(e?Math.min(64,jg-e):16.667),Dg.flush(),Lg.flush(),Mg.flush()):jg=-1}function Gg(){let e=new Set,t=e;return{add(n){zg+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(zg-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,zg-=t.size,qg(t,(t=>t(n)&&e.add(t))),zg+=e.size,t=e)}}}function qg(e,t){e.forEach((e=>{try{t(e)}catch(e){Ag.catch(e)}}))}var Kg=Object.defineProperty,Yg={};function Xg(){}((e,t)=>{for(var n in t)Kg(e,n,{get:t[n],enumerable:!0})})(Yg,{assign:()=>dv,colors:()=>sv,createStringInterpolator:()=>ov,skipAnimation:()=>cv,to:()=>iv,willAdvance:()=>uv});var Qg={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Jg(e,t){if(Qg.arr(e)){if(!Qg.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var ev=(e,t)=>e.forEach(t);function tv(e,t,n){if(Qg.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var nv=e=>Qg.und(e)?[]:Qg.arr(e)?e:[e];function rv(e,t){if(e.size){let n=Array.from(e);e.clear(),ev(n,t)}}var ov,iv,lv=(e,...t)=>rv(e,(e=>e(...t))),av=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),sv=null,cv=!1,uv=Xg,dv=e=>{e.to&&(iv=e.to),e.now&&(Ag.now=e.now),void 0!==e.colors&&(sv=e.colors),null!=e.skipAnimation&&(cv=e.skipAnimation),e.createStringInterpolator&&(ov=e.createStringInterpolator),e.requestAnimationFrame&&Ag.use(e.requestAnimationFrame),e.batchedUpdates&&(Ag.batchedUpdates=e.batchedUpdates),e.willAdvance&&(uv=e.willAdvance),e.frameLoop&&(Ag.frameLoop=e.frameLoop)},pv=new Set,mv=[],hv=[],fv=0,gv={get idle(){return!pv.size&&!mv.length},start(e){fv>e.priority?(pv.add(e),Ag.onStart(vv)):(bv(e),Ag(_v))},advance:_v,sort(e){if(fv)Ag.onFrame((()=>gv.sort(e)));else{let t=mv.indexOf(e);~t&&(mv.splice(t,1),yv(e))}},clear(){mv=[],pv.clear()}};function vv(){pv.forEach(bv),pv.clear(),Ag(_v)}function bv(e){mv.includes(e)||yv(e)}function yv(e){mv.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(mv,(t=>t.priority>e.priority)),0,e)}function _v(e){let t=hv;for(let n=0;n<mv.length;n++){let r=mv[n];fv=r.priority,r.idle||(uv(r),r.advance(e),r.idle||t.push(r))}return fv=0,(hv=mv).length=0,(mv=t).length>0}var kv="[-+]?\\d*\\.?\\d+",xv=kv+"%";function wv(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Cv=new RegExp("rgb"+wv(kv,kv,kv)),Ev=new RegExp("rgba"+wv(kv,kv,kv,kv)),Sv=new RegExp("hsl"+wv(kv,xv,xv)),Iv=new RegExp("hsla"+wv(kv,xv,xv,kv)),Tv=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Nv=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Bv=/^#([0-9a-fA-F]{6})$/,Pv=/^#([0-9a-fA-F]{8})$/;function Av(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Lv(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=Av(o,r,e+1/3),l=Av(o,r,e),a=Av(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*l)<<16|Math.round(255*a)<<8}function Rv(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Dv(e){return(parseFloat(e)%360+360)%360/360}function Mv(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ov(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Fv(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Bv.exec(e))?parseInt(t[1]+"ff",16)>>>0:sv&&void 0!==sv[e]?sv[e]:(t=Cv.exec(e))?(Rv(t[1])<<24|Rv(t[2])<<16|Rv(t[3])<<8|255)>>>0:(t=Ev.exec(e))?(Rv(t[1])<<24|Rv(t[2])<<16|Rv(t[3])<<8|Mv(t[4]))>>>0:(t=Tv.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Pv.exec(e))?parseInt(t[1],16)>>>0:(t=Nv.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Sv.exec(e))?(255|Lv(Dv(t[1]),Ov(t[2]),Ov(t[3])))>>>0:(t=Iv.exec(e))?(Lv(Dv(t[1]),Ov(t[2]),Ov(t[3]))|Mv(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var Zv=(e,t,n)=>{if(Qg.fun(e))return e;if(Qg.arr(e))return Zv({range:e,output:t,extrapolate:n});if(Qg.str(e.output[0]))return ov(e);let r=e,o=r.output,i=r.range||[0,1],l=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,l,a,s){let c=s?s(e):e;if(c<t){if("identity"===l)return c;"clamp"===l&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],s,l,a,r.map)}},jv=1.70158,zv=1.525*jv,Hv=jv+1,Vv=2*Math.PI/3,Wv=2*Math.PI/4.5,Uv=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,$v={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Hv*e*e*e-jv*e*e,easeOutBack:e=>1+Hv*Math.pow(e-1,3)+jv*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(zv+1)*e-zv)/2:(Math.pow(2*e-2,2)*((zv+1)*(2*e-2)+zv)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Vv),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Vv)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Wv)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Wv)/2+1,easeInBounce:e=>1-Uv(1-e),easeOutBounce:Uv,easeInOutBounce:e=>e<.5?(1-Uv(1-2*e))/2:(1+Uv(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},Gv=Symbol.for("FluidValue.get"),qv=Symbol.for("FluidValue.observers"),Kv=e=>Boolean(e&&e[Gv]),Yv=e=>e&&e[Gv]?e[Gv]():e,Xv=e=>e[qv]||null;function Qv(e,t){let n=e[qv];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var Jv=class{[Gv];[qv];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");eb(this,e)}},eb=(e,t)=>ob(e,Gv,t);function tb(e,t){if(e[Gv]){let n=e[qv];n||ob(e,qv,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function nb(e,t){let n=e[qv];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[qv]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var rb,ob=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ib=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,lb=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ab=new RegExp(`(${ib.source})(%|[a-z]+)`,"i"),sb=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cb=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ub=e=>{let[t,n]=db(e);if(!t||av())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&cb.test(n)?ub(n):n||e},db=e=>{let t=cb.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},pb=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,mb=e=>{rb||(rb=sv?new RegExp(`(${Object.keys(sv).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Yv(e).replace(cb,ub).replace(lb,Fv).replace(rb,Fv))),n=t.map((e=>e.match(ib).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Zv({...e,output:t})));return e=>{let n=!ab.test(t[0])&&t.find((e=>ab.test(e)))?.replace(ib,""),o=0;return t[0].replace(ib,(()=>`${r[o++](e)}${n||""}`)).replace(sb,pb)}},hb="react-spring: ",fb=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${hb}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},gb=fb(console.warn),vb=fb(console.warn);function bb(e){return Qg.str(e)&&("#"==e[0]||/\d/.test(e)||!av()&&cb.test(e)||e in(sv||{}))}new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var yb=av()?b.useEffect:b.useLayoutEffect,_b=()=>{let e=(0,b.useRef)(!1);return yb((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function kb(){let e=(0,b.useState)()[1],t=_b();return()=>{t.current&&e(Math.random())}}var xb=e=>(0,b.useEffect)(e,wb),wb=[];function Cb(e){let t=(0,b.useRef)();return(0,b.useEffect)((()=>{t.current=e})),t.current}var Eb=Symbol.for("Animated:node"),Sb=e=>e&&e[Eb],Ib=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Eb,t),Tb=e=>e&&e[Eb]&&e[Eb].getPayload(),Nb=class{payload;constructor(){Ib(this,this)}getPayload(){return this.payload||[]}},Bb=class extends Nb{constructor(e){super(),this._value=e,Qg.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Bb(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Qg.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,Qg.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Pb=class extends Bb{_string=null;_toString;constructor(e){super(0),this._toString=Zv({output:[e,e]})}static create(e){return new Pb(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(Qg.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Zv({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ab={dependencies:null},Lb=class extends Nb{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return tv(this.source,((n,r)=>{var o;(o=n)&&o[Eb]===o?t[r]=n.getValue(e):Kv(n)?t[r]=Yv(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ev(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return tv(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ab.dependencies&&Kv(e)&&Ab.dependencies.add(e);let t=Tb(e);t&&ev(t,(e=>this.add(e)))}},Rb=class extends Lb{constructor(e){super(e)}static create(e){return new Rb(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Db)),!0)}};function Db(e){return(bb(e)?Pb:Bb).create(e)}function Mb(e){let t=Sb(e);return t?t.constructor:Qg.arr(e)?Rb:bb(e)?Pb:Bb}var Ob=(e,t)=>{let n=!Qg.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,b.forwardRef)(((r,o)=>{let i=(0,b.useRef)(null),l=n&&(0,b.useCallback)((e=>{i.current=function(e,t){return e&&(Qg.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,s]=function(e,t){let n=new Set;return Ab.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Lb(e),Ab.dependencies=null,[e,n]}(r,t),c=kb(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Fb(u,s),p=(0,b.useRef)();yb((()=>(p.current=d,ev(s,(e=>tb(e,d))),()=>{p.current&&(ev(p.current.deps,(e=>nb(e,p.current))),Ag.cancel(p.current.update))}))),(0,b.useEffect)(u,[]),xb((()=>()=>{let e=p.current;ev(e.deps,(t=>nb(t,e)))}));let m=t.getComponentProps(a.getValue());return b.createElement(e,{...m,ref:l})}))},Fb=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Ag.write(this.update)}},Zb=Symbol.for("AnimatedComponent"),jb=e=>Qg.str(e)?e:e&&Qg.str(e.displayName)?e.displayName:Qg.fun(e)&&e.name||null;function zb(e,...t){return Qg.fun(e)?e(...t):e}var Hb=(e,t)=>!0===e||!!(t&&e&&(Qg.fun(e)?e(t):nv(e).includes(t))),Vb=(e,t)=>Qg.obj(e)?t&&e[t]:e,Wb=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ub=e=>e,$b=(e,t=Ub)=>{let n=Gb;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);Qg.und(n)||(r[o]=n)}return r},Gb=["config","onProps","onStart","onChange","onPause","onResume","onRest"],qb={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Kb(e){let t=function(e){let t={},n=0;if(tv(e,((e,r)=>{qb[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return tv(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function Yb(e){return e=Yv(e),Qg.arr(e)?e.map(Yb):bb(e)?Yg.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Xb(e){return Qg.fun(e)||Qg.arr(e)&&Qg.obj(e[0])}var Qb={tension:170,friction:26,mass:1,damping:1,easing:$v.linear,clamp:!1};function Jb(e,t){if(Qg.und(t.decay)){let n=!Qg.und(t.tension)||!Qg.und(t.friction);(n||!Qg.und(t.frequency)||!Qg.und(t.damping)||!Qg.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var ey=[];function ty(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((l,a)=>{let s,c,u=Hb(n.cancel??r?.cancel,t);if(u)m();else{Qg.und(n.pause)||(o.paused=Hb(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||Hb(e,t)),s=zb(n.delay||0,t),e?(o.resumeQueue.add(p),i.pause()):(i.resume(),p())}function d(){o.resumeQueue.add(p),o.timeouts.delete(c),c.cancel(),s=c.time-Ag.now()}function p(){s>0&&!Yg.skipAnimation?(o.delayed=!0,c=Ag.setTimeout(m,s),o.pauseQueue.add(d),o.timeouts.add(c)):m()}function m(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},l)}catch(e){a(e)}}}))}var ny=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?iy(e.get()):t.every((e=>e.noop))?ry(e.get()):oy(e.get(),t.every((e=>e.finished))),ry=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),oy=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),iy=e=>({value:e,cancelled:!0,finished:!1});function ly(e,t,n,r){let{callId:o,parentId:i,onRest:l}=t,{asyncTo:a,promise:s}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,p=$b(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),h=e=>{let t=o<=(n.cancelId||0)&&iy(r)||o!==n.asyncId&&oy(r,!1);if(t)throw e.result=t,u(e),e},f=(e,t)=>{let i=new sy,l=new cy;return(async()=>{if(Yg.skipAnimation)throw ay(n),l.result=oy(r,!1),u(l),l;h(i);let a=Qg.obj(e)?{...e}:{...t,to:e};a.parentId=o,tv(p,((e,t)=>{Qg.und(a[t])&&(a[t]=e)}));let s=await r.start(a);return h(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(Yg.skipAnimation)return ay(n),oy(r,!1);try{let t;t=Qg.arr(e)?(async e=>{for(let t of e)await f(t)})(e):Promise.resolve(e(f,r.stop.bind(r))),await Promise.all([t.then(c),m]),d=oy(r.get(),!0,!1)}catch(e){if(e instanceof sy)d=e.result;else{if(!(e instanceof cy))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?s:void 0)}return Qg.fun(l)&&Ag.batchedUpdates((()=>{l(d,r,r.item)})),d})():s}function ay(e,t){rv(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var sy=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},cy=class extends Error{result;constructor(){super("SkipAnimationSignal")}},uy=e=>e instanceof py,dy=1,py=class extends Jv{id=dy++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Sb(this);return e&&e.getValue()}to(...e){return Yg.to(this,e)}interpolate(...e){return gb(`${hb}The "interpolate" function is deprecated in v9 (use "to" instead)`),Yg.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Qv(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||gv.sort(this),Qv(this,{type:"priority",parent:this,priority:e})}},my=Symbol.for("SpringPhase"),hy=e=>(1&e[my])>0,fy=e=>(2&e[my])>0,gy=e=>(4&e[my])>0,vy=(e,t)=>t?e[my]|=3:e[my]&=-3,by=(e,t)=>t?e[my]|=4:e[my]&=-5,yy=class extends py{key;animation=new class{changed=!1;values=ey;toValues=null;fromValues=ey;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Qb)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!Qg.und(e)||!Qg.und(t)){let n=Qg.obj(e)?{...e}:{...t,from:e};Qg.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(fy(this)||this._state.asyncTo)||gy(this)}get goal(){return Yv(this.animation.to)}get velocity(){let e=Sb(this);return e instanceof Bb?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return hy(this)}get isAnimating(){return fy(this)}get isPaused(){return gy(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,l=Tb(r.to);!l&&Kv(r.to)&&(i=nv(Yv(r.to))),r.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==Pb?1:l?l[s].lastPosition:i[s],u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,i=r.fromValues[s],l=null!=a.v0?a.v0:a.v0=Qg.arr(o.velocity)?o.velocity[s]:o.velocity,p=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(Qg.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+l/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<=p,t=l*r}else{t=null==a.lastVelocity?l:a.lastVelocity;let n,r=o.restVelocity||p/10,s=o.clamp?0:o.bounce,m=!Qg.und(s),h=i==c?a.v0>0:i<c,f=!1,g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(n=Math.abs(t)>r,n||(u=Math.abs(c-d)<=p,!u));++e)m&&(f=d==c||d>c==h,f&&(t=-t*s,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,n=a.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}l&&!l[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));let a=Sb(this),s=a.getValue();if(t){let e=Yv(r.to);s===e&&!n||o.decay?n&&o.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return Ag.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(fy(this)){let{to:e,config:t}=this.animation;Ag.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Qg.und(e)?(n=this.queue||[],this.queue=[]):n=[Qg.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>ny(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),ay(this._state,e&&this._lastCallId),Ag.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=Qg.obj(n)?n[t]:n,(null==n||Xb(n))&&(n=void 0),r=Qg.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return hy(this)||(e.reverse&&([n,r]=[r,n]),r=Yv(r),Qg.und(r)?Sb(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,$b(e,((e,t)=>/^on/.test(t)?Vb(e,n):e))),Sy(this,e,"onProps"),Iy(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return ty(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{gy(this)||(by(this,!0),lv(i.pauseQueue),Iy(this,"onPause",oy(this,_y(this,this.animation.to)),this))},resume:()=>{gy(this)&&(by(this,!1),fy(this)&&this._resume(),lv(i.resumeQueue),Iy(this,"onResume",oy(this,_y(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=ky(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(iy(this));let r=!Qg.und(e.to),o=!Qg.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(iy(this));this._lastToId=t.callId}let{key:i,defaultProps:l,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;o&&!r&&(!t.default||Qg.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!Jg(d,c);p&&(a.from=d),d=Yv(d);let m=!Jg(u,s);m&&this._focus(u);let h=Xb(t.to),{config:f}=a,{decay:g,velocity:v}=f;(r||o)&&(f.velocity=0),t.config&&!h&&function(e,t,n){n&&(Jb(n={...n},t),t={...n,...t}),Jb(e,t),Object.assign(e,t);for(let t in Qb)null==e[t]&&(e[t]=Qb[t]);let{mass:r,frequency:o,damping:i}=e;Qg.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(f,zb(t.config,i),t.config!==l.config?zb(l.config,i):void 0);let b=Sb(this);if(!b||Qg.und(u))return n(oy(this,!0));let y=Qg.und(t.reset)?o&&!t.default:!Qg.und(d)&&Hb(t.reset,i),_=y?d:this.get(),k=Yb(u),x=Qg.num(k)||Qg.arr(k)||bb(k),w=!h&&(!x||Hb(l.immediate||t.immediate,i));if(m){let e=Mb(u);if(e!==b.constructor){if(!w)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(k)}}let C=b.constructor,E=Kv(u),S=!1;if(!E){let e=y||!hy(this)&&p;(m||e)&&(S=Jg(Yb(_),k),E=!S),(!Jg(a.immediate,w)&&!w||!Jg(f.decay,g)||!Jg(f.velocity,v))&&(E=!0)}if(S&&fy(this)&&(a.changed&&!y?E=!0:E||this._stop(s)),!h&&((E||Kv(s))&&(a.values=b.getPayload(),a.toValues=Kv(u)?null:C==Pb?[1]:nv(k)),a.immediate!=w&&(a.immediate=w,!w&&!y&&this._set(s)),E)){let{onRest:e}=a;ev(Ey,(e=>Sy(this,t,e)));let r=oy(this,_y(this,s));lv(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&Ag.batchedUpdates((()=>{a.changed=!y,e?.(r,this),y?zb(l.onRest,r):a.onStart?.(r,this)}))}y&&this._set(_),h?n(ly(t.to,t,this._state,this)):E?this._start():fy(this)&&!m?this._pendingCalls.add(n):n(ry(_))}_focus(e){let t=this.animation;e!==t.to&&(Xv(this)&&this._detach(),t.to=e,Xv(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Kv(t)&&(tb(t,this),uy(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Kv(e)&&nb(e,this)}_set(e,t=!0){let n=Yv(e);if(!Qg.und(n)){let e=Sb(this);if(!e||!Jg(n,e.getValue())){let r=Mb(n);e&&e.constructor==r?e.setValue(n):Ib(this,r.create(n)),e&&Ag.batchedUpdates((()=>{this._onChange(n,t)}))}}return Sb(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Iy(this,"onStart",oy(this,_y(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),zb(this.animation.onChange,e,this)),zb(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Sb(this).reset(Yv(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),fy(this)||(vy(this,!0),gy(this)||this._resume())}_resume(){Yg.skipAnimation?this.finish():gv.start(this)}_stop(e,t){if(fy(this)){vy(this,!1);let n=this.animation;ev(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Qv(this,{type:"idle",parent:this});let r=t?iy(this.get()):oy(this.get(),_y(this,e??n.to));lv(this._pendingCalls,r),n.changed&&(n.changed=!1,Iy(this,"onRest",r,this))}}};function _y(e,t){let n=Yb(t);return Jg(Yb(e.get()),n)}function ky(e,t=e.loop,n=e.to){let r=zb(t);if(r){let o=!0!==r&&Kb(r),i=(o||e).reverse,l=!o||o.reset;return xy({...e,loop:t,default:!1,pause:void 0,to:!i||Xb(n)?n:void 0,from:l?e.from:void 0,reset:l,...o})}}function xy(e){let{to:t,from:n}=e=Kb(e),r=new Set;return Qg.obj(t)&&Cy(t,r),Qg.obj(n)&&Cy(n,r),e.keys=r.size?Array.from(r):null,e}function wy(e){let t=xy(e);return Qg.und(t.default)&&(t.default=$b(t)),t}function Cy(e,t){tv(e,((e,n)=>null!=e&&t.add(n)))}var Ey=["onStart","onRest","onChange","onPause","onResume"];function Sy(e,t,n){e.animation[n]=t[n]!==Wb(t,n)?Vb(t[n],e.key):void 0}function Iy(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Ty=["onStart","onChange","onRest"],Ny=1,By=class{id=Ny++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];Qg.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(xy(e)),this}start(e){let{queue:t}=this;return e?t=nv(e).map(xy):this.queue=[],this._flush?this._flush(this,t):(Oy(this,t),Py(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;ev(nv(t),(t=>n[t].stop(!!e)))}else ay(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Qg.und(e))this.start({pause:!0});else{let t=this.springs;ev(nv(e),(e=>t[e].pause()))}return this}resume(e){if(Qg.und(e))this.start({pause:!1});else{let t=this.springs;ev(nv(e),(e=>t[e].resume()))}return this}each(e){tv(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,rv(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,l=o||i&&n.size?this.get():null;o&&t.size&&rv(t,(([e,t])=>{t.value=l,e(t,this,this._item)})),i&&(this._started=!1,rv(n,(([e,t])=>{t.value=l,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}Ag.onFrame(this._onFrame)}};function Py(e,t){return Promise.all(t.map((t=>Ay(e,t)))).then((t=>ny(e,t)))}async function Ay(e,t,n){let{keys:r,to:o,from:i,loop:l,onRest:a,onResolve:s}=t,c=Qg.obj(t.default)&&t.default;l&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=Qg.arr(o)||Qg.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):ev(Ty,(n=>{let r=t[n];if(Qg.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,lv(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Wb(t,"cancel");(u||m&&d.asyncId)&&p.push(ty(++e._lastAsyncId,{props:t,state:d,actions:{pause:Xg,resume:Xg,start(t,n){m?(ay(d,e._lastAsyncId),n(iy(e))):(t.onRest=a,n(ly(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let h=ny(e,await Promise.all(p));if(l&&h.finished&&(!n||!h.noop)){let n=ky(t,l,o);if(n)return Oy(e,[n]),Ay(e,n,!0)}return s&&Ag.batchedUpdates((()=>s(h,e,e.item))),h}function Ly(e,t){let n={...e.springs};return t&&ev(nv(t),(e=>{Qg.und(e.keys)&&(e=xy(e)),Qg.obj(e.to)||(e={...e,to:void 0}),My(n,e,(e=>Dy(e)))})),Ry(e,n),n}function Ry(e,t){tv(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,tb(t,e))}))}function Dy(e,t){let n=new yy;return n.key=e,t&&tb(n,t),n}function My(e,t,n){t.keys&&ev(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function Oy(e,t){ev(t,(t=>{My(e.springs,t,(t=>Dy(t,e)))}))}var Fy=({children:e,...t})=>{let n=(0,b.useContext)(Zy),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,b.useState)((()=>({inputs:t,result:e()}))),r=(0,b.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.inputs))||(i={inputs:t,result:e()}):i=n,(0,b.useEffect)((()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=Zy;return b.createElement(i,{value:t},e)},Zy=function(e,t){return Object.assign(e,b.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(Fy);Fy.Provider=Zy.Provider,Fy.Consumer=Zy.Consumer;var jy=()=>{let e=[],t=function(t){vb(`${hb}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let r=[];return ev(e,((e,o)=>{if(Qg.und(t))r.push(e.start());else{let i=n(t,e,o);i&&r.push(e.start(i))}})),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return ev(e,(e=>e.pause(...arguments))),this},t.resume=function(){return ev(e,(e=>e.resume(...arguments))),this},t.set=function(t){ev(e,((e,n)=>{let r=Qg.fun(t)?t(n,e):t;r&&e.set(r)}))},t.start=function(t){let n=[];return ev(e,((e,r)=>{if(Qg.und(t))n.push(e.start());else{let o=this._getProps(t,e,r);o&&n.push(e.start(o))}})),n},t.stop=function(){return ev(e,(e=>e.stop(...arguments))),this},t.update=function(t){return ev(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return Qg.fun(e)?e(n,t):e};return t._getProps=n,t};function zy(e,t){let n=Qg.fun(e),[[r],o]=function(e,t,n){let r=Qg.fun(t)&&t;r&&!n&&(n=[]);let o=(0,b.useMemo)((()=>r||3==arguments.length?jy():void 0),[]),i=(0,b.useRef)(0),l=kb(),a=(0,b.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=Ly(e,t);return i.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Py(e,t):new Promise((r=>{Ry(e,n),a.queue.push((()=>{r(Py(e,t))})),l()}))}})),[]),s=(0,b.useRef)([...a.ctrls]),c=[],u=Cb(e)||0;function d(e,n){for(let o=e;o<n;o++){let e=s.current[o]||(s.current[o]=new By(null,a.flush)),n=r?r(o,e):t[o];n&&(c[o]=wy(n))}}(0,b.useMemo)((()=>{ev(s.current.slice(e,u),(e=>{(function(e,t){e.ref?.delete(e),t?.delete(e)})(e,o),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,b.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>Ly(e,c[t]))),m=(0,b.useContext)(Fy),h=Cb(m),f=m!==h&&function(e){for(let t in e)return!0;return!1}(m);yb((()=>{i.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],ev(e,(e=>e()))),ev(s.current,((e,t)=>{o?.add(e),f&&e.start({default:m});let n=c[t];n&&(function(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),xb((()=>()=>{ev(a.ctrls,(e=>e.stop(!0)))}));let g=p.map((e=>({...e})));return o?[g,o]:g}(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,o]:r}var Hy=class extends py{constructor(e,t){super(),this.source=e,this.calc=Zv(...t);let n=this._get(),r=Mb(n);Ib(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();Jg(t,this.get())||(Sb(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Wy(this._active)&&Uy(this)}_get(){let e=Qg.arr(this.source)?this.source.map(Yv):nv(Yv(this.source));return this.calc(...e)}_start(){this.idle&&!Wy(this._active)&&(this.idle=!1,ev(Tb(this),(e=>{e.done=!1})),Yg.skipAnimation?(Ag.batchedUpdates((()=>this.advance())),Uy(this)):gv.start(this))}_attach(){let e=1;ev(nv(this.source),(t=>{Kv(t)&&tb(t,this),uy(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){ev(nv(this.source),(e=>{Kv(e)&&nb(e,this)})),this._active.clear(),Uy(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=nv(this.source).reduce(((e,t)=>Math.max(e,(uy(t)?t.priority:0)+1)),0))}};function Vy(e){return!1!==e.idle}function Wy(e){return!e.size||Array.from(e).every(Vy)}function Uy(e){e.idle||(e.idle=!0,ev(Tb(e),(e=>{e.done=!0})),Qv(e,{type:"idle",parent:e}))}Yg.assign({createStringInterpolator:mb,to:(e,t)=>new Hy(e,t)}),gv.advance;var $y=/^--/;function Gy(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||$y.test(e)||Ky.hasOwnProperty(e)&&Ky[e]?(""+t).trim():t+"px"}var qy={},Ky={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yy=["Webkit","Ms","Moz","O"];Ky=Object.keys(Ky).reduce(((e,t)=>(Yy.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ky);var Xy=/^(matrix|translate|scale|rotate|skew)/,Qy=/^(translate)/,Jy=/^(rotate|skew)/,e_=(e,t)=>Qg.num(e)&&0!==e?e+t:e,t_=(e,t)=>Qg.arr(e)?e.every((e=>t_(e,t))):Qg.num(e)?e===t:parseFloat(e)===t,n_=class extends Lb{constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>e_(e,"px"))).join(",")})`,t_(e,0)]))),tv(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(Xy.test(t)){if(delete r[t],Qg.und(e))return;let n=Qy.test(t)?"px":Jy.test(t)?"deg":"";o.push(nv(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${e_(o,n)})`,t_(o,0)]:e=>[`${t}(${e.map((e=>e_(e,n))).join(",")})`,t_(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new r_(o,i)),super(r)}},r_=class extends Jv{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return ev(this.inputs,((n,r)=>{let o=Yv(n[0]),[i,l]=this.transforms[r](Qg.arr(o)?o:n.map(Yv));e+=" "+i,t=t&&l})),t?"none":e}observerAdded(e){1==e&&ev(this.inputs,(e=>ev(e,(e=>Kv(e)&&tb(e,this)))))}observerRemoved(e){0==e&&ev(this.inputs,(e=>ev(e,(e=>Kv(e)&&nb(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Qv(this,e)}};Yg.assign({batchedUpdates:y.unstable_batchedUpdates,createStringInterpolator:mb,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var o_=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Lb(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=jb(e)||"Anonymous";return(e=Qg.str(e)?i[e]||(i[e]=Ob(e,o)):e[Zb]||(e[Zb]=Ob(e,o))).displayName=`Animated(${t})`,e};return tv(e,((t,n)=>{Qg.arr(e)&&(n=jb(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:l,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:qy[t]||(qy[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=Gy(t,r[t]);$y.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==l&&(e.scrollLeft=l),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new n_(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),i_=(o_.animated,n(2734)),l_=n(16573);const a_=e=>e+1,s_=e=>({top:e.offsetTop,left:e.offsetLeft}),c_=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:r,triggerAnimationOnChange:o}=e;const i=(0,b.useRef)(),l=(0,i_.Z)()||!r,[a,s]=(0,b.useReducer)(a_,0),[c,u]=(0,b.useReducer)(a_,0),[d,p]=(0,b.useState)({x:0,y:0}),m=(0,b.useMemo)((()=>i.current?s_(i.current):null),[o]),h=(0,b.useMemo)((()=>{if(!n||!i.current)return()=>{};const e=(0,l_.Z)(i.current);if(!e)return()=>{};const t=i.current.getBoundingClientRect();return()=>{const n=i.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[o,n]);return(0,b.useLayoutEffect)((()=>{a&&u()}),[a]),(0,b.useLayoutEffect)((()=>{if(!m)return;if(l)return void h();i.current.style.transform=void 0;const e=s_(i.current);s(),p({x:Math.round(m.left-e.left),y:Math.round(m.top-e.top)})}),[o]),zy({from:{x:d.x,y:d.y},to:{x:0,y:0},reset:a!==c,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:function(e){let{value:n}=e;if(!i.current)return;let{x:r,y:o}=n;r=Math.round(r),o=Math.round(o);const l=0===r&&0===o;i.current.style.transformOrigin="center center",i.current.style.transform=l?void 0:`translate3d(${r}px,${o}px,0)`,i.current.style.zIndex=t?"1":"",h()}}),i};var u_=n(56247),d_=n(25542),p_=n(25936),m_=n(96293);const h_=".block-editor-block-list__block",f_=".block-list-appender",g_=".block-editor-button-block-appender";function v_(e,t){return t.closest([h_,f_,g_].join(","))===e}function b_(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(h_);return t?t.id.slice("block-".length):void 0}function y_(e){const t=(0,b.useRef)(),n=function(e){return(0,un.Z)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:r,isBlockSelected:o}=t(pd);if(o(e)&&"edit"===r())return n()}),[e])}(e),{isBlockSelected:r,isMultiSelecting:o}=(0,un.Z)(pd);return(0,b.useEffect)((()=>{if(!r(e)||o())return;if(null==n)return;if(!t.current)return;const{ownerDocument:i}=t.current;if(v_(t.current,i.activeElement))return;const l=u_.focus.tabbable.find(t.current).filter((e=>(0,d_.Z)(e))),a=-1===n,s=l[a?l.length-1:0]||t.current;if(v_(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=u_.focus.tabbable.findNext(t.current);if(e&&v_(t.current,e)&&(0,p_.Z)(e))return void e.focus()}(0,m_.Z)(s,a)}else t.current.focus()}),[n,e]),t}var __=n(23889);function k_(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function x_(){const e=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return t().outlineMode}),[]);return(0,__.Z)((t=>{if(e)return t.addEventListener("mouseout",k_),t.addEventListener("mouseover",k_),()=>{t.removeEventListener("mouseout",k_),t.removeEventListener("mouseover",k_),t.classList.remove("is-hovered")}}),[e])}function w_(e){return(0,un.Z)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:r,isBlockSelected:o,isBlockMultiSelected:i,getBlockName:l,getSettings:a,hasSelectedInnerBlock:s,isTyping:c,__unstableIsFullySelected:u,__unstableSelectionHasUnmergeableBlock:d}=t(pd),{outlineMode:p}=a(),m=n(e),h=o(e),f=l(e),g=s(e,!0),v=i(e);return C()({"is-selected":h,"is-highlighted":r(e),"is-multi-selected":v,"is-partially-selected":v&&!u()&&!d(),"is-reusable":Qn(qn(f)),"is-dragging":m,"has-child-selected":g,"remove-outline":h&&p&&c()})}),[e])}function C_(e){return(0,un.Z)((t=>{const n=t(pd).getBlockName(e),r=qn(n);if((null==r?void 0:r.apiVersion)>1)return Go(n)}),[e])}function E_(e){return(0,un.Z)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(pd),o=r(e);if(null==o||!o.className)return;const i=qn(n(e));return(null==i?void 0:i.apiVersion)>1?o.className:void 0}),[e])}function S_(e){return(0,un.Z)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:r,getBlockName:o,getBlockRootClientId:i,isBlockSelected:l}=t(pd);if(!l(e))return;const a=n();return a?C()("is-block-moving-mode",{"can-insert-moving-block":r(o(a),i(e))}):void 0}),[e])}function I_(e){const{isBlockSelected:t}=(0,un.Z)(pd),{selectBlock:n,selectionChange:r}=(0,dn.Z)(pd);return(0,__.Z)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):v_(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}var T_=n(50899);function N_(e){const t=(0,un.Z)((t=>t(pd).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:r}=(0,un.Z)(pd),{insertDefaultBlock:o,removeBlock:i}=(0,dn.Z)(pd);return(0,__.Z)((l=>{if(t)return l.addEventListener("keydown",a),l.addEventListener("dragstart",s),()=>{l.removeEventListener("keydown",a),l.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==T_.ENTER&&a!==T_.BACKSPACE&&a!==T_.DELETE||s!==l||(0,d_.Z)(s)||(t.preventDefault(),a===T_.ENTER?o({},n(e),r(e)+1):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function B_(e){const{isNavigationMode:t,isBlockSelected:n}=(0,un.Z)(pd),{setNavigationMode:r,selectBlock:o}=(0,dn.Z)(pd);return(0,__.Z)((i=>{function l(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",l),()=>{i.addEventListener("mousedown",l)}}),[e,t,n,r])}const P_=(0,b.createContext)({refs:new Map,callbacks:new Map});function A_(e){let{children:t}=e;const n=(0,b.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,b.createElement)(P_.Provider,{value:n},t)}function L_(e){const{refs:t,callbacks:n}=(0,b.useContext)(P_),r=(0,b.useRef)();return(0,b.useLayoutEffect)((()=>(t.set(r,e),()=>{t.delete(r)})),[e]),(0,__.Z)((t=>{r.current=t,n.forEach(((n,r)=>{e===n&&r(t)}))}),[e])}function R_(e){const{refs:t}=(0,b.useContext)(P_),n=(0,b.useRef)();return n.current=e,(0,b.useMemo)((()=>({get current(){let e=null;for(const[r,o]of t.entries())o===n.current&&r.current&&(e=r.current);return e}})),[])}function D_(e){const{callbacks:t}=(0,b.useContext)(P_),n=R_(e),[r,o]=(0,b.useState)(null);return(0,b.useLayoutEffect)((()=>{if(e)return t.set(o,e),()=>{t.delete(o)}}),[e]),n.current||r}function M_(){const e=(0,b.useContext)(XI);return(0,__.Z)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}const O_=200;function F_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:r,wrapperProps:o={},isAligned:i}=(0,b.useContext)(Z_),{index:l,mode:a,name:s,blockApiVersion:c,blockTitle:u,isPartOfSelection:d,adjustScrolling:p,enableAnimation:m}=(0,un.Z)((e=>{const{getBlockAttributes:t,getBlockIndex:r,getBlockMode:o,getBlockName:i,isTyping:l,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(pd),{getActiveBlockVariation:p}=e(Bo),m=s(n),h=c(n)||u(n),f=i(n),g=qn(f),v=p(f,t(n));return{index:r(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:(null==v?void 0:v.title)||(null==g?void 0:g.title),isPartOfSelection:m||h,adjustScrolling:m||d(n),enableAnimation:!l()&&a()<=O_}}),[n]),h=function(e){return(0,un.Z)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(pd);return n(e)}),[e])}(n),f=(0,O.sprintf)((0,O.__)("Block: %s"),u),g="html"!==a||t?"":"-visual",v=(0,np.Z)([e.ref,y_(n),L_(n),I_(n),N_(n),B_(n),x_(),M_(),c_({isSelected:d,adjustScrolling:p,enableAnimation:m,triggerAnimationOnChange:l}),(0,Bg.Z)({isDisabled:!h})]),y=vd();return c<2&&n===y.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...o,...e,ref:v,id:`block-${n}${g}`,role:"document","aria-label":f,"data-block":n,"data-type":s,"data-title":u,className:C()(C()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":h}),r,e.className,o.className,w_(n),C_(n),E_(n),S_(n)),style:{...o.style,...e.style}}}F_.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:n}=Ko;return(0,tr.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,n)};const Z_=(0,b.createContext)();function j_(e){let{children:t,isHtml:n,...r}=e;return(0,b.createElement)("div",F_(r,{__unstableIsHtml:n}),t)}const z_=(0,ig.Z)(((e,t)=>{let{clientId:n,rootClientId:r}=t;const{isBlockSelected:o,getBlockMode:i,isSelectionEnabled:l,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(pd),d=s(n),p=o(n),m=a(r),h=c(n,r),f=u(n,r),{name:g,attributes:v,isValid:b}=d||{};return{mode:i(n),isSelectionEnabled:l(),isLocked:!!m,canRemove:h,canMove:f,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),H_=(0,lg.Z)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:l,toggleSelection:a,__unstableMarkLastChangeAsPersistent:s,moveBlocksToPosition:c,removeBlock:u}=e(pd);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(pd),i=o(),{clientId:l}=t,a=i.length?i:[l];r(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:l}=n.select(pd),a=l(r);o(e,a+1,i)},onMerge(e){const{clientId:r,rootClientId:l}=t,{getPreviousBlockClientId:a,getNextBlockClientId:s,getBlock:d,getBlockAttributes:p,getBlockName:m,getBlockOrder:h,getBlockIndex:f,getBlockRootClientId:g,canInsertBlockType:v}=n.select(pd);function b(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=g(e),i=h(e),[l]=i;if(1===i.length&&fr(d(l)))u(e);else{if(v(m(l),r))c([l],e,r,f(e));else{const i=pr(d(l),Gn());i&&i.length&&n.batch((()=>{o(i,f(e),r,t),u(l,!1)}))}!h(e).length&&fr(d(e))&&u(e,!1)}}if(e){if(l){const e=s(l);if(e){if(m(l)!==m(e))return void i(l,e);{const t=p(l),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(h(e),e,l),u(e,!1)}))}}}const e=s(r);if(!e)return;h(e).length?b(e,!1):i(r,e)}else{const e=a(r);if(e)i(e,r);else if(l){const e=a(l);if(e&&m(l)===m(e)){const t=p(l),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(h(l),l,e),u(l,!1)}))}b(l)}}},onReplace(e,n,r){e.length&&!gr(e[e.length-1])&&s(),l([t.clientId],e,n,r)},toggleSelection(e){a(e)}}})),V_=(0,B.Z)(ag.Z,z_,H_,(0,sg.Z)((e=>{let{block:t}=e;return!!t})),og("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:r,isLocked:o,canRemove:i,clientId:l,isSelected:a,isSelectionEnabled:s,className:c,__unstableLayoutClassNames:u,name:d,isValid:p,attributes:m,wrapperProps:h,setAttributes:f,onReplace:g,onInsertBlocksAfter:v,onMerge:y,toggleSelection:_}=e;const{themeSupportsLayout:k,hasContentLockedParent:x,isContentBlock:w,isContentLocking:E,isTemporarilyEditingAsBlocks:S}=(0,un.Z)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:r,__unstableGetTemporarilyEditingAsBlocks:o}=e(pd),i=!!n(l);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(Bo).__experimentalHasContentRoleAttribute(d),hasContentLockedParent:i,isContentLocking:"contentOnly"===r(l)&&!i,isTemporarilyEditingAsBlocks:o()===l}}),[d,l]),{removeBlock:I}=(0,dn.Z)(pd),T=(0,b.useCallback)((()=>I(l)),[l]),N=Dh()||{};let B=(0,b.createElement)(fg,{name:d,isSelected:a,attributes:m,setAttributes:f,insertBlocksAfter:o?void 0:v,onReplace:i?g:void 0,onRemove:i?T:void 0,mergeBlocks:i?y:void 0,clientId:l,isSelectionEnabled:s,toggleSelection:_,__unstableLayoutClassNames:u,__unstableParentLayout:Object.keys(N).length?N:void 0});const P=qn(d);x&&!w&&(h={...h,tabIndex:-1}),null!=P&&P.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=C()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(h,P.getEditWrapperProps(m)));const A=h&&!!h["data-align"]&&!k;let L;if(A&&(B=(0,b.createElement)("div",{className:"wp-block","data-align":h["data-align"]},B)),p)L="html"===r?(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{style:{display:"none"}},B),(0,b.createElement)(j_,{isHtml:!0},(0,b.createElement)(Ng,{clientId:l}))):(null==P?void 0:P.apiVersion)>1?B:(0,b.createElement)(j_,h,B);else{const e=n?$o(n):Xo(P,m);L=(0,b.createElement)(j_,{className:"has-warning"},(0,b.createElement)(wg,{clientId:l}),(0,b.createElement)(Wo.Z,null,(0,cg.Z)(e)))}const{"data-align":R,...D}=null!==(t=h)&&void 0!==t?t:{},M={clientId:l,className:C()({"is-content-locked":E,"is-content-locked-temporarily-editing-as-blocks":S,"is-content-block":x&&w},R&&k&&`align${R}`,c),wrapperProps:D,isAligned:A},O=(0,b.useMemo)((()=>M),Object.values(M));return(0,b.createElement)(Z_.Provider,{value:O},(0,b.createElement)(Ig,{fallback:(0,b.createElement)(j_,{className:"has-warning"},(0,b.createElement)(Eg,null))},L))}));var W_=n(82963),U_=n(46583),$_=n(77460),G_=n(97941),q_=n(28943);const K_=function(e){const{children:t}=e;return(0,b.createElement)("div",{className:"components-tip"},(0,b.createElement)(Gm.Z,{icon:q_.Z}),(0,b.createElement)("p",null,t))},Y_=[(0,G_.Z)((0,O.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,b.createElement)("kbd",null)}),(0,G_.Z)((0,O.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,b.createElement)("kbd",null)}),(0,G_.Z)((0,O.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,b.createElement)("kbd",null)}),(0,O.__)("Drag files into the editor to automatically insert media blocks."),(0,O.__)("Change a block's type by pressing the block icon on the toolbar.")],X_=function(){const[e]=(0,b.useState)(Math.floor(Math.random()*Y_.length));return(0,b.createElement)(K_,null,Y_[e])};var Q_=n(83158),J_=n(74193),ek=n(50418);const tk=(0,b.memo)((function(e){var t;let{icon:n,showColors:r=!1,className:o,context:i}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:ek.Z});const l=(0,b.createElement)(Ip.Z,{icon:n&&n.src?n.src:n,context:i}),a=r?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,b.createElement)("span",{style:a,className:C()("block-editor-block-icon",o,{"has-colors":r})},l)})),nk=function(e){let{title:t,icon:n,description:r,blockType:o,className:i}=e;o&&((0,j.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:r}=o));const{parentNavBlockClientId:l}=(0,un.Z)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(pd);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,dn.Z)(pd);return(0,b.createElement)("div",{className:C()("block-editor-block-card",i)},l&&(0,b.createElement)(ia.ZP,{onClick:()=>a(l),label:(0,O.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,O.isRTL)()?Q_.Z:J_.Z,isSmall:!0}),(0,b.createElement)(tk,{icon:n,showColors:!0}),(0,b.createElement)("div",{className:"block-editor-block-card__content"},(0,b.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,b.createElement)("span",{className:"block-editor-block-card__description"},r)))};var rk=n(30285),ok=n(3563),ik=n(7673);const lk=(0,na.o)((e=>(0,rk.Z)((t=>{let{useSubRegistry:n=!0,registry:r,...o}=t;if(!n)return(0,b.createElement)(e,(0,ta.Z)({registry:r},o));const[i,l]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=(0,ok.p)({},r);e.registerStore(sd,dd),l(e)}),[r]),i?(0,b.createElement)(ik.ZP,{value:i},(0,b.createElement)(e,(0,ta.Z)({registry:i},o))):null}))),"withRegistryProvider"),ak=()=>{};function sk(e){let{clientId:t=null,value:n,selection:r,onChange:o=ak,onInput:i=ak}=e;const l=(0,Jf.Z)(),{resetBlocks:a,resetSelection:s,replaceInnerBlocks:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=l.dispatch(pd),{getBlockName:p,getBlocks:m}=l.select(pd),h=(0,un.Z)((e=>!t||e(pd).areInnerBlocksControlled(t)),[t]),f=(0,b.useRef)({incoming:null,outgoing:[]}),g=(0,b.useRef)(!1),v=()=>{n&&(d(),t?l.batch((()=>{u(t,!0);const e=n.map((e=>ir(e)));g.current&&(f.current.incoming=e),d(),c(t,e)})):(g.current&&(f.current.incoming=n),a(n)))},y=(0,b.useRef)(i),_=(0,b.useRef)(o);(0,b.useEffect)((()=>{y.current=i,_.current=o}),[i,o]),(0,b.useEffect)((()=>{f.current.outgoing.includes(n)?f.current.outgoing[f.current.outgoing.length-1]===n&&(f.current.outgoing=[]):m(t)!==n&&(f.current.outgoing=[],v(),r&&s(r.selectionStart,r.selectionEnd,r.initialPosition))}),[n,t]),(0,b.useEffect)((()=>{h||(f.current.outgoing=[],v())}),[h]),(0,b.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:r,isLastBlockChangePersistent:o,__unstableIsLastBlockChangeIgnored:i,areInnerBlocksControlled:a}=l.select(pd);let s=m(t),c=o(),u=!1;g.current=!0;const d=l.subscribe((()=>{if(null!==t&&null===p(t))return;if(t&&!a(t))return;const l=o(),d=m(t),h=d!==s;if(s=d,h&&(f.current.incoming||i()))return f.current.incoming=null,void(c=l);(h||u&&!h&&l&&!c)&&(c=l,f.current.outgoing.push(s),(c?_.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:r()}})),u=h}));return()=>{g.current=!1,d()}}),[l,t])}const ck=lk((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=ud((0,dn.Z)(pd));return(0,b.useEffect)((()=>{o({...n,__internalIsInitialized:!0},r)}),[n]),sk(e),(0,b.createElement)(A_,null,t)})),uk=e=>(0,b.createElement)(ck,(0,ta.Z)({},e,{stripExperimentalSettings:!0}),e.children),dk={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},pk=(0,b.createContext)(!1),{Consumer:mk,Provider:hk}=pk;function fk(e){let{className:t,children:n,isDisabled:r=!0,...o}=e;const i=(0,zd.I)();return(0,b.createElement)(hk,{value:r},(0,b.createElement)("div",(0,ta.Z)({inert:r?"true":void 0,className:r?i(dk,t,"components-disabled"):void 0},o),n))}fk.Context=pk,fk.Consumer=mk;const gk=fk;function vk(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,un.Z)(pd),{clearSelectedBlock:r}=(0,dn.Z)(pd),{clearBlockSelection:o}=e();return(0,__.Z)((e=>{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function bk(e){return(0,b.createElement)("div",(0,ta.Z)({ref:vk()},e))}function yk(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:l}=e(pd);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:l()}}function _k(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,un.Z)(yk,[]);return(0,__.Z)((o=>{const{ownerDocument:l}=o,{defaultView:a}=l;if(null==e)return;if(!r||t)return;const{length:s}=n;s<2||i&&(o.contentEditable=!0,o.focus(),a.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}var kk=n(12999),xk=n(15309),wk=n(137),Ck=n(6188),Ek=n(71265);function Sk(e,t,n,r){let o,i=u_.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(h_)===t.closest(h_)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!u_.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function Ik(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,un.Z)(pd),{selectBlock:i}=(0,dn.Z)(pd);return(0,__.Z)((l=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:h}=s,f=c===T_.UP,g=c===T_.DOWN,v=c===T_.LEFT,b=c===T_.RIGHT,y=f||v,_=v||b,k=f||g,x=_||k,w=d||p||m||h,C=k?kk.Z:xk.Z,{ownerDocument:E}=l,{defaultView:S}=E;if(!x)return;if(r()){if(d)return;if(!o())return;return s.preventDefault(),void(y?i(e()):i(t(),-1))}if(!function(e,t,n){if((t===T_.UP||t===T_.DOWN)&&!n)return!0;const{tagName:r}=e;return"INPUT"===r?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==r}(u,c,w))return;k?a||(a=(0,wk.Z)(S)):a=null;const I=(0,Ck.Z)(u)?!y:y,{keepCaretInsideBlock:T}=n();if(d)(function(e,t){const n=Sk(e,t,l);return n&&b_(n)})(u,y)&&C(u,y)&&(l.contentEditable=!0,l.focus());else if(!k||!(0,kk.Z)(u,y)||m&&!(0,xk.Z)(u,I)||T){if(_&&S.getSelection().isCollapsed&&(0,xk.Z)(u,I)&&!T){const e=Sk(u,I,l);(0,m_.Z)(e,y),s.preventDefault()}}else{const e=Sk(u,y,l,!0);e&&((0,Ek.Z)(e,m?!y:y,m?void 0:a),s.preventDefault())}}return l.addEventListener("mousedown",s),l.addEventListener("keydown",c),()=>{l.removeEventListener("mousedown",s),l.removeEventListener("keydown",c)}}),[])}var Tk=n(82009),Nk=n(18883);function Bk(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,un.Z)(pd),{multiSelect:r,selectBlock:o}=(0,dn.Z)(pd),i=(0,Nk.sx)();return(0,__.Z)((l=>{function a(a){if(!i("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,Tk.Z)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?r(d[0],d[d.length-1]):u&&(l.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return l.addEventListener("keydown",a),()=>{l.removeEventListener("keydown",a)}}),[])}function Pk(e,t){e.contentEditable=t,t&&e.focus()}function Ak(){const{startMultiSelect:e,stopMultiSelect:t}=(0,dn.Z)(pd),{isSelectionEnabled:n,hasMultiSelection:r,isDraggingBlocks:o}=(0,un.Z)(pd);return(0,__.Z)((i=>{const{ownerDocument:l}=i,{defaultView:a}=l;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(r())return;Pk(i,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d(t){let{buttons:r,target:c}=t;o()||1===r&&c.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),a.addEventListener("mouseup",u),Pk(i,!0))}return i.addEventListener("mouseout",d),()=>{i.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,r])}function Lk(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function Rk(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,dn.Z)(pd),{getBlockParents:r,getBlockSelectionStart:o}=(0,un.Z)(pd);return(0,__.Z)((n=>{const{ownerDocument:i}=n,{defaultView:l}=i;function a(i){const a=l.getSelection();if(!a.rangeCount)return;const s=i.shiftKey&&"mouseup"===i.type;if(a.isCollapsed&&!s)return void Lk(n,!1);let c=b_(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=b_(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=o(),t=b_(i.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...r(c),c],n=[...r(u),u],o=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[o],n[o])}else Lk(n,!1)}function s(){i.addEventListener("selectionchange",a),l.addEventListener("mouseup",a)}function c(){i.removeEventListener("selectionchange",a),l.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,r])}function Dk(){const{selectBlock:e}=(0,dn.Z)(pd),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,un.Z)(pd);return(0,__.Z)((o=>{function i(i){if(!t()||0!==i.button)return;const l=n(),a=b_(i.target);i.shiftKey?l!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function Mk(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:r}=(0,un.Z)(pd),{replaceBlocks:o,__unstableSplitSelection:i,removeBlocks:l,__unstableDeleteSelection:a,__unstableExpandSelection:s}=(0,dn.Z)(pd);return(0,__.Z)((c=>{function u(e){var t;r()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function d(u){u.defaultPrevented||r()&&(u.keyCode===T_.ENTER?(c.contentEditable=!1,u.preventDefault(),e()?o(t(),nr(Gn())):i()):u.keyCode===T_.BACKSPACE||u.keyCode===T_.DELETE?(c.contentEditable=!1,u.preventDefault(),e()?l(t()):n()?a(u.keyCode===T_.DELETE):s()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,n()?a(u.keyCode===T_.DELETE):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){r()&&(c.contentEditable=!1,n()?a():(e.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()))}return c.addEventListener("beforeinput",u),c.addEventListener("keydown",d),c.addEventListener("compositionstart",p),()=>{c.removeEventListener("beforeinput",u),c.removeEventListener("keydown",d),c.removeEventListener("compositionstart",p)}}),[])}function Ok(){const[e,t,n]=function(){const e=(0,b.useRef)(),t=(0,b.useRef)(),n=(0,b.useRef)(),r=(0,b.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:l}=(0,un.Z)(pd),{setNavigationMode:a}=(0,dn.Z)(pd),s=(0,un.Z)((e=>e(pd).isNavigationMode()),[])?void 0:"0",c=(0,b.useRef)();function u(t){if(c.current)c.current=null;else if(o())e.current.focus();else if(i())r.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";u_.focus.tabbable[n](t.target).focus()}}const d=(0,b.createElement)("div",{ref:t,tabIndex:s,onFocus:u}),p=(0,b.createElement)("div",{ref:n,tabIndex:s,onFocus:u}),m=(0,__.Z)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===T_.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==T_.TAB)return;const r=e.shiftKey,l=r?"findPrevious":"findNext";if(!o()&&!i())return void(e.target===s&&a(!0));if(((0,p_.Z)(e.target)||e.target.getAttribute("data-block")===i())&&(0,p_.Z)(u_.focus.tabbable[l](e.target)))return;const u=r?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){r.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==l()||s.focus()}function p(r){var o;if(r.keyCode!==T_.TAB)return;if("region"===(null===(o=r.target)||void 0===o?void 0:o.getAttribute("role")))return;if(e.current===r.target)return;const i=r.shiftKey?"findPrevious":"findNext",l=u_.focus.tabbable[i](r.target);l!==t.current&&l!==n.current||(r.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:h}=m;return h.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{h.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[d,(0,np.Z)([e,m]),p]}(),r=(0,un.Z)((e=>e(pd).hasMultiSelection()),[]);return[e,(0,np.Z)([t,Mk(),Ak(),Rk(),Dk(),_k(),Bk(),Ik(),(0,__.Z)((e=>{if(e.tabIndex=0,e.contentEditable=r,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,O.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}const Fk=(0,b.forwardRef)((function(e,t){let{children:n,...r}=e;const[o,i,l]=Ok();return(0,b.createElement)(b.Fragment,null,o,(0,b.createElement)("div",(0,ta.Z)({},r,{ref:(0,np.Z)([i,t]),className:C()(r.className,"block-editor-writing-flow")}),n),l)}));function Zk(e){return(0,b.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function jk(e){var t,n,r,o;let{contentRef:i,children:l,head:a,tabIndex:s=0,scale:c=1,frameSize:u=0,expand:d=!1,readonly:p,forwardedRef:m,...h}=e;const f=(0,un.Z)((e=>e(pd).getSettings().__unstableResolvedAssets),[]),[,g]=(0,b.useReducer)((()=>({}))),[v,_]=(0,b.useState)(),[k,x]=(0,b.useState)([]),w=Zk(null==f?void 0:f.styles),E=w.map((e=>e.id)),S=(0,b.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:r,cssRules:o}=t;return r?e(o):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(r)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}return e}),[])),[]),I=S.filter((e=>!E.includes(e.id))),T=Zk(null==f?void 0:f.scripts),N=vk(),[B,P,A]=Ok(),[L,{height:R}]=(0,Jd.Z)(),D=(0,__.Z)((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{readyState:i,documentElement:l}=r;return t=r,("interactive"===i||"complete"===i)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function r(e){const r=Object.getPrototypeOf(e).constructor.name,o=window[r],i={};for(const t in e)i[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();i.clientX+=e.left,i.clientY+=e.top}const l=new o(e.type,i);!n.dispatchEvent(l)&&e.preventDefault()}const o=["dragover"];for(const t of o)e.addEventListener(t,r)}(r),_(r),N(l),x(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir,l.removeChild(r.head),l.removeChild(r.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",r),()=>{var o,i;e.removeEventListener("load",r),null===(o=t)||void 0===o||o.removeEventListener("dragover",n),null===(i=t)||void 0===i||i.removeEventListener("drop",n)}}),[]),M=(0,__.Z)((e=>{T.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:r}=t;return new Promise(((t,o)=>{const i=e.ownerDocument.createElement("script");i.id=n,r?(i.src=r,i.onload=()=>t(),i.onerror=()=>o()):t(),e.appendChild(i)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),F=(0,Bg.Z)({isDisabled:!p}),Z=(0,np.Z)([i,N,P,F]),j=(0,b.createElement)(b.Fragment,null,(0,b.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...w,...I].map((e=>{let{tagName:t,href:n,id:r,rel:o,media:i,textContent:l}=e;const a=t.toLowerCase();return"style"===a?(0,b.createElement)(a,{id:r,key:r},l):(0,b.createElement)(a,{href:n,id:r,rel:o,media:i,key:r})}))),z=(0,b.useMemo)((()=>"<!doctype html>"+(0,Uo.ZP)(j)),[]),H=R*(1-c)/2;return(0,b.createElement)(b.Fragment,null,s>=0&&B,(0,b.createElement)("iframe",(0,ta.Z)({},h,{style:{...h.style,height:d?R:null===(t=h.style)||void 0===t?void 0:t.height,marginTop:c?-H+u:null===(n=h.style)||void 0===n?void 0:n.marginTop,marginBottom:c?-H+u:null===(r=h.style)||void 0===r?void 0:r.marginBottom,transform:c?`scale( ${c} )`:null===(o=h.style)||void 0===o?void 0:o.transform,transition:"all .3s"},ref:(0,np.Z)([m,D]),tabIndex:s,srcDoc:z,title:(0,O.__)("Editor canvas")}),v&&(0,y.createPortal)((0,b.createElement)(b.Fragment,null,(0,b.createElement)("head",{ref:M},j,a),(0,b.createElement)("body",{ref:Z,className:C()("block-editor-iframe__body","editor-styles-wrapper",...k)},L,(0,b.createElement)(ra.Z,{document:v},l))),v.documentElement)),s>=0&&A)}const zk=(0,b.forwardRef)((function(e,t){return(0,un.Z)((e=>e(pd).getSettings().__internalIsInitialized),[])?(0,b.createElement)(jk,(0,ta.Z)({},e,{forwardedRef:t})):null}));var Hk=n(28771),Vk=n.n(Hk);const Wk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Uk(e,t){t=t||{};let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){const e={line:n,column:r};return function(t){return t.position=new l(e),m(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;const a=[];function s(o){const i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;a.push(i)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),h(n);e.length&&"}"!==e.charAt(0)&&(t=C()||E());)!1!==t&&(n.push(t),h(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function m(){p(/^\s*/)}function h(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){const t=i();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("End of comment missing");const l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}function g(){const e=p(/^([^{]+)/);if(e)return $k(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=i();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=$k(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:t.replace(Wk,""),value:n?$k(n[0]).replace(Wk,""):""});return p(/^[;\s]*/),r}function b(){const e=[];if(!c())return s("missing '{'");let t;for(h(e);t=v();)!1!==t&&(e.push(t),h(e));return u()?e:s("missing '}'")}function y(){let e;const t=[],n=i();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=w("import"),k=w("charset"),x=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=i(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){if("@"===e[0])return function(){const e=i();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const r=t[1];if(!c())return s("@keyframes missing '{'");let o,l=h();for(;o=y();)l.push(o),l=l.concat(h());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:l}):s("@keyframes missing '}'")}()||function(){const e=i(),t=p(/^@media *([^{]+)/);if(!t)return;const n=$k(t[1]);if(!c())return s("@media missing '{'");const r=h().concat(d());return u()?e({type:"media",media:n,rules:r}):s("@media missing '}'")}()||function(){const e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:$k(t[1]),media:$k(t[2])})}()||function(){const e=i(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=$k(t[1]);if(!c())return s("@supports missing '{'");const r=h().concat(d());return u()?e({type:"supports",supports:n,rules:r}):s("@supports missing '}'")}()||_()||k()||x()||function(){const e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=$k(t[1]),r=$k(t[2]);if(!c())return s("@document missing '{'");const o=h().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):s("@document missing '}'")}()||function(){const e=i();if(!p(/^@page */))return;const t=g()||[];if(!c())return s("@page missing '{'");let n,r=h();for(;n=v();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):s("@page missing '}'")}()||function(){const e=i();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=h().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=i();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=h();for(;t=v();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function E(){const e=i(),t=g();return t?(h(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return Gk(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function $k(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Gk(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Gk(e,r)})):n&&"object"==typeof n&&Gk(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var qk=n(89118),Kk=n.n(qk);const Yk=Xk;function Xk(e){this.options=e||{}}Xk.prototype.emit=function(e){return e},Xk.prototype.visit=function(e){return this[e.type](e)},Xk.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n};const Qk=Jk;function Jk(e){Yk.call(this,e)}Kk()(Jk,Yk),Jk.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Jk.prototype.comment=function(e){return this.emit("",e.position)},Jk.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Jk.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jk.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jk.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Jk.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Jk.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jk.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Jk.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Jk.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Jk.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Jk.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jk.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Jk.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Jk.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const ex=tx;function tx(e){e=e||{},Yk.call(this,e),this.indentation=e.indent}Kk()(tx,Yk),tx.prototype.compile=function(e){return this.stylesheet(e)},tx.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},tx.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},tx.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},tx.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},tx.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("  {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},tx.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},tx.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},tx.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},tx.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},tx.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},tx.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},tx.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},tx.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},tx.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},tx.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},tx.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},tx.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||"  ")};function nx(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function rx(e,t){return new URL(e,t).toString()}const ox=/^(body|html|:root).*$/,ix=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:r}=e;const o=[];return t&&o.push(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(ox)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n}(t)),r&&o.push((i=r,e=>{if("declaration"===e.type){const o=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const r=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};nx(e)&&r.push(e)}return r}(e.value).map((r=i,e=>({...e,newUrl:"url("+e.before+e.quote+rx(e.value,r)+e.quote+e.after+")"})));return{...e,value:(t=e.value,n=o,n.forEach((e=>{t=t.replace(e.source,e.newUrl)})),t)}}var t,n,r;return e})),o.length?function(e,t){try{const n=Uk(e);return function(e,t){return((t=t||{}).compress?new Qk(t):new ex(t)).compile(e)}(Vk().map(n,(function(e){if(!e)return e;const n=t(e);return this.update(n)})))}catch(e){return console.warn("Error while traversing the CSS: "+e),null}}(n,(0,B.Z)(o)):n;var i}))},lx=".editor-styles-wrapper";function ax(e){return(0,b.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:r}=t,o=t.querySelector(lx);let i;if(o)i=n.getComputedStyle(o,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=n.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=(0,Tn.Vi)(i);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e])}function sx(e){let{styles:t}=e;const n=(0,b.useMemo)((()=>ix(t,lx)),[t]);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("style",{ref:ax(t)}),n.map(((e,t)=>(0,b.createElement)("style",{key:t},e))))}function cx(e){let{selector:t,id:n}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,b.createElement)("style",null,r)}function ux(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,b.createElement)("style",null,n)}function dx(e){let{id:t,colors:n}=e;const r=function(){const e={r:[],g:[],b:[],a:[]};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const n=(0,Tn.Vi)(t).toRgb();e.r.push(n.r/255),e.g.push(n.g/255),e.b.push(n.b/255),e.a.push(n.a)})),e}(n);return(0,b.createElement)(Vp.Wj,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,b.createElement)("defs",null,(0,b.createElement)("filter",{id:t},(0,b.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,b.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,b.createElement)("feFuncR",{type:"table",tableValues:r.r.join(" ")}),(0,b.createElement)("feFuncG",{type:"table",tableValues:r.g.join(" ")}),(0,b.createElement)("feFuncB",{type:"table",tableValues:r.b.join(" ")}),(0,b.createElement)("feFuncA",{type:"table",tableValues:r.a.join(" ")})),(0,b.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function px(e){let{preset:t}=e;return(0,b.createElement)(dx,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let mx;(0,Tn.l7)([Nn.Z,An]);const hx=2e3;function fx(e){let{viewportWidth:t,containerWidth:n,minHeight:r,additionalStyles:o=[]}=e;t||(t=n);const[i,{height:l}]=(0,Jd.Z)(),{styles:a,duotone:s}=(0,un.Z)((e=>{var t,n;const r=e(pd).getSettings();return{styles:r.styles,duotone:null===(t=r.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,b.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:a),[a,o]),u=(0,b.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);mx=mx||(0,ag.Z)(eT);const d=n/t;return(0,b.createElement)(gk,{className:"block-editor-block-preview__content",style:{transform:`scale(${d})`,height:l*d,maxHeight:l>hx?hx*d:void 0,minHeight:r}},(0,b.createElement)(zk,{head:(0,b.createElement)(sx,{styles:c}),contentRef:(0,__.Z)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:l,pointerEvents:"none",maxHeight:hx,minHeight:0!==d&&d<1&&r?r/d:r}},i,u.map((e=>(0,b.createElement)(px,{preset:e,key:e.slug}))),(0,b.createElement)(mx,{renderAppender:!1})))}function gx(e){const[t,{width:n}]=(0,Jd.Z)();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,b.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,b.createElement)(fx,(0,ta.Z)({},e,{containerWidth:n}))))}const vx=(0,b.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:r,additionalStyles:o=[],__experimentalMinHeight:i,__experimentalPadding:l}=e;i&&(r=i,(0,j.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],(0,j.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,un.Z)((e=>e(pd).getSettings()),[]),s=(0,b.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,b.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,b.createElement)(ck,{value:c,settings:s},(0,b.createElement)(gx,{viewportWidth:n,minHeight:r,additionalStyles:o})):null})),bx=function(e){var t;let{item:n}=e;const{name:r,title:o,icon:i,description:l,initialAttributes:a,example:s}=n,c=Qn(n);return(0,b.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,b.createElement)("div",{className:"block-editor-inserter__preview"},c||s?(0,b.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,b.createElement)(vx,{blocks:s?mr(r,{attributes:{...s.attributes,...a},innerBlocks:s.innerBlocks}):nr(r,a),viewportWidth:null!==(t=null==s?void 0:s.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,b.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,O.__)("No Preview Available."))),!c&&(0,b.createElement)(nk,{title:o,icon:i,description:l}))};var yx=n(43157),_x=n(22860);const kx=(0,jd.Iq)((function(e,t){const n=(0,_x.Z)(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({as:"span"},n,{ref:t}))}),"Truncate");var xx=n(51454),wx=n(83453);const Cx=(0,b.createContext)(),Ex=(0,b.forwardRef)((function(e,t){let{isFirst:n,as:r,children:o,...i}=e;const l=(0,b.useContext)(Cx);return(0,b.createElement)(wx.A,(0,ta.Z)({ref:t,state:l,role:"option",focusable:!0},i),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return r?(0,b.createElement)(r,t,o):"function"==typeof o?o(t):(0,b.createElement)(ia.ZP,t,o)}))}));var Sx=n(79030);const Ix="is-dragging-components-draggable",Tx=function(e){let{children:t,onDragStart:n,onDragOver:r,onDragEnd:o,cloneClassname:i,elementId:l,transferData:a,__experimentalTransferDataType:s="text",__experimentalDragComponent:c}=e;const u=(0,b.useRef)(null),d=(0,b.useRef)((()=>{}));return(0,b.useEffect)((()=>()=>{d.current()}),[]),(0,b.createElement)(b.Fragment,null,t({onDraggableStart:function(e){const{ownerDocument:t}=e.target;e.dataTransfer.setData(s,JSON.stringify(a));const o=t.createElement("div");o.style.top="0",o.style.left="0";const c=t.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(c.classList.add("components-draggable__invisible-drag-image"),t.body.appendChild(c),e.dataTransfer.setDragImage(c,0,0)),o.classList.add("components-draggable__clone"),i&&o.classList.add(i);let p=0,m=0;if(u.current){p=e.clientX,m=e.clientY,o.style.transform=`translate( ${p}px, ${m}px )`;const n=t.createElement("div");n.innerHTML=u.current.innerHTML,o.appendChild(n),t.body.appendChild(o)}else{const e=t.getElementById(l),n=e.getBoundingClientRect(),r=e.parentNode,i=n.top,a=n.left;o.style.width=`${n.width+0}px`;const s=e.cloneNode(!0);s.id=`clone-${l}`,p=a-0,m=i-0,o.style.transform=`translate( ${p}px, ${m}px )`,Array.from(s.querySelectorAll("iframe")).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),o.appendChild(s),null==r||r.appendChild(o)}let h=e.clientX,f=e.clientY;const g=(0,Sx.P)((function(e){if(h===e.clientX&&f===e.clientY)return;const t=p+e.clientX-h,n=m+e.clientY-f;o.style.transform=`translate( ${t}px, ${n}px )`,h=e.clientX,f=e.clientY,p=t,m=n,r&&r(e)}),16);let v;t.addEventListener("dragover",g),t.body.classList.add(Ix),e.persist(),n&&(v=setTimeout((()=>n(e)))),d.current=()=>{o&&o.parentNode&&o.parentNode.removeChild(o),c&&c.parentNode&&c.parentNode.removeChild(c),t.body.classList.remove(Ix),t.removeEventListener("dragover",g),clearTimeout(v)}},onDraggableEnd:function(e){e.preventDefault(),d.current(),o&&o(e)}}),c&&(0,b.createElement)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u},c))};var Nx=n(16459);function Bx(e){let{count:t,icon:n,isPattern:r}=e;const o=r&&(0,O.__)("Pattern");return(0,b.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,b.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,b.createElement)(Od.Z,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,b.createElement)(Fd.Z,null,n?(0,b.createElement)(tk,{icon:n}):o||(0,O.sprintf)((0,O._n)("%d block","%d blocks",t),t)),(0,b.createElement)(Fd.Z,null,(0,b.createElement)(tk,{icon:Nx.Z})))))}const Px=e=>{let{isEnabled:t,blocks:n,icon:r,children:o,isPattern:i}=e;const l={type:"inserter",blocks:n};return(0,b.createElement)(Tx,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,b.createElement)(Bx,{count:n.length,icon:r,isPattern:i})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return o({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?r:void 0})}))},Ax=(0,b.memo)((function(e){let{className:t,isFirst:n,item:r,onSelect:o,onHover:i,isDraggable:l,...a}=e;const s=(0,b.useRef)(!1),c=r.icon?{backgroundColor:r.icon.background,color:r.icon.foreground}:{},u=(0,b.useMemo)((()=>[nr(r.name,r.initialAttributes,rr(r.innerBlocks))]),[r.name,r.initialAttributes,r.initialAttributes]),d=Qn(r)||Jn(r);return(0,b.createElement)(Px,{isEnabled:l&&!r.disabled,blocks:u,icon:r.icon},(e=>{let{draggable:l,onDragStart:u,onDragEnd:p}=e;return(0,b.createElement)("div",{className:C()("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:l,onDragStart:e=>{s.current=!0,u&&(i(null),u(e))},onDragEnd:e=>{s.current=!1,p&&p(e)}},(0,b.createElement)(Ex,(0,ta.Z)({isFirst:n,className:C()("block-editor-block-types-list__item",t),disabled:r.isDisabled,onClick:e=>{e.preventDefault(),o(r,(0,xx.R)()?e.metaKey:e.ctrlKey),i(null)},onKeyDown:e=>{const{keyCode:t}=e;t===T_.ENTER&&(e.preventDefault(),o(r,(0,xx.R)()?e.metaKey:e.ctrlKey),i(null))},onMouseEnter:()=>{s.current||i(r)},onMouseLeave:()=>i(null)},a),(0,b.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:c},(0,b.createElement)(tk,{icon:r.icon,showColors:!0})),(0,b.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,b.createElement)(kx,{numberOfLines:3},r.title))))}))})),Lx=(0,b.forwardRef)((function(e,t){const[n,r]=(0,b.useState)(!1);return(0,b.useEffect)((()=>{n&&(0,Xc.speak)((0,O.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,b.createElement)("div",(0,ta.Z)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&r(!1)}},e))}));var Rx=n(19386);const Dx=(0,b.forwardRef)((function(e,t){const n=(0,b.useContext)(Cx);return(0,b.createElement)(Rx.E,(0,ta.Z)({state:n,role:"presentation",ref:t},e))})),Mx=function(e){let{items:t=[],onSelect:n,onHover:r=(()=>{}),children:o,label:i,isDraggable:l=!0}=e;return(0,b.createElement)(Lx,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,r=e.length;t<r;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,b.createElement)(Dx,{key:t},e.map(((e,o)=>(0,b.createElement)(Ax,{key:e.id,item:e,className:qo(e.id),onSelect:n,onHover:r,isDraggable:l&&!e.isDisabled,isFirst:0===t&&0===o})))))),o)},Ox=function(e){let{title:t,icon:n,children:r}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,b.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,b.createElement)(Ip.Z,{icon:n})),(0,b.createElement)("div",{className:"block-editor-inserter__panel-content"},r))},Fx=(e,t)=>{const{categories:n,collections:r,items:o}=(0,un.Z)((t=>{const{getInserterItems:n}=t(pd),{getCategories:r,getCollections:o}=t(Bo);return{categories:r(),collections:o(),items:n(e)}}),[e]),i=(0,b.useCallback)(((e,n)=>{let{name:r,initialAttributes:o,innerBlocks:i}=e;const l=nr(r,o,rr(i));t(l,void 0,n)}),[t]);return[o,n,r,i]};var Zx=n(77996);const jx=function(e){let{children:t}=e;const n=(0,Zx.u)({shift:!0,wrap:"horizontal"});return(0,b.createElement)(Cx.Provider,{value:n},t)},zx=[],Hx=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:o}=e;const[i,l,a,s]=Fx(t,n),c=(0,b.useMemo)((()=>Da(i,"frecency","desc").slice(0,6)),[i]),u=(0,b.useMemo)((()=>i.filter((e=>!e.category))),[i]),d=(0,b.useMemo)((()=>(0,Lr.Z)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,N.groupBy)(e,"category")))(i)),[i]),p=(0,b.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=i.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[i,a]);(0,b.useEffect)((()=>()=>r(null)),[]);const m=(0,yx.Z)(l),h=l.length===m.length,f=(0,b.useMemo)((()=>Object.entries(a)),[a]),g=(0,yx.Z)(h?f:zx);return(0,b.createElement)(jx,null,(0,b.createElement)("div",null,o&&!!c.length&&(0,b.createElement)(Ox,{title:(0,O._x)("Most used","blocks")},(0,b.createElement)(Mx,{items:c,onSelect:s,onHover:r,label:(0,O._x)("Most used","blocks")})),m.map((e=>{const t=d[e.slug];return t&&t.length?(0,b.createElement)(Ox,{key:e.slug,title:e.title,icon:e.icon},(0,b.createElement)(Mx,{items:t,onSelect:s,onHover:r,label:e.title})):null})),h&&u.length>0&&(0,b.createElement)(Ox,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,O.__)("Uncategorized")},(0,b.createElement)(Mx,{items:u,onSelect:s,onHover:r,label:(0,O.__)("Uncategorized")})),g.map((e=>{let[t,n]=e;const o=p[t];return o&&o.length?(0,b.createElement)(Ox,{key:t,title:n.title,icon:n.icon},(0,b.createElement)(Mx,{items:o,onSelect:s,onHover:r,label:n.title})):null}))))},Vx=(0,Wd.css)("appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;&:hover{color:",Ud.D.ui.theme,";}&:focus{background-color:transparent;color:",Ud.D.ui.theme,";border-color:",Ud.D.ui.theme,";outline:3px solid transparent;}",""),Wx={name:"1bcj5ek",styles:"width:100%;display:block"},Ux={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},$x=(0,Wd.css)("border:1px solid ",$d.Z.surfaceBorderColor,";",""),Gx=(0,Wd.css)(">*:not( marquee )>*{border-bottom:1px solid ",$d.Z.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),qx=$d.Z.controlBorderRadius,Kx=(0,Wd.css)("border-radius:",qx,";",""),Yx=(0,Wd.css)("border-radius:",qx,";>*:first-of-type>*{border-top-left-radius:",qx,";border-top-right-radius:",qx,";}>*:last-of-type>*{border-bottom-left-radius:",qx,";border-bottom-right-radius:",qx,";}",""),Xx=`calc(${$d.Z.fontSize} * ${$d.Z.fontLineHeightBase})`,Qx=`calc((${$d.Z.controlHeight} - ${Xx} - 2px) / 2)`,Jx=`calc((${$d.Z.controlHeightSmall} - ${Xx} - 2px) / 2)`,ew=`calc((${$d.Z.controlHeightLarge} - ${Xx} - 2px) / 2)`,tw={small:(0,Wd.css)("padding:",Jx," ",$d.Z.controlPaddingXSmall,";",""),medium:(0,Wd.css)("padding:",Qx," ",$d.Z.controlPaddingX,";",""),large:(0,Wd.css)("padding:",ew," ",$d.Z.controlPaddingXLarge,";","")},nw=(0,b.createContext)({size:"medium"}),rw=()=>(0,b.useContext)(nw),ow=(0,jd.Iq)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...l}=(0,Zd.y)(e,"ItemGroup");return{isBordered:n,className:(0,zd.I)()(n&&$x,o&&Gx,r&&Yx,t),role:i,isSeparated:o,...l}}(e),{size:l}=rw(),a={spacedAround:!n&&!r,size:o||l};return(0,b.createElement)(nw.Provider,{value:a},(0,b.createElement)(rp.Z,(0,ta.Z)({},i,{ref:t})))}),"ItemGroup"),iw=(0,jd.Iq)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...l}=(0,Zd.y)(e,"Item"),{spacedAround:a,size:s}=rw(),c=i||s,u=t||(void 0!==r?"button":"div"),d=(0,zd.I)(),p=(0,b.useMemo)((()=>d("button"===u&&Vx,tw[c]||tw.medium,Ux,a&&Kx,n)),[u,n,d,c,a]),m=d(Wx);return{as:u,className:p,onClick:r,wrapperClassName:m,role:o,...l}}(e);return(0,b.createElement)("div",{role:n,className:r},(0,b.createElement)(rp.Z,(0,ta.Z)({},o,{ref:t})))}),"Item");var lw=n(50828),aw=n(46824);const sw=(e,t)=>{const{patternCategories:n,patterns:r}=(0,un.Z)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(pd);return{patterns:n(t),patternCategories:r().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:o}=(0,dn.Z)(aw.h),i=(0,b.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>ir(e))),t.name),o((0,O.sprintf)((0,O.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[r,n,i]};var cw=n(60369);const uw=e=>{let{showTooltip:t,title:n,children:r}=e;return t?(0,b.createElement)(kp.Z,{text:n},r):(0,b.createElement)(b.Fragment,null,r)};function dw(e){let{isDraggable:t,pattern:n,onClick:r,onHover:o,composite:i,showTooltip:l}=e;const[a,s]=(0,b.useState)(!1),{blocks:c,viewportWidth:u}=n,d=`block-editor-block-patterns-list__item-description-${(0,ep.Z)(dw)}`;return(0,b.createElement)(Px,{isEnabled:t,blocks:c,isPattern:!!n},(e=>{let{draggable:t,onDragStart:p,onDragEnd:m}=e;return(0,b.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),p&&(null==o||o(null),p(e))},onDragEnd:e=>{s(!1),m&&m(e)}},(0,b.createElement)(uw,{showTooltip:l,title:n.title},(0,b.createElement)(wx.A,(0,ta.Z)({role:"option",as:"div"},i,{className:"block-editor-block-patterns-list__item",onClick:()=>{r(n,c),null==o||o(null)},onMouseEnter:()=>{a||null==o||o(n)},onMouseLeave:()=>null==o?void 0:o(null),"aria-label":n.title,"aria-describedby":n.description?d:void 0}),(0,b.createElement)(vx,{blocks:c,viewportWidth:u}),!l&&(0,b.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,b.createElement)(U_.Z,{id:d},n.description))))}))}function pw(){return(0,b.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const mw=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:r,onHover:o,onClickPattern:i,orientation:l,label:a=(0,O.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const c=(0,Zx.u)({orientation:l});return(0,b.createElement)(cw.b,(0,ta.Z)({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>r.includes(e)?(0,b.createElement)(dw,{key:e.name,pattern:e,onClick:i,onHover:o,isDraggable:t,composite:c,showTooltip:s}):(0,b.createElement)(pw,{key:e.name}))))};function hw(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r}=e;const o="block-editor-block-patterns-explorer__sidebar";return(0,b.createElement)("div",{className:`${o}__categories-list`},n.map((e=>{let{name:n,label:i}=e;return(0,b.createElement)(ia.ZP,{key:n,label:i,className:`${o}__categories-list__item`,isPressed:t===n,onClick:()=>{r(n)}},i)})))}function fw(e){let{filterValue:t,setFilterValue:n}=e;return(0,b.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,b.createElement)($_.Z,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,O.__)("Search for patterns"),placeholder:(0,O.__)("Search")}))}const gw=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:o,setFilterValue:i}=e;return(0,b.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,b.createElement)(fw,{filterValue:o,setFilterValue:i}),!o&&(0,b.createElement)(hw,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},vw=function(){return(0,b.createElement)("div",{className:"block-editor-inserter__no-results"},(0,b.createElement)(Gm.Z,{className:"block-editor-inserter__no-results-icon",icon:ek.Z}),(0,b.createElement)("p",null,(0,O.__)("No results found.")))},bw=function(e){let{rootClientId:t="",insertionIndex:n,clientId:r,isAppender:o,onSelect:i,shouldFocusBlock:l=!0,selectBlockOnInsert:a=!0}=e;const{getSelectedBlock:s}=(0,un.Z)(pd),{destinationRootClientId:c,destinationIndex:u}=(0,un.Z)((e=>{const{getSelectedBlockClientId:i,getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s}=e(pd),c=i();let u,d=t;return void 0!==n?u=n:r?u=a(r):!o&&c?(d=l(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,r,o]),{replaceBlocks:d,insertBlocks:p,showInsertionPoint:m,hideInsertionPoint:h}=(0,dn.Z)(pd),f=(0,b.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=s();!o&&r&&gr(r)?d(r.clientId,e,null,l||n?0:null,t):p(e,u,c,a,l||n?0:null,t);const m=Array.isArray(e)?e.length:1,h=(0,O.sprintf)((0,O._n)("%d block added.","%d blocks added.",m),m);(0,Xc.speak)(h),i&&i(e)}),[o,s,d,p,c,u,i,l]),g=(0,b.useCallback)((e=>{e?m(c,u):h()}),[m,h,c,u]);return[c,f,g]};var yw=n(37066);const _w=e=>e.name||"",kw=e=>e.title,xw=e=>e.description||"",ww=e=>e.keywords||[],Cw=e=>e.category,Ew=()=>null;function Sw(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,yw.B)(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Iw(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Ar()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Tw=function(){return Sw(Iw(arguments.length>0&&void 0!==arguments[0]?arguments[0]:""))},Nw=(e,t,n,r)=>{if(0===Tw(r).length)return e;const o={getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===e.category})))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}};return Bw(e,r,o)},Bw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(0===Tw(t).length)return e;const r=e.map((e=>[e,Pw(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,r]=t;return r-n})),r.map((e=>{let[t]=e;return t}))};function Pw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:r=_w,getTitle:o=kw,getDescription:i=xw,getKeywords:l=ww,getCategory:a=Cw,getCollection:s=Ew}=n,c=r(e),u=o(e),d=i(e),p=l(e),m=a(e),h=s(e),f=Iw(t),g=Iw(u);let v=0;if(f===g)v+=30;else if(g.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,h].join(" ");0===(b=Sw(f),y=e,b.filter((e=>!Tw(y).some((t=>t.includes(e)))))).length&&(v+=10)}var b,y;return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function Aw(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,b.createElement)(xf.Z,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,O.sprintf)((0,O._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const Lw=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const o=(0,ng.Z)(Xc.speak,500),[i,l]=bw({shouldFocusBlock:!0}),[a,,s]=sw(l,i),c=(0,b.useMemo)((()=>r.map((e=>e.name))),[r]),u=(0,b.useMemo)((()=>t?Bw(a,t):a.filter((e=>{var t,r;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(r=e.categories)||void 0===r?void 0:r.includes(n)}))),[t,n,a]);(0,b.useEffect)((()=>{if(!t)return;const e=u.length,n=(0,O.sprintf)((0,O._n)("%d result found.","%d results found.",e),e);o(n)}),[t,o]);const d=(0,yx.Z)(u,{step:2}),p=!(null==u||!u.length);return(0,b.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},p&&(0,b.createElement)(Aw,{filterValue:t,filteredBlockPatternsLength:u.length}),(0,b.createElement)(jx,null,!p&&(0,b.createElement)(vw,null),p&&(0,b.createElement)(mw,{shownPatterns:d,blockPatterns:u,onClickPattern:s,isDraggable:!1})))};function Rw(e){let{initialCategory:t,patternCategories:n}=e;const[r,o]=(0,b.useState)(""),[i,l]=(0,b.useState)(null==t?void 0:t.name);return(0,b.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,b.createElement)(gw,{selectedCategory:i,patternCategories:n,onClickCategory:l,filterValue:r,setFilterValue:o}),(0,b.createElement)(Lw,{filterValue:r,selectedCategory:i,patternCategories:n}))}const Dw=function(e){let{onModalClose:t,...n}=e;return(0,b.createElement)(gg.Z,{title:(0,O.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,b.createElement)(Rw,n))};var Mw=n(53817),Ow=n(94375);const Fw=(0,b.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}}),Zw=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,b.useContext)(Fw);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}},jw=(0,jd.Iq)((function(e,t){const n=function(e){const{onClick:t,as:n=ia.ZP,goToParent:r=!1,...o}=(0,Zd.y)(e,"NavigatorBackButton"),{goBack:i,goToParent:l}=Zw();return{as:n,onClick:(0,b.useCallback)((e=>{e.preventDefault(),r?l():i(),null==t||t(e)}),[r,l,i,t]),...o}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({ref:t},n))}),"NavigatorBackButton");var zw=n(95997);function Hw(e,t){return(0,zw.match)(t,{decode:decodeURIComponent})(e)}function Vw(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"add":return[...e,t.screen];case"remove":return e.filter((e=>e.id!==t.screen.id))}return e}var Ww={name:"15bx5k",styles:"overflow-x:hidden"};const Uw=(0,jd.Iq)((function(e,t){const{initialPath:n,children:r,className:o,...i}=(0,Zd.y)(e,"NavigatorProvider"),[l,a]=(0,b.useState)([{path:n}]),s=(0,b.useRef)([]),[c,u]=(0,b.useReducer)(Vw,[]),d=(0,b.useRef)([]);(0,b.useEffect)((()=>{d.current=c}),[c]),(0,b.useEffect)((()=>{s.current=l}),[l]);const p=(0,b.useRef)(),m=(0,b.useMemo)((()=>{let e;if(0===l.length||void 0===(e=l[l.length-1].path))return void(p.current=void 0);const t=(e=>{const t=function(e,t){for(const n of t){const t=Hw(e,n.path);if(t)return{params:t.params,id:n.id}}}(e,c);return p.current&&t&&(0,P.default)(t.params,p.current.params)&&t.id===p.current.id?p.current:t})(e);return p.current=t,t}),[c,l]),h=(0,b.useCallback)((e=>u({type:"add",screen:e})),[]),f=(0,b.useCallback)((e=>u({type:"remove",screen:e})),[]),g=(0,b.useCallback)((()=>{a((e=>e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]))}),[]),v=(0,b.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{focusTargetSelector:n,isBack:r=!1,...o}=t;r&&s.current.length>1&&s.current[s.current.length-2].path===e?g():a((t=>{const i={...o,path:e,isBack:r,hasRestoredFocus:!1};return t.length<1?[i]:[...t.slice(t.length>49?1:0,-1),{...t[t.length-1],focusTargetSelector:n},i]}))}),[g]),y=(0,b.useCallback)((()=>{const e=s.current[s.current.length-1].path;if(void 0===e)return;const t=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==Hw(e,t.path)))&&(r=e)}return r}(e,d.current);void 0!==t&&v(t,{isBack:!0})}),[v]),_=(0,b.useMemo)((()=>({location:{...l[l.length-1],isInitial:1===l.length},params:m?m.params:{},match:m?m.id:void 0,goTo:v,goBack:g,goToParent:y,addScreen:h,removeScreen:f})),[l,m,v,g,y,h,f]),k=(0,zd.I)(),x=(0,b.useMemo)((()=>k(Ww,o)),[o,k]);return(0,b.createElement)(rp.Z,(0,ta.Z)({ref:t,className:x},i),(0,b.createElement)(Fw.Provider,{value:_},r))}),"NavigatorProvider"),$w=Uw;var Gw=n(52750),qw=n(7969),Kw={name:"14x3t6z",styles:"overflow-x:auto;max-height:100%"};const Yw=(0,jd.Iq)((function(e,t){const n=(0,b.useId)(),{children:r,className:o,path:i,...l}=(0,Zd.y)(e,"NavigatorScreen"),a=(0,i_.Z)(),{location:s,match:c,addScreen:u,removeScreen:d}=(0,b.useContext)(Fw),p=c===n,m=(0,b.useRef)(null);(0,b.useEffect)((()=>{const e={id:n,path:(0,qw.escapeAttribute)(i)};return u(e),()=>d(e)}),[n,i,u,d]);const h=(0,zd.I)(),f=(0,b.useMemo)((()=>h(Kw,o)),[o,h]),g=(0,b.useRef)(s);(0,b.useEffect)((()=>{g.current=s}),[s]);const v=s.isInitial&&!s.isBack;(0,b.useEffect)((()=>{if(v||!p||!m.current||g.current.hasRestoredFocus)return;const e=m.current.ownerDocument.activeElement;if(m.current.contains(e))return;let t=null;if(s.isBack&&null!=s&&s.focusTargetSelector&&(t=m.current.querySelector(s.focusTargetSelector)),!t){const e=u_.focus.tabbable.find(m.current)[0];t=null!=e?e:m.current}g.current.hasRestoredFocus=!0,t.focus()}),[v,p,s.isBack,s.focusTargetSelector]);const y=(0,np.Z)([t,m]);if(!p)return null;if(a)return(0,b.createElement)(rp.Z,(0,ta.Z)({ref:y,className:f},l),r);const _={opacity:0,x:(0,O.isRTL)()&&s.isBack||!(0,O.isRTL)()&&!s.isBack?50:-50},k={animate:{opacity:1,transition:{delay:0,duration:.14,ease:"easeInOut"},x:0},exit:{delay:0,opacity:0,x:!(0,O.isRTL)()&&s.isBack||(0,O.isRTL)()&&!s.isBack?50:-50,transition:{duration:.14,ease:"easeInOut"}},initial:_};return(0,b.createElement)(Gw.E.div,(0,ta.Z)({ref:y,className:f},l,k),r)}),"NavigatorScreen"),Xw=Yw,Qw=(0,jd.Iq)((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=ia.ZP,attributeName:o="id",...i}=(0,Zd.y)(e,"NavigatorButton"),l=(0,qw.escapeAttribute)(t),{goTo:a}=Zw();return{as:r,onClick:(0,b.useCallback)((e=>{var t,r;e.preventDefault(),a(l,{focusTargetSelector:(t=o,r=l,`[${t}="${r}"]`)}),null==n||n(e)}),[a,n,o,l]),...i,[o]:l}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({ref:t},n))}),"NavigatorButton");function Jw(e){let{title:t}=e;return(0,b.createElement)(Mw.Z,{spacing:0},(0,b.createElement)(rp.Z,null,(0,b.createElement)(Ow.Z,{marginBottom:0,paddingX:4,paddingY:3},(0,b.createElement)(kf.Z,{spacing:2},(0,b.createElement)(jw,{style:{minWidth:24,padding:0},icon:(0,O.isRTL)()?Q_.Z:J_.Z,isSmall:!0,"aria-label":(0,O.__)("Navigate to the previous view")}),(0,b.createElement)(Ow.Z,null,(0,b.createElement)(xf.Z,{level:5},t))))))}function eC(e){let{categories:t,children:n}=e;return(0,b.createElement)($w,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,b.createElement)(Xw,{path:"/"},(0,b.createElement)(ow,null,t.map((e=>(0,b.createElement)(Qw,{key:e.name,path:`/category/${e.name}`,as:iw,isAction:!0},(0,b.createElement)(kf.Z,null,(0,b.createElement)(lw.Z,null,e.label),(0,b.createElement)(Gm.Z,{icon:(0,O.isRTL)()?J_.Z:Q_.Z}))))))),t.map((e=>(0,b.createElement)(Xw,{key:e.name,path:`/category/${e.name}`},(0,b.createElement)(Jw,{title:(0,O.__)("Back")}),n(e)))))}const tC=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function nC(e){const[t,n]=sw(void 0,e),r=(0,b.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),o=(0,b.useMemo)((()=>{const e=n.filter((e=>t.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:r}=t,o=tC.indexOf(n),i=tC.indexOf(r);return o<0&&(o=tC.length),i<0&&(i=tC.length),o-i}));return t.some((e=>!r(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,O._x)("Uncategorized")}),e}),[t,n]);return o}function rC(e){let{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}=e;const l=(0,b.useRef)();return(0,b.useEffect)((()=>{const e=setTimeout((()=>{const[e]=u_.focus.tabbable.find(l.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,b.createElement)("div",{ref:l,className:"block-editor-inserter__patterns-category-dialog"},(0,b.createElement)(oC,{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}))}function oC(e){let{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}=e;const[l,,a]=sw(n,t),s=nC(t),c=(0,b.useMemo)((()=>l.filter((e=>{var t,n,r;return"uncategorized"!==o.name?null===(r=e.categories)||void 0===r?void 0:r.includes(o.name):0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[l,o]),u=(0,yx.Z)(c);return(0,b.useEffect)((()=>()=>r(null)),[]),c.length?(0,b.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,b.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},o.label),(0,b.createElement)("p",null,o.description),(0,b.createElement)(mw,{shownPatterns:u,blockPatterns:c,onClickPattern:a,onHover:r,label:o.label,orientation:"vertical",category:o.label,isDraggable:!0,showTitlesAsTooltip:i})):null}const iC=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:r,rootClientId:o}=e;const[i,l]=(0,b.useState)(!1),a=nC(o),s=n||a[0],c=(0,tg.Z)("medium","<");return(0,b.createElement)(b.Fragment,null,!c&&(0,b.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,b.createElement)("nav",{"aria-label":(0,O.__)("Block pattern categories")},(0,b.createElement)(ow,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,b.createElement)(iw,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,b.createElement)(kf.Z,null,(0,b.createElement)(lw.Z,null,e.label),(0,b.createElement)(Gm.Z,{icon:Q_.Z}))))),(0,b.createElement)("div",{role:"listitem"},(0,b.createElement)(ia.ZP,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>l(!0),variant:"secondary"},(0,O.__)("Explore all patterns")))))),c&&(0,b.createElement)(eC,{categories:a},(e=>(0,b.createElement)(oC,{onInsert:r,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),i&&(0,b.createElement)(Dw,{initialCategory:s,patternCategories:a,onModalClose:()=>l(!1)}))};function lC(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[o,,,i]=Fx(r,n),l=(0,b.useMemo)((()=>o.filter((e=>{let{category:t}=e;return"reusable"===t}))),[o]);return 0===l.length?(0,b.createElement)(vw,null):(0,b.createElement)(Ox,{title:(0,O.__)("Reusable blocks")},(0,b.createElement)(Mx,{items:l,onSelect:i,onHover:t,label:(0,O.__)("Reusable blocks")}))}const aC=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(lC,{onHover:r,onInsert:n,rootClientId:t}),(0,b.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,b.createElement)(ia.ZP,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,Z.f)("edit.php",{post_type:"wp_block"})},(0,O.__)("Manage Reusable blocks"))))};function sC(e){const[t,n]=(0,b.useState)([]),{canInsertImage:r,canInsertVideo:o,canInsertAudio:i}=(0,un.Z)((t=>{const{canInsertBlockType:n}=t(pd);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),l=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,un.Z)((e=>{const t=e(pd).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),r=(0,b.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return r}();return(0,b.useEffect)((()=>{(async()=>{const e=[];if(!l)return;const t=new Map(await Promise.all(l.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:r,video:o,audio:i};l.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,o,i,l]),t}var cC=n(25853),uC=n(6198);const dC={image:"img",video:"video",audio:"audio"};function pC(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},r=e.url,o=e.alt||void 0;"image"===t?(n.url=r,n.alt=o):["video","audio"].includes(t)&&(n.src=r);const i=dC[t],l=(0,b.createElement)(i,{src:e.previewUrl||r,alt:o,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=r)}});return[nr(`core/${t}`,n),l]}const mC=["image"],hC={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function fC(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const r=t.getReportUrl(n);return(0,b.createElement)(ua.Z,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,O.__)("Options"),popoverProps:hC,icon:_f.Z},(()=>(0,b.createElement)(Td.Z,null,(0,b.createElement)(Nd.Z,{onClick:()=>window.open(r,"_blank").focus(),icon:uC.Z},(0,O.sprintf)((0,O.__)("Report %s"),t.mediaType)))))}function gC(e){let{onClose:t,onSubmit:n}=e;return(0,b.createElement)(gg.Z,{title:(0,O.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,b.createElement)(Mw.Z,{spacing:3},(0,b.createElement)("p",null,(0,O.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,b.createElement)("p",null,(0,O.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,b.createElement)(Od.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{variant:"tertiary",onClick:t},(0,O.__)("Cancel"))),(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{variant:"primary",onClick:n},(0,O.__)("Insert")))))}function vC(e){var t;let{media:n,onClick:r,composite:o,category:i}=e;const[l,a]=(0,b.useState)(!1),[s,c]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[p,m]=(0,b.useMemo)((()=>pC(n,i.mediaType)),[n,i.mediaType]),{createErrorNotice:h,createSuccessNotice:f}=(0,dn.Z)(aw.h),g=(0,un.Z)((e=>e(pd).getSettings().mediaUpload),[]),v=(0,b.useCallback)((e=>{if(u)return;const t=ir(e),{id:n,url:o,caption:i}=t.attributes;n?r(t):(d(!0),window.fetch(o).then((e=>e.blob())).then((e=>{g({filesList:[e],additionalData:{caption:i},onFileChange(e){let[n]=e;Cn(n.url)||(r({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),f((0,O.__)("Image uploaded and inserted."),{type:"snackbar"}),d(!1))},allowedTypes:mC,onError(e){h(e,{type:"snackbar"}),d(!1)}})})).catch((()=>{a(!0),d(!1)})))}),[u,r,g,h,f]),y=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let _;if(y.length>25){const e="...";_=y.slice(0,25-e.length)+e}const k=(0,b.useCallback)((()=>c(!0)),[]),x=(0,b.useCallback)((()=>c(!1)),[]);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Px,{isEnabled:!0,blocks:[p]},(e=>{let{draggable:t,onDragStart:r,onDragEnd:l}=e;return(0,b.createElement)("div",{className:C()("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:t,onDragStart:r,onDragEnd:l},(0,b.createElement)(kp.Z,{text:_||y},(0,b.createElement)("div",{onMouseEnter:k,onMouseLeave:x},(0,b.createElement)(wx.A,(0,ta.Z)({role:"option",as:"div"},o,{className:"block-editor-inserter__media-list__item",onClick:()=>v(p),"aria-label":y}),(0,b.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},m,u&&(0,b.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,b.createElement)(cC.ZP,null)))),!u&&(0,b.createElement)(fC,{category:i,media:n}))))})),l&&(0,b.createElement)(gC,{onClose:()=>a(!1),onSubmit:()=>{r(ir(p)),f((0,O.__)("Image inserted."),{type:"snackbar"}),a(!1)}}))}const bC=function(e){let{mediaList:t,category:n,onClick:r,label:o=(0,O.__)("Media List")}=e;const i=(0,Zx.u)();return(0,b.createElement)(cw.b,(0,ta.Z)({},i,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o}),t.map(((e,t)=>(0,b.createElement)(vC,{key:e.id||e.sourceId||t,media:e,category:n,onClick:r,composite:i}))))};function yC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,b.useState)(e),[r,o]=(0,b.useState)(e),i=(0,ng.Z)(o,250);return(0,b.useEffect)((()=>{r!==t&&i(t)}),[r,t]),[t,n,r]}const _C=10;function kC(e){let{rootClientId:t,onInsert:n,category:r}=e;const o=(0,b.useRef)();return(0,b.useEffect)((()=>{const e=setTimeout((()=>{const[e]=u_.focus.tabbable.find(o.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,b.createElement)("div",{ref:o,className:"block-editor-inserter__media-dialog"},(0,b.createElement)(xC,{rootClientId:t,onInsert:n,category:r}))}function xC(e){let{rootClientId:t,onInsert:n,category:r}=e;const[o,i,l]=yC(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,r]=(0,b.useState)(),[o,i]=(0,b.useState)(!1),l=(0,b.useRef)();return(0,b.useEffect)((()=>{(async()=>{var n;const o=JSON.stringify({category:e.name,...t});l.current=o,i(!0),r([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));o===l.current&&(r(a),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:o}}(r,{per_page:l?20:_C,search:l}),c="block-editor-inserter__media-panel",u=r.labels.search_items||(0,O.__)("Search");return(0,b.createElement)("div",{className:c},(0,b.createElement)($_.Z,{className:`${c}-search`,onChange:i,value:o,label:u,placeholder:u}),s&&(0,b.createElement)("div",{className:`${c}-spinner`},(0,b.createElement)(cC.ZP,null)),!s&&!(null!=a&&a.length)&&(0,b.createElement)(vw,null),!s&&!(null==a||!a.length)&&(0,b.createElement)(bC,{rootClientId:t,onClick:n,mediaList:a,category:r}))}const wC=function(e){let{fallback:t=null,children:n}=e;const r=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return!!t().mediaUpload}),[]);return r?n:t},CC=og("editor.MediaUpload")((()=>null)),EC=["image","video","audio"],SC=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:r,onInsert:o}=e;const i=sC(t),l=(0,tg.Z)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,b.useCallback)((e=>{if(null==e||!e.url)return;const[t]=pC(e,e.type);o(t)}),[o]),c=(0,b.useMemo)((()=>i.map((e=>({...e,label:e.labels.name})))),[i]);return(0,b.createElement)(b.Fragment,null,!l&&(0,b.createElement)("div",{className:`${a}-container`},(0,b.createElement)("nav",{"aria-label":(0,O.__)("Media categories")},(0,b.createElement)(ow,{role:"list",className:a},i.map((e=>(0,b.createElement)(iw,{role:"listitem",key:e.name,onClick:()=>r(e),className:C()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,b.createElement)(kf.Z,null,(0,b.createElement)(lw.Z,null,e.labels.name),(0,b.createElement)(Gm.Z,{icon:Q_.Z}))))),(0,b.createElement)("div",{role:"listitem"},(0,b.createElement)(wC,null,(0,b.createElement)(CC,{multiple:!1,onSelect:s,allowedTypes:EC,render:e=>{let{open:t}=e;return(0,b.createElement)(ia.ZP,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,O.__)("Open Media Library"))}})))))),l&&(0,b.createElement)(eC,{categories:c},(e=>(0,b.createElement)(xC,{onInsert:o,rootClientId:t,category:e}))))},{Fill:IC,Slot:TC}=(0,pn.up)("__unstableInserterMenuExtension");IC.Slot=TC;const NC=IC,BC=[],PC=function(e){let{filterValue:t,onSelect:n,onHover:r,rootClientId:o,clientId:i,isAppender:l,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:p=!0,prioritizePatterns:m,selectBlockOnInsert:h}=e;const f=(0,ng.Z)(Xc.speak,500),[g,v]=bw({onSelect:n,rootClientId:o,clientId:i,isAppender:l,insertionIndex:a,shouldFocusBlock:p,selectBlockOnInsert:h}),[y,_,k,x]=Fx(g,v),[w,,C]=sw(v,g),E=(0,b.useMemo)((()=>{if(0===s)return[];const e=Bw(w,t);return void 0!==s?e.slice(0,s):e}),[t,w,s]);let S=c;m&&E.length>2&&(S=0);const I=(0,b.useMemo)((()=>{if(0===S)return[];const e=Nw(Da(y,"frecency","desc"),_,k,t);return void 0!==S?e.slice(0,S):e}),[t,y,_,k,c]);(0,b.useEffect)((()=>{if(!t)return;const e=I.length+E.length,n=(0,O.sprintf)((0,O._n)("%d result found.","%d results found.",e),e);f(n)}),[t,f]);const T=(0,yx.Z)(I,{step:9}),N=(0,yx.Z)(T.length===I.length?E:BC),B=I.length>0||E.length>0,P=!!I.length&&(0,b.createElement)(Ox,{title:(0,b.createElement)(U_.Z,null,(0,O.__)("Blocks"))},(0,b.createElement)(Mx,{items:T,onSelect:x,onHover:r,label:(0,O.__)("Blocks"),isDraggable:d})),A=!!E.length&&(0,b.createElement)(Ox,{title:(0,b.createElement)(U_.Z,null,(0,O.__)("Block Patterns"))},(0,b.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,b.createElement)(mw,{shownPatterns:N,blockPatterns:E,onClickPattern:C,onHover:r,isDraggable:d})));return(0,b.createElement)(jx,null,!u&&!B&&(0,b.createElement)(vw,null),m?A:P,!!I.length&&!!E.length&&(0,b.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),m?P:A,u&&(0,b.createElement)(NC.Slot,{fillProps:{onSelect:x,onHover:r,filterValue:t,hasItems:B,rootClientId:g}},(e=>e.length?e:B?null:(0,b.createElement)(vw,null))))};var AC=n(92893);const LC={name:"blocks",title:(0,O.__)("Blocks")},RC={name:"patterns",title:(0,O.__)("Patterns")},DC={name:"reusable",title:(0,O.__)("Reusable"),icon:Aa.Z},MC={name:"media",title:(0,O.__)("Media")},OC=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:r=!1,showMedia:o=!1,onSelect:i,prioritizePatterns:l}=e;const a=(0,b.useMemo)((()=>{const e=[];return l&&n&&e.push(RC),e.push(LC),!l&&n&&e.push(RC),o&&e.push(MC),r&&e.push(DC),e}),[l,LC,n,RC,r,o,DC]);return(0,b.createElement)(AC.Z,{className:"block-editor-inserter__tabs",tabs:a,onSelect:i},t)},FC=(0,b.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,onSelect:l,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:u=!0,prioritizePatterns:d}=e;const[p,m,h]=yC(c),[f,g]=(0,b.useState)(null),[v,y]=(0,b.useState)(null),[_,k]=(0,b.useState)(null),[x,w]=(0,b.useState)(null),[E,S,I]=bw({rootClientId:n,clientId:r,isAppender:o,insertionIndex:i,shouldFocusBlock:u}),{showPatterns:T,inserterItems:N}=(0,un.Z)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(pd);return{showPatterns:!!t(E).length,inserterItems:n(E)}}),[E]),B=(0,b.useMemo)((()=>N.some((e=>{let{category:t}=e;return"reusable"===t}))),[N]),P=!!sC(E).length,A=(0,b.useCallback)(((e,t,n)=>{S(e,t,n),l()}),[S,l]),L=(0,b.useCallback)(((e,t)=>{S(e,{patternName:t}),l()}),[S,l]),R=(0,b.useCallback)((e=>{I(!!e),g(e)}),[I,g]),D=(0,b.useCallback)((e=>{I(!!e)}),[I]),M=(0,b.useCallback)((e=>{y(e)}),[y]),F=(0,b.useMemo)((()=>(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"block-editor-inserter__block-list"},(0,b.createElement)(Hx,{rootClientId:E,onInsert:A,onHover:R,showMostUsedBlocks:s})),a&&(0,b.createElement)("div",{className:"block-editor-inserter__tips"},(0,b.createElement)(U_.Z,{as:"h2"},(0,O.__)("A tip for using the block editor")),(0,b.createElement)(X_,null)))),[E,A,R,h,s,a]),Z=(0,b.useMemo)((()=>(0,b.createElement)(iC,{rootClientId:E,onInsert:L,onSelectCategory:M,selectedCategory:v})),[E,L,M,v]),j=(0,b.useMemo)((()=>(0,b.createElement)(aC,{rootClientId:E,onInsert:A,onHover:R})),[E,A,R]),z=(0,b.useMemo)((()=>(0,b.createElement)(SC,{rootClientId:E,selectedCategory:_,onSelectCategory:k,onInsert:A})),[E,A,_,k]),H=(0,b.useCallback)((e=>"blocks"===e.name?F:"patterns"===e.name?Z:"reusable"===e.name?j:"media"===e.name?z:void 0),[F,Z,j,z]),V=(0,b.useRef)();(0,b.useImperativeHandle)(t,(()=>({focusSearch:()=>{V.current.focus()}})));const W="patterns"===x&&!h&&v,U=!h&&(T||B||P),$="media"===x&&!h&&_;return(0,b.createElement)("div",{className:"block-editor-inserter__menu"},(0,b.createElement)("div",{className:C()("block-editor-inserter__main-area",{"show-as-tabs":U})},(0,b.createElement)($_.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{f&&g(null),m(e)},value:p,label:(0,O.__)("Search for blocks and patterns"),placeholder:(0,O.__)("Search"),ref:V}),!!h&&(0,b.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,b.createElement)(PC,{filterValue:h,onSelect:l,onHover:R,rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,showBlockDirectory:!0,shouldFocusBlock:u})),U&&(0,b.createElement)(OC,{showPatterns:T,showReusableBlocks:B,showMedia:P,prioritizePatterns:d,onSelect:w},H),!h&&!U&&(0,b.createElement)("div",{className:"block-editor-inserter__no-tab-container"},F)),$&&(0,b.createElement)(kC,{rootClientId:E,onInsert:A,category:_}),a&&f&&(0,b.createElement)(bx,{item:f}),W&&(0,b.createElement)(rC,{rootClientId:E,onInsert:L,onHover:D,category:v,showTitlesAsTooltip:!0}))}));function ZC(e){let{onSelect:t,rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:l}=e;const[a,s]=(0,b.useState)(""),[c,u]=bw({onSelect:t,rootClientId:n,clientId:r,isAppender:o,selectBlockOnInsert:l}),[d]=Fx(c,u),[p]=sw(u,c),{setInserterIsOpened:m,insertionIndex:h}=(0,un.Z)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:o}=e(pd),i=t(),l=n(r),a=o();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===l?a:l}}),[r]),f=p.length&&(!!a||i),g=f&&p.length>6||d.length>6;(0,b.useEffect)((()=>{m&&m(!1)}),[m]);let v=0;return f&&(v=i?4:2),(0,b.createElement)("div",{className:C()("block-editor-inserter__quick-inserter",{"has-search":g,"has-expand":m})},g&&(0,b.createElement)($_.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:a,onChange:e=>{s(e)},label:(0,O.__)("Search for blocks and patterns"),placeholder:(0,O.__)("Search")}),(0,b.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,b.createElement)(PC,{filterValue:a,onSelect:t,rootClientId:n,clientId:r,isAppender:o,maxBlockPatterns:v,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:i,selectBlockOnInsert:l})),m&&(0,b.createElement)(ia.ZP,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{m({rootClientId:n,insertionIndex:h,filterValue:a})},"aria-label":(0,O.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,O.__)("Browse all")))}const jC=e=>{let t,{onToggle:n,disabled:r,isOpen:o,blockTitle:i,hasSingleBlockType:l,toggleProps:a={},prioritizePatterns:s}=e;t=l?(0,O.sprintf)((0,O._x)("Add %s","directly add the only allowed block"),i):s?(0,O.__)("Add pattern"):(0,O._x)("Add block","Generic label for block inserter button");const{onClick:c,...u}=a;return(0,b.createElement)(ia.ZP,(0,ta.Z)({icon:yf.Z,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),c&&c(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:r},u))};class zC extends b.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:r,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,hasItems:s,renderToggle:c=jC,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:r||!s,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,__experimentalIsQuick:l,prioritizePatterns:a,onSelectOrClose:s,selectBlockOnInsert:c}=this.props;return l?(0,b.createElement)(ZC,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:a,selectBlockOnInsert:c}):(0,b.createElement)(FC,{onSelect:()=>{t()},rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:r,__experimentalIsQuick:o,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:r}):(0,b.createElement)(W_.Z,{className:"block-editor-inserter",contentClassName:C()("block-editor-inserter__popover",{"is-quick":o}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,O.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const HC=(0,B.Z)([(0,ig.Z)(((e,t)=>{var n;let{clientId:r,rootClientId:o,shouldDirectInsert:i=!0}=t;const{getBlockRootClientId:l,hasInserterItems:a,getAllowedBlocks:s,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(pd),{getBlockVariations:d}=e(Bo);o=o||l(r)||void 0;const p=s(o),m=i&&c(o),h=u(),f=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let g=!1;return f&&(g=p[0]),{hasItems:a(o),hasSingleBlockType:f,blockTitle:g?g.title:"",allowedBlockType:g,directInsertBlock:m,rootClientId:o,prioritizePatterns:h.__experimentalPreferPatternsOnRoot&&!o}})),(0,lg.Z)(((e,t,n)=>{let{select:r}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:o,isAppender:i,hasSingleBlockType:l,allowedBlockType:a,directInsertBlock:s,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!l&&!s)return;const{insertBlock:d}=e(pd);let p;if(s){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=r(pd);if(!e||!o&&!n)return{};const l={};let a={};if(o){const e=t(o),n=t(i(o));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var c;const e=t(n);if(null!=e&&null!==(c=e.innerBlocks)&&void 0!==c&&c.length){const t=e.innerBlocks[e.innerBlocks.length-1];s&&(null==s?void 0:s.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(l[e]=a[e])})),l}(s.attributesToCopy);p=nr(s.name,{...s.attributes||{},...e})}else p=nr(a.name);var m;d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:a}=r(pd);if(o)return e(o);const s=t();return!i&&s&&a(s)===n?e(s)+1:l(n).length}(),n,u),c&&c({clientId:null===(m=p)||void 0===m?void 0:m.clientId});const h=(0,O.sprintf)((0,O.__)("%s block added"),a.title);(0,Xc.speak)(h)}}})),(0,sg.Z)((e=>{let{hasItems:t,isAppender:n,rootClientId:r,clientId:o}=e;return t||!n&&!r&&!o}))])(zC),VC=(0,B.Z)((0,ig.Z)(((e,t)=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=e(pd),i=!n(t.rootClientId),{bodyPlaceholder:l}=r();return{showPrompt:i,isLocked:!!o(t.rootClientId),placeholder:l}})),(0,lg.Z)(((e,t)=>{const{insertDefaultBlock:n,startTyping:r}=e(pd);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),r()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:r,placeholder:o,rootClientId:i}=e;if(t)return null;const l=(0,si.decodeEntities)(o)||(0,O.__)("Type / to choose a block");return(0,b.createElement)("div",{"data-root-client-id":i||"",className:C()("block-editor-default-block-appender",{"has-visible-prompt":r})},(0,b.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,O.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{T_.ENTER!==e.keyCode&&T_.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{r&&n()}},r?l:"\ufeff"),(0,b.createElement)(HC,{rootClientId:i,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function WC(e,t){let{rootClientId:n,className:r,onFocus:o,tabIndex:i}=e;return(0,b.createElement)(HC,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:l,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:u}=e;n=u?(0,O.sprintf)((0,O._x)("Add %s","directly add the only allowed block"),c):(0,O._x)("Add block","Generic label for block inserter button");const d=!u;let p=(0,b.createElement)(ia.ZP,{ref:t,onFocus:o,tabIndex:i,className:C()(r,"block-editor-button-block-appender"),onClick:l,"aria-haspopup":d?"true":void 0,"aria-expanded":d?s:void 0,disabled:a,label:n},!u&&(0,b.createElement)(U_.Z,{as:"span"},n),(0,b.createElement)(Gm.Z,{icon:yf.Z}));return(d||u)&&(p=(0,b.createElement)(kp.Z,{text:n},p)),p},isAppender:!0})}(0,b.forwardRef)(((e,t)=>((0,j.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),WC(e,t))));const UC=(0,b.forwardRef)(WC);function $C(e){let{rootClientId:t}=e;return(0,un.Z)((e=>e(pd).canInsertBlockType(Gn(),t)))?(0,b.createElement)(VC,{rootClientId:t}):(0,b.createElement)(UC,{rootClientId:t,className:"block-list-appender__toggle"})}const GC=function(e){let{rootClientId:t,renderAppender:n,className:r,tagName:o="div"}=e;const i=function(e,t){const{hideInserter:n,isParentSelected:r}=(0,un.Z)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:r,__unstableGetEditorMode:o}=t(pd),i=r();return{hideInserter:!!n(e)||"zoom-out"===o(),isParentSelected:e===i||!e&&!i}}),[e]);return n||!1===t?null:t?(0,b.createElement)(t,null):r?(0,b.createElement)($C,{rootClientId:e}):null}(t,n);return i?(0,b.createElement)(o,{tabIndex:-1,className:C()("block-list-appender wp-block",r),contentEditable:!1,"data-block":!0},i):null},qC=function(e){return(0,__.Z)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])},KC=Number.MAX_SAFE_INTEGER;(0,b.createContext)();const YC=function(e){let{previousClientId:t,nextClientId:n,children:r,__unstablePopoverSlot:o,__unstableContentRef:i,...l}=e;const[a,s]=(0,b.useReducer)((e=>(e+1)%KC),0),{orientation:c,rootClientId:u,isVisible:d}=(0,un.Z)((e=>{var r;const{getBlockListSettings:o,getBlockRootClientId:i,isBlockVisible:l}=e(pd),a=i(null!=t?t:n);return{orientation:(null===(r=o(a))||void 0===r?void 0:r.orientation)||"vertical",rootClientId:a,isVisible:l(t)&&l(n)}}),[t,n]),p=D_(t),m=D_(n),h="vertical"===c,f=(0,b.useMemo)((()=>{if(a<0||!p&&!m||!d)return;const{ownerDocument:e}=p||m;return{ownerDocument:e,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=m?m.getBoundingClientRect():null;let n=0,r=0,o=0,i=0;return h?(r=e?e.bottom:t.top,o=e?e.width:t.width,i=t&&e?t.top-e.bottom:0,n=(0,O.isRTL)()?e?e.right:t.right:e?e.left:t.left):(r=e?e.top:t.top,i=e?e.height:t.height,(0,O.isRTL)()?(n=e?e.left:t.right,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0)),new window.DOMRect(n,r,o,i)}}}),[p,m,a,h,d]),g=qC(i);return(0,b.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(s);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,b.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(s);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]),(0,b.useLayoutEffect)((()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=p.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[p]),(p||m)&&d?(0,b.createElement)(mn.Z,(0,ta.Z)({ref:g,animate:!1,anchor:f,focusOnMount:!1,__unstableSlotName:o||null,key:n+"--"+u},l,{className:C()("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"}),(0,b.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},r)):null},XC=Number.MAX_SAFE_INTEGER,QC=(0,b.forwardRef)((function(e,t){let{clientId:n,bottomClientId:r,children:o,__unstableRefreshSize:i,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:c=!0,...u}=e;const d=D_(n),p=D_(null!=r?r:n),m=(0,np.Z)([t,qC(s)]),[h,f]=(0,b.useReducer)((e=>(e+1)%XC),0);(0,b.useLayoutEffect)((()=>{if(!d)return;const e=new window.MutationObserver(f);return e.observe(d,{attributes:!0}),()=>{e.disconnect()}}),[d]);const g=(0,b.useMemo)((()=>h<0||!d||p!==d?{}:{position:"absolute",width:d.offsetWidth,height:d.offsetHeight}),[d,p,i,h]),v=(0,b.useMemo)((()=>{if(!(h<0||!d||r&&!p))return{getBoundingClientRect(){var e,t,n,r;const o=d.getBoundingClientRect(),i=null==p?void 0:p.getBoundingClientRect(),l=Math.min(o.left,null!==(e=null==i?void 0:i.left)&&void 0!==e?e:1/0),a=Math.min(o.top,null!==(t=null==i?void 0:i.top)&&void 0!==t?t:1/0),s=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-l,c=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-a;return new window.DOMRect(l,a,s,c)},ownerDocument:d.ownerDocument}}),[r,p,d,h]);return!d||r&&!p?null:(0,b.createElement)(mn.Z,(0,ta.Z)({ref:m,animate:!1,focusOnMount:!1,anchor:v,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:c},u,{className:C()("block-editor-block-popover",u.className),variant:"unstyled"}),l&&(0,b.createElement)("div",{style:g},o),!l&&o)})),JC={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},eE=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:r}=(0,un.Z)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(pd),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),o=(0,i_.Z)();return(0,b.createElement)(QC,{clientId:r,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,b.createElement)(Gw.E.div,{"data-testid":"block-popover-drop-zone",initial:o?JC.show:JC.hide,animate:JC.show,exit:o?JC.show:JC.exit,className:"block-editor-block-popover__drop-zone-foreground"}))},tE=(0,b.createContext)();function nE(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:r,hideInsertionPoint:o}=(0,dn.Z)(pd),i=(0,b.useContext)(tE),l=(0,b.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:u,isInserterShown:d,isDistractionFree:p,isNavigationMode:m}=(0,un.Z)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:r,getBlockInsertionPoint:o,isBlockBeingDragged:i,getPreviousBlockClientId:l,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(pd),u=o(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;i(p);)p=l(p);for(;i(m);)m=a(m);const h=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=r(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:h.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),h=(0,i_.Z)(),f={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:d?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},g={start:{scale:h?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(p&&!m)return null;const v=C()("block-editor-block-list__insertion-point","is-"+a);return(0,b.createElement)(YC,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,b.createElement)(Gw.E.div,{layout:!h,initial:h?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&c&&r(c,-1)},onFocus:function(e){e.target!==l.current&&(i.current=!0)},className:C()(v,{"is-with-inserter":d}),onHoverEnd:function(e){e.target!==l.current||i.current||o()}},(0,b.createElement)(Gw.E.div,{variants:f,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),d&&(0,b.createElement)(Gw.E.div,{variants:g,className:C()("block-editor-block-list__insertion-point-inserter")},(0,b.createElement)(HC,{position:"bottom center",clientId:c,rootClientId:u,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1}}))))}function rE(e){const{insertionPoint:t,isVisible:n}=(0,un.Z)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(pd);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,b.createElement)(eE,(0,ta.Z)({key:`${t.rootClientId}-${t.index}`},e)):(0,b.createElement)(nE,e):null}function oE(){const e=(0,b.useContext)(tE),t=(0,un.Z)((e=>e(pd).getSettings().isDistractionFree||"zoom-out"===e(pd).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:r,getBlockIndex:o,isBlockInsertionPointVisible:i,isMultiSelecting:l,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,un.Z)(pd),{showInsertionPoint:u,hideInsertionPoint:d}=(0,dn.Z)(pd);return(0,__.Z)((r=>{if(!t)return r.addEventListener("mousemove",i),()=>{r.removeEventListener("mousemove",i)};function i(t){var r;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(l())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let i;if(t.target.classList.contains("is-root-container")||(i=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(i))return;const p=(null===(r=n(i))||void 0===r?void 0:r.orientation)||"vertical",m=t.clientY,h=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===p&&t.left>h}));if(!f)return void d();if(!f.id&&(f=f.firstElementChild,!f))return void d();const g=f.id.slice("block-".length);if(!g||c(g))return;if(a().includes(g))return;const v=f.getBoundingClientRect();if("horizontal"===p&&(t.clientY>v.bottom||t.clientY<v.top)||"vertical"===p&&(t.clientX>v.right||t.clientX<v.left))return void d();const b=o(g);0!==b?u(i,b,{__unstableWithInserter:!0}):d()}}),[e,n,r,o,i,l,u,d,a,t])}const iE="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,lE="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function aE(e){return(0,un.Z)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(pd),{getBlockType:o,getActiveBlockVariation:i}=t(Bo),l=n(e),a=o(l);if(!a)return null;const s=r(e),c=i(l,s),u=Qn(a)||Jn(a),d={isSynced:u,title:a.title,icon:a.icon,description:a.description,anchor:null==s?void 0:s.anchor};return c?{isSynced:u,title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:null==s?void 0:s.anchor}:d}),[e])}function sE(e){let{clientId:t,maximumLength:n,context:r}=e;const{attributes:o,name:i,reusableBlockTitle:l}=(0,un.Z)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:r,__experimentalGetReusableBlockTitle:o}=e(pd),i=n(t);if(!i)return{};const l=Qn(qn(i));return{attributes:r(t),name:i,reusableBlockTitle:l&&o(r(t).ref)}}),[t]),a=aE(t);if(!i||!a)return null;const s=qn(i),c=s?yr(s,o,r):null,u=l||c,d=u&&u!==s.title?u:a.title;if(n&&n>0&&d.length>n){const e="...";return d.slice(0,n-e.length)+e}return d}function cE(e){let{clientId:t,maximumLength:n,context:r}=e;return sE({clientId:t,maximumLength:n,context:r})}const uE=e=>{let{children:t,clientIds:n,cloneClassname:r,onDragStart:o,onDragEnd:i}=e;const{srcRootClientId:l,isDraggable:a,icon:s}=(0,un.Z)((e=>{var t;const{canMoveBlocks:r,getBlockRootClientId:o,getBlockName:i}=e(pd),l=o(n[0]),a=i(n[0]);return{srcRootClientId:l,isDraggable:r(n,l),icon:null===(t=qn(a))||void 0===t?void 0:t.icon}}),[n]),c=(0,b.useRef)(!1),[u,d,p]=function(){const e=(0,b.useRef)(null),t=(0,b.useRef)(null),n=(0,b.useRef)(null),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>()=>{r.current&&(clearInterval(r.current),r.current=null)}),[]),[(0,b.useCallback)((o=>{e.current=o.clientY,n.current=(0,l_.Z)(o.target),r.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,b.useCallback)((r=>{if(!n.current)return;const o=n.current.offsetHeight,i=e.current-n.current.offsetTop,l=r.clientY-n.current.offsetTop;if(r.clientY>i){const e=Math.max(o-i-50,0),n=Math.max(l-i-50,0)/e;t.current=25*n}else if(r.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-l-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{startDraggingBlocks:m,stopDraggingBlocks:h}=(0,dn.Z)(pd);if((0,b.useEffect)((()=>()=>{c.current&&h()}),[]),!a)return t({draggable:!1});const f={type:"block",srcClientIds:n,srcRootClientId:l};return(0,b.createElement)(Tx,{cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:f,onDragStart:e=>{m(n),c.current=!0,u(e),o&&o()},onDragOver:d,onDragEnd:()=>{h(),c.current=!1,p(),i&&i()},__experimentalDragComponent:(0,b.createElement)(Bx,{count:n.length,icon:s})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return t({draggable:!0,onDragStart:n,onDragEnd:r})}))};var dE=n(33535),pE=n(96328);const mE=(e,t)=>"up"===e?"horizontal"===t?(0,O.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,O.isRTL)()?"left":"right":"down":null;const hE=(e,t)=>"up"===e?"horizontal"===t?(0,O.isRTL)()?Q_.Z:J_.Z:dE.Z:"down"===e?"horizontal"===t?(0,O.isRTL)()?J_.Z:Q_.Z:pE.Z:null,fE=(e,t)=>"up"===e?"horizontal"===t?(0,O.isRTL)()?(0,O.__)("Move right"):(0,O.__)("Move left"):(0,O.__)("Move up"):"down"===e?"horizontal"===t?(0,O.isRTL)()?(0,O.__)("Move left"):(0,O.__)("Move right"):(0,O.__)("Move down"):null,gE=(0,b.forwardRef)(((e,t)=>{let{clientIds:n,direction:r,orientation:o,...i}=e;const l=(0,ep.Z)(gE),a=Array.isArray(n)?n:[n],s=a.length,{blockType:c,isDisabled:u,rootClientId:d,isFirst:p,isLast:m,firstIndex:h,orientation:f="vertical"}=(0,un.Z)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:l,getBlockListSettings:s}=e(pd),c=a[0],u=n(c),d=t(c),p=t(a[a.length-1]),m=i(u),h=l(c),f=0===d,g=p===m.length-1,{orientation:v}=s(u)||{};return{blockType:h?qn(h.name):null,isDisabled:"up"===r?f:g,rootClientId:u,firstIndex:d,isFirst:f,isLast:g,orientation:o||v}}),[n,r]),{moveBlocksDown:g,moveBlocksUp:v}=(0,dn.Z)(pd),y="up"===r?v:g,_=`block-editor-block-mover-button__description-${l}`;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ia.ZP,(0,ta.Z)({ref:t,className:C()("block-editor-block-mover-button",`is-${r}-button`),icon:hE(r,f),label:fE(r,f),"aria-describedby":_},i,{onClick:u?null:e=>{y(n,d),i.onClick&&i.onClick(e)},disabled:u,__experimentalIsFocusable:!0})),(0,b.createElement)(U_.Z,{id:_},function(e,t,n,r,o,i,l){const a=n+1;if(e>1)return function(e,t,n,r,o,i){const l=t+1;if(n&&r)return(0,O.__)("All blocks are selected, and cannot be moved");if(o>0&&!r){const t=mE("down",i);if("down"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d down by one place"),e,l);if("left"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o>0&&r){const e=mE("down",i);if("down"===e)return(0,O.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,O.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,O.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(o<0&&!n){const t=mE("up",i);if("up"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d up by one place"),e,l);if("left"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,O.sprintf)((0,O.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o<0&&n){const e=mE("up",i);if("up"===e)return(0,O.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,O.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,O.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,r,o,i,l);if(r&&o)return(0,O.sprintf)((0,O.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!o){const e=mE("down",l);if("down"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&o){const e=mE("down",l);if("down"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!r){const e=mE("up",l);if("up"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,O.sprintf)((0,O.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){const e=mE("up",l);if("up"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,O.sprintf)((0,O.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(s,c&&c.title,h,p,m,"up"===r?-1:1,f)))})),vE=(0,b.forwardRef)(((e,t)=>(0,b.createElement)(gE,(0,ta.Z)({direction:"up",ref:t},e)))),bE=(0,b.forwardRef)(((e,t)=>(0,b.createElement)(gE,(0,ta.Z)({direction:"down",ref:t},e)))),yE=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:r,rootClientId:o,isFirst:i,isLast:l,orientation:a}=(0,un.Z)((e=>{var n;const{getBlockIndex:r,getBlockListSettings:o,canMoveBlocks:i,getBlockOrder:l,getBlockRootClientId:a}=e(pd),s=Array.isArray(t)?t:[t],c=s[0],u=a(c),d=r(c),p=r(s[s.length-1]),m=l(u);return{canMove:i(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=o(u))||void 0===n?void 0:n.orientation}}),[t]);if(!r||i&&l&&!o)return null;const s=(0,O.__)("Drag");return(0,b.createElement)(pa,{className:C()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,b.createElement)(uE,{clientIds:t},(e=>(0,b.createElement)(ia.ZP,(0,ta.Z)({icon:Nx.Z,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,b.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,b.createElement)(la.Z,null,(e=>(0,b.createElement)(vE,(0,ta.Z)({clientIds:t},e)))),(0,b.createElement)(la.Z,null,(e=>(0,b.createElement)(bE,(0,ta.Z)({clientIds:t},e))))))},_E=function(e){let{clientId:t,rootClientId:n}=e;const r=aE(t),o=(0,un.Z)((e=>{var r;const{getBlock:o,getBlockIndex:i,hasBlockMovingClientId:l,getBlockListSettings:a,__unstableGetEditorMode:s}=e(pd),c=i(t),{name:u,attributes:d}=o(t);return{index:c,name:u,attributes:d,blockMovingMode:l(),orientation:null===(r=a(n))||void 0===r?void 0:r.orientation,editorMode:s()}}),[t,n]),{index:i,name:l,attributes:a,blockMovingMode:s,orientation:c,editorMode:u}=o,{setNavigationMode:d,removeBlock:p}=(0,dn.Z)(pd),m=(0,b.useRef)(),h=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const o=null==e?void 0:e.title,i=e?yr(e,t,"accessibility"):"",l=void 0!==n,a=i&&i!==o;return l&&"vertical"===r?a?(0,O.sprintf)((0,O.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,O.sprintf)((0,O.__)("%1$s Block. Row %2$d"),o,n):l&&"horizontal"===r?a?(0,O.sprintf)((0,O.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,O.sprintf)((0,O.__)("%1$s Block. Column %2$d"),o,n):a?(0,O.sprintf)((0,O.__)("%1$s Block. %2$s"),o,i):(0,O.sprintf)((0,O.__)("%s Block"),o)}(qn(l),a,i+1,c);(0,b.useEffect)((()=>{m.current.focus(),(0,Xc.speak)(h)}),[h]);const f=D_(t),{hasBlockMovingClientId:g,getBlockIndex:v,getBlockRootClientId:y,getClientIdsOfDescendants:_,getSelectedBlockClientId:k,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:w,getNextBlockClientId:E}=(0,un.Z)(pd),{selectBlock:S,clearSelectedBlock:I,setBlockMovingClientId:T,moveBlockToPosition:N}=(0,dn.Z)(pd),B=C()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),P=(0,O.__)("Drag");return(0,b.createElement)("div",{className:B},(0,b.createElement)(Od.Z,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,b.createElement)(Fd.Z,null,(0,b.createElement)(tk,{icon:null==r?void 0:r.icon,showColors:!0})),(0,b.createElement)(Fd.Z,null,"zoom-out"===u&&(0,b.createElement)(yE,{clientIds:[t],hideDragHandle:!0}),"navigation"===u&&(0,b.createElement)(uE,{clientIds:[t]},(e=>(0,b.createElement)(ia.ZP,(0,ta.Z)({icon:Nx.Z,className:"block-selection-button_drag-handle","aria-hidden":"true",label:P,tabIndex:"-1"},e))))),(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{ref:m,onClick:"navigation"===u?()=>d(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,r=n===T_.UP,o=n===T_.DOWN,i=n===T_.LEFT,l=n===T_.RIGHT,a=n===T_.TAB,s=n===T_.ESCAPE,c=n===T_.ENTER,u=n===T_.SPACE,d=e.shiftKey;if(n===T_.BACKSPACE||n===T_.DELETE)return p(t),void e.preventDefault();const m=k(),h=x(),b=w(h||m),C=E(h||m),B=a&&d||r,P=a&&!d||o,A=i,L=l;let R;if(B)R=b;else if(P)R=C;else if(A){var D;R=null!==(D=y(m))&&void 0!==D?D:m}else if(L){var M;R=null!==(M=_([m])[0])&&void 0!==M?M:m}const O=g();if(s&&O&&!e.defaultPrevented&&(T(null),e.preventDefault()),(c||u)&&O){const e=y(O),t=y(m),n=v(O);let r=v(m);n<r&&e===t&&(r-=1),N(O,e,t,r),S(O),T(null)}if(P||B||A||L)if(R)e.preventDefault(),S(R);else if(a&&m){let t;if(P){t=f;do{t=u_.focus.tabbable.findNext(t)}while(t&&f.contains(t));t||(t=f.ownerDocument.defaultView.frameElement,t=u_.focus.tabbable.findNext(t))}else t=u_.focus.tabbable.findPrevious(f);t&&(e.preventDefault(),t.focus(),I())}},label:h,showTooltip:!1,className:"block-selection-button_select-button"},(0,b.createElement)(cE,{clientId:t,maximumLength:35})))))};var kE=n(1482),xE=n(8496);const wE=(0,b.forwardRef)((function(e,t){let{label:n,...r}=e;const o=(0,kE.U)({loop:!0,baseId:r.id,rtl:(0,O.isRTL)()});return(0,b.createElement)(oa.Z.Provider,{value:o},(0,b.createElement)(xE.o,(0,ta.Z)({ref:t,"aria-label":n},o,r)))})),CE=wE,EE=(0,b.forwardRef)((function(e,t){let{className:n,label:r,...o}=e;if(!r)return(0,j.default)("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"}),(0,b.createElement)(pa,(0,ta.Z)({},o,{className:n}));const i=C()("components-accessible-toolbar",n);return(0,b.createElement)(CE,(0,ta.Z)({className:i,label:r,ref:t},o))})),SE=EE;var IE=n(23351);function TE(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const NE=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:r,__experimentalOnIndexChange:o,...i}=e;const l=(0,b.useRef)(),a=function(e){const[t,n]=(0,b.useState)(!0),r=(0,b.useCallback)((()=>{const t=!u_.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||(0,j.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,b.useLayoutEffect)((()=>{const t=new window.MutationObserver(r);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(l);return function(e,t,n,r,o){const[i]=(0,b.useState)(t),[l]=(0,b.useState)(r),a=(0,b.useCallback)((()=>{!function(e){const[t]=u_.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Nk.bx)("core/block-editor/focus-toolbar",a),(0,b.useEffect)((()=>{i&&a()}),[n,i,a]),(0,b.useEffect)((()=>{let t=0;return l&&!i&&(t=window.requestAnimationFrame((()=>{const t=TE(e.current),n=l||0;var r;t[n]&&(r=e.current).contains(r.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!o||!e.current)return;const n=TE(e.current).findIndex((e=>0===e.tabIndex));o(n)}}),[l,i])}(l,n,a,r,o),a?(0,b.createElement)(SE,(0,ta.Z)({label:i["aria-label"],ref:l},i),t):(0,b.createElement)(IE.Z,(0,ta.Z)({orientation:"horizontal",role:"toolbar",ref:l},i),t)},{clearTimeout:BE,setTimeout:PE}=window,AE=()=>{},LE=200;function RE(e){let{ref:t,isFocused:n,debounceTimeout:r=LE,onChange:o=AE}=e;const[i,l]=(0,b.useState)(!1),a=(0,b.useRef)(),s=e=>{null!=t&&t.current&&l(e),o(e)},c=()=>{const e=a.current;e&&BE&&BE(e)};return(0,b.useEffect)((()=>()=>{s(!1),c()}),[]),{showMovers:i,debouncedShowMovers:e=>{e&&e.stopPropagation(),c(),i||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),c(),a.current=PE((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&s(!1)}),r)}}}function DE(e){let{ref:t,debounceTimeout:n=LE,onChange:r=AE}=e;const[o,i]=(0,b.useState)(!1),{showMovers:l,debouncedShowMovers:a,debouncedHideMovers:s}=RE({ref:t,debounceTimeout:n,isFocused:o,onChange:r}),c=(0,b.useRef)(!1),u=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,b.useEffect)((()=>{const e=t.current,n=()=>{u()&&(i(!0),a())},r=()=>{u()||(i(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",r,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",r))}}),[t,c,i,a,s]),{showMovers:l,gestures:{onMouseMove:a,onMouseLeave:s}}}function ME(){const{selectBlock:e,toggleBlockHighlight:t}=(0,dn.Z)(pd),{firstParentClientId:n,shouldHide:r,isDistractionFree:o}=(0,un.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:r,getSettings:o}=e(pd),{hasBlockSupport:i}=e(Bo),l=n(r()),a=l[l.length-1],s=qn(t(a)),c=o();return{firstParentClientId:a,shouldHide:!i(s,"__experimentalParentSelector",!0),isDistractionFree:c.isDistractionFree}}),[]),i=aE(n),l=(0,b.useRef)(),{gestures:a}=DE({ref:l,onChange(e){e&&o||t(n,e)}});return r||void 0===n?null:(0,b.createElement)("div",(0,ta.Z)({className:"block-editor-block-parent-selector",key:n,ref:l},a),(0,b.createElement)(sa,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,O.sprintf)((0,O.__)("Select %s"),null==i?void 0:i.title),showTooltip:!0,icon:(0,b.createElement)(tk,{icon:null==i?void 0:i.icon})}))}var OE=n(53318);function FE(e){let{blocks:t}=e;return(0,b.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,b.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,b.createElement)(mn.Z,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,b.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,b.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,O.__)("Preview")),(0,b.createElement)(vx,{viewportWidth:500,blocks:t})))))}function ZE(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:r}=e;return t.map((e=>(0,b.createElement)(jE,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:r})))}function jE(e){let{item:t,onSelect:n,setHoveredTransformItemName:r}=e;const{name:o,icon:i,title:l,isDisabled:a}=t;return(0,b.createElement)(Nd.Z,{className:qo(o),onClick:e=>{e.preventDefault(),n(o)},disabled:a,onMouseLeave:()=>r(null),onMouseEnter:()=>r(o)},(0,b.createElement)(tk,{icon:i,showColors:!0}),l)}const zE=e=>{let{className:t,possibleBlockTransformations:n,onSelect:r,blocks:o}=e;const[i,l]=(0,b.useState)(),{priorityTextTransformations:a,restTransformations:s}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,b.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:r}=t;return n.includes(r)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:r}=e,{name:o}=n;return t[r]<t[o]?-1:1})),n}(n),c=a.length&&s.length,u=!!s.length&&(0,b.createElement)(ZE,{restTransformations:s,onSelect:r,setHoveredTransformItemName:l});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Td.Z,{label:(0,O.__)("Transform to"),className:t},i&&(0,b.createElement)(FE,{blocks:pr(o,i)}),a.map((e=>(0,b.createElement)(jE,{key:e.name,item:e,onSelect:r,setHoveredTransformItemName:l}))),!c&&u),!!c&&(0,b.createElement)(Td.Z,{className:t},u))};var HE=n(87036);class VE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.value=e,this._currentValue,this._valueAsArray}entries(){return this._valueAsArray.entries(...arguments)}forEach(){return this._valueAsArray.forEach(...arguments)}keys(){return this._valueAsArray.keys(...arguments)}values(){return this._valueAsArray.values(...arguments)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.value+=" "+t.join(" ")}remove(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.value=this._valueAsArray.filter((e=>!t.includes(e))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}function WE(e,t,n){const r=new VE(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+n.name),r.value}function UE(e){return null==e?void 0:e.find((e=>e.isDefault))}function $E(e){let{clientId:t,onSwitch:n}=e;const{styles:r,block:o,blockType:i,className:l}=(0,un.Z)((e=>{const{getBlock:n}=e(pd),r=n(t);if(!r)return{};const o=qn(r.name),{getBlockStyles:i}=e(Bo);return{block:r,blockType:o,styles:i(r.name),className:r.attributes.className||""}}),[t]),{updateBlockAttributes:a}=(0,dn.Z)(pd),s=function(e){return e&&0!==e.length?UE(e)?e:[{name:"default",label:(0,O._x)("Default","block style"),isDefault:!0},...e]:[]}(r),c=function(e,t){for(const n of new VE(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),r=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(r)return r}return UE(e)}(s,l),u=function(e,t){return(0,b.useMemo)((()=>{const n=null==t?void 0:t.example,r=null==t?void 0:t.name;return n&&r?mr(r,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?ir(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(o,i);return{onSelect:e=>{const r=WE(l,c,e);a(t,{className:r}),n()},stylesToRender:s,activeStyle:c,genericPreviewBlock:u,className:l}}const GE=()=>{};function qE(e){let{clientId:t,onSwitch:n=GE}=e;const{onSelect:r,stylesToRender:o,activeStyle:i}=$E({clientId:t,onSwitch:n});return o&&0!==o.length?(0,b.createElement)(b.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,b.createElement)(Nd.Z,{key:e.name,icon:i.name===e.name?bf.Z:null,onClick:()=>r(e)},(0,b.createElement)(HE.Z,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function KE(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:r}=t;return(0,b.createElement)(Td.Z,{label:(0,O.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,b.createElement)(qE,{clientId:r,onSwitch:n}))}const YE=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:r,name:o,innerBlocks:i=[]}=e;if(!n.has(r)){if(o===t)return e;for(const e of i){const r=YE(e,t,n);if(r)return r}}},XE=(e,t)=>{const n=((e,t)=>{const n=function(e,t){var n;const r=null===(n=qn(e))||void 0===n?void 0:n.attributes;if(!r)return[];const o=Object.keys(r);return t?o.filter((e=>{var n;return(null===(n=r[e])||void 0===n?void 0:n.__experimentalRole)===t})):o}(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function QE(e){let{patterns:t,onSelect:n}=e;return(0,b.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,b.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,b.createElement)(mn.Z,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,b.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,b.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,O.__)("Preview")),(0,b.createElement)(JE,{patterns:t,onSelect:n})))))}function JE(e){let{patterns:t,onSelect:n}=e;const r=(0,Zx.u)();return(0,b.createElement)(cw.b,(0,ta.Z)({},r,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,O.__)("Patterns list")}),t.map((e=>(0,b.createElement)(eS,{key:e.name,pattern:e,onSelect:n,composite:r}))))}function eS(e){let{pattern:t,onSelect:n,composite:r}=e;const o="block-editor-block-switcher__preview-patterns-container",i=(0,ep.Z)(eS,`${o}-list__item-description`);return(0,b.createElement)("div",{className:`${o}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?i:void 0},(0,b.createElement)(wx.A,(0,ta.Z)({role:"option",as:"div"},r,{className:`${o}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,b.createElement)(vx,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,b.createElement)("div",{className:`${o}-list__item-title`},t.title)),!!t.description&&(0,b.createElement)(U_.Z,{id:i},t.description))}const tS=function(e){let{blocks:t,patterns:n,onSelect:r}=e;const[o,i]=(0,b.useState)(!1),l=((e,t)=>(0,b.useMemo)((()=>e.reduce(((e,n)=>{const r=((e,t)=>{const n=t.map((e=>ir(e))),r=new Set;for(const t of e){let e=!1;for(const o of n){const n=YE(o,t.name,r);if(n){e=!0,r.add(n.clientId),XE(n,t);break}}if(!e)return}return n})(t,n.blocks);return r&&e.push({...n,transformedBlocks:r}),e}),[])),[e,t]))(n,t);return l.length?(0,b.createElement)(Td.Z,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,b.createElement)(QE,{patterns:l,onSelect:r}),(0,b.createElement)(Nd.Z,{onClick:e=>{e.preventDefault(),i(!o)},icon:Q_.Z},(0,O.__)("Patterns"))):null},nS=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:r,multiSelect:o}=(0,dn.Z)(pd),i=aE(n[0].clientId),{possibleBlockTransformations:l,canRemove:a,hasBlockStyles:s,icon:c,patterns:u}=(0,un.Z)((e=>{const{getBlockRootClientId:r,getBlockTransformItems:o,__experimentalGetPatternTransformItems:l}=e(pd),{getBlockStyles:a,getBlockType:s}=e(Bo),{canRemoveBlocks:c}=e(pd),u=r(Array.isArray(t)?t[0]:t),[{name:d}]=n,p=1===n.length,m=p&&a(d);let h;if(p)h=null==i?void 0:i.icon;else{var f;const e=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size;h=e?null===(f=s(d))||void 0===f?void 0:f.icon:OE.Z}return{possibleBlockTransformations:o(n,u),canRemove:c(t,u),hasBlockStyles:!(null==m||!m.length),icon:h,patterns:l(n,u)}}),[t,n,null==i?void 0:i.icon]),d=sE({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),p=1===n.length&&Qn(n[0]),m=1===n.length&&Jn(n[0]);function h(e){e.length>1&&o(e[0].clientId,e[e.length-1].clientId)}const f=!!l.length&&a&&!m,g=!(null==u||!u.length)&&a;if(!s&&!f)return(0,b.createElement)(pa,null,(0,b.createElement)(sa,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:d,icon:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(tk,{icon:c,showColors:!0}),(p||m)&&(0,b.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},d))}));const v=d,y=1===n.length?(0,O.sprintf)((0,O.__)("%s: Change block type or style"),d):(0,O.sprintf)((0,O._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),_=s||f||g;return(0,b.createElement)(pa,null,(0,b.createElement)(la.Z,null,(e=>(0,b.createElement)(ua.Z,{className:"block-editor-block-switcher",label:v,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(tk,{icon:c,className:"block-editor-block-switcher__toggle",showColors:!0}),(p||m)&&(0,b.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},d)),toggleProps:{describedBy:y,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:o}=e;return _&&(0,b.createElement)("div",{className:"block-editor-block-switcher__container"},g&&(0,b.createElement)(tS,{blocks:n,patterns:u,onSelect:e=>{!function(e){r(t,e),h(e)}(e),o()}}),f&&(0,b.createElement)(zE,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,blocks:n,onSelect:e=>{!function(e){const o=pr(n,e);r(t,o),h(o)}(e),o()}}),s&&(0,b.createElement)(KE,{hoveredBlock:n[0],onSwitch:o}))})))))},rS=e=>{let{clientIds:t}=e;const n=(0,un.Z)((e=>e(pd).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,b.createElement)(nS,{clientIds:t,blocks:n})},{Fill:oS,Slot:iS}=(0,pn.up)("__unstableBlockToolbarLastItem");oS.Slot=iS;const lS=oS;var aS=n(40266);const sS="__experimentalBorder",cS="color",uS="typography.__experimentalFontFamily",dS="typography.fontSize",pS=["typography.lineHeight",dS,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",uS,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",sS,cS,"spacing"],mS={align:e=>Xn(e,"align"),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==Pa.Z.OS)return!1;const n=Yn(e,sS);return!(!0!==n&&!("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=Yn(e,cS);return t&&!1!==t.background},textColor:e=>{const t=Yn(e,cS);return t&&!1!==t.text},gradient:e=>{const t=Yn(e,cS);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>Xn(e,"customClassName",!0),fontFamily:e=>Xn(e,uS),fontSize:e=>Xn(e,dS),layout:e=>Xn(e,"__experimentalLayout"),style:e=>pS.some((t=>Xn(e,t)))};function hS(e,t){return Object.entries(mS).reduce(((n,r)=>{let[o,i]=r;return i(e.name)&&i(t.name)&&(n[o]=e.attributes[o]),n}),{})}function fS(e,t,n){for(let r=0;r<Math.min(t.length,e.length);r+=1)n(e[r].clientId,hS(t[r],e[r])),fS(e[r].innerBlocks,t[r].innerBlocks,n)}function gS(e){let{clientIds:t,children:n,__experimentalUpdateSelection:r}=e;const{canInsertBlockType:o,getBlockRootClientId:i,getBlocksByClientId:l,canMoveBlocks:a,canRemoveBlocks:s}=(0,un.Z)(pd),{getDefaultBlockName:c,getGroupingBlockName:u}=(0,un.Z)(Bo),d=l(t),p=i(t[0]),m=d.every((e=>!!e&&Xn(e.name,"multiple",!0)&&o(e.name,p))),h=o(c(),p),f=a(t,p),g=s(t,p),{removeBlocks:v,replaceBlocks:y,duplicateBlocks:_,insertAfterBlock:k,insertBeforeBlock:x,flashBlock:w,setBlockMovingClientId:C,setNavigationMode:E,selectBlock:S}=(0,dn.Z)(pd),I=function(){const{getBlockName:e}=(0,un.Z)(pd),{getBlockType:t}=(0,un.Z)(Bo),{createSuccessNotice:n}=(0,dn.Z)(aw.h);return(0,b.useCallback)(((r,o)=>{let i="";if(1===o.length){var l;const n=o[0],a=null===(l=t(e(n)))||void 0===l?void 0:l.title;i="copy"===r?(0,O.sprintf)((0,O.__)('Copied "%s" to clipboard.'),a):(0,O.sprintf)((0,O.__)('Moved "%s" to clipboard.'),a)}else i="copy"===r?(0,O.sprintf)((0,O._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,O.sprintf)((0,O._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}(),T=function(){const e=(0,Jf.Z)(),{updateBlockAttributes:t}=(0,dn.Z)(pd),{createSuccessNotice:n,createWarningNotice:r,createErrorNotice:o}=(0,dn.Z)(aw.h);return(0,b.useCallback)((async i=>{let l="";try{if(!window.navigator.clipboard)return void o((0,O.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});l=await window.navigator.clipboard.readText()}catch(e){return void o((0,O.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!l||!function(e){try{const t=el(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(l))return void r((0,O.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=el(l);if(1===a.length?e.batch((()=>{fS(i,i.map((()=>a[0])),t)})):e.batch((()=>{fS(i,a,t)})),1===i.length){var s;const e=null===(s=qn(i[0].name))||void 0===s?void 0:s.title;n((0,O.sprintf)((0,O.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,O.sprintf)((0,O.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,r,o])}();return n({canDuplicate:m,canInsertDefaultBlock:h,canMove:f,canRemove:g,rootClientId:p,blocks:d,onDuplicate:()=>_(t,r),onRemove:()=>v(t,r),onInsertBefore(){const e=Array.isArray(t)?t[0]:e;x(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;k(e)},onMoveTo(){E(!0),S(t[0]),C(t[0])},onGroup(){if(!d.length)return;const e=u(),n=pr(d,e);n&&y(t,n)},onUngroup(){if(!d.length)return;const e=d[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=d.map((e=>{let{clientId:t}=e;return t}));1===d.length&&w(e[0]),I("copy",e)},async onPasteStyles(){await T(d)}})}const vS=()=>{},bS=(0,B.Z)([(0,ig.Z)(((e,t)=>{let{clientId:n}=t;const{getBlock:r,getBlockMode:o,getSettings:i}=e(pd),l=r(n),a=i().codeEditingEnabled;return{mode:o(n),blockType:l?qn(l.name):null,isCodeEditingEnabled:a}})),(0,lg.Z)(((e,t)=>{let{onToggle:n=vS,clientId:r}=t;return{onToggleMode(){e(pd).toggleBlockMode(r),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:r,small:o=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!Xn(t,"html",!0)||!i)return null;const l="visual"===n?(0,O.__)("Edit as HTML"):(0,O.__)("Edit visually");return(0,b.createElement)(Nd.Z,{onClick:r},!o&&l)})),yS=(0,B.Z)((0,ig.Z)(((e,t)=>{let{clientId:n}=t;const r=e(pd).getBlock(n);return{block:r,shouldRender:r&&"core/html"===r.name}})),(0,lg.Z)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(pd).replaceBlocks(n.clientId,Sl({HTML:Qo(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:r}=e;if(!t)return null;const o=(0,O.__)("Convert to Blocks");return(0,b.createElement)(Nd.Z,{onClick:n},!r&&o)})),{Fill:_S,Slot:kS}=(0,pn.up)("__unstableBlockSettingsMenuFirstItem");_S.Slot=kS;const xS=_S;function wS(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}=(0,un.Z)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:r,canInsertBlockType:o,getSelectedBlockClientIds:i}=e(pd),{getGroupingBlockName:l}=e(Bo),a=i(),s=l(),c=o(s,null!=a&&a.length?n(a[0]):void 0),u=r(a),d=1===u.length&&(null===(t=u[0])||void 0===t?void 0:t.name)===s;return{clientIds:a,isGroupable:c&&u.length,isUngroupable:d&&!!u[0].innerBlocks.length,blocksSelection:u,groupingBlockName:s}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}}function CS(e){let{clientIds:t,isGroupable:n,isUngroupable:r,blocksSelection:o,groupingBlockName:i,onClose:l=(()=>{})}=e;const{replaceBlocks:a}=(0,dn.Z)(pd);return n||r?(0,b.createElement)(b.Fragment,null,n&&(0,b.createElement)(Nd.Z,{onClick:()=>{(()=>{const e=pr(o,i);e&&a(t,e)})(),l()}},(0,O._x)("Group","verb")),r&&(0,b.createElement)(Nd.Z,{onClick:()=>{(()=>{const e=o[0].innerBlocks;e.length&&a(t,e)})(),l()}},(0,O._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function ES(e){return(0,un.Z)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:l,getBlockRootClientId:a,getTemplateLock:s}=t(pd),c=a(e),u=n(e),d=r(e,c),p=o(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(l(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var SS=n(60869),IS=n(72897),TS=n(730),NS=n(27157);const BS=["core/block","core/navigation"];function PS(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function AS(e){let{clientId:t,onClose:n}=e;const[r,o]=(0,b.useState)({move:!1,remove:!1}),{canEdit:i,canMove:l,canRemove:a}=ES(t),{allowsEditLocking:s,templateLock:c,hasTemplateLock:u}=(0,un.Z)((e=>{var n,r;const{getBlockName:o,getBlockAttributes:i}=e(pd),l=o(t),a=qn(l);return{allowsEditLocking:BS.includes(l),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(r=a.attributes)||void 0===r||!r.templateLock)}}),[t]),[d,p]=(0,b.useState)(!!c),{updateBlockAttributes:m}=(0,dn.Z)(pd),h=aE(t),f=(0,ep.Z)(AS,"block-editor-block-lock-modal__options-title");(0,b.useEffect)((()=>{o({move:!l,remove:!a,...s?{edit:!i}:{}})}),[i,l,a,s]);const g=Object.values(r).every(Boolean),v=Object.values(r).some(Boolean)&&!g;return(0,b.createElement)(gg.Z,{title:(0,O.sprintf)((0,O.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,b.createElement)("p",null,(0,O.__)("Choose specific attributes to restrict or lock all available options.")),(0,b.createElement)("form",{onSubmit:e=>{e.preventDefault(),m([t],{lock:r,templateLock:d?PS(r):void 0}),n()}},(0,b.createElement)("div",{role:"group","aria-labelledby":f,className:"block-editor-block-lock-modal__options"},(0,b.createElement)(TS.C,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,b.createElement)("span",{id:f},(0,O.__)("Lock all")),checked:g,indeterminate:v,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,b.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,b.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,b.createElement)(TS.C,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Restrict editing"),checked:!!r.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,b.createElement)(Ip.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.edit?NS.Z:SS.Z})),(0,b.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,b.createElement)(TS.C,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Disable movement"),checked:r.move,onChange:e=>o((t=>({...t,move:e})))}),(0,b.createElement)(Ip.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.move?NS.Z:SS.Z})),(0,b.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,b.createElement)(TS.C,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Prevent removal"),checked:r.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,b.createElement)(Ip.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.remove?NS.Z:SS.Z}))),u&&(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,O.__)("Apply to all blocks inside"),checked:d,disabled:r.move&&!r.remove,onChange:()=>p(!d)})),(0,b.createElement)(Od.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{variant:"tertiary",onClick:n},(0,O.__)("Cancel"))),(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{variant:"primary",type:"submit"},(0,O.__)("Apply"))))))}function LS(e){let{clientId:t}=e;const{canLock:n,isLocked:r}=ES(t),[o,i]=(0,b.useReducer)((e=>!e),!1);if(!n)return null;const l=r?(0,O.__)("Unlock"):(0,O.__)("Lock");return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Nd.Z,{icon:r?SS.Z:IS.Z,onClick:i},l),o&&(0,b.createElement)(AS,{clientId:t,onClose:i}))}const{Fill:RS,Slot:DS}=(0,pn.up)("BlockSettingsMenuControls");function MS(e){let{...t}=e;return(0,b.createElement)(ra.Z,{document},(0,b.createElement)(RS,t))}MS.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:r}=e;const{selectedBlocks:o,selectedClientIds:i,canRemove:l}=(0,un.Z)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:r,canRemoveBlocks:o}=e(pd),i=null!==n?n:r();return{selectedBlocks:t(i),selectedClientIds:i,canRemove:o(i)}}),[n]),{canLock:a}=ES(i[0]),s=1===i.length&&a,c=wS(),{isGroupable:u,isUngroupable:d}=c,p=(u||d)&&l;return(0,b.createElement)(DS,{fillProps:{...t,__unstableDisplayLocation:r,selectedBlocks:o,selectedClientIds:i}},(e=>!(null!=e&&e.length)>0&&!p&&!s?null:(0,b.createElement)(Td.Z,null,s&&(0,b.createElement)(LS,{clientId:i[0]}),e,p&&(0,b.createElement)(CS,(0,ta.Z)({},c,{onClose:null==t?void 0:t.onClose})))))};const OS=MS,FS=()=>{},ZS={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function jS(e){let{blocks:t,onCopy:n,label:r}=e;const o=(0,aS.Z)((()=>ei(t)),n),i=t.length>1?(0,O.__)("Copy blocks"):(0,O.__)("Copy block"),l=r||i;return(0,b.createElement)(Nd.Z,{ref:o},l)}const zS=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:r,__unstableDisplayLocation:o,...i}=e;const l=Array.isArray(t)?t:[t],a=l.length,s=l[0],{firstParentClientId:c,isDistractionFree:u,onlyBlock:d,parentBlockType:p,previousBlockClientId:m,nextBlockClientId:h,selectedBlockClientIds:f}=(0,un.Z)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:r,getPreviousBlockClientId:o,getNextBlockClientId:i,getSelectedBlockClientIds:l,getSettings:a,getBlockAttributes:c}=e(pd),{getActiveBlockVariation:u}=e(Bo),d=r(s),p=d&&n(d);return{firstParentClientId:d,isDistractionFree:a().isDistractionFree,onlyBlock:1===t(d),parentBlockType:d&&(u(p,c(d))||qn(p)),previousBlockClientId:o(s),nextBlockClientId:i(s),selectedBlockClientIds:l()}}),[s]),g=(0,un.Z)((e=>{const{getShortcutRepresentation:t}=e(Nk.h);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:v,toggleBlockHighlight:y}=(0,dn.Z)(pd),_=(0,b.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:FS,[n]),k=sE({clientId:s,maximumLength:25}),x=(0,b.useCallback)(n?()=>{const e=m||h||c;e&&f.includes(s)&&!f.includes(e)&&n(e)}:FS,[n,m,h,c,f]),w=(0,O.sprintf)((0,O.__)("Remove %s"),k),C=1===a?w:(0,O.__)("Remove blocks"),E=(0,b.useRef)(),{gestures:S}=DE({ref:E,onChange(e){e&&u||y(c,e)}}),I=null==f?void 0:f.includes(c);return(0,b.createElement)(gS,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:u,canRemove:m,onDuplicate:h,onInsertAfter:f,onInsertBefore:y,onRemove:k,onCopy:w,onPasteStyles:T,onMoveTo:N,blocks:B}=e;return(0,b.createElement)(ua.Z,(0,ta.Z)({icon:_f.Z,label:(0,O.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:ZS,noIcons:!0},i),(e=>{let{onClose:i}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Td.Z,null,(0,b.createElement)(xS.Slot,{fillProps:{onClose:i}}),!I&&!!c&&(0,b.createElement)(Nd.Z,(0,ta.Z)({},S,{ref:E,icon:(0,b.createElement)(tk,{icon:p.icon}),onClick:()=>v(c)}),(0,O.sprintf)((0,O.__)("Select parent block (%s)"),p.title)),1===a&&(0,b.createElement)(yS,{clientId:s}),(0,b.createElement)(jS,{blocks:B,onCopy:w}),n&&(0,b.createElement)(Nd.Z,{onClick:(0,Lr.Z)(i,h,_),shortcut:g.duplicate},(0,O.__)("Duplicate")),l&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Nd.Z,{onClick:(0,Lr.Z)(i,y),shortcut:g.insertBefore},(0,O.__)("Insert before")),(0,b.createElement)(Nd.Z,{onClick:(0,Lr.Z)(i,f),shortcut:g.insertAfter},(0,O.__)("Insert after"))),u&&!d&&(0,b.createElement)(Nd.Z,{onClick:(0,Lr.Z)(i,N)},(0,O.__)("Move to")),1===a&&(0,b.createElement)(bS,{clientId:s,onToggle:i})),(0,b.createElement)(Td.Z,null,(0,b.createElement)(jS,{blocks:B,onCopy:w,label:(0,O.__)("Copy styles")}),(0,b.createElement)(Nd.Z,{onClick:T},(0,O.__)("Paste styles"))),(0,b.createElement)(OS.Slot,{fillProps:{onClose:i},clientIds:t,__unstableDisplayLocation:o}),"function"==typeof r?r({onClose:i}):b.Children.map((e=>(0,b.cloneElement)(e,{onClose:i}))),m&&(0,b.createElement)(Td.Z,null,(0,b.createElement)(Nd.Z,{onClick:(0,Lr.Z)(i,k,x),shortcut:g.remove},C)))}))}))},HS=function(e){let{clientIds:t,...n}=e;return(0,b.createElement)(pa,null,(0,b.createElement)(la.Z,null,(e=>(0,b.createElement)(zS,(0,ta.Z)({clientIds:t,toggleProps:e},n)))))};function VS(e){let{clientId:t}=e;const n=aE(t),{canEdit:r,canMove:o,canRemove:i,canLock:l}=ES(t),[a,s]=(0,b.useReducer)((e=>!e),!1);return l?r&&o&&i?null:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(pa,{className:"block-editor-block-lock-toolbar"},(0,b.createElement)(sa,{icon:NS.Z,label:(0,O.sprintf)((0,O.__)("Unlock %s"),n.title),onClick:s})),a&&(0,b.createElement)(AS,{clientId:t,onClose:s})):null}var WS=n(1358),US=n(95061),$S=n(75262);const GS={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},qS=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:r}=wS(),{replaceBlocks:o}=(0,dn.Z)(pd),{canRemove:i,variations:l}=(0,un.Z)((e=>{const{canRemoveBlocks:r}=e(pd),{getBlockVariations:o}=e(Bo);return{canRemove:r(t),variations:o(n,"transform")}}),[t,n]),a=r=>{const i=pr(e,n);"string"!=typeof r&&(r="group"),i&&i.length>0&&(i[0].attributes.layout=GS[r],o(t,i))};if(!r||!i)return null;const s=!!l.find((e=>{let{name:t}=e;return"group-row"===t})),c=!!l.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,b.createElement)(pa,null,(0,b.createElement)(sa,{icon:WS.Z,label:(0,O._x)("Group","verb"),onClick:a}),s&&(0,b.createElement)(sa,{icon:US.Z,label:(0,O._x)("Row","single horizontal line"),onClick:()=>a("row")}),c&&(0,b.createElement)(sa,{icon:$S.Z,label:(0,O._x)("Stack","verb"),onClick:()=>a("stack")}))};function KS(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,r=(0,un.Z)((e=>!!n&&"html"===e(pd).getBlockMode(n)),[n]),{toggleBlockMode:o}=(0,dn.Z)(pd);return r?(0,b.createElement)(pa,null,(0,b.createElement)(sa,{onClick:()=>{o(n)}},(0,O.__)("Edit visually"))):null}const YS=(0,b.createContext)(""),XS=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:r,blockType:o,hasFixedToolbar:i,isDistractionFree:l,isValid:a,isVisual:s,isContentLocked:c}=(0,un.Z)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:r,isBlockValid:o,getBlockRootClientId:i,getSettings:l,__unstableGetContentLockingParent:a}=e(pd),s=r(),c=s[0],u=i(c),d=l();return{blockClientIds:s,blockClientId:c,blockType:c&&qn(t(c)),hasFixedToolbar:d.hasFixedToolbar,isDistractionFree:d.isDistractionFree,rootClientId:u,isValid:s.every((e=>o(e))),isVisual:s.every((e=>"visual"===n(e))),isContentLocked:!!a(c)}}),[]),{toggleBlockHighlight:u}=(0,dn.Z)(pd),d=(0,b.useRef)(),{showMovers:p,gestures:m}=DE({ref:d,onChange(e){e&&l||u(r,e)}}),h=(0,tg.Z)("medium","<")||i;if(o&&!Xn(o,"__experimentalToolbar",!0))return null;const f=h||p;if(0===n.length)return null;const g=a&&s,v=n.length>1,y=Qn(o)||Jn(o),_=C()("block-editor-block-toolbar",{"is-showing-movers":f,"is-synced":y});return(0,b.createElement)("div",{className:_},!v&&!h&&!c&&(0,b.createElement)(ME,null),(0,b.createElement)("div",(0,ta.Z)({ref:d},m),(g||v)&&!c&&(0,b.createElement)(pa,{className:"block-editor-block-toolbar__block-controls"},(0,b.createElement)(rS,{clientIds:n}),!v&&(0,b.createElement)(VS,{clientId:n[0]}),(0,b.createElement)(yE,{clientIds:n,hideDragHandle:t}))),g&&v&&(0,b.createElement)(qS,null),g&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,b.createElement)(Sd.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,b.createElement)(Sd.Slot,{className:"block-editor-block-toolbar__slot"}),(0,b.createElement)(Sd.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,b.createElement)(Sd.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,b.createElement)(YS.Provider,{value:null==o?void 0:o.name},(0,b.createElement)(lS.Slot,null))),(0,b.createElement)(KS,{clientIds:n}),!c&&(0,b.createElement)(HS,{clientIds:n}))},QS=function(e){let{focusOnMount:t,isFixed:n,...r}=e;const{blockType:o,hasParents:i,showParentSelector:l}=(0,un.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:r,__unstableGetContentLockingParent:o}=e(pd),{getBlockType:i}=e(Bo),l=r(),a=l[0],s=n(a),c=i(t(s[s.length-1]));return{blockType:a&&i(t(a)),hasParents:s.length,showParentSelector:c&&Xn(c,"__experimentalParentSelector",!0)&&l.length<=1&&!o(a)}}),[]);if(o&&!Xn(o,"__experimentalToolbar",!0))return null;const a=C()("block-editor-block-contextual-toolbar",{"has-parent":i&&l,"is-fixed":n});return(0,b.createElement)(NE,(0,ta.Z)({focusOnMount:t,className:a,"aria-label":(0,O.__)("Block tools")},r),(0,b.createElement)(XS,{hideDragHandle:n}))};var JS=n(12066),eI=n(80546),tI=n(21339),nI=n(61849);const rI=e=>e.__nextUnconstrainedWidth?"":(0,Wd.css)(Om.W2,"{min-width:130px;}",""),oI=(0,Vd.default)(nI.Z,{target:"eswuck60"})(rI,";"),iI=e=>null==e?void 0:e.name,lI=(e,t)=>{let{selectedItem:n}=e,{type:r,changes:o,props:{items:i}}=t;switch(r){case JS.useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:return{selectedItem:i[n?Math.min(i.indexOf(n)+1,i.length-1):0]};case JS.useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:return{selectedItem:i[n?Math.max(i.indexOf(n)-1,0):i.length-1]};default:return o}};function aI(e){var t;const{__next36pxDefaultSize:n=!1,__nextUnconstrainedWidth:r=!1,className:o,hideLabelFromVision:i,label:l,describedBy:a,options:s,onChange:c,size:u="default",value:d,onMouseOver:p,onMouseOut:m,onFocus:h,onBlur:f,__experimentalShowSelectedHint:g=!1}=e,{getLabelProps:v,getToggleButtonProps:y,getMenuProps:_,getItemProps:k,isOpen:x,highlightedIndex:w,selectedItem:E}=(0,JS.useSelect)({initialSelectedItem:s[0],items:s,itemToString:iI,onSelectedItemChange:c,...null!=d?{selectedItem:d}:void 0,stateReducer:lI}),[S,I]=(0,b.useState)(!1);r||(0,j.default)("Constrained width styles for wp.components.CustomSelectControl",{since:"6.1",version:"6.4",hint:"Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version"});const T=_({className:"components-custom-select-control__menu","aria-hidden":!x}),N=(0,b.useCallback)((e=>{var t;e.stopPropagation(),null==T||null===(t=T.onKeyDown)||void 0===t||t.call(T,e)}),[T]);return null!==(t=T["aria-activedescendant"])&&void 0!==t&&t.startsWith("downshift-null")&&delete T["aria-activedescendant"],(0,b.createElement)("div",{className:C()("components-custom-select-control",o)},i?(0,b.createElement)(U_.Z,(0,ta.Z)({as:"label"},v()),l):(0,b.createElement)(wf.ar,v({className:"components-custom-select-control__label"}),l),(0,b.createElement)(oI,{__next36pxDefaultSize:n,__nextUnconstrainedWidth:r,isFocused:x||S,__unstableInputWidth:r?void 0:"auto",labelPosition:r?void 0:"top",size:u,suffix:(0,b.createElement)(tI.Z,null)},(0,b.createElement)(eI.Ph,(0,ta.Z)({onMouseOver:p,onMouseOut:m,as:"button",onFocus:function(e){I(!0),null==h||h(e)},onBlur:function(e){I(!1),null==f||f(e)},selectSize:u,__next36pxDefaultSize:n},y({"aria-label":l,"aria-labelledby":void 0,className:"components-custom-select-control__button",describedBy:a||(E?(0,O.sprintf)((0,O.__)("Currently selected: %s"),E.name):(0,O.__)("No selection"))})),iI(E),g&&E.__experimentalHint&&(0,b.createElement)("span",{className:"components-custom-select-control__hint"},E.__experimentalHint))),(0,b.createElement)("ul",(0,ta.Z)({},T,{onKeyDown:N}),x&&s.map(((e,t)=>(0,b.createElement)("li",k({item:e,index:t,key:e.key,className:C()(e.className,"components-custom-select-control__item",{"is-highlighted":t===w,"has-hint":!!e.__experimentalHint,"is-next-36px-default-size":n}),style:e.style}),e.name,e.__experimentalHint&&(0,b.createElement)("span",{className:"components-custom-select-control__item-hint"},e.__experimentalHint),e===E&&(0,b.createElement)(Gm.Z,{icon:bf.Z,className:"components-custom-select-control__item-icon"}))))))}function sI(e){return(0,b.createElement)(aI,(0,ta.Z)({},e,{__experimentalShowSelectedHint:!1}))}var cI=n(5098);const{lock:uI,unlock:dI}=(0,Io.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/components"),pI={};uI(pI,{CustomSelectControl:aI,__experimentalPopoverLegacyPositionToPlacement:cI.KF});const{CustomSelectControl:mI}=ud(pI),hI="position",fI="block-editor-hooks__position-selection__select-control__option",gI={key:"default",value:"",name:(0,O.__)("Default"),className:fI},vI={key:"sticky",value:"sticky",name:(0,O.__)("Sticky"),className:fI,__experimentalHint:(0,O.__)("The block will stick to the top of the window instead of scrolling.")},bI={key:"fixed",value:"fixed",name:(0,O.__)("Fixed"),className:fI,__experimentalHint:(0,O.__)("The block will not move when the page is scrolled.")},yI=["top","right","bottom","left"],_I=["sticky","fixed"];function kI(e){var t,n;const r=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===r||"fixed"===r}function xI(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=am("position.fixed"),n=am("position.sticky"),r=!t&&!n;return!Yn(e,hI)||r}function wI(e){var t;const{attributes:{style:n={}},clientId:r,name:o,setAttributes:i}=e,l=function(e){const t=Yn(e,hI);return!!(!0===t||null!=t&&t.fixed)}(o),a=function(e){const t=Yn(e,hI);return!!(!0===t||null!=t&&t.sticky)}(o),s=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:c}=(0,un.Z)((e=>{const{getBlockParents:t}=e(pd);return{hasParents:t(r).length}}),[r]),u=(0,b.useMemo)((()=>{const e=[gI];return(a&&!c||s===vI.value)&&e.push(vI),(l||s===bI.value)&&e.push(bI),e}),[l,a,c,s]),d=s&&u.find((e=>e.value===s))||gI;return Pa.Z.select({web:u.length>1?(0,b.createElement)(Gf,{group:"position"},(0,b.createElement)(Hd.ZP,{className:"block-editor-hooks__position-selection"},(0,b.createElement)(mI,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,O.__)("Position"),hideLabelFromVision:!0,describedBy:(0,O.sprintf)((0,O.__)("Currently selected position: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};i({style:sm(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const CI=(0,na.o)((e=>t=>{const{name:n}=t;return[Xn(n,hI)&&!xI(t)&&(0,b.createElement)(wI,(0,ta.Z)({key:"position"},t)),(0,b.createElement)(e,(0,ta.Z)({key:"edit"},t))]}),"withInspectorControls"),EI=(0,na.o)((e=>t=>{var n,r,o,i;const{name:l,attributes:a}=t,s=Xn(l,hI)&&!xI(t),c=(0,ep.Z)(e),u=(0,b.useContext)(eT.__unstableElementContext);let d;s&&(d=function(e){let{selector:t,style:n}=e,r="";const{type:o}=(null==n?void 0:n.position)||{};return _I.includes(o)?(r+=`${t} {`,r+=`position: ${o};`,yI.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(r+=`${e}: ${n.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(r+="z-index: 10"),r+="}",r):r}({selector:`.wp-container-${c}.wp-container-${c}`,style:null==a?void 0:a.style})||"");const p=C()(null==t?void 0:t.className,{[`wp-container-${c}`]:s&&!!d,[`is-position-${null==a||null===(n=a.style)||void 0===n||null===(r=n.position)||void 0===r?void 0:r.type}`]:s&&!!d&&!(null==a||null===(o=a.style)||void 0===o||null===(i=o.position)||void 0===i||!i.type)});return(0,b.createElement)(b.Fragment,null,s&&u&&!!d&&(0,y.createPortal)((0,b.createElement)("style",null,d),u),(0,b.createElement)(e,(0,ta.Z)({},t,{className:p})))}));(0,tr.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",EI),(0,tr.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",CI);const SI={placement:"top-start"},II={...SI,flip:!1,shift:!0},TI={...SI,flip:!0,shift:!1};function NI(e,t,n,r,o){if(!e||!t)return II;const i=(null==n?void 0:n.scrollTop)||0,l=t.getBoundingClientRect(),a=i+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+r,u=l.top>c,d=l.height>s-r;return o||!u&&!d?TI:II}function BI(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:r,isTyping:o,isBlockInterfaceHidden:i,getSettings:l,getLastMultiSelectedBlockClientId:a}=ud(e(pd));return{editorMode:t(),hasMultiSelection:r(),isMultiSelecting:n(),isTyping:o(),isBlockInterfaceHidden:i(),hasFixedToolbar:l().hasFixedToolbar,isDistractionFree:l().isDistractionFree,lastClientId:r()?a():null}}function PI(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:r,showContents:o,capturingClientId:i,__unstablePopoverSlot:l,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:c,isMultiSelecting:u,isTyping:d,isBlockInterfaceHidden:p,hasFixedToolbar:m,isDistractionFree:h,lastClientId:f}=(0,un.Z)(BI,[]),g=(0,un.Z)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:r,getBlockOrder:o}=e(pd);if(!n())return!1;const i=r();return o(i.rootClientId)[i.index]===t}),[t]),v=(0,tg.Z)("medium"),y=(0,b.useRef)(!1),{stopTyping:_}=(0,dn.Z)(pd),k=!d&&"edit"===s&&r,x=!c&&("navigation"===s||"zoom-out"===s),w="edit"===s&&!m&&v&&!u&&!k&&!d&&!p,E=!("edit"!==s||w||m||h||r);(0,Nk.bx)("core/block-editor/focus-toolbar",(()=>{y.current=!0,_(!0)}),{isDisabled:!E}),(0,b.useEffect)((()=>{y.current=!1}));const S=(0,b.useRef)(),I=function(e){let{contentElement:t,clientId:n}=e;const r=D_(n),[o,i]=(0,b.useState)(0),{blockIndex:l,isSticky:a}=(0,un.Z)((e=>{const{getBlockIndex:t,getBlockAttributes:r}=e(pd);return{blockIndex:t(n),isSticky:kI(r(n))}}),[n]),s=(0,b.useMemo)((()=>{if(t)return(0,l_.Z)(t)}),[t]),[c,u]=(0,b.useState)((()=>NI(t,r,s,o,a))),d=(0,__.Z)((e=>{i(e.offsetHeight)}),[]),p=(0,b.useCallback)((()=>u(NI(t,r,s,o,a))),[t,r,s,o]);return(0,b.useLayoutEffect)(p,[l,p]),(0,b.useLayoutEffect)((()=>{var e,n,o;if(!t||!r)return;const i=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let l;null==i||null===(n=i.addEventHandler)||void 0===n||n.call(i,"resize",p);const a=null==r||null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView;return a.ResizeObserver&&(l=new a.ResizeObserver(p),l.observe(r)),()=>{var e;null==i||null===(e=i.removeEventHandler)||void 0===e||e.call(i,"resize",p),l&&l.disconnect()}}),[p,t,r]),{...c,ref:d}}({contentElement:null==a?void 0:a.current,clientId:t});return k?(0,b.createElement)(QC,(0,ta.Z)({clientId:i||t,__unstableCoverTarget:!0,bottomClientId:f,className:C()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":g}),__unstablePopoverSlot:l,__unstableContentRef:a,resize:!1,shift:!1},I),(0,b.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,b.createElement)(HC,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):x||w?(0,b.createElement)(QC,(0,ta.Z)({clientId:i||t,bottomClientId:f,className:C()("block-editor-block-list__block-popover",{"is-insertion-point-visible":g}),__unstablePopoverSlot:l,__unstableContentRef:a,resize:!1},I),w&&o&&(0,b.createElement)(QS,{focusOnMount:y.current,__experimentalInitialIndex:S.current,__experimentalOnIndexChange:e=>{S.current=e},key:t}),x&&(0,b.createElement)(_E,{clientId:t,rootClientId:n})):null}function AI(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:r,getBlock:o,getBlockParents:i,getSettings:l,isNavigationMode:a,__experimentalGetBlockListSettingsForBlocks:s}=e(pd),c=t()||n();if(!c)return;const{name:u,attributes:d={}}=o(c)||{},p=i(c),m=s(p),h=p.find((e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),f=l();return{clientId:c,rootClientId:r(c),name:u,isDistractionFree:f.isDistractionFree,isNavigationMode:a(),isEmptyDefaultBlock:u&&gr({name:u,attributes:d}),capturingClientId:h}}function LI(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=(0,un.Z)(AI,[]);if(!r)return null;const{clientId:o,rootClientId:i,name:l,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:u}=r;return l?(0,b.createElement)(PI,{clientId:o,rootClientId:i,isEmptyDefaultBlock:a,showContents:!c||u,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function RI(e){let{children:t}=e;const n=(0,b.useContext)(tE),r=(0,b.useContext)(gk.Context);return n||r?t:((0,j.default)('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,b.createElement)(rE,{__unstablePopoverSlot:"block-toolbar"},(0,b.createElement)(LI,{__unstablePopoverSlot:"block-toolbar"}),t))}const DI=(0,na.o)((e=>t=>{const{clientId:n}=vd();return(0,b.createElement)(e,(0,ta.Z)({},t,{clientId:n}))}),"withClientId"),MI=DI((e=>{let{clientId:t,showSeparator:n,isFloating:r,onAddBlock:o,isToggle:i}=e;return(0,b.createElement)(UC,{className:C()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:r,onAddBlock:o})})),OI=(0,B.Z)([DI,(0,ig.Z)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:r}=e(pd),o=r(n);return{lastBlockClientId:o[o.length-1]}}))])((e=>{let{clientId:t}=e;return(0,b.createElement)(VC,{rootClientId:t})})),FI=new WeakMap;var ZI=n(83086),jI=n(69693),zI=n(69793);function HI(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:r="insert"}=n,o=(0,un.Z)((e=>e(pd).getSettings().mediaUpload),[]),{canInsertBlockType:i,getBlockIndex:l,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,un.Z)(pd),{insertBlocks:u,moveBlocksToPosition:d,updateBlockAttributes:p,clearSelectedBlock:m,replaceBlocks:h,removeBlocks:f}=(0,dn.Z)(pd),g=(0,Jf.Z)(),v=(0,b.useCallback)((function(n){let o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===r){const r=s(e)[t];h(r,n,void 0,i)}else u(n,t,e,o,i)}),[r,s,u,h,t,e]),y=(0,b.useCallback)(((n,o,i)=>{if("replace"===r){const r=c(n),o=s(e)[t];g.batch((()=>{f(n,!1),h(o,r,void 0,0)}))}else d(n,o,e,i)}),[r,s,c,u,d,f,t,e]),_=function(e,t,n,r,o,i,l){return a=>{const{srcRootClientId:s,srcClientIds:c,type:u,blocks:d}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===u){l();const e=d.map((e=>ir(e)));i(e,!0,null)}if("block"===u){const i=n(c[0]);if(s===e&&i===t)return;if(c.includes(e)||r(c).some((t=>t===e)))return;const l=s===e,a=c.length;o(c,s,l&&i<t?t-a:t)}}}(e,t,l,a,y,v,m),k=function(e,t,n,r,o,i){return t=>{if(!n)return;const l=cr(ur("from"),(n=>"files"===n.type&&o(n.blockName,e)&&n.isMatch(t)));if(l){const e=l.transform(t,r);i(e)}}}(e,0,o,p,i,v),x=function(e,t,n){return e=>{const t=Ql({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}(0,0,v);return e=>{const t=(0,zI.f)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?x(n):t.length?k(t):_(e)}}function VI(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,b.useState)({index:null,operation:"insert"}),r=(0,un.Z)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:r,__unstableHasActiveBlockOverlayActive:o}=t(pd),i=n(e);return["all","contentOnly"].some((e=>e===i))||o(e)||r(e)}),[e]),{getBlockListSettings:o,getBlocks:i,getBlockIndex:l}=(0,un.Z)(pd),{showInsertionPoint:a,hideInsertionPoint:s}=(0,dn.Z)(pd),c=HI(e,t.index,{operation:t.operation}),u=(0,ZI.Z)((0,b.useCallback)(((t,r)=>{var s;const c=i(e);if(0===c.length)return void n({index:0,operation:"insert"});const u=c.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:gr(e),getBoundingClientRect:()=>r.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:l(t)}})),[d,p]=function(e,t){var n,r;const o="horizontal"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical")?["left","right"]:["top","bottom"],i=(0,O.isRTL)();let l=0,a="before",s=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:r,blockIndex:c}=e;const u=r();let[d,p]=function(e,t){let n,r;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"]).forEach((o=>{const i=function(e,t,n){const r="top"===n||"bottom"===n,{x:o,y:i}=e,l=r?o:i,a=r?i:o,s=r?t.left:t.top,c=r?t.right:t.bottom,u=t[n];let d;return d=l>=s&&l<=c?l:l<c?s:c,Math.sqrt((l-d)**2+(a-u)**2)}(e,t,o);(void 0===n||i<n)&&(n=i,r=o)})),[n,r]}(t,u,o);n&&function(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}(t,u)&&(d=0),d<s&&(a="bottom"===p||!i&&"right"===p||i&&"left"===p?"after":"before",s=d,l=c)}));const c=l+("after"===a?1:-1),u=!(null===(n=e[l])||void 0===n||!n.isUnmodifiedDefaultBlock),d=!(null===(r=e[c])||void 0===r||!r.isUnmodifiedDefaultBlock);return u||d?[u?l:c,"replace"]:["after"===a?l+1:l,"insert"]}(u,{x:t.clientX,y:t.clientY},null===(s=o(e))||void 0===s?void 0:s.orientation);n({index:d,operation:p}),a(e,d,{operation:p})}),[e]),200);return(0,jI.Z)({isDisabled:r,onDrop:c,onDragOver(e){u(e,e.currentTarget.ownerDocument)},onDragLeave(){u.cancel(),s()},onDragEnd(){u.cancel(),s()}})}const WI={};function UI(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:r,__experimentalDirectInsert:o,template:i,templateLock:l,wrapperRef:a,templateInsertUpdatesSelection:s,__experimentalCaptureToolbars:c,__experimentalAppenderTagName:u,renderAppender:d,orientation:p,placeholder:m,layout:h}=e;!function(e,t,n,r,o,i,l,a){const{updateBlockListSettings:s}=(0,dn.Z)(pd),c=(0,Jf.Z)(),{blockListSettings:u,parentLock:d}=(0,un.Z)((t=>{const n=t(pd).getBlockRootClientId(e);return{blockListSettings:t(pd).getBlockListSettings(e),parentLock:t(pd).getTemplateLock(n)}}),[e]),p=(0,b.useMemo)((()=>t),t);(0,b.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===o||"contentOnly"===d?d:o};if(void 0!==i&&(t.__experimentalCaptureToolbars=i),void 0!==l)t.orientation=l;else{const e=Ph(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==r&&(t.__experimentalDirectInsert=r),(0,P.default)(u,t)||(FI.get(c)||FI.set(c,[]),FI.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=FI.get(c))&&void 0!==e&&e.length&&c.batch((()=>{FI.get(c).forEach((e=>{s(...e)})),FI.set(c,[])}))})))}),[e,u,p,n,r,o,d,i,l,s,a,c])}(t,n,r,o,l,c,p,h),function(e,t,n,r){const{getBlocks:o,getSelectedBlocksInitialCaretPosition:i,isBlockSelected:l}=(0,un.Z)(pd),{replaceInnerBlocks:a,__unstableMarkNextChangeAsNotPersistent:s}=(0,dn.Z)(pd),{innerBlocks:c}=(0,un.Z)((t=>({innerBlocks:t(pd).getBlocks(e)})),[e]),u=(0,b.useRef)(null);(0,b.useLayoutEffect)((()=>{let c=!1;return window.queueMicrotask((()=>{if(c)return;const d=o(e),p=0===d.length||"all"===n||"contentOnly"===n,m=!T()(t,u.current);if(!p||!m)return;u.current=t;const h=ea(d,t);T()(h,d)||(s(),a(e,h,0===d.length&&r&&0!==h.length&&l(e),i()))})),()=>{c=!0}}),[c,t,n,e])}(t,i,l,s);const f=function(e){return(0,un.Z)((t=>{const n=t(pd).getBlock(e);if(!n)return;const r=t(Bo).getBlockType(n.name);return r&&0!==Object.keys(r.providesContext).length?Object.fromEntries(Object.entries(r.providesContext).map((e=>{let[t,r]=e;return[t,n.attributes[r]]}))):void 0}),[e])}(t),g=Yn((0,un.Z)((e=>{var n;return null===(n=e(pd).getBlock(t))||void 0===n?void 0:n.name}),[t]),"__experimentalLayout")||WI,{allowSizingOnChildren:v=!1}=g,y=am("layout")||WI,_=h||g,k=(0,b.useMemo)((()=>({...y,..._,...v&&{allowSizingOnChildren:!0}})),[y,_,v]);return(0,b.createElement)(dg,{value:f},(0,b.createElement)(nT,{rootClientId:t,renderAppender:d,__experimentalAppenderTagName:u,__experimentalLayout:k,wrapperRef:a,placeholder:m}))}function $I(e){return sk(e),(0,b.createElement)(UI,e)}const GI=(0,b.forwardRef)(((e,t)=>{const n=qI({ref:t},e);return(0,b.createElement)("div",{className:"block-editor-inner-blocks"},(0,b.createElement)("div",n))}));function qI(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:r}=t,{clientId:o,layout:i=null,__unstableLayoutClassNames:l=""}=vd(),a=(0,tg.Z)("medium","<"),{__experimentalCaptureToolbars:s,hasOverlay:c}=(0,un.Z)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:r,__unstableGetEditorMode:i}=e(pd),l=t(o),s="navigation"===i()||a;return{__experimentalCaptureToolbars:e(Bo).hasBlockSupport(l,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==l&&!n(o)&&!r(o,!0)&&s}}),[o,a]),u=VI({rootClientId:o}),d=(0,np.Z)([e.ref,r?null:u]),p={__experimentalCaptureToolbars:s,layout:i,...t},m=p.value&&p.onChange?$I:UI;return{...e,ref:d,className:C()(e.className,"block-editor-block-list__layout",n?"":l,{"has-overlay":c}),children:o?(0,b.createElement)(m,(0,ta.Z)({},p,{clientId:o})):(0,b.createElement)(nT,t)}}qI.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=Yo,n=ei(t,{isInnerBlocks:!0});return{...e,children:(0,b.createElement)(Wo.Z,null,n)}},GI.DefaultBlockAppender=OI,GI.ButtonBlockAppender=MI,GI.Content=()=>qI.save().children;const KI=GI,YI=(0,b.createContext)(),XI=(0,b.createContext)(),QI=new WeakMap;function JI(e){let{className:t,...n}=e;const[r,o]=(0,b.useState)(),i=(0,tg.Z)("medium"),{isOutlineMode:l,isFocusMode:a,editorMode:s}=(0,un.Z)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(pd),{outlineMode:r,focusMode:o}=t();return{isOutlineMode:r,isFocusMode:o,editorMode:n()}}),[]),c=(0,Jf.Z)(),{setBlockVisibility:u}=(0,dn.Z)(pd),d=(0,ng.Z)((0,b.useCallback)((()=>{const e={};QI.get(c).forEach((t=>{let[n,r]=t;e[n]=r})),u(e)}),[c]),300,{trailing:!0}),p=(0,b.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{QI.get(c)||QI.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");QI.get(c).push([e,t.isIntersecting])}d()}))}),[]),m=qI({ref:(0,np.Z)([vk(),oE(),o]),className:C()("is-root-container",t,{"is-outline-mode":l,"is-focus-mode":a&&i,"is-navigate-mode":"navigation"===s})},n);return(0,b.createElement)(YI.Provider,{value:r},(0,b.createElement)(XI.Provider,{value:p},(0,b.createElement)("div",m)))}function eT(e){return function(){const{patterns:e,isPreviewMode:t}=(0,un.Z)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(pd).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,b.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,r=-1;const o=()=>{r++,r>=e.length||((0,S.select)(pd).__experimentalGetParsedPattern(e[r].name),n=iE(o))};return n=iE(o),()=>lE(n)}),[e,t])}(),(0,b.createElement)(RI,null,(0,b.createElement)(gd,{value:hd},(0,b.createElement)(JI,e)))}function tT(e){let{placeholder:t,rootClientId:n,renderAppender:r,__experimentalAppenderTagName:o,__experimentalLayout:i=Ah}=e;const{order:l,selectedBlocks:a,visibleBlocks:s}=(0,un.Z)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:o}=e(pd);return{order:t(n),selectedBlocks:r(),visibleBlocks:o()}}),[n]);return(0,b.createElement)(Rh,{value:i},l.map((e=>(0,b.createElement)(eg.ZP,{key:e,value:!s.has(e)&&!a.includes(e)},(0,b.createElement)(V_,{rootClientId:n,clientId:e})))),l.length<1&&t,(0,b.createElement)(GC,{tagName:o,rootClientId:n,renderAppender:r}))}function nT(e){return(0,b.createElement)(eg.ZP,{value:!1},(0,b.createElement)(tT,e))}eT.__unstableElementContext=YI;const rT=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?$/,oT=["top","right","bottom","left"],iT=["color","style","width"],lT=e=>!e||!iT.some((t=>void 0!==e[t])),aT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).some((e=>-1!==oT.indexOf(e)))},sT=e=>{if(!aT(e))return!1;const t=oT.map((t=>cT(null==e?void 0:e[t])));return!t.every((e=>e===t[0]))},cT=(e,t)=>{if(lT(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:l=r,width:a=o}=e;return[a,a&&"0"!==a||i?l||"solid":l,i].filter(Boolean).join(" ")},uT=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(rT);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e))),dT=()=>{},pT=(0,jd.Iq)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){var t,n,r;const{className:o,hasValue:i,isShownByDefault:l=!1,label:a,panelId:s,resetAllFilter:c=dT,onDeselect:u,onSelect:d,...p}=(0,Zd.y)(e,"ToolsPanelItem"),{panelId:m,menuItems:h,registerResetAllFilter:f,deregisterResetAllFilter:g,registerPanelItem:v,deregisterPanelItem:y,flagItemCustomization:_,isResetting:k,shouldRenderPlaceholderItems:x,firstDisplayedItem:w,lastDisplayedItem:C,__experimentalFirstVisibleItemClass:E,__experimentalLastVisibleItemClass:S}=lf(),I=(0,b.useCallback)(i,[s,i]),T=(0,b.useCallback)(c,[s,c]),N=(0,tp.Z)(m),B=m===s||null===m;(0,b.useEffect)((()=>(B&&null!==N&&v({hasValue:I,isShownByDefault:l,label:a,panelId:s}),()=>{(null===N&&m||m===s)&&y(a)})),[m,B,l,a,I,s,N,v,y]),(0,b.useEffect)((()=>(B&&f(T),()=>{B&&g(T)})),[f,g,T,B]);const P=l?"default":"optional",A=null==h||null===(t=h[P])||void 0===t?void 0:t[a],L=(0,tp.Z)(A),R=void 0!==(null==h||null===(n=h[P])||void 0===n?void 0:n[a]),D=i(),M=(0,tp.Z)(D),O=D&&!M;(0,b.useEffect)((()=>{O&&(l||null===m)&&_(a,P)}),[m,O,l,P,a,_]),(0,b.useEffect)((()=>{R&&!k&&B&&(!A||D||L||null==d||d(),!A&&L&&(null==u||u()))}),[B,A,R,k,D,L,d,u]);const F=l?void 0!==(null==h||null===(r=h[P])||void 0===r?void 0:r[a]):A,Z=(0,zd.I)(),j=(0,b.useMemo)((()=>Z(Tf,x&&!F&&Nf,o,w===a&&E,C===a&&S)),[F,x,o,Z,w,C,E,S,a]);return{...p,isShown:F,shouldRenderPlaceholder:x,className:j}}(e);return r?(0,b.createElement)(rp.Z,(0,ta.Z)({},i,{ref:t}),n):o?(0,b.createElement)(rp.Z,(0,ta.Z)({},i,{ref:t})):null}),"ToolsPanelItem");var mT=n(12234),hT=n(59067);const fT=(0,Wd.css)("",""),gT={name:"bjn8wh",styles:"position:relative"},vT=e=>{const{color:t=Ud.D.gray[200],style:n="solid",width:r=$d.Z.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==$d.Z.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},bT={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};const yT=(0,jd.Iq)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,Zd.y)(e,"BorderBoxControlLinkedButton"),o=(0,zd.I)();return{...r,className:(0,b.useMemo)((()=>o((e=>(0,Wd.css)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,Dm.b)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,O.__)("Unlink sides"):(0,O.__)("Link sides");return(0,b.createElement)(kp.Z,{text:i},(0,b.createElement)(rp.Z,{className:n},(0,b.createElement)(ia.ZP,(0,ta.Z)({},o,{isSmall:!0,icon:r?mT.Z:hT.Z,iconSize:24,"aria-label":i,ref:t}))))}),"BorderBoxControlLinkedButton");const _T=(0,jd.Iq)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,Zd.y)(e,"BorderBoxControlVisualizer"),i=(0,zd.I)();return{...o,className:(0,b.useMemo)((()=>i(((e,t)=>(0,Wd.css)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",vT(null==e?void 0:e.top),";border-bottom:",vT(null==e?void 0:e.bottom),";",(0,Dm.b)({borderLeft:vT(null==e?void 0:e.left)})()," ",(0,Dm.b)({borderRight:vT(null==e?void 0:e.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({},r,{ref:t}))}),"BorderBoxControlVisualizer");var kT=n(15128),xT=n(89552),wT=n(38189),CT=n(24619),ET=n(26870);const ST={name:"f3vz0n",styles:"font-weight:500"},IT=(0,Wd.css)("box-shadow:inset 0 0 0 ",$d.Z.borderWidth," ",Ud.D.ui.borderFocus,";",""),TT=(0,Wd.css)("border:0;padding:0;margin:0;",ET.p,";",""),NT=(0,Wd.css)(Zm,"{flex:0 0 auto;}",""),BT=(0,Wd.css)("width:",228,"px;>div:first-of-type>",wf.ar,"{margin-bottom:0;",ST,";}&& ",wf.ar,"+button:not( .has-text ){min-width:24px;padding:0;}",""),PT=(0,Wd.css)("",""),AT=(0,Wd.css)("",""),LT=(0,Wd.css)("justify-content:center;width:100%;&&{border-top:",$d.Z.borderWidth," solid ",Ud.D.gray[200],";border-top-left-radius:0;border-top-right-radius:0;height:46px;}",""),RT=(0,Wd.css)(wf.ar,"{",ST,";}",""),DT={name:"1486260",styles:"&&&&&{min-width:30px;width:30px;height:30px;padding:3px;}"},MT=[{label:(0,O.__)("Solid"),icon:xT.Z,value:"solid"},{label:(0,O.__)("Dashed"),icon:wT.Z,value:"dashed"},{label:(0,O.__)("Dotted"),icon:CT.Z,value:"dotted"}],OT=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,b.createElement)(U_.Z,{as:"label"},t):(0,b.createElement)(wf.ar,null,t):null},FT=(0,jd.Iq)(((e,t)=>{const{buttonClassName:n,hideLabelFromVision:r,label:o,onChange:i,value:l,...a}=function(e){const{className:t,...n}=(0,Zd.y)(e,"BorderControlStylePicker"),r=(0,zd.I)();return{...n,className:(0,b.useMemo)((()=>r(RT,t)),[t,r]),buttonClassName:(0,b.useMemo)((()=>r(DT)),[r])}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({},a,{ref:t}),(0,b.createElement)(OT,{label:o,hideLabelFromVision:r}),(0,b.createElement)(Od.Z,{justify:"flex-start",gap:1},MT.map((e=>(0,b.createElement)(ia.ZP,{key:e.value,className:n,icon:e.icon,isSmall:!0,isPressed:e.value===l,onClick:()=>i(e.value===l?void 0:e.value),"aria-label":e.label,label:e.label,showTooltip:!0})))))}),"BorderControlStylePicker"),ZT=(0,b.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,b.createElement)("span",(0,ta.Z)({className:C()("component-color-indicator",n),style:{background:r},ref:t},o))}));var jT=n(6712),zT=n(23210);function HT(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,zT.uZ)(e,t,n)}`)}const VT=()=>(0,Wd.css)({height:30,minHeight:30},"",""),WT=(0,Vd.default)("div",{target:"e1epgpqk14"})({name:"1se47kl",styles:"-webkit-tap-highlight-color:transparent;align-items:flex-start;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%"}),UT=(0,Vd.default)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",(e=>{let{color:t=Ud.D.ui.borderFocus}=e;return(0,Wd.css)({color:t},"","")}),";",VT,";",(e=>{let{marks:t,__nextHasNoMarginBottom:n}=e;return n?"":(0,Wd.css)({marginBottom:t?16:void 0},"","")}),";"),$T=(0,Vd.default)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,Dm.b)({marginRight:6}),";"),GT=(0,Vd.default)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,Dm.b)({marginLeft:6}),";"),qT=(0,Vd.default)("span",{target:"e1epgpqk10"})("background-color:",Ud.D.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",(e=>{let{disabled:t,railColor:n}=e,r=n||"";return t&&(r=Ud.D.ui.backgroundDisabled),(0,Wd.css)({background:r},"","")}),";"),KT=(0,Vd.default)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",(e=>{let{disabled:t,trackColor:n}=e,r=n||"currentColor";return t&&(r=Ud.D.gray[400]),(0,Wd.css)({background:r},"","")}),";"),YT=(0,Vd.default)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),XT=(0,Vd.default)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",(e=>{let{disabled:t,isFilled:n}=e,r=n?"currentColor":Ud.D.gray[300];return t&&(r=Ud.D.gray[400]),(0,Wd.css)({backgroundColor:r},"","")}),";"),QT=(0,Vd.default)("span",{target:"e1epgpqk6"})("color:",Ud.D.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",(e=>{let{isFilled:t}=e;return(0,Wd.css)({color:t?Ud.D.gray[700]:Ud.D.gray[300]},"","")}),";"),JT=e=>{let{disabled:t}=e;return t?(0,Wd.css)("background-color:",Ud.D.gray[400],";",""):(0,Wd.css)("background-color:",Ud.D.ui.theme,";","")},eN=(0,Vd.default)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",JT,";",(0,Dm.b)({marginLeft:-10}),";",(0,Dm.b)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),tN=(0,Vd.default)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",JT,";",(e=>{let{isFocused:t}=e;return t?(0,Wd.css)("&::before{content:' ';position:absolute;background-color:",Ud.D.ui.theme,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):""}),";"),nN=(0,Vd.default)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );");var rN={name:"1cypxip",styles:"top:-80%"},oN={name:"1lr98c4",styles:"bottom:-80%"};const iN=(0,Vd.default)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;",(e=>{let{show:t}=e;return(0,Wd.css)({opacity:t?1:0},"","")}),";",(e=>{let{position:t}=e;return"bottom"===t?oN:rN}),";",(0,Gd.r)("transition"),";",(0,Dm.b)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),lN=(0,Vd.default)(Mm.Z,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;width:",(0,Fm.D)(16),"!important;input[type='number']&{",VT,";}",(0,Dm.b)({marginLeft:`${(0,Fm.D)(4)} !important`}),";"),aN=(0,Vd.default)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",VT,";}",(0,Dm.b)({marginLeft:8}),";"),sN=(0,b.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,b.createElement)(nN,(0,ta.Z)({},i,{"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o}))}));function cN(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,l=C()("components-range-control__mark",n&&"is-filled",t),a=C()("components-range-control__mark-label",n&&"is-filled");return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(XT,(0,ta.Z)({},i,{"aria-hidden":"true",className:l,isFilled:n,style:o})),r&&(0,b.createElement)(QT,{"aria-hidden":"true",className:a,isFilled:n,style:o},r))}function uN(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0,...a}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(qT,(0,ta.Z)({disabled:t},a)),n&&(0,b.createElement)(dN,{disabled:t,marks:n,min:r,max:o,step:i,value:l}))}function dN(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0}=e,a=function(e){let{marks:t,min:n=0,max:r=100,step:o=1,value:i=0}=e;if(!t)return[];const l=r-n;if(!Array.isArray(t)){t=[];const e=1+Math.round(l/o);for(;e>t.push({value:o*t.length+n}););}const a=[];return t.forEach(((e,t)=>{if(e.value<n||e.value>r)return;const o=`mark-${t}`,s=e.value<=i,c=(e.value-n)/l*100+"%",u={[(0,O.isRTL)()?"right":"left"]:c};a.push({...e,isFilled:s,key:o,style:u})})),a}({marks:n,min:r,max:o,step:"any"===i?1:i,value:l});return(0,b.createElement)(YT,{"aria-hidden":"true",className:"components-range-control__marks"},a.map((e=>(0,b.createElement)(cN,(0,ta.Z)({},e,{key:e.key,"aria-hidden":"true",disabled:t})))))}function pN(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:l=0,renderTooltipContent:a=(e=>e),zIndex:s=100,...c}=e,u=function(e){let{inputRef:t,tooltipPosition:n}=e;const[r,o]=(0,b.useState)(),i=(0,b.useCallback)((()=>{t&&t.current&&o(n)}),[n,t]);return(0,b.useEffect)((()=>{i()}),[i]),(0,b.useEffect)((()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}))),r}({inputRef:n,tooltipPosition:r}),d=C()("components-simple-tooltip",t),p={...i,zIndex:s};return(0,b.createElement)(iN,(0,ta.Z)({},c,{"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:p}),a(l))}const mN=()=>{},hN=(0,b.forwardRef)((function e(t,n){var r;const{__nextHasNoMarginBottom:o=!1,afterIcon:i,allowReset:l=!1,beforeIcon:a,className:s,color:c=Ud.D.ui.theme,currentInput:u,disabled:d=!1,help:p,hideLabelFromVision:m=!1,initialPosition:h,isShiftStepEnabled:f=!0,label:g,marks:v=!1,max:y=100,min:_=0,onBlur:k=mN,onChange:x=mN,onFocus:w=mN,onMouseLeave:E=mN,onMouseMove:S=mN,railColor:I,renderTooltipContent:T=(e=>e),resetFallbackValue:N,shiftStep:B=10,showTooltip:P,step:A=1,trackColor:L,value:R,withInputField:D=!0,...M}=t,[F,Z]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,l]=(0,Wm.Z)(HT(r,t,n),{initial:HT(null!=o?o:null,t,n),fallback:null});return[i,(0,b.useCallback)((e=>{l(null===e?null:HT(e,t,n))}),[t,n,l])]}({min:_,max:y,value:null!=R?R:null,initial:h}),j=(0,b.useRef)(!1);let z=P,H=D;"any"===A&&(z=!1,H=!1);const[V,W]=(0,b.useState)(z),[U,$]=(0,b.useState)(!1),G=(0,b.useRef)(),q=null===(r=G.current)||void 0===r?void 0:r.matches(":focus"),K=!d&&U,Y=null===F,X=Y?"":void 0!==F?F:u,Q=Y?(y-_)/2+_:F,J=Y?50:(F-_)/(y-_)*100,ee=`${(0,zT.uZ)(J,0,100)}%`,te=C()("components-range-control",s),ne=C()("components-range-control__wrapper",!!v&&"is-marked"),re=(0,ep.Z)(e,"inspector-range-control"),oe=p?`${re}__help`:void 0,ie=!1!==z&&Number.isFinite(F),le=()=>{let e=parseFloat(`${N}`),t=e;isNaN(e)&&(e=null,t=void 0),Z(e),x(t)},ae={[(0,O.isRTL)()?"right":"left"]:ee};return(0,b.createElement)(Hd.ZP,{__nextHasNoMarginBottom:o,className:te,label:g,hideLabelFromVision:m,id:`${re}`,help:p},(0,b.createElement)(WT,{className:"components-range-control__root"},a&&(0,b.createElement)($T,null,(0,b.createElement)(Ip.Z,{icon:a})),(0,b.createElement)(UT,{__nextHasNoMarginBottom:o,className:ne,color:c,marks:!!v},(0,b.createElement)(sN,(0,ta.Z)({},M,{className:"components-range-control__slider",describedBy:oe,disabled:d,id:`${re}`,label:g,max:y,min:_,onBlur:e=>{k(e),$(!1),W(!1)},onChange:e=>{const t=parseFloat(e.target.value);Z(t),x(t)},onFocus:e=>{w(e),$(!0),W(!0)},onMouseMove:S,onMouseLeave:E,ref:(0,np.Z)([G,n]),step:A,value:null!=X?X:void 0})),(0,b.createElement)(uN,{"aria-hidden":!0,disabled:d,marks:v,max:y,min:_,railColor:I,step:A,value:Q}),(0,b.createElement)(KT,{"aria-hidden":!0,className:"components-range-control__track",disabled:d,style:{width:ee},trackColor:L}),(0,b.createElement)(eN,{className:"components-range-control__thumb-wrapper",style:ae,disabled:d},(0,b.createElement)(tN,{"aria-hidden":!0,isFocused:K,disabled:d})),ie&&(0,b.createElement)(pN,{className:"components-range-control__tooltip",inputRef:G,tooltipPosition:"bottom",renderTooltipContent:T,show:q||V,style:ae,value:F})),i&&(0,b.createElement)(GT,null,(0,b.createElement)(Ip.Z,{icon:i})),H&&(0,b.createElement)(lN,{"aria-label":g,className:"components-range-control__number",disabled:d,inputMode:"decimal",isShiftStepEnabled:f,max:y,min:_,onBlur:()=>{j.current&&(le(),j.current=!1)},onChange:e=>{let t=parseFloat(e);Z(t),isNaN(t)?l&&(j.current=!0):((t<_||t>y)&&(t=HT(t,_,y)),x(t),j.current=!1)},shiftStep:B,step:A,value:X}),l&&(0,b.createElement)(aN,null,(0,b.createElement)(ia.ZP,{className:"components-range-control__reset",disabled:d||void 0===F,variant:"secondary",isSmall:!0,onClick:le},(0,O.__)("Reset")))))})),fN=hN,gN=(0,Vd.default)(Mm.Z,{target:"ez9hsf47"})(Om.W2,"{width:",(0,Fm.D)(24),";}"),vN=(0,Vd.default)(jT.Z,{target:"ez9hsf46"})("margin-left:",(0,Fm.D)(-2),";width:5em;",Om.Kg,"{display:none;}"),bN=(0,Vd.default)(fN,{target:"ez9hsf45"})("flex:1;margin-right:",(0,Fm.D)(2),";"),yN=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,Fm.D)(2)} );\n\tmargin-left: ${(0,Fm.D)(1)};\n}`,_N=(0,Vd.default)("div",{target:"ez9hsf44"})("padding-top:",(0,Fm.D)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),kN=(0,Vd.default)(kf.Z,{target:"ez9hsf43"})("padding-left:",(0,Fm.D)(4),";padding-right:",(0,Fm.D)(4),";"),xN=(0,Vd.default)(Od.Z,{target:"ez9hsf42"})("padding-top:",(0,Fm.D)(4),";padding-left:",(0,Fm.D)(4),";padding-right:",(0,Fm.D)(3),";padding-bottom:",(0,Fm.D)(5),";"),wN=(0,Vd.default)("div",{target:"ez9hsf41"})(ET.p,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,Fm.D)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,Fm.D)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",$d.Z.borderWidthFocus," #fff;}",yN,";"),CN=(0,Vd.default)(ia.ZP,{target:"ez9hsf40"})("&&&&&{min-width:",(0,Fm.D)(6),";padding:0;>svg{margin-right:0;}}");var EN=n(33955),SN=n(6686);const IN=(0,b.createContext)({});var TN=n(23561);const NN=(0,jd.Iq)((function(e,t){const{as:n="span",shortcut:r,className:o,...i}=(0,Zd.y)(e,"Shortcut");if(!r)return null;let l,a;return"string"==typeof r?l=r:(l=r.display,a=r.ariaLabel),(0,b.createElement)(rp.Z,(0,ta.Z)({as:n,className:o,"aria-label":a,ref:t},i),l)}),"Shortcut"),BN=(0,Wd.css)("z-index:",1000002,";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ",$d.Z.transitionDurationFastest," ease;font-size:",$d.Z.fontSize,";&[data-enter]{opacity:1;}",""),PN=(0,Vd.default)("div",{target:"e7tfjmw1"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:",Ud.D.white,";padding:4px 8px;"),AN={name:"12mkfdx",styles:"outline:none"},LN=(0,Vd.default)(NN,{target:"e7tfjmw0"})("display:inline-block;margin-left:",(0,Fm.D)(1),";"),{TooltipPopoverView:RN}=h,DN=(0,jd.Iq)((function(e,t){const{children:n,className:r,...o}=(0,Zd.y)(e,"TooltipContent"),{tooltip:i}=(0,b.useContext)(IN),l=(0,zd.I)()(BN,r);return(0,b.createElement)(TN.u,(0,ta.Z)({as:rp.Z},o,i,{className:l,ref:t}),(0,b.createElement)(RN,null,n))}),"TooltipContent"),MN=(0,jd.Iq)((function(e,t){const{animated:n=!0,animationDuration:r=160,baseId:o,children:i,content:l,focusable:a=!0,gutter:s=4,id:c,modal:u=!0,placement:d,visible:p=!1,shortcut:m,...h}=(0,Zd.y)(e,"Tooltip"),f=(0,EN.K)({animated:n?r:void 0,baseId:o||c,gutter:s,placement:d,visible:p,...h}),g=(0,b.useMemo)((()=>({tooltip:f})),[f]);return(0,b.createElement)(IN.Provider,{value:g},l&&(0,b.createElement)(DN,{unstable_portal:u,ref:t},l,m&&(0,b.createElement)(LN,{shortcut:m})),i&&(0,b.createElement)(SN.v,(0,ta.Z)({},f,i.props,{ref:null==i?void 0:i.ref}),(e=>(a||(e.tabIndex=void 0),(0,b.cloneElement)(i,e)))))}),"Tooltip"),ON=MN,FN=e=>{const{color:t,colorType:n}=e,[r,o]=(0,b.useState)(null),i=(0,b.useRef)(),l=(0,aS.Z)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,b.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,b.createElement)(ON,{content:(0,b.createElement)(HE.Z,{color:"white"},r===t.toHex()?(0,O.__)("Copied!"):(0,O.__)("Copy")),placement:"bottom"},(0,b.createElement)(CN,{isSmall:!0,ref:l,icon:OE.Z,showTooltip:!1}))},ZN=e=>{let{min:t,max:n,label:r,abbreviation:o,onChange:i,value:l}=e;return(0,b.createElement)(kf.Z,{spacing:4},(0,b.createElement)(gN,{min:t,max:n,label:r,hideLabelFromVision:!0,value:l,onChange:e=>{i(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,b.createElement)(Ow.Z,{as:HE.Z,paddingLeft:(0,Fm.D)(4),color:Ud.D.ui.theme,lineHeight:1},o),spinControls:"none",size:"__unstable-large"}),(0,b.createElement)(bN,{__nextHasNoMarginBottom:!0,label:r,hideLabelFromVision:!0,min:t,max:n,value:l,onChange:i,withInputField:!1}))},jN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{r:o,g:i,b:l,a}=t.toRgb();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ZN,{min:0,max:255,label:"Red",abbreviation:"R",value:o,onChange:e=>n((0,Tn.Vi)({r:e,g:i,b:l,a}))}),(0,b.createElement)(ZN,{min:0,max:255,label:"Green",abbreviation:"G",value:i,onChange:e=>n((0,Tn.Vi)({r:o,g:e,b:l,a}))}),(0,b.createElement)(ZN,{min:0,max:255,label:"Blue",abbreviation:"B",value:l,onChange:e=>n((0,Tn.Vi)({r:o,g:i,b:e,a}))}),r&&(0,b.createElement)(ZN,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>n((0,Tn.Vi)({r:o,g:i,b:l,a:e/100}))}))},zN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{h:o,s:i,l,a}=t.toHsl();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ZN,{min:0,max:359,label:"Hue",abbreviation:"H",value:o,onChange:e=>{n((0,Tn.Vi)({h:e,s:i,l,a}))}}),(0,b.createElement)(ZN,{min:0,max:100,label:"Saturation",abbreviation:"S",value:i,onChange:e=>{n((0,Tn.Vi)({h:o,s:e,l,a}))}}),(0,b.createElement)(ZN,{min:0,max:100,label:"Lightness",abbreviation:"L",value:l,onChange:e=>{n((0,Tn.Vi)({h:o,s:i,l:e,a}))}}),r&&(0,b.createElement)(ZN,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>{n((0,Tn.Vi)({h:o,s:i,l,a:e/100}))}}))};var HN=n(83297);const VN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;return(0,b.createElement)(HN.gs,{prefix:(0,b.createElement)(Ow.Z,{as:HE.Z,marginLeft:(0,Fm.D)(4),color:Ud.D.ui.theme,lineHeight:1},"#"),value:t.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const t=e.startsWith("#")?e:"#"+e;n((0,Tn.Vi)(t))},maxLength:r?9:7,label:(0,O.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{var n,r,o,i;const l=null===(n=t.payload)||void 0===n||null===(r=n.event)||void 0===r?void 0:r.nativeEvent;if("insertFromPaste"!==(null==l?void 0:l.inputType))return{...e};const a=null!==(o=e.value)&&void 0!==o&&o.startsWith("#")?e.value.slice(1).toUpperCase():null===(i=e.value)||void 0===i?void 0:i.toUpperCase();return{...e,value:a}},__unstableInputWidth:"9em"})},WN=e=>{let{colorType:t,color:n,onChange:r,enableAlpha:o}=e;const i={color:n,onChange:r,enableAlpha:o};switch(t){case"hsl":return(0,b.createElement)(zN,i);case"rgb":return(0,b.createElement)(jN,i);default:return(0,b.createElement)(VN,i)}};var UN=n(83664);const $N=e=>{let{color:t,enableAlpha:n,onChange:r}=e;const o=n?UN.RgbaStringColorPicker:UN.RgbStringColorPicker,i=(0,b.useMemo)((()=>t.toRgbString()),[t]);return(0,b.createElement)(o,{color:i,onChange:e=>{r((0,Tn.Vi)(e))}})};(0,Tn.l7)([Nn.Z]);const GN=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],qN=(0,jd.Iq)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:l,...a}=(0,Zd.y)(e,"ColorPicker"),[s,c]=function(e){let{defaultValue:t,onChange:n,value:r}=e;const o=void 0!==r,i=o?r:t,[l,a]=(0,b.useState)(i);let s;return s=o&&"function"==typeof n?n:o||"function"!=typeof n?a:e=>{n(e),a(e)},[o?r:l,s]}({onChange:o,value:r,defaultValue:i}),u=(0,b.useMemo)((()=>(0,Tn.Vi)(s||"")),[s]),d=(0,ng.Z)(c),p=(0,b.useCallback)((e=>{d(e.toHex())}),[d]),[m,h]=(0,b.useState)(l||"hex");return(0,b.createElement)(wN,(0,ta.Z)({ref:t},a),(0,b.createElement)($N,{onChange:p,color:u,enableAlpha:n}),(0,b.createElement)(_N,null,(0,b.createElement)(kN,{justify:"space-between"},(0,b.createElement)(vN,{__nextHasNoMarginBottom:!0,options:GN,value:m,onChange:e=>h(e),label:(0,O.__)("Color format"),hideLabelFromVision:!0}),(0,b.createElement)(FN,{color:u,colorType:l||m})),(0,b.createElement)(xN,{direction:"column",gap:2},(0,b.createElement)(WN,{colorType:m,color:u,onChange:p,enableAlpha:n}))))}),"ColorPicker"),KN=qN;function YN(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const XN=Oi()((e=>{const t=(0,Tn.Vi)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}})),QN=e=>(0,b.createElement)(KN,function(e){const{onChangeComplete:t}=e,n=(0,b.useCallback)((e=>{t(XN(e))}),[t]);return function(e){var t;return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof(null===(t=e.color)||void 0===t?void 0:t.hex)}(e)?{color:YN(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}(e));function JN(e){const{actions:t,className:n,options:r,children:o}=e;return(0,b.createElement)("div",{className:C()("components-circular-option-picker",n)},(0,b.createElement)("div",{className:"components-circular-option-picker__swatches"},r),o,t&&(0,b.createElement)("div",{className:"components-circular-option-picker__custom-clear-wrapper"},t))}JN.Option=function(e){let{className:t,isSelected:n,selectedIconProps:r,tooltipText:o,...i}=e;const l=(0,b.createElement)(ia.ZP,(0,ta.Z)({isPressed:n,className:"components-circular-option-picker__option"},i));return(0,b.createElement)("div",{className:C()(t,"components-circular-option-picker__option-wrapper")},o?(0,b.createElement)(kp.Z,{text:o},l):l,n&&(0,b.createElement)(Gm.Z,(0,ta.Z)({icon:bf.Z},r||{})))},JN.ButtonAction=function(e){let{className:t,children:n,...r}=e;return(0,b.createElement)(ia.ZP,(0,ta.Z)({className:C()("components-circular-option-picker__clear",t),variant:"tertiary"},r),n)},JN.DropdownLinkAction=function(e){let{buttonProps:t,className:n,dropdownProps:r,linkText:o}=e;return(0,b.createElement)(W_.Z,(0,ta.Z)({className:C()("components-circular-option-picker__dropdown-link-action",n),renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,b.createElement)(ia.ZP,(0,ta.Z)({"aria-expanded":n,"aria-haspopup":"true",onClick:r,variant:"link"},t),o)}},r))};const eB=JN,tB=(0,Vd.default)(xf.Z,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),nB=(0,Vd.default)("div",{target:"eovvns30"})("margin-left:",(0,Fm.D)(-2),";margin-right:",(0,Fm.D)(-2),";&:first-of-type{margin-top:",(0,Fm.D)(-2),";}&:last-of-type{margin-bottom:",(0,Fm.D)(-2),";}",(e=>{let{paddingSize:t="small"}=e;if("none"===t)return;const n={small:(0,Fm.D)(2),medium:(0,Fm.D)(4)};return(0,Wd.css)("padding:",n[t]||n.small,";","")}),";"),rB=(0,jd.Iq)((function(e,t){const{paddingSize:n="small",...r}=(0,Zd.y)(e,"DropdownContentWrapper");return(0,b.createElement)(nB,(0,ta.Z)({},r,{paddingSize:n,ref:t}))}),"DropdownContentWrapper");(0,Tn.l7)([Nn.Z,An]);const oB=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function iB(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:l}=e;const a=(0,b.useMemo)((()=>r.map(((e,t)=>{let{color:r,name:l}=e;const a=(0,Tn.Vi)(r),s=i===r;return(0,b.createElement)(eB.Option,{key:`${r}-${t}`,isSelected:s,selectedIconProps:s?{fill:a.contrast()>a.contrast("#000")?"#fff":"#000"}:{},tooltipText:l||(0,O.sprintf)((0,O.__)("Color code: %s"),r),style:{backgroundColor:r,color:r},onClick:s?n:()=>o(r,t),"aria-label":l?(0,O.sprintf)((0,O.__)("Color: %s"),l):(0,O.sprintf)((0,O.__)("Color code: %s"),r)})}))),[r,i,o,n]);return(0,b.createElement)(eB,{className:t,options:a,actions:l})}function lB(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:l,headingLevel:a}=e;return 0===r.length?null:(0,b.createElement)(Mw.Z,{spacing:3,className:t},r.map(((e,t)=>{let{name:s,colors:c}=e;return(0,b.createElement)(Mw.Z,{spacing:2,key:t},(0,b.createElement)(tB,{level:a},s),(0,b.createElement)(iB,{clearColor:n,colors:c,onChange:e=>o(e,t),value:i,actions:r.length===t+1?l:null}))})))}function aB(e){let{isRenderedInSidebar:t,popoverProps:n,...r}=e;const o=(0,b.useMemo)((()=>({shift:!0,...t?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...n})),[t,n]);return(0,b.createElement)(W_.Z,(0,ta.Z)({contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:o},r))}(0,Tn.l7)([Nn.Z,An]);const sB=(0,b.forwardRef)((function(e,t){const{clearable:n=!0,colors:r=[],disableCustomColors:o=!1,enableAlpha:i=!1,onChange:l,value:a,__experimentalIsRenderedInSidebar:s=!1,headingLevel:c=2,...u}=e,[d,p]=(0,b.useState)(a),m=(0,b.useCallback)((()=>l(void 0)),[l]),h=(0,b.useCallback)((e=>{p(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=null==r?void 0:r.getComputedStyle(t).backgroundColor;return o?(0,Tn.Vi)(o).toHex():e})(a,e))}),[a]),f=oB(r),g=(0,b.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,Tn.Vi)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,Tn.Vi)(n).toHex()))return t;return(0,O.__)("Custom")}(a,r,f)),[a,r,f]),v=(0,Tn.Vi)(null!=d?d:""),y=null!=a&&a.startsWith("#")?a.substring(1):null!=a?a:"",_=y?(0,O.sprintf)((0,O.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),g,y):(0,O.__)("Custom color picker."),k={clearable:n,clearColor:m,onChange:l,value:a,actions:!!n&&(0,b.createElement)(eB.ButtonAction,{onClick:m},(0,O.__)("Clear")),headingLevel:c};return(0,b.createElement)(Mw.Z,(0,ta.Z)({spacing:3,ref:t},u),!o&&(0,b.createElement)(aB,{isRenderedInSidebar:s,renderContent:()=>(0,b.createElement)(rB,{paddingSize:"none"},(0,b.createElement)(QN,{color:d,onChange:e=>l(e),enableAlpha:i})),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,b.createElement)(Od.Z,{as:"button",ref:h,justify:"space-between",align:"flex-start",className:"components-color-palette__custom-color","aria-expanded":t,"aria-haspopup":"true",onClick:n,"aria-label":_,style:(r=a,void 0===r||0===(0,Tn.Vi)(r).alpha()?{color:"#000"}:{background:a,color:v.contrast()>v.contrast("#000")?"#fff":"#000"})},(0,b.createElement)(Fd.Z,{isBlock:!0,as:kx,className:"components-color-palette__custom-color-name"},g),(0,b.createElement)(Fd.Z,{as:"span",className:"components-color-palette__custom-color-value"},y));var r}}),f?(0,b.createElement)(lB,(0,ta.Z)({},k,{colors:r})):(0,b.createElement)(iB,(0,ta.Z)({},k,{colors:r})))}));function cB(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:l,previousStyleSelection:a,size:s="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,Zd.y)(e,"BorderControlDropdown"),[d]=Pm(null==t?void 0:t.width),p=0===d,m=(0,zd.I)(),h=(0,b.useMemo)((()=>m((e=>(0,Wd.css)("background:#fff;&&>button{height:","__unstable-large"===e?"40px":"30px",";width:","__unstable-large"===e?"40px":"30px",";padding:0;display:flex;align-items:center;justify-content:center;",(0,Dm.b)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",$d.Z.borderWidth," solid ",Ud.D.ui.border,";&:focus,&:hover:not( :disabled ){",IT," border-color:",Ud.D.ui.borderFocus,";z-index:1;position:relative;}}",""))(s),n)),[n,m,s]),f=(0,b.useMemo)((()=>m(AT)),[m]),g=(0,b.useMemo)((()=>m(((e,t)=>{const{style:n}=e||{};return(0,Wd.css)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?Ud.D.gray[300]:void 0;return(0,Wd.css)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,Fm.D)(4),";width:",(0,Fm.D)(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")})(t,s))),[t,m,s]),v=(0,b.useMemo)((()=>m(BT)),[m]),y=(0,b.useMemo)((()=>m(PT)),[m]),_=(0,b.useMemo)((()=>m(LT)),[m]);return{...u,border:t,className:h,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:f,indicatorWrapperClassName:g,onColorChange:e=>{const n="none"===(null==t?void 0:t.style)?a:null==t?void 0:t.style,r=p&&e?"1px":null==t?void 0:t.width;l({color:e,style:n,width:r})},onStyleChange:e=>{const n=p&&e?"1px":null==t?void 0:t.width;l({...t,style:e,width:n})},onReset:()=>{l({...t,color:void 0,style:void 0})},popoverContentClassName:y,popoverControlsClassName:v,resetButtonClassName:_,__experimentalIsRenderedInSidebar:c}}const uB=(0,jd.Iq)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:l,enableStyle:a,indicatorClassName:s,indicatorWrapperClassName:c,onReset:u,onColorChange:d,onStyleChange:p,popoverContentClassName:m,popoverControlsClassName:h,resetButtonClassName:f,showDropdownHeader:g,__unstablePopoverProps:v,...y}=cB(e),{color:_,style:k}=r||{},x=((e,t)=>{if(e&&t){if(oB(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),w=((e,t,n,r)=>r?t?n?(0,O.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,t.color,n):(0,O.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?n?(0,O.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',e,n):(0,O.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',e):(0,O.__)("Border color and style picker."):t?(0,O.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?(0,O.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',e):(0,O.__)("Border color picker."))(_,x,k,a),C=_||k&&"none"!==k,E=n?"bottom left":void 0;return(0,b.createElement)(W_.Z,(0,ta.Z)({renderToggle:e=>{let{onToggle:t}=e;return(0,b.createElement)(ia.ZP,{onClick:t,variant:"tertiary","aria-label":w,tooltipPosition:E,label:(0,O.__)("Border color and style picker"),showTooltip:!0},(0,b.createElement)("span",{className:c},(0,b.createElement)(ZT,{className:s,colorValue:_})))},renderContent:e=>{let{onClose:t}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(rB,{paddingSize:"medium"},(0,b.createElement)(Mw.Z,{className:h,spacing:6},g?(0,b.createElement)(kf.Z,null,(0,b.createElement)(wf.ar,null,(0,O.__)("Border color")),(0,b.createElement)(ia.ZP,{isSmall:!0,label:(0,O.__)("Close border color"),icon:kT.Z,onClick:t})):void 0,(0,b.createElement)(sB,{className:m,value:_,onChange:d,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:l}),a&&(0,b.createElement)(FT,{label:(0,O.__)("Style"),value:k,onChange:p}))),C&&(0,b.createElement)(rB,{paddingSize:"none"},(0,b.createElement)(ia.ZP,{className:f,variant:"tertiary",onClick:()=>{u(),t()}},(0,O.__)("Reset to default"))))},popoverProps:{...v}},y,{ref:t}))}),"BorderControlDropdown"),dB=uB;const pB=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,b.createElement)(U_.Z,{as:"legend"},t):(0,b.createElement)(wf.ar,{as:"legend"},t):null},mB=(0,jd.Iq)(((e,t)=>{const{colors:n,disableCustomColors:r,disableUnits:o,enableAlpha:i,enableStyle:l,hideLabelFromVision:a,innerWrapperClassName:s,inputWidth:c,label:u,onBorderChange:d,onSliderChange:p,onWidthChange:m,placeholder:h,__unstablePopoverProps:f,previousStyleSelection:g,showDropdownHeader:v,size:y,sliderClassName:_,value:k,widthUnit:x,widthValue:w,withSlider:C,__experimentalIsRenderedInSidebar:E,...S}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:l=!0,shouldSanitizeBorder:a=!0,size:s="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,...p}=(0,Zd.y)(e,"BorderControl"),[m,h]=Pm(null==c?void 0:c.width),f=h||"px",g=0===m,[v,y]=(0,b.useState)(),[_,k]=(0,b.useState)(),x=(0,b.useCallback)((e=>{if(a)return o((e=>{const t=void 0===(null==e?void 0:e.width)||""===e.width,n=void 0===(null==e?void 0:e.color);if(!t||!n)return e})(e));o(e)}),[o,a]),w=(0,b.useCallback)((e=>{const t=""===e?void 0:e,[n]=Pm(e),r=0===n,o={...c,width:t};r&&!g&&(y(null==c?void 0:c.color),k(null==c?void 0:c.style),o.color=void 0,o.style="none"),!r&&g&&(void 0===o.color&&(o.color=v),"none"===o.style&&(o.style=_)),x(o)}),[c,g,v,_,x]),C=(0,b.useCallback)((e=>{w(`${e}${f}`)}),[w,f]),E=(0,zd.I)(),S=(0,b.useMemo)((()=>E(TT,t)),[t,E]);let I=u;r&&(I="__unstable-large"===s?"116px":"90px");const T=(0,b.useMemo)((()=>{const e=!!I&&NT,t=(e=>(0,Wd.css)("height:","__unstable-large"===e?"40px":"30px",";",""))(s);return E((0,Wd.css)(Zm,"{flex:1 1 40%;}&& ",Hm,"{min-height:0;}",""),e,t)}),[I,E,s]),N=(0,b.useMemo)((()=>E((0,Wd.css)("flex:1 1 60%;",(0,Dm.b)({marginRight:(0,Fm.D)(3)})(),";",""))),[E]);return{...p,className:S,colors:n,enableAlpha:i,enableStyle:l,innerWrapperClassName:T,inputWidth:I,onBorderChange:x,onSliderChange:C,onWidthChange:w,previousStyleSelection:_,sliderClassName:N,value:c,widthUnit:f,widthValue:m,size:s,__experimentalIsRenderedInSidebar:d}}(e);return(0,b.createElement)(rp.Z,(0,ta.Z)({as:"fieldset"},S,{ref:t}),(0,b.createElement)(pB,{label:u,hideLabelFromVision:a}),(0,b.createElement)(kf.Z,{spacing:4,className:s},(0,b.createElement)($m,{prefix:(0,b.createElement)(dB,{border:k,colors:n,__unstablePopoverProps:f,disableCustomColors:r,enableAlpha:i,enableStyle:l,onChange:d,previousStyleSelection:g,showDropdownHeader:v,__experimentalIsRenderedInSidebar:E,size:y}),label:(0,O.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:(null==k?void 0:k.width)||"",placeholder:h,disableUnits:o,__unstableInputWidth:c,size:y}),C&&(0,b.createElement)(fN,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:p,step:["px","%"].includes(x)?1:.1,value:w||void 0,withInputField:!1})))}),"BorderControl"),hB=mB;const fB=(0,jd.Iq)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,onChange:a,popoverPlacement:s,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:p,__experimentalIsRenderedInSidebar:m,...h}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:l=!1,...a}=(0,Zd.y)(e,"BorderBoxControlSplitControls"),s=(0,zd.I)(),c=(0,b.useMemo)((()=>s((e=>(0,Wd.css)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[s,t,i]);return{...a,centeredClassName:(0,b.useMemo)((()=>s(bT,t)),[s,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,b.useMemo)((()=>s((0,Wd.css)((0,Dm.b)({marginLeft:"auto"})(),";",""),t)),[s,t]),size:i,__experimentalIsRenderedInSidebar:l}}(e),[f,g]=(0,b.useState)(null),v=(0,b.useMemo)((()=>s?{placement:s,offset:c,anchor:f,shift:!0}:void 0),[s,c,f]),y={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,isCompact:!0,__experimentalIsRenderedInSidebar:m,size:d},_=(0,np.Z)([g,t]);return(0,b.createElement)(jf,(0,ta.Z)({},h,{ref:_,gap:4}),(0,b.createElement)(_T,{value:p,size:d}),(0,b.createElement)(hB,(0,ta.Z)({className:n,hideLabelFromVision:!0,label:(0,O.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:v,value:null==p?void 0:p.top},y)),(0,b.createElement)(hB,(0,ta.Z)({hideLabelFromVision:!0,label:(0,O.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:v,value:null==p?void 0:p.left},y)),(0,b.createElement)(hB,(0,ta.Z)({className:u,hideLabelFromVision:!0,label:(0,O.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:v,value:null==p?void 0:p.right},y)),(0,b.createElement)(hB,(0,ta.Z)({className:n,hideLabelFromVision:!0,label:(0,O.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:v,value:null==p?void 0:p.bottom},y)))}),"BorderBoxControlSplitControls");function gB(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:l="default",value:a,__experimentalIsRenderedInSidebar:s=!1,...c}=(0,Zd.y)(e,"BorderBoxControl"),u=sT(a),d=aT(a),p=d?(e=>{if(!e)return;const t=[],n=[],r=[];oT.forEach((o=>{var i,l,a;t.push(null===(i=e[o])||void 0===i?void 0:i.color),n.push(null===(l=e[o])||void 0===l?void 0:l.style),r.push(null===(a=e[o])||void 0===a?void 0:a.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),l=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:l?r[0]:uT(r)}})(a):a,m=d?a:(e=>{if(e&&!lT(e))return{top:e,right:e,bottom:e,left:e}})(a),h=!isNaN(parseFloat(`${null==p?void 0:p.width}`)),[f,g]=(0,b.useState)(!u),v=(0,zd.I)(),y=(0,b.useMemo)((()=>v(fT,t)),[v,t]),_=(0,b.useMemo)((()=>v((0,Wd.css)("flex:1;",(0,Dm.b)({marginRight:"24px"})(),";",""))),[v]),k=(0,b.useMemo)((()=>v(gT)),[v]);return{...c,className:y,colors:n,disableUnits:u&&!h,enableAlpha:o,enableStyle:i,hasMixedBorders:u,isLinked:f,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!u||(t=e)&&iT.every((e=>void 0!==t[e])))return r(lT(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(p,e),o={top:{...null==a?void 0:a.top,...n},right:{...null==a?void 0:a.right,...n},bottom:{...null==a?void 0:a.bottom,...n},left:{...null==a?void 0:a.left,...n}};if(sT(o))return r(o);const i=lT(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};sT(n)?r(n):r(e)},toggleLinked:()=>g(!f),linkedValue:p,size:l,splitValue:m,wrapperClassName:k,__experimentalIsRenderedInSidebar:s}}const vB=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,b.createElement)(U_.Z,{as:"label"},t):(0,b.createElement)(wf.ar,null,t):null},bB=(0,jd.Iq)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:l,enableStyle:a,hasMixedBorders:s,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:p,linkedValue:m,onLinkedChange:h,onSplitChange:f,popoverPlacement:g,popoverOffset:v,size:y,splitValue:_,toggleLinked:k,wrapperClassName:x,__experimentalIsRenderedInSidebar:w,...C}=gB(e),[E,S]=(0,b.useState)(null),I=(0,b.useMemo)((()=>g?{placement:g,offset:v,anchor:E,shift:!0}:void 0),[g,v,E]),T=(0,np.Z)([S,t]);return(0,b.createElement)(rp.Z,(0,ta.Z)({className:n},C,{ref:T}),(0,b.createElement)(vB,{label:d,hideLabelFromVision:c}),(0,b.createElement)(rp.Z,{className:x},u?(0,b.createElement)(hB,{className:p,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:l,enableStyle:a,onChange:h,placeholder:s?(0,O.__)("Mixed"):void 0,__unstablePopoverProps:I,shouldSanitizeBorder:!1,value:m,withSlider:!0,width:"__unstable-large"===y?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:y}):(0,b.createElement)(fB,{colors:r,disableCustomColors:o,enableAlpha:l,enableStyle:a,onChange:f,popoverPlacement:g,popoverOffset:v,value:_,__experimentalIsRenderedInSidebar:w,size:y}),(0,b.createElement)(yT,{onClick:k,isLinked:u,size:y})))}),"BorderBoxControl"),yB=bB;function _B(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function kB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||_B(Object.values(n).filter(Boolean))||"px"}function xB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>Pm(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=_B(r);return 0===o||o?`${o}${i}`:void 0}function wB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=xB(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function CB(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function EB(e){let{onChange:t,selectedUnits:n,setSelectedUnits:r,values:o,...i}=e,l=xB(o);void 0===l&&(l=kB(n));const a=CB(o)&&wB(o),s=a?(0,O.__)("Mixed"):null;return(0,b.createElement)($m,(0,ta.Z)({},i,{"aria-label":(0,O.__)("Border radius"),disableUnits:a,isOnly:!0,value:l,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{r({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}const SB={topLeft:(0,O.__)("Top left"),topRight:(0,O.__)("Top right"),bottomLeft:(0,O.__)("Bottom left"),bottomRight:(0,O.__)("Bottom right")};function IB(e){let{onChange:t,selectedUnits:n,setSelectedUnits:r,values:o,...i}=e;const l=e=>n=>{if(!t)return;const r=isNaN(parseFloat(n))?void 0:n;t({...a,[e]:r})},a="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,b.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(SB).map((e=>{let[t,o]=e;const[s,c]=Pm(a[t]),u=a[t]?c:n[t]||n.flat;return(0,b.createElement)(kp.Z,{text:o,position:"top",key:t},(0,b.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,b.createElement)($m,(0,ta.Z)({},i,{"aria-label":o,value:[s,u].join(""),onChange:l(t),onUnitChange:(d=t,e=>{const t={...n};t[d]=e,r(t)}),size:"__unstable-large"}))));var d})))}function TB(e){let{isLinked:t,...n}=e;const r=t?(0,O.__)("Unlink radii"):(0,O.__)("Link radii");return(0,b.createElement)(kp.Z,{text:r},(0,b.createElement)("span",null,(0,b.createElement)(ia.ZP,(0,ta.Z)({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?mT.Z:hT.Z,iconSize:24,"aria-label":r}))))}const NB={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},BB=0,PB={px:100,em:20,rem:20};function AB(e){let{onChange:t,values:n}=e;const[r,o]=(0,b.useState)(!CB(n)||!wB(n)),[i,l]=(0,b.useState)({flat:"string"==typeof n?Pm(n)[1]:void 0,topLeft:Pm(null==n?void 0:n.topLeft)[1],topRight:Pm(null==n?void 0:n.topRight)[1],bottomLeft:Pm(null==n?void 0:n.bottomLeft)[1],bottomRight:Pm(null==n?void 0:n.bottomRight)[1]}),a=Lm({availableUnits:am("spacing.units")||["px","em","rem"]}),s=kB(i),c=a&&a.find((e=>e.value===s)),u=(null==c?void 0:c.step)||1,[d]=Pm(xB(n));return(0,b.createElement)("fieldset",{className:"components-border-radius-control"},(0,b.createElement)(Hd.ZP.VisualLabel,{as:"legend"},(0,O.__)("Radius")),(0,b.createElement)("div",{className:"components-border-radius-control__wrapper"},r?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(EB,{className:"components-border-radius-control__unit-control",values:n,min:BB,onChange:t,selectedUnits:i,setSelectedUnits:l,units:a}),(0,b.createElement)(fN,{label:(0,O.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:BB,max:PB[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:u,__nextHasNoMarginBottom:!0})):(0,b.createElement)(IB,{min:BB,onChange:t,selectedUnits:i,setSelectedUnits:l,values:n||NB,units:a}),(0,b.createElement)(TB,{onClick:()=>o(!r),isLinked:r})))}function LB(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,b.createElement)(AB,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=sm({...n,border:{...null==n?void 0:n.border,radius:e}});r({style:t})}})}(0,Tn.l7)([Nn.Z,An]);const RB=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},DB=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function MB(e,t){if(e&&t)return`has-${(0,N.kebabCase)(t)}-${e}`}function OB(){const e={disableCustomColors:!am("color.custom"),disableCustomGradients:!am("color.customGradient")},t=am("color.palette.custom"),n=am("color.palette.theme"),r=am("color.palette.default"),o=am("color.defaultPalette");e.colors=(0,b.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,O._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,O._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,O._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[r,n,t]);const i=am("color.gradients.custom"),l=am("color.gradients.theme"),a=am("color.gradients.default"),s=am("color.defaultGradients");return e.gradients=(0,b.useMemo)((()=>{const e=[];return l&&l.length&&e.push({name:(0,O._x)("Theme","Indicates this palette comes from the theme."),gradients:l}),s&&a&&a.length&&e.push({name:(0,O._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),i&&i.length&&e.push({name:(0,O._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,l,a]),e}const FB="__experimentalBorder",ZB=["top","right","bottom","left"],jB=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},zB=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},HB=e=>{let{colors:t,namedColor:n,customColor:r}=e;if(n){const e=zB(t,"slug",n);if(e)return e}if(!r)return{color:void 0};return zB(t,"color",r)||{color:r}};function VB(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function WB(e){const{attributes:t,clientId:n,setAttributes:r}=e,{style:o}=t,{colors:i}=OB(),l=UB(e.name),a=am("border.color")&&UB(e.name,"color"),s=am("border.radius")&&UB(e.name,"radius"),c=am("border.style")&&UB(e.name,"style"),u=am("border.width")&&UB(e.name,"width");if([!a,!s,!c,!u].every(Boolean)||!l)return null;const d=Yn(e.name,[FB,"__experimentalDefaultControls"]),p=(null==d?void 0:d.color)||(null==d?void 0:d.width),m=((e,t)=>{const{borderColor:n,style:r}=e,{border:o}=r||{};if(n){const{color:e}=HB({colors:t,namedColor:n});return e?{...o,color:e}:o}if(!o)return o;const i={...o};return ZB.forEach((e=>{var n;const r=VB(null===(n=i[e])||void 0===n?void 0:n.color);if(r){const{color:n}=HB({colors:t,namedColor:r});i[e]={...i[e],color:n}}})),i})(t,i);return(0,b.createElement)(Gf,{group:"border"},(u||a)&&(0,b.createElement)(pT,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return r=null==n?void 0:n.border,!((!r||(aT(r)?oT.every((e=>lT(r[e]))):lT(r)))&&!t);var r})(e),label:(0,O.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:r}=e;const{style:o}=n;r({borderColor:void 0,style:{...o,border:sm({radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:p,resetAllFilter:jB,panelId:n},(0,b.createElement)(yB,{colors:i,enableAlpha:!0,enableStyle:c,onChange:e=>{var t;let n,l={...e};if(aT(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},ZB.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var r;const n=HB({colors:i,customColor:null===(r=e[t])||void 0===r?void 0:r.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,r=HB({colors:i,customColor:t});r.slug&&(n=r.slug,l.color=void 0)}const a=sm({...o,border:{radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius,...l}});r({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:m,__experimentalIsRenderedInSidebar:!0})),s&&(0,b.createElement)(pT,{hasValue:()=>function(e){var t,n;const r=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof r?Object.entries(r).some(Boolean):!!r}(e),label:(0,O.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:$B(r,"radius")})}(e),isShownByDefault:null==d?void 0:d.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,b.createElement)(LB,e)))}function UB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==Pa.Z.OS)return!1;const n=Yn(e,FB);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function $B(e,t){return sm({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function GB(e,t,n){if(!UB(t,"color")||pm(t,FB,"color"))return e;const r=qB(n),o=C()(e.className,r);return e.className=o||void 0,e}function qB(e){var t;const{borderColor:n,style:r}=e,o=MB("border-color",n);return C()({"has-border-color":n||(null==r||null===(t=r.border)||void 0===t?void 0:t.color),[o]:!!o})}const KB=(0,na.o)((e=>t=>{var n,r,o,i,l,a,s,c,u;const{name:d,attributes:p}=t,{borderColor:m,style:h}=p,{colors:f}=OB();if(!UB(d,"color")||pm(d,FB,"color"))return(0,b.createElement)(e,t);const{color:g}=HB({colors:f,namedColor:m}),{color:v}=HB({colors:f,namedColor:VB(null==h||null===(n=h.border)||void 0===n||null===(r=n.top)||void 0===r?void 0:r.color)}),{color:y}=HB({colors:f,namedColor:VB(null==h||null===(o=h.border)||void 0===o||null===(i=o.right)||void 0===i?void 0:i.color)}),{color:_}=HB({colors:f,namedColor:VB(null==h||null===(l=h.border)||void 0===l||null===(a=l.bottom)||void 0===a?void 0:a.color)}),{color:k}=HB({colors:f,namedColor:VB(null==h||null===(s=h.border)||void 0===s||null===(c=s.left)||void 0===c?void 0:c.color)}),x={borderTopColor:v||g,borderRightColor:y||g,borderBottomColor:_||g,borderLeftColor:k||g};let w=t.wrapperProps;return w={...t.wrapperProps,style:{...null===(u=t.wrapperProps)||void 0===u?void 0:u.style,...x}},(0,b.createElement)(e,(0,ta.Z)({},t,{wrapperProps:w}))}));(0,tr.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return UB(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",GB),(0,tr.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!UB(e,"color")||pm(e,FB,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),GB(r,e,n)},e})),(0,tr.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",KB);var YB=n(56016);const XB=e=>{let{__nextHasNoMarginBottom:t}=e;return t?"":(0,Wd.css)("margin-bottom:",(0,Fm.D)(2),";","")},QB=(0,Vd.default)(Od.Z,{target:"eln3bjz3"})(XB,";"),JB=(0,Vd.default)("div",{target:"eln3bjz2"})("border-radius:50%;border:",$d.Z.borderWidth," solid ",Ud.D.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;"),eP=(0,Vd.default)("div",{target:"eln3bjz1"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),tP=(0,Vd.default)("div",{target:"eln3bjz0"})("background:",Ud.D.ui.theme,";border-radius:50%;border:",3,"px solid ",Ud.D.ui.theme,";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-",16,"px;width:0px;"),nP=function(e){let{value:t,onChange:n,...r}=e;const o=(0,b.useRef)(null),i=(0,b.useRef)(),l=(0,b.useRef)(),a=e=>{var t;if(void 0!==e&&(e.preventDefault(),null===(t=e.target)||void 0===t||t.focus(),void 0!==i.current&&void 0!==n)){const{x:t,y:r}=i.current;n(function(e,t,n,r){const o=r-t,i=n-e,l=Math.atan2(o,i),a=Math.round(l*(180/Math.PI))+90;return a<0?360+a:a}(t,r,e.clientX,e.clientY))}},{startDrag:s,isDragging:c}=(0,YB.Z)({onDragStart:e=>{(()=>{if(null===o.current)return;const e=o.current.getBoundingClientRect();i.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),a(e)},onDragMove:a,onDragEnd:a});return(0,b.useEffect)((()=>{c?(void 0===l.current&&(l.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=l.current||"",l.current=void 0)}),[c]),(0,b.createElement)(JB,(0,ta.Z)({ref:o,onMouseDown:s,className:"components-angle-picker-control__angle-circle",style:c?{cursor:"grabbing"}:void 0},r),(0,b.createElement)(eP,{style:t?{transform:`rotate(${t}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1},(0,b.createElement)(tP,{className:"components-angle-picker-control__angle-circle-indicator"})))},rP=(0,b.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,label:o=(0,O.__)("Angle"),onChange:i,value:l,...a}=e;n||(0,j.default)("Bottom margin styles for wp.components.AnglePickerControl",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const s=C()("components-angle-picker-control",r);return(0,b.createElement)(QB,(0,ta.Z)({},a,{ref:t,__nextHasNoMarginBottom:n,className:s,gap:4}),(0,b.createElement)(lw.Z,null,(0,b.createElement)(Mm.Z,{label:o,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===i)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;i(t)},size:"__unstable-large",step:"1",value:l,spinControls:"none",suffix:(0,b.createElement)(Ow.Z,{as:HE.Z,marginBottom:0,marginRight:(0,Fm.D)(3),style:{color:Ud.D.ui.theme}},"°")})),(0,b.createElement)(Fd.Z,{style:{marginBottom:(0,Fm.D)(1),marginTop:"auto"}},(0,b.createElement)(nP,{"aria-hidden":"true",value:l,onChange:i})))})),oP=10,iP=0,lP=oP;function aP(e){return Math.max(0,Math.min(100,e))}function sP(e,t,n){const r=e.slice();return r[t]=n,r}function cP(e,t,n){return function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:iP;const o=e[t].position,i=Math.min(o,n),l=Math.max(o,n);return e.some(((e,o)=>{let{position:a}=e;return o!==t&&(Math.abs(a-n)<r||i<a&&a<l)}))}(e,t,n)?e:sP(e,t,{...e[t],position:n})}function uP(e,t,n){return sP(e,t,{...e[t],color:n})}function dP(e,t){if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=e-n;return Math.round(aP(100*o/r))}function pP(e){let{isOpen:t,position:n,color:r,...o}=e;const i=`components-custom-gradient-picker__control-point-button-description-${(0,ep.Z)(pP)}`;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ia.ZP,(0,ta.Z)({"aria-label":(0,O.sprintf)((0,O.__)("Gradient control point at position %1$s%% with color code %2$s."),n,r),"aria-describedby":i,"aria-haspopup":"true","aria-expanded":t,className:C()("components-custom-gradient-picker__control-point-button",{"is-active":t})},o)),(0,b.createElement)(U_.Z,{id:i},(0,O.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")))}function mP(e){let{isRenderedInSidebar:t,className:n,...r}=e;const o=(0,b.useMemo)((()=>({placement:"bottom",offset:8})),[]),i=C()("components-custom-gradient-picker__control-point-dropdown",n);return(0,b.createElement)(aB,(0,ta.Z)({isRenderedInSidebar:t,popoverProps:o,className:i},r))}function hP(e){let{disableRemove:t,disableAlpha:n,gradientPickerDomRef:r,ignoreMarkerPosition:o,value:i,onChange:l,onStartControlPointChange:a,onStopControlPointChange:s,__experimentalIsRenderedInSidebar:c}=e;const u=(0,b.useRef)(),d=e=>{const t=dP(e.clientX,r.current),{initialPosition:n,index:o,significantMoveHappened:a}=u.current;!a&&Math.abs(n-t)>=5&&(u.current.significantMoveHappened=!0),l(cP(i,o,t))},p=()=>{window&&window.removeEventListener&&u.current&&u.current.listenersActivated&&(window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",p),s(),u.current.listenersActivated=!1)},m=(0,b.useRef)();return m.current=p,(0,b.useEffect)((()=>()=>{m.current()}),[]),i.map(((e,r)=>{const m=null==e?void 0:e.position;return o!==m&&(0,b.createElement)(mP,{isRenderedInSidebar:c,key:r,onClose:s,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,b.createElement)(pP,{key:r,onClick:()=>{u.current&&u.current.significantMoveHappened||(n?s():a(),o())},onMouseDown:()=>{window&&window.addEventListener&&(u.current={initialPosition:m,index:r,significantMoveHappened:!1,listenersActivated:!0},a(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",p))},onKeyDown:t=>{"ArrowLeft"===t.code?(t.stopPropagation(),l(cP(i,r,aP(e.position-lP)))):"ArrowRight"===t.code&&(t.stopPropagation(),l(cP(i,r,aP(e.position+lP))))},isOpen:n,position:e.position,color:e.color})},renderContent:o=>{let{onClose:a}=o;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(QN,{enableAlpha:!n,color:e.color,onChange:e=>{l(uP(i,r,(0,Tn.Vi)(e).toRgbString()))}}),!t&&i.length>2&&(0,b.createElement)(kf.Z,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center"},(0,b.createElement)(ia.ZP,{onClick:()=>{l(function(e,t){return e.filter(((e,n)=>n!==t))}(i,r)),a()},variant:"link"},(0,O.__)("Remove Control Point"))))},style:{left:`${e.position}%`,transform:"translateX( -50% )"}})}))}hP.InsertPoint=function(e){let{value:t,onChange:n,onOpenInserter:r,onCloseInserter:o,insertPosition:i,disableAlpha:l,__experimentalIsRenderedInSidebar:a}=e;const[s,c]=(0,b.useState)(!1);return(0,b.createElement)(mP,{isRenderedInSidebar:a,className:"components-custom-gradient-picker__inserter",onClose:()=>{o()},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,b.createElement)(ia.ZP,{"aria-expanded":t,"aria-haspopup":"true",onClick:()=>{t?o():(c(!1),r()),n()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:yf.Z})},renderContent:()=>(0,b.createElement)(QN,{enableAlpha:!l,onChange:e=>{s?n(function(e,t,n){const r=e.findIndex((e=>e.position===t));return uP(e,r,n)}(t,i,(0,Tn.Vi)(e).toRgbString())):(n(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(t,i,(0,Tn.Vi)(e).toRgbString())),c(!0))}}),style:null!==i?{left:`${i}%`,transform:"translateX( -50% )"}:void 0})};const fP=hP;function gP(e,t){switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e}const vP={id:"IDLE"};function bP(e){let{background:t,hasGradient:n,value:r,onChange:o,disableInserter:i=!1,disableAlpha:l=!1,__experimentalIsRenderedInSidebar:a}=e;const s=(0,b.useRef)(),[c,u]=(0,b.useReducer)(gP,vP),d=e=>{const t=dP(e.clientX,s.current);r.some((e=>{let{position:n}=e;return Math.abs(t-n)<oP}))?"MOVING_INSERTER"===c.id&&u({type:"STOP_INSERTER_MOVE"}):u({type:"MOVE_INSERTER",insertPosition:t})},p="MOVING_INSERTER"===c.id,m="INSERTING_CONTROL_POINT"===c.id;return(0,b.createElement)("div",{className:C()("components-custom-gradient-picker__gradient-bar",{"has-gradient":n}),onMouseEnter:d,onMouseMove:d,style:{background:t},onMouseLeave:()=>{u({type:"STOP_INSERTER_MOVE"})}},(0,b.createElement)("div",{ref:s,className:"components-custom-gradient-picker__markers-container"},!i&&(p||m)&&(0,b.createElement)(fP.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:l,insertPosition:c.insertPosition,value:r,onChange:o,onOpenInserter:()=>{u({type:"OPEN_INSERTER"})},onCloseInserter:()=>{u({type:"CLOSE_INSERTER"})}}),(0,b.createElement)(fP,{__experimentalIsRenderedInSidebar:a,disableAlpha:l,disableRemove:i,gradientPickerDomRef:s,ignoreMarkerPosition:m?c.insertPosition:void 0,value:r,onChange:o,onStartControlPointChange:()=>{u({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{u({type:"STOP_CONTROL_CHANGE"})}})))}var yP=n(49963);const _P="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",kP={type:"angular",value:90},xP=[{value:"linear-gradient",label:(0,O.__)("Linear")},{value:"radial-gradient",label:(0,O.__)("Radial")}],wP={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function CP(e){let{type:t,value:n,length:r}=e;return`${function(e){let{type:t,value:n}=e;return"literal"===t?n:"hex"===t?`#${n}`:`${t}(${n.join(",")})`}({type:t,value:n})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(r)}`}function EP(e){let{type:t,orientation:n,colorStops:r}=e;const o=function(e){if(e&&"angular"===e.type)return`${e.value}deg`}(n);return`${t}(${[o,...r.sort(((e,t)=>{var n,r,o,i;return(null!==(n=null==e||null===(r=e.length)||void 0===r?void 0:r.value)&&void 0!==n?n:0)-(null!==(o=null==t||null===(i=t.length)||void 0===i?void 0:i.value)&&void 0!==o?o:0)})).map(CP)].filter(Boolean).join(",")})`}function SP(e){return void 0===e.length||"%"!==e.length.type}function IP(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,Tn.l7)([Nn.Z]);const TP=(0,Vd.default)(lw.Z,{target:"e99xvul1"})({name:"1gvx10y",styles:"flex-grow:5"}),NP=(0,Vd.default)(lw.Z,{target:"e99xvul0"})({name:"1gvx10y",styles:"flex-grow:5"}),BP=e=>{var t,n;let{gradientAST:r,hasGradient:o,onChange:i}=e;const l=null!==(t=null==r||null===(n=r.orientation)||void 0===n?void 0:n.value)&&void 0!==t?t:180;return(0,b.createElement)(rP,{__nextHasNoMarginBottom:!0,onChange:e=>{i(EP({...r,orientation:{type:"angular",value:e}}))},value:o?l:""})},PP=e=>{let{gradientAST:t,hasGradient:n,onChange:r}=e;const{type:o}=t;return(0,b.createElement)(jT.Z,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,O.__)("Type"),labelPosition:"top",onChange:e=>{"linear-gradient"===e&&r(EP({...t,...t.orientation?{}:{orientation:kP},type:"linear-gradient"})),"radial-gradient"===e&&(()=>{const{orientation:e,...n}=t;r(EP({...n,type:"radial-gradient"}))})()},options:xP,size:"__unstable-large",value:n&&o})};function AP(e){let{__nextHasNoMargin:t=!1,value:n,onChange:r,__experimentalIsRenderedInSidebar:o}=e;const i=function(e){var t;let n;try{n=yP.parse(e)[0],n.value=e}catch(e){n=yP.parse(_P)[0],n.value=_P}if("directional"===(null===(t=n.orientation)||void 0===t?void 0:t.type)&&(n.orientation.type="angular",n.orientation.value=wP[n.orientation.value].toString()),n.colorStops.some(SP)){const{colorStops:e}=n,t=100/(e.length-1);e.forEach(((e,n)=>{e.length={value:t*n,type:"%"}})),n.value=EP(n)}return n}(n),l=function(e){return EP({type:"linear-gradient",orientation:kP,colorStops:e.colorStops})}(i),a=i.value!==_P,s=i.colorStops.map((e=>({color:IP(e),position:parseInt(e.length.value)})));return t||(0,j.default)("Outer margin styles for wp.components.CustomGradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,b.createElement)(Mw.Z,{spacing:4,className:C()("components-custom-gradient-picker",{"is-next-has-no-margin":t})},(0,b.createElement)(bP,{__experimentalIsRenderedInSidebar:o,background:l,hasGradient:a,value:s,onChange:e=>{r(EP(function(e,t){return{...e,colorStops:t.map((e=>{let{position:t,color:n}=e;const{r,g:o,b:i,a:l}=(0,Tn.Vi)(n).toRgb();return{length:{type:"%",value:null==t?void 0:t.toString()},type:l<1?"rgba":"rgb",value:l<1?[r,o,i,l]:[r,o,i]}}))}}(i,e)))}}),(0,b.createElement)(Od.Z,{gap:3,className:"components-custom-gradient-picker__ui-line"},(0,b.createElement)(TP,null,(0,b.createElement)(PP,{gradientAST:i,hasGradient:a,onChange:r})),(0,b.createElement)(NP,null,"linear-gradient"===i.type&&(0,b.createElement)(BP,{gradientAST:i,hasGradient:a,onChange:r}))))}const LP=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function RP(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l}=e;const a=(0,b.useMemo)((()=>r.map(((e,t)=>{let{gradient:r,name:l}=e;return(0,b.createElement)(eB.Option,{key:r,value:r,isSelected:i===r,tooltipText:l||(0,O.sprintf)((0,O.__)("Gradient code: %s"),r),style:{color:"rgba( 0,0,0,0 )",background:r},onClick:i===r?n:()=>o(r,t),"aria-label":l?(0,O.sprintf)((0,O.__)("Gradient: %s"),l):(0,O.sprintf)((0,O.__)("Gradient code: %s"),r)})}))),[r,i,o,n]);return(0,b.createElement)(eB,{className:t,options:a,actions:l})}function DP(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l,headingLevel:a}=e;return(0,b.createElement)(Mw.Z,{spacing:3,className:t},r.map(((e,t)=>{let{name:s,gradients:c}=e;return(0,b.createElement)(Mw.Z,{spacing:2,key:t},(0,b.createElement)(tB,{level:a},s),(0,b.createElement)(RP,(0,ta.Z)({clearGradient:n,gradients:c,onChange:e=>o(e,t),value:i},r.length===t+1?{actions:l}:{})))})))}function MP(e){let{__nextHasNoMargin:t=!1,className:n,gradients:r,onChange:o,value:i,clearable:l=!0,disableCustomGradients:a=!1,__experimentalIsRenderedInSidebar:s,headingLevel:c=2}=e;const u=(0,b.useCallback)((()=>o(void 0)),[o]),d=LP(r)?DP:RP;t||(0,j.default)("Outer margin styles for wp.components.GradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"});const p=t?{}:{marginTop:null!=r&&r.length?void 0:3,marginBottom:l?0:6};return(0,b.createElement)(Ow.Z,(0,ta.Z)({marginBottom:0},p),(0,b.createElement)(Mw.Z,{spacing:null!=r&&r.length?4:0},!a&&(0,b.createElement)(AP,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:s,value:i,onChange:o}),((null==r?void 0:r.length)||l)&&(0,b.createElement)(d,{className:n,clearable:l,clearGradient:u,gradients:r,onChange:o,value:i,actions:l&&!a&&(0,b.createElement)(eB.ButtonAction,{onClick:u},(0,O.__)("Clear")),headingLevel:c})))}const OP=["colors","disableCustomColors","gradients","disableCustomGradients"],FP={name:"color",title:"Solid",value:"color"},ZP={name:"gradient",title:"Gradient",value:"gradient"},jP=[FP,ZP];function zP(e){let{colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,className:l,label:a,onColorChange:s,onGradientChange:c,colorValue:u,gradientValue:d,clearable:p,showTitle:m=!0,enableAlpha:h,headingLevel:f}=e;const g=s&&(!(0,N.isEmpty)(t)||!r),v=c&&(!(0,N.isEmpty)(n)||!o);if(!g&&!v)return null;const y={[FP.value]:(0,b.createElement)(sB,{value:u,onChange:v?e=>{s(e),c()}:s,colors:t,disableCustomColors:r,__experimentalIsRenderedInSidebar:i,clearable:p,enableAlpha:h,headingLevel:f}),[ZP.value]:(0,b.createElement)(MP,{__nextHasNoMargin:!0,value:d,onChange:g?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,clearable:p,headingLevel:f})},_=e=>(0,b.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,b.createElement)(Hd.ZP,{__nextHasNoMarginBottom:!0,className:C()("block-editor-color-gradient-control",l)},(0,b.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,b.createElement)(Mw.Z,{spacing:1},m&&(0,b.createElement)("legend",null,(0,b.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,b.createElement)(Hd.ZP.VisualLabel,null,a))),g&&v&&(0,b.createElement)(AC.Z,{className:"block-editor-color-gradient-control__tabs",tabs:jP,initialTabName:d?ZP.value:!!g&&FP.value},(e=>_(e.value))),!v&&_(FP.value),!g&&_(ZP.value))))}function HP(e){const t={};return t.colors=am("color.palette"),t.gradients=am("color.gradients"),t.disableCustomColors=!am("color.custom"),t.disableCustomGradients=!am("color.customGradient"),(0,b.createElement)(zP,(0,ta.Z)({},t,e))}const VP=function(e){return OP.every((t=>e.hasOwnProperty(t)))?(0,b.createElement)(zP,e):(0,b.createElement)(HP,e)},WP=e=>{let{setting:t,children:n,panelId:r,...o}=e;return(0,b.createElement)(pT,(0,ta.Z)({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},o,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:r,resetAllFilter:t.resetAllFilter}),n)},UP=e=>{let{colorValue:t,label:n}=e;return(0,b.createElement)(kf.Z,{justify:"flex-start"},(0,b.createElement)(ZT,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,b.createElement)(Fd.Z,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},$P=e=>t=>{let{onToggle:n,isOpen:r}=t;const{colorValue:o,label:i}=e,l={onClick:n,className:C()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r};return(0,b.createElement)(ia.ZP,l,(0,b.createElement)(UP,{colorValue:o,label:i}))};function GP(e){let t,{colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradients:l,settings:a,__experimentalIsRenderedInSidebar:s,...c}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,b.createElement)(b.Fragment,null,a.map(((e,a)=>{var u;const d={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradientValue:e.gradientValue,gradients:l,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},p={colorValue:null!==(u=e.gradientValue)&&void 0!==u?u:e.colorValue,label:e.label};return e&&(0,b.createElement)(WP,(0,ta.Z)({key:a,setting:e},c),(0,b.createElement)(W_.Z,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:$P(p),renderContent:()=>(0,b.createElement)(rB,{paddingSize:"none"},(0,b.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,b.createElement)(VP,d)))}))})))}var qP=n(63964);(0,Tn.l7)([Nn.Z,An]);const KP=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:r,fallbackLinkColor:o,fontSize:i,isLargeText:l,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const u=t||n;if(!u)return null;const d=a||r,p=s||o;if(!d&&!p)return null;const m=[{color:d,description:(0,O.__)("text color")},{color:p,description:(0,O.__)("link color")}],h=(0,Tn.Vi)(u),f=h.alpha()<1,g=h.brightness(),v={level:"AA",size:l||!1!==l&&i>=24?"large":"small"};let y="",_="";for(const e of m){if(!e.color)continue;const t=(0,Tn.Vi)(e.color),n=t.isReadable(h,v),r=t.alpha()<1;if(!n){if(f||r)continue;y=g<t.brightness()?(0,O.sprintf)((0,O.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,O.sprintf)((0,O.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),_=(0,O.__)("This color combination may be hard for people to read.");break}r&&c&&(y=(0,O.__)("Transparent text may be hard for people to read."),_=(0,O.__)("Transparent text may be hard for people to read."))}return y?((0,Xc.speak)(_),(0,b.createElement)("div",{className:"block-editor-contrast-checker"},(0,b.createElement)(qP.Z,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function YP(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function XP(e){let{enableAlpha:t=!1,settings:n,clientId:r,enableContrastChecking:o=!0}=e;const[i,l]=(0,b.useState)(),[a,s]=(0,b.useState)(),[c,u]=(0,b.useState)(),d=R_(r),p=n.filter((e=>null==e?void 0:e.colorValue));(0,b.useEffect)((()=>{var e;if(!o)return;if(!p.length)return i&&l(),a&&s(),void(c&&s());if(!d.current)return;s(YP(d.current).color);const t=null===(e=d.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&u(YP(t).color);let n=d.current,r=YP(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,r=YP(n).backgroundColor;l(r)}));const m=OB();return(0,b.createElement)(Gf,{group:"color"},(0,b.createElement)(GP,(0,ta.Z)({enableAlpha:t,panelId:r,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},m)),o&&(0,b.createElement)(KP,{backgroundColor:i,textColor:a,enableAlphaChecker:t,linkColor:c}))}const QP="color",JP=e=>{const t=Yn(e,QP);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},eA=e=>{if("web"!==Pa.Z.OS)return!1;const t=Yn(e,QP);return null!==t&&"object"==typeof t&&!!t.link},tA=e=>{const t=Yn(e,QP);return null!==t&&"object"==typeof t&&!!t.gradients},nA=e=>{const t=Yn(e,QP);return t&&!1!==t.background},rA=e=>{const t=Yn(e,QP);return t&&!1!==t.text},oA=(e,t)=>sm(um(t,e,void 0)),iA=e=>({textColor:void 0,style:oA(["color","text"],e.style)}),lA=e=>({style:oA(["elements","link","color","text"],e.style)}),aA=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function sA(e,t,n){var r,o,i,l,a,s;if(!JP(t)||pm(t,QP))return e;const c=tA(t),{backgroundColor:u,textColor:d,gradient:p,style:m}=n,h=e=>!pm(t,QP,e),f=h("text")?MB("color",d):void 0,g=h("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(p):void 0,v=h("background")?MB("background-color",u):void 0,b=h("background")||h("gradients"),y=u||(null==m||null===(r=m.color)||void 0===r?void 0:r.background)||c&&(p||(null==m||null===(o=m.color)||void 0===o?void 0:o.gradient)),_=C()(e.className,f,g,{[v]:!(c&&null!=m&&null!==(i=m.color)&&void 0!==i&&i.gradient||!v),"has-text-color":h("text")&&(d||(null==m||null===(l=m.color)||void 0===l?void 0:l.text)),"has-background":b&&y,"has-link-color":h("link")&&(null==m||null===(a=m.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=_||void 0,e}const cA=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?RB(e,n[1]).color:t};function uA(e){var t,n,r,o,i,l;const{name:a,attributes:s}=e,c=am("color.palette.custom"),u=am("color.palette.theme"),d=am("color.palette.default"),p=(0,b.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]),m=am("color.gradients.custom"),h=am("color.gradients.theme"),f=am("color.gradients.default"),g=(0,b.useMemo)((()=>[...m||[],...h||[],...f||[]]),[m,h,f]),v=am("color.custom"),y=am("color.customGradient"),_=am("color.background"),k=am("color.link"),x=am("color.text"),w=v||!u||(null==u?void 0:u.length)>0,C=y||!h||(null==h?void 0:h.length)>0,E=(0,b.useRef)(s);if((0,b.useEffect)((()=>{E.current=s}),[s]),!JP(a))return null;const S=eA(a)&&k&&w,I=rA(a)&&x&&w,T=nA(a)&&_&&w,N=tA(a)&&C;if(!(S||I||T||N))return null;const{style:B,textColor:P,backgroundColor:A,gradient:L}=s;let R;if(N&&L)R=function(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}(g,L);else if(N){var D;R=null==B||null===(D=B.color)||void 0===D?void 0:D.gradient}const M=t=>n=>{var r,o;const i=DB(p,n),l=t+"Color",a={...E.current.style,color:{...null===(r=E.current)||void 0===r||null===(o=r.style)||void 0===o?void 0:o.color,[t]:null!=i&&i.slug?void 0:n}},s=null!=i&&i.slug?i.slug:void 0,c={style:sm(a),[l]:s};e.setAttributes(c),E.current={...E.current,...c}},F=Yn(e.name,[QP,"__experimentalDefaultControls"]),Z="web"===Pa.Z.OS&&!L&&!(null!=B&&null!==(t=B.color)&&void 0!==t&&t.gradient)&&T&&(S||I)&&!1!==Yn(e.name,[QP,"enableContrastChecker"]);return(0,b.createElement)(XP,{enableContrastChecking:Z,clientId:e.clientId,enableAlpha:!0,settings:[...I?[{label:(0,O.__)("Text"),onColorChange:M("text"),colorValue:RB(p,P,null==B||null===(n=B.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:iA}]:[],...T||N?[{label:(0,O.__)("Background"),onColorChange:T?M("background"):void 0,colorValue:RB(p,A,null==B||null===(r=B.color)||void 0===r?void 0:r.background).color,gradientValue:R,onGradientChange:N?t=>{const n=function(e,t){const n=function(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}(e,t);return n&&n.slug}(g,t);let r;if(n){var o,i,l;const e={...null===(o=E.current)||void 0===o?void 0:o.style,color:{...null===(i=E.current)||void 0===i||null===(l=i.style)||void 0===l?void 0:l.color,gradient:void 0}};r={style:sm(e),gradient:n}}else{var a,s,c;const e={...null===(a=E.current)||void 0===a?void 0:a.style,color:{...null===(s=E.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};r={style:sm(e),gradient:void 0}}e.setAttributes(r),E.current={...E.current,...r}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:aA}]:[],...S?[{label:(0,O.__)("Link"),onColorChange:t=>{var n;const r=DB(p,t),o=null!=r&&r.slug?`var:preset|color|${r.slug}`:t,i=sm(um(null===(n=E.current)||void 0===n?void 0:n.style,["elements","link","color","text"],o));e.setAttributes({style:i}),E.current={...E.current,style:i}},colorValue:cA(p,null==B||null===(o=B.elements)||void 0===o||null===(i=o.link)||void 0===i||null===(l=i.color)||void 0===l?void 0:l.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:lA}]:[]]})}const dA=(0,na.o)((e=>t=>{var n;const{name:r,attributes:o}=t,{backgroundColor:i,textColor:l}=o,a=am("color.palette.custom"),s=am("color.palette.theme"),c=am("color.palette.default"),u=(0,b.useMemo)((()=>[...a||[],...s||[],...c||[]]),[a,s,c]);if(!JP(r)||pm(r,QP))return(0,b.createElement)(e,t);const d={};var p,m;l&&!pm(r,QP,"text")&&(d.color=null===(p=RB(u,l))||void 0===p?void 0:p.color),i&&!pm(r,QP,"background")&&(d.backgroundColor=null===(m=RB(u,i))||void 0===m?void 0:m.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...d,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,b.createElement)(e,(0,ta.Z)({},t,{wrapperProps:h}))})),pA={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,tr.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return JP(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),tA(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",sA),(0,tr.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!JP(e)||pm(e,QP))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),sA(r,e,n)},e})),(0,tr.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",dA),(0,tr.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return dm({linkColor:eA(o),textColor:rA(o),backgroundColor:nA(o),gradient:tA(o)},pA,e,t,n,r)}));var mA=n(92494);function hA(e){const[t,...n]=e;if(!t)return null;const[,r]=Pm(t.size),o=n.every((e=>{const[,t]=Pm(e.size);return t===r}));return o?r:null}const fA=(0,Vd.default)("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),gA=(0,Vd.default)(Hd.ZP.VisualLabel,{target:"e8tqeku3"})("display:flex;gap:",(0,Fm.D)(1),";justify-content:flex-start;margin-bottom:0;"),vA=(0,Vd.default)("span",{target:"e8tqeku2"})("color:",Ud.D.gray[700],";"),bA=(0,Vd.default)("div",{target:"e8tqeku1"})((e=>!e.__nextHasNoMarginBottom&&`margin-bottom: ${(0,Fm.D)(6)};`),";"),yA=(0,Vd.default)(ia.ZP,{target:"e8tqeku0"})("&&&{height:",(e=>"__unstable-large"===e.size?"40px":"30px"),";}"),_A={key:"default",name:(0,O.__)("Default"),value:void 0},kA={key:"custom",name:(0,O.__)("Custom")},xA=e=>{var t;const{fontSizes:n,value:r,disableCustomFontSizes:o,size:i,onChange:l,onSelectCustom:a}=e,s=!!hA(n),c=[_A,...n.map((e=>{let t;if(s){const[n]=Pm(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...o?[]:[kA]],u=r?null!==(t=c.find((e=>e.value===r)))&&void 0!==t?t:kA:_A;return(0,b.createElement)(aI,{__nextUnconstrainedWidth:!0,className:"components-font-size-picker__select",label:(0,O.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,O.sprintf)((0,O.__)("Currently selected font size: %s"),u.name),options:c,value:u,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;t===kA?a():l(t.value)},size:i})},wA=(0,b.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,b.createElement)(Sp,(0,ta.Z)({},r,{"aria-label":o,ref:t}),n)})),CA=[(0,O.__)("S"),(0,O.__)("M"),(0,O.__)("L"),(0,O.__)("XL"),(0,O.__)("XXL")],EA=[(0,O.__)("Small"),(0,O.__)("Medium"),(0,O.__)("Large"),(0,O.__)("Extra Large"),(0,O.__)("Extra Extra Large")],SA=e=>{const{fontSizes:t,value:n,__nextHasNoMarginBottom:r,size:o,onChange:i}=e;return(0,b.createElement)(pp,{__nextHasNoMarginBottom:r,label:(0,O.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o},t.map(((e,t)=>(0,b.createElement)(wA,{key:e.slug,value:e.size,label:CA[t],"aria-label":e.name||EA[t],showTooltip:!0}))))},IA=(0,b.forwardRef)(((e,t)=>{var n;const{__nextHasNoMarginBottom:r=!1,fallbackFontSize:o,fontSizes:i=[],disableCustomFontSizes:l=!1,onChange:a,size:s="default",value:c,withSlider:u=!1,withReset:d=!0}=e;r||(0,j.default)("Bottom margin styles for wp.components.FontSizePicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const p=Lm({availableUnits:["px","em","rem"]}),m=i.length>5,h=i.find((e=>e.size===c)),f=!!c&&!h,[g,v]=(0,b.useState)(!l&&f),y=(0,b.useMemo)((()=>{if(g)return(0,O.__)("Custom");if(!m)return h?h.name||EA[i.indexOf(h)]:"";const e=hA(i);return e?`(${e})`:""}),[g,m,h,i]);if(0===i.length&&l)return null;const _="string"==typeof c||"string"==typeof(null===(n=i[0])||void 0===n?void 0:n.size),[k,x]=Pm(c,p),w=!!x&&["em","rem"].includes(x);return(0,b.createElement)(fA,{ref:t,className:"components-font-size-picker"},(0,b.createElement)(U_.Z,{as:"legend"},(0,O.__)("Font size")),(0,b.createElement)(Ow.Z,null,(0,b.createElement)(kf.Z,{className:"components-font-size-picker__header"},(0,b.createElement)(gA,{"aria-label":`${(0,O.__)("Size")} ${y||""}`},(0,O.__)("Size"),y&&(0,b.createElement)(vA,{className:"components-font-size-picker__header__hint"},y)),!l&&(0,b.createElement)(ia.ZP,{label:g?(0,O.__)("Use size preset"):(0,O.__)("Set custom size"),icon:mA.Z,onClick:()=>{v(!g)},isPressed:g,isSmall:!0}))),(0,b.createElement)(bA,{className:"components-font-size-picker__controls",__nextHasNoMarginBottom:r},!!i.length&&m&&!g&&(0,b.createElement)(xA,{fontSizes:i,value:c,disableCustomFontSizes:l,size:s,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:Number(e),i.find((t=>t.size===e)))},onSelectCustom:()=>v(!0)}),!m&&!g&&(0,b.createElement)(SA,{fontSizes:i,value:c,__nextHasNoMarginBottom:r,size:s,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:Number(e),i.find((t=>t.size===e)))}}),!l&&g&&(0,b.createElement)(Od.Z,{className:"components-font-size-picker__custom-size-control"},(0,b.createElement)(Fd.Z,{isBlock:!0},(0,b.createElement)($m,{label:(0,O.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:parseInt(e,10))},size:s,units:_?p:[],min:0})),u&&(0,b.createElement)(Fd.Z,{isBlock:!0},(0,b.createElement)(Ow.Z,{marginX:2,marginBottom:0},(0,b.createElement)(fN,{__nextHasNoMarginBottom:r,className:"components-font-size-picker__custom-input",label:(0,O.__)("Custom Size"),hideLabelFromVision:!0,value:k,initialPosition:o,withInputField:!1,onChange:e=>{void 0===e?null==a||a(void 0):_?null==a||a(e+(null!=x?x:"px")):null==a||a(e)},min:0,max:w?10:100,step:w?.1:1}))),d&&(0,b.createElement)(Fd.Z,null,(0,b.createElement)(yA,{disabled:void 0===c,onClick:()=>{null==a||a(void 0)},isSmall:!0,variant:"secondary",size:s},(0,O.__)("Reset"))))))})),TA=IA;function NA(e){let{value:t="",onChange:n,fontFamilies:r,...o}=e;const i=am("typography.fontFamilies");if(r||(r=i),!r||0===r.length)return null;const l=[{value:"",label:(0,O.__)("Default")},...r.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,b.createElement)(jT.Z,(0,ta.Z)({label:(0,O.__)("Font"),options:l,value:t,onChange:n,labelPosition:"top"},o))}const BA=[{name:(0,O._x)("Regular","font style"),value:"normal"},{name:(0,O._x)("Italic","font style"),value:"italic"}],PA=[{name:(0,O._x)("Thin","font weight"),value:"100"},{name:(0,O._x)("Extra Light","font weight"),value:"200"},{name:(0,O._x)("Light","font weight"),value:"300"},{name:(0,O._x)("Regular","font weight"),value:"400"},{name:(0,O._x)("Medium","font weight"),value:"500"},{name:(0,O._x)("Semi Bold","font weight"),value:"600"},{name:(0,O._x)("Bold","font weight"),value:"700"},{name:(0,O._x)("Extra Bold","font weight"),value:"800"},{name:(0,O._x)("Black","font weight"),value:"900"}],AA=(e,t)=>e?t?(0,O.__)("Appearance"):(0,O.__)("Font style"):(0,O.__)("Font weight");function LA(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...l}=e,a=n||r,s=AA(n,r),c={key:"default",name:(0,O.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,b.useMemo)((()=>n&&r?(()=>{const e=[c];return BA.forEach((t=>{let{name:n,value:r}=t;PA.forEach((t=>{let{name:o,value:i}=t;const l="normal"===r?o:(0,O.sprintf)((0,O.__)("%1$s %2$s"),o,n);e.push({key:`${r}-${i}`,name:l,style:{fontStyle:r,fontWeight:i}})}))})),e})():n?(()=>{const e=[c];return BA.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:r,fontWeight:void 0}})})),e})():(()=>{const e=[c];return PA.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:void 0,fontWeight:r}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return a&&(0,b.createElement)(sI,(0,ta.Z)({},l,{className:"components-font-appearance-control",label:s,describedBy:d?n?r?(0,O.sprintf)((0,O.__)("Currently selected font appearance: %s"),d.name):(0,O.sprintf)((0,O.__)("Currently selected font style: %s"),d.name):(0,O.sprintf)((0,O.__)("Currently selected font weight: %s"),d.name):(0,O.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const RA=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:r=!1,__unstableInputWidth:o="60px",...i}=e;const l=function(e){return void 0!==e&&""!==e}(t),a=l?t:"";r||(0,j.default)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const s=r?void 0:{marginBottom:24};return(0,b.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,b.createElement)(Mm.Z,(0,ta.Z)({},i,{__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{var n;const r=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),o=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,r);return{...e,value:o}},onChange:n,label:(0,O.__)("Line height"),placeholder:1.5,step:.1,value:a,min:0,spinControls:"custom"})))};function DA(e){let{value:t,onChange:n,__unstableInputWidth:r="60px",...o}=e;const i=Lm({availableUnits:am("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,b.createElement)($m,(0,ta.Z)({},o,{label:(0,O.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:i,onChange:n}))}var MA=n(88615),OA=n(34709),FA=n(18808),ZA=n(86798);const jA=[{name:(0,O.__)("None"),value:"none",icon:MA.Z},{name:(0,O.__)("Uppercase"),value:"uppercase",icon:OA.Z},{name:(0,O.__)("Lowercase"),value:"lowercase",icon:FA.Z},{name:(0,O.__)("Capitalize"),value:"capitalize",icon:ZA.Z}];function zA(e){let{className:t,value:n,onChange:r}=e;return(0,b.createElement)("fieldset",{className:C()("block-editor-text-transform-control",t)},(0,b.createElement)(Hd.ZP.VisualLabel,{as:"legend"},(0,O.__)("Letter case")),(0,b.createElement)("div",{className:"block-editor-text-transform-control__buttons"},jA.map((e=>(0,b.createElement)(ia.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{r(e.value===n?void 0:e.value)}})))))}var HA=n(87995),VA=n(88025);const WA=[{name:(0,O.__)("None"),value:"none",icon:MA.Z},{name:(0,O.__)("Underline"),value:"underline",icon:HA.Z},{name:(0,O.__)("Strikethrough"),value:"line-through",icon:VA.Z}];function UA(e){let{value:t,onChange:n,className:r}=e;return(0,b.createElement)("fieldset",{className:C()("block-editor-text-decoration-control",r)},(0,b.createElement)(Hd.ZP.VisualLabel,{as:"legend"},(0,O.__)("Decoration")),(0,b.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},WA.map((e=>(0,b.createElement)(ia.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const $A="1600px",GA="768px",qA=1,KA=.75;function YA(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:r,minimumViewPortWidth:o=GA,maximumViewPortWidth:i=$A,scaleFactor:l=qA,minimumFontSizeFactor:a=KA,minimumFontSizeLimit:s}=e;if(s=XA(s)?s:"14px",r){const e=XA(r);if(null==e||!e.unit)return null;const o=XA(s,{coerceTo:e.unit});if(null!=o&&o.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==o?void 0:o.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=QA(e.value*a,3);t=null!=o&&o.value&&n<(null==o?void 0:o.value)?`${o.value}${o.unit}`:`${n}${e.unit}`}}const c=XA(t),u=(null==c?void 0:c.unit)||"rem",d=XA(n,{coerceTo:u});if(!c||!d)return null;const p=XA(t,{coerceTo:"rem"}),m=XA(i,{coerceTo:u}),h=XA(o,{coerceTo:u});if(!m||!h||!p)return null;const f=QA(h.value/100,3),g=QA(f,3)+u,v=QA(((d.value-c.value)/(m.value-h.value)*100||1)*l,3);return`clamp(${t}, ${p.value}${p.unit} + ((1vw - ${g}) * ${v}), ${n})`}function XA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=null==o?void 0:o.join("|"),l=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(l);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:QA(u,3),unit:c}}function QA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const JA=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return function(e,t){var n,r;const{size:o}=e;if(!o||"0"===o)return o;if(null==t||!t.fluid||"object"==typeof(null==t?void 0:t.fluid)&&0===Object.keys(t.fluid).length)return o;if(!1===(null==e?void 0:e.fluid))return o;const i="object"==typeof(null==t?void 0:t.fluid)?null==t?void 0:t.fluid:{};return YA({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(r=e.fluid)||void 0===r?void 0:r.max,fontSize:o,minimumFontSizeLimit:null==i?void 0:i.minFontSize})||o}(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}];function eL(e,t,n,r,o){const i=[(0,N.get)(e,["blocks",t,...n]),(0,N.get)(e,n)];for(const l of i)if(l){const i=["custom","theme","default"];for(const a of i){const i=l[a];if(i){const l=i.find((e=>e[r]===o));if(l)return"slug"===r||eL(e,t,n,"slug",l.slug)[r]===l[r]?l:void 0}}}}function tL(e,t,n){if(!n||"string"!=typeof n){var r,o;if(null===(r=n)||void 0===r||!r.ref||"string"!=typeof(null===(o=n)||void 0===o?void 0:o.ref))return n;{var i;const t=n.ref.split(".");if(!(n=(0,N.get)(e,t))||null!==(i=n)&&void 0!==i&&i.ref)return n}}const l="var:",a="var(--wp--";let s;if(n.startsWith(l))s=n.slice(l.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;s=n.slice(a.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,r){let[o,i]=r;const l=JA.find((e=>e.cssVarInfix===o));if(!l)return n;const a=eL(e.settings,t,l.path,"slug",i);if(a){const{valueKey:n}=l;return tL(e,t,a[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,r){var o;const i=null!==(o=(0,N.get)(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:(0,N.get)(e.settings,["custom",...r]);return i?tL(e,t,i):n}(e,t,n,u):n}function nL(e){var t,n,r,o,i;const l=!(null!=e&&null!==(t=e.typography)&&void 0!==t&&t.customFontSize),a=null!==(n=null==e||null===(r=e.typography)||void 0===r?void 0:r.fontSizes)&&void 0!==n?n:{},s=null!==(o=null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:null==a?void 0:a.theme)&&void 0!==o?o:a.default;return!(null==s||!s.length)||!l}function rL(e){var t,n,r;const o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontFamilies,i=null!==(n=null!==(r=null==o?void 0:o.custom)&&void 0!==r?r:null==o?void 0:o.theme)&&void 0!==n?n:null==o?void 0:o.default;return!(null==i||!i.length)}function oL(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.lineHeight}function iL(e){var t,n;const r=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontStyle,o=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontWeight;return r||o}function lL(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.letterSpacing}function aL(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textTransform}function sL(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textDecoration}function cL(e){let{resetAllFilter:t,onChange:n,value:r,panelId:o,children:i}=e;return(0,b.createElement)(zf,{label:(0,O.__)("Typography"),resetAll:()=>{const e=t(r);n(e)},panelId:o},i)}const uL={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0};function dL(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,y;let{as:_=cL,value:k,onChange:x,inheritedValue:w=k,settings:C,panelId:E,defaultControls:S=uL}=e;const I=e=>tL({settings:C},"",e),T=rL(C),N=null==C||null===(t=C.typography)||void 0===t?void 0:t.fontFamilies,B=null!==(n=null!==(r=null==N?void 0:N.custom)&&void 0!==r?r:null==N?void 0:N.theme)&&void 0!==n?n:null==N?void 0:N.default,P=I(null==w||null===(o=w.typography)||void 0===o?void 0:o.fontFamily),A=e=>{var t;const n=null==B||null===(t=B.find((t=>{let{fontFamily:n}=t;return n===e})))||void 0===t?void 0:t.slug;x({...k,typography:{...null==k?void 0:k.typography,fontFamily:n?`var:preset|font-family|${n}`:e}})},L=nL(C),R=!(null!=C&&null!==(i=C.typography)&&void 0!==i&&i.customFontSize),D=null!==(l=null==C||null===(a=C.typography)||void 0===a?void 0:a.fontSizes)&&void 0!==l?l:{},M=null!==(s=null!==(c=null==D?void 0:D.custom)&&void 0!==c?c:null==D?void 0:D.theme)&&void 0!==s?s:D.default,F=I(null==w||null===(u=w.typography)||void 0===u?void 0:u.fontSize),Z=(e,t)=>{const n=null!=t&&t.slug?`var:preset|font-size|${null==t?void 0:t.slug}`:e;x({...k,typography:{...null==k?void 0:k.typography,fontSize:n}})},j=iL(C),z=function(e){var t,n;const r=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontStyle,o=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontWeight;return r?o?(0,O.__)("Appearance"):(0,O.__)("Font style"):(0,O.__)("Font weight")}(C),H=null==C||null===(d=C.typography)||void 0===d?void 0:d.fontStyle,V=null==C||null===(p=C.typography)||void 0===p?void 0:p.fontWeight,W=I(null==w||null===(m=w.typography)||void 0===m?void 0:m.fontStyle),U=I(null==w||null===(h=w.typography)||void 0===h?void 0:h.fontWeight),$=e=>{let{fontStyle:t,fontWeight:n}=e;x({...k,typography:{...null==k?void 0:k.typography,fontStyle:t,fontWeight:n}})},G=oL(C),q=I(null==w||null===(f=w.typography)||void 0===f?void 0:f.lineHeight),K=e=>{x({...k,typography:{...null==k?void 0:k.typography,lineHeight:e}})},Y=lL(C),X=I(null==w||null===(g=w.typography)||void 0===g?void 0:g.letterSpacing),Q=e=>{x({...k,typography:{...null==k?void 0:k.typography,letterSpacing:e}})},J=aL(C),ee=I(null==w||null===(v=w.typography)||void 0===v?void 0:v.textTransform),te=e=>{x({...k,typography:{...null==k?void 0:k.typography,textTransform:e}})},ne=sL(C),re=I(null==w||null===(y=w.typography)||void 0===y?void 0:y.textDecoration),oe=e=>{x({...k,typography:{...null==k?void 0:k.typography,textDecoration:e}})},ie=(0,b.useCallback)((e=>({...e,typography:{}})),[]);return(0,b.createElement)(_,{resetAllFilter:ie,value:k,onChange:x,panelId:E},T&&(0,b.createElement)(pT,{label:(0,O.__)("Font family"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontFamily)},onDeselect:()=>A(void 0),isShownByDefault:S.fontFamily,panelId:E},(0,b.createElement)(NA,{fontFamilies:B,value:P,onChange:A,size:"__unstable-large",__nextHasNoMarginBottom:!0})),L&&(0,b.createElement)(pT,{label:(0,O.__)("Font size"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontSize)},onDeselect:()=>Z(void 0),isShownByDefault:S.fontSize,panelId:E},(0,b.createElement)(TA,{value:F,onChange:Z,fontSizes:M,disableCustomFontSizes:R,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),j&&(0,b.createElement)(pT,{className:"single-column",label:z,hasValue:()=>{var e,t;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontStyle)||!(null==k||null===(t=k.typography)||void 0===t||!t.fontWeight)},onDeselect:()=>{$({})},isShownByDefault:S.fontAppearance,panelId:E},(0,b.createElement)(LA,{value:{fontStyle:W,fontWeight:U},onChange:$,hasFontStyles:H,hasFontWeights:V,size:"__unstable-large",__nextHasNoMarginBottom:!0})),G&&(0,b.createElement)(pT,{className:"single-column",label:(0,O.__)("Line height"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.lineHeight)},onDeselect:()=>K(void 0),isShownByDefault:S.lineHeight,panelId:E},(0,b.createElement)(RA,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:q,onChange:K,size:"__unstable-large"})),Y&&(0,b.createElement)(pT,{className:"single-column",label:(0,O.__)("Letter spacing"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.letterSpacing)},onDeselect:()=>Q(void 0),isShownByDefault:S.letterSpacing,panelId:E},(0,b.createElement)(DA,{value:X,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})),ne&&(0,b.createElement)(pT,{className:"single-column",label:(0,O.__)("Text decoration"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.textDecoration)},onDeselect:()=>oe(void 0),isShownByDefault:S.textDecoration,panelId:E},(0,b.createElement)(UA,{value:re,onChange:oe,size:"__unstable-large",__unstableInputWidth:"auto"})),J&&(0,b.createElement)(pT,{label:(0,O.__)("Letter case"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.textTransform)},onDeselect:()=>te(void 0),isShownByDefault:S.textTransform,panelId:E},(0,b.createElement)(zA,{value:ee,onChange:te,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}const pL="typography.__experimentalFontFamily";function mL(e,t,n){if(!Xn(t,pL))return e;if(pm(t,_L,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const r=new VE(e.className);r.add(`has-${(0,N.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}function hL(e){if(e)return`has-${(0,N.kebabCase)(e)}-font-size`}(0,tr.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Xn(e,pL)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",mL),(0,tr.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!Xn(e,pL))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),mL(r,e,n)},e}));const fL="typography.fontSize";function gL(e,t,n){if(!Xn(t,fL))return e;if(pm(t,_L,"fontSize"))return e;const r=new VE(e.className);r.add(hL(n.fontSize));const o=r.value;return e.className=o||void 0,e}const vL=(0,na.o)((e=>t=>{var n,r;const o=am("typography.fontSizes"),{name:i,attributes:{fontSize:l,style:a},wrapperProps:s}=t;if(!Xn(i,fL)||pm(i,_L,"fontSize")||!l||null!=a&&null!==(n=a.typography)&&void 0!==n&&n.fontSize)return(0,b.createElement)(e,t);const c=((e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}})(o,l,null==a||null===(r=a.typography)||void 0===r?void 0:r.fontSize).size,u={...t,wrapperProps:{...s,style:{fontSize:c,...null==s?void 0:s.style}}};return(0,b.createElement)(e,u)}),"withFontSizeInlineStyles"),bL={fontSize:[["fontSize"],["style","typography","fontSize"]]};function yL(e,t){return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.includes(n)})))}(0,tr.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Xn(e,fL)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",gL),(0,tr.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!Xn(e,fL))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),gL(r,e,n)},e})),(0,tr.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",vL),(0,tr.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return dm({fontSize:Xn(e.name,fL)},bL,e,t,n,r)})),(0,tr.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!Xn(e,fL)||pm(e,_L,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,r,o;const i=t?t(e):{},l=null==i||null===(n=i.style)||void 0===n?void 0:n.fontSize,a=null===(r=(0,S.select)(pd).getSettings().__experimentalFeatures)||void 0===r||null===(o=r.typography)||void 0===o?void 0:o.fluid,s="object"==typeof a?a:{},c=l&&a?YA({fontSize:l,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?i:{...i,style:{...null==i?void 0:i.style,fontSize:c}}},e}),11);const _L="typography",kL=["typography.lineHeight",fL,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",pL,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function xL(e){var t,n;const r={...yL(e,["fontFamily"])},o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontSize,i=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontFamily,l=null!=o&&o.startsWith("var:preset|font-size|")?o.substring("var:preset|font-size|".length):void 0,a=null!=i&&i.startsWith("var:preset|font-family|")?i.substring("var:preset|font-family|".length):void 0;return r.typography={...yL(r.typography,["fontFamily"]),fontSize:l?void 0:o},{style:sm(r),fontFamily:a,fontSize:l}}function wL(e){var t,n,r;return{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:null===(n=e.style)||void 0===n||null===(r=n.typography)||void 0===r?void 0:r.fontSize}}}function CL(e){let{children:t,resetAllFilter:n}=e;const r=(0,b.useCallback)((e=>{const t=wL(e),r=n(t);return{...e,...xL(r)}}),[n]);return(0,b.createElement)(Gf,{group:"typography",resetAllFilter:r},t)}function EL(e){let{clientId:t,name:n,attributes:r,setAttributes:o,__unstableParentLayout:i}=e;const l=mm(n,i),a=function(e){const t=rL(e),n=oL(e),r=iL(e),o=lL(e),i=aL(e),l=sL(e),a=nL(e);return t||n||r||o||i||a||l}(l),s=(0,b.useMemo)((()=>wL({style:r.style,fontFamily:r.fontFamily,fontSize:r.fontSize})),[r.style,r.fontSize,r.fontFamily]);if(!a)return null;const c=Yn(n,[_L,"__experimentalDefaultControls"]);return(0,b.createElement)(dL,{as:CL,panelId:t,name:n,settings:l,value:s,onChange:e=>{o(xL(e))},defaultControls:c})}var SL=n(67687);const IL=(0,Vd.default)("div",{target:"e1jovhle6"})({name:"14bvcyk",styles:"box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%"}),TL=(0,Vd.default)(Od.Z,{target:"e1jovhle5"})({name:"5bhc30",styles:"margin-bottom:8px"}),NL=(0,Vd.default)(Od.Z,{target:"e1jovhle4"})({name:"aujtid",styles:"min-height:30px;gap:0"}),BL=(0,Vd.default)("div",{target:"e1jovhle3"})({name:"112jwab",styles:"box-sizing:border-box;max-width:80px"}),PL=(0,Vd.default)(Od.Z,{target:"e1jovhle2"})({name:"xy18ro",styles:"justify-content:center;padding-top:8px"}),AL=(0,Vd.default)(Od.Z,{target:"e1jovhle1"})({name:"3tw5wk",styles:"position:relative;height:100%;width:100%;justify-content:flex-start"});var LL={name:"1ch9yvl",styles:"border-radius:0"},RL={name:"tg3mx0",styles:"border-radius:2px"};const DL=e=>{let{isFirst:t,isLast:n,isOnly:r}=e;return t?(0,Dm.b)({borderTopRightRadius:0,borderBottomRightRadius:0})():n?(0,Dm.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})():r?RL:LL},ML=e=>{let{isFirst:t,isOnly:n}=e;const r=t||n?0:-1;return(0,Dm.b)({marginLeft:r})()},OL=(0,Vd.default)($m,{target:"e1jovhle0"})("max-width:60px;",DL,";",ML,";"),FL=()=>{};function ZL(e){let{isFirst:t,isLast:n,isOnly:r,onHoverOn:o=FL,onHoverOff:i=FL,label:l,value:a,...s}=e;const c=(0,SL.useHover)((e=>{let{event:t,...n}=e;n.hovering?o(t,n):i(t,n)}));return(0,b.createElement)(BL,c(),(0,b.createElement)(jL,{text:l},(0,b.createElement)(OL,(0,ta.Z)({"aria-label":l,className:"component-box-control__unit-control",isFirst:t,isLast:n,isOnly:r,isPressEnterToChange:!0,isResetValueOnUnitChange:!1,value:a},s))))}function jL(e){let{children:t,text:n}=e;return n?(0,b.createElement)(kp.Z,{text:n,position:"top"},(0,b.createElement)("div",null,t)):t}const zL={all:(0,O.__)("All"),top:(0,O.__)("Top"),bottom:(0,O.__)("Bottom"),left:(0,O.__)("Left"),right:(0,O.__)("Right"),mixed:(0,O.__)("Mixed"),vertical:(0,O.__)("Vertical"),horizontal:(0,O.__)("Horizontal")},HL={top:void 0,right:void 0,bottom:void 0,left:void 0},VL=["top","right","bottom","left"];function WL(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function UL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const n=function(e){const t=[];if(null==e||!e.length)return VL;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=VL.filter((t=>e.includes(t)));t.push(...n)}return t}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:VL).map((t=>Pm(e[t]))),r=n.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=n.map((e=>e[1])),i=r.every((e=>e===r[0]))?r[0]:"";let l;var a;return l="number"==typeof i?WL(o):null!==(a=function(e){if(!e||"object"!=typeof e)return;return WL(Object.values(e).filter(Boolean))}(t))&&void 0!==a?a:WL(o),[i,l].join("")}function $L(){const e=UL(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:VL);return isNaN(parseFloat(e))}function GL(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function qL(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function KL(e,t,n){const r={...e};return null!=n&&n.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):VL.forEach((e=>r[e]=t)),r}const YL=()=>{};function XL(e){let{onChange:t=YL,onFocus:n=YL,onHoverOn:r=YL,onHoverOff:o=YL,values:i,sides:l,selectedUnits:a,setSelectedUnits:s,...c}=e;const u=UL(i,a,l),d=GL(i)&&$L(i,a,l),p=d?zL.mixed:void 0;return(0,b.createElement)(ZL,(0,ta.Z)({},c,{disableUnits:d,isOnly:!0,value:u,onChange:e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),r=KL(i,n?e:void 0,l);t(r)},onUnitChange:e=>{const t=KL(a,e,l);s(t)},onFocus:e=>{n(e,{side:"all"})},onHoverOn:()=>{r({top:!0,bottom:!0,left:!0,right:!0})},onHoverOff:()=>{o({top:!1,bottom:!1,left:!1,right:!1})},placeholder:p}))}const QL=()=>{};function JL(e){let{onChange:t=QL,onFocus:n=QL,onHoverOn:r=QL,onHoverOff:o=QL,values:i,selectedUnits:l,setSelectedUnits:a,sides:s,...c}=e;const u=e=>t=>{n(t,{side:e})},d=e=>()=>{r({[e]:!0})},p=e=>()=>{o({[e]:!1})},m=e=>(n,r)=>{let{event:o}=r;const l={...i},a=void 0===n||isNaN(parseFloat(n))?void 0:n;if(l[e]=a,o.altKey)switch(e){case"top":l.bottom=a;break;case"bottom":l.top=a;break;case"left":l.right=a;break;case"right":l.left=a}(e=>{t(e)})(l)},h=e=>t=>{const n={...l};n[e]=t,a(n)},f=null!=s&&s.length?VL.filter((e=>s.includes(e))):VL,g=f[0],v=f[f.length-1],y=g===v&&g;return(0,b.createElement)(PL,{className:"component-box-control__input-controls-wrapper"},(0,b.createElement)(AL,{gap:0,align:"top",className:"component-box-control__input-controls"},f.map((e=>{const[t,n]=Pm(i[e]),r=i[e]?n:l[e];return(0,b.createElement)(ZL,(0,ta.Z)({},c,{isFirst:g===e,isLast:v===e,isOnly:y===e,value:[t,r].join(""),onChange:m(e),onUnitChange:h(e),onFocus:u(e),onHoverOn:d(e),onHoverOff:p(e),label:zL[e],key:`box-control-${e}`}))}))))}const eR=["vertical","horizontal"];function tR(e){let{onChange:t,onFocus:n,onHoverOn:r,onHoverOff:o,values:i,selectedUnits:l,setSelectedUnits:a,sides:s,...c}=e;const u=e=>t=>{n&&n(t,{side:e})},d=e=>()=>{r&&("vertical"===e&&r({top:!0,bottom:!0}),"horizontal"===e&&r({left:!0,right:!0}))},p=e=>()=>{o&&("vertical"===e&&o({top:!1,bottom:!1}),"horizontal"===e&&o({left:!1,right:!1}))},m=e=>n=>{if(!t)return;const r={...i},o=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},h=e=>t=>{const n={...l};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),a(n)},f=null!=s&&s.length?eR.filter((e=>s.includes(e))):eR,g=f[0],v=f[f.length-1],y=g===v&&g;return(0,b.createElement)(AL,{gap:0,align:"top",className:"component-box-control__vertical-horizontal-input-controls"},f.map((e=>{const[t,n]=Pm("vertical"===e?i.top:i.left),r="vertical"===e?l.top:l.left;return(0,b.createElement)(ZL,(0,ta.Z)({},c,{isFirst:g===e,isLast:v===e,isOnly:y===e,value:[t,null!=r?r:n].join(""),onChange:m(e),onUnitChange:h(e),onFocus:u(e),onHoverOn:d(e),onHoverOff:p(e),label:zL[e],key:e}))})))}const nR=(0,Vd.default)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),rR=(0,Vd.default)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),oR=(0,Vd.default)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",(e=>{let{isFocused:t}=e;return(0,Wd.css)({backgroundColor:"currentColor",opacity:t?1:.3},"","")}),";"),iR=(0,Vd.default)(oR,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),lR=(0,Vd.default)(oR,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),aR=(0,Vd.default)(lR,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),sR=(0,Vd.default)(iR,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),cR=(0,Vd.default)(lR,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),uR=(0,Vd.default)(iR,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"}),dR=24;function pR(e){let{size:t=24,side:n="all",sides:r,...o}=e;const i=e=>!(e=>(null==r?void 0:r.length)&&!r.includes(e))(e)&&("all"===n||n===e),l=i("top")||i("vertical"),a=i("right")||i("horizontal"),s=i("bottom")||i("vertical"),c=i("left")||i("horizontal"),u=t/dR;return(0,b.createElement)(nR,(0,ta.Z)({style:{transform:`scale(${u})`}},o),(0,b.createElement)(rR,null,(0,b.createElement)(aR,{isFocused:l}),(0,b.createElement)(sR,{isFocused:a}),(0,b.createElement)(cR,{isFocused:s}),(0,b.createElement)(uR,{isFocused:c})))}function mR(e){let{isLinked:t,...n}=e;const r=t?(0,O.__)("Unlink sides"):(0,O.__)("Link sides");return(0,b.createElement)(kp.Z,{text:r},(0,b.createElement)(ia.ZP,(0,ta.Z)({},n,{className:"component-box-control__linked-button",isSmall:!0,icon:t?mT.Z:hT.Z,iconSize:24,"aria-label":r})))}const hR={min:0},fR=()=>{};const gR=function e(t){let{id:n,inputProps:r=hR,onChange:o=fR,label:i=(0,O.__)("Box Control"),values:l,units:a,sides:s,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=HL,onMouseOver:p,onMouseOut:m}=t;const[h,f]=(0,Wm.Z)(l,{fallback:HL}),g=h||HL,v=GL(l),y=1===(null==s?void 0:s.length),[_,k]=(0,b.useState)(v),[x,w]=(0,b.useState)(!v||!$L(g)||y),[C,E]=(0,b.useState)(qL(x,c)),[S,I]=(0,b.useState)({top:Pm(null==l?void 0:l.top)[1],right:Pm(null==l?void 0:l.right)[1],bottom:Pm(null==l?void 0:l.bottom)[1],left:Pm(null==l?void 0:l.left)[1]}),T=function(t){const n=(0,ep.Z)(e,"inspector-box-control");return t||n}(n),N=`${T}-heading`,B={...r,onChange:e=>{o(e),f(e),k(!0)},onFocus:(e,t)=>{let{side:n}=t;E(n)},isLinked:x,units:a,selectedUnits:S,setSelectedUnits:I,sides:s,values:g,onMouseOver:p,onMouseOut:m};return(0,b.createElement)(IL,{id:T,role:"group","aria-labelledby":N},(0,b.createElement)(TL,{className:"component-box-control__header"},(0,b.createElement)(Fd.Z,null,(0,b.createElement)(Hd.Xp.VisualLabel,{id:N},i)),u&&(0,b.createElement)(Fd.Z,null,(0,b.createElement)(ia.ZP,{className:"component-box-control__reset-button",variant:"secondary",isSmall:!0,onClick:()=>{o(d),f(d),I(d),k(!1)},disabled:!_},(0,O.__)("Reset")))),(0,b.createElement)(NL,{className:"component-box-control__header-control-wrapper"},(0,b.createElement)(Fd.Z,null,(0,b.createElement)(pR,{side:C,sides:s})),x&&(0,b.createElement)(lw.Z,null,(0,b.createElement)(XL,(0,ta.Z)({"aria-label":i},B))),!x&&c&&(0,b.createElement)(lw.Z,null,(0,b.createElement)(tR,B)),!y&&(0,b.createElement)(Fd.Z,null,(0,b.createElement)(mR,{onClick:()=>{w(!x),E(qL(!x,c))},isLinked:x}))),!x&&!c&&(0,b.createElement)(JL,B))},vR={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function bR(e){var t,n,r,o,i;let{spacingSizes:l,value:a,side:s,onChange:c,isMixed:u=!1,type:d,minimumCustomValue:p,onMouseOver:m,onMouseOut:h}=e;a=function(e,t){if(Rp(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,l);let f=l;const g=l.length<=8,v=(0,un.Z)((e=>{const t=e(pd).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[y,_]=(0,b.useState)(!v&&void 0!==a&&!Rp(a)),k=Lm({availableUnits:am("spacing.units")||["px","em","rem"]});let x=null;g||y||void 0===a||!(!Rp(a)||Rp(a)&&u)?u||(x=y?function(e,t){if(!Rp(e))return e;const n=Mp(e),r=t.find((e=>String(e.slug)===n));return null==r?void 0:r.size}(a,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Mp(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(a,l)):(f=[...l,{name:u?(0,O.__)("Mixed"):(0,O.sprintf)((0,O.__)("Custom (%s)"),a),slug:"custom",size:a}],x=f.length-1);const w=(0,b.useMemo)((()=>Pm(x)),[x])[1]||k[0].value,E=e=>{var t;return void 0===a||null===(t=l[e])||void 0===t?void 0:t.name},S=parseFloat(x,10),I=(e,t)=>{var n;const r=parseInt(e,10);if("selectList"===t){if(0===r)return;if(1===r)return"0"}else if(0===r)return"0";return`var:preset|spacing|${null===(n=l[e])||void 0===n?void 0:n.slug}`},T=u?(0,O.__)("Mixed"):null,N=u?(0,O.__)("Mixed"):E(x),B=f.map(((e,t)=>({key:t,name:e.name}))),P=l.map(((e,t)=>({value:t,label:void 0}))),A=(0,O.sprintf)((0,O.__)("%1$s %2$s"),Op[s],null==d?void 0:d.toLowerCase()),L=g&&!y&&void 0!==N;return(0,b.createElement)(b.Fragment,null,"all"!==s&&(0,b.createElement)(kf.Z,{className:"components-spacing-sizes-control__side-labels"},(0,b.createElement)(Hd.ZP.VisualLabel,{className:"components-spacing-sizes-control__side-label"},Op[s]),L&&(0,b.createElement)(Hd.ZP.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},N)),"all"===s&&L&&(0,b.createElement)(Hd.ZP.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},N),!v&&(0,b.createElement)(ia.ZP,{label:y?(0,O.__)("Use size preset"):(0,O.__)("Set custom size"),icon:mA.Z,onClick:()=>{_(!y)},isPressed:y,isSmall:!0,className:C()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),y&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)($m,{onMouseOver:m,onMouseOut:h,onFocus:m,onBlur:h,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:x,units:k,min:p,placeholder:T,disableUnits:u,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,b.createElement)(fN,{onMouseOver:m,onMouseOut:h,onFocus:m,onBlur:h,value:S,min:0,max:null!==(t=null===(n=vR[w])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(r=null===(o=vR[w])||void 0===o?void 0:o.steps)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{c([e,w].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),g&&!y&&(0,b.createElement)(fN,{onMouseOver:m,onMouseOut:h,className:"components-spacing-sizes-control__range-control",value:x,onChange:e=>c(I(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":x,"aria-valuetext":null===(i=l[x])||void 0===i?void 0:i.name,renderTooltipContent:E,min:0,max:l.length-1,marks:P,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:m,onBlur:h}),!g&&!y&&(0,b.createElement)(sI,{className:"components-spacing-sizes-control__custom-select-control",value:B.find((e=>e.key===x))||"",onChange:e=>{c(I(e.selectedItem.key,"selectList"))},options:B,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:m,onMouseOut:h,onFocus:m,onBlur:h}))}function yR(e){let{onChange:t,values:n,sides:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t=Object.values(e)).sort(((e,n)=>t.filter((t=>t===e)).length-t.filter((e=>e===n)).length)).pop();var t}(n),u=zp(n)&&jp(n,r);return(0,b.createElement)(bR,{value:c,onChange:e=>{const o=KL(n,e,r);t(o)},side:"all",spacingSizes:o,isMixed:u,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s})}function _R(e){let{values:t,sides:n,onChange:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?Zp.filter((e=>n.includes(e))):Zp,u=e=>n=>{const o={...t};o[e]=n,r(o)};return(0,b.createElement)(b.Fragment,null,c.map((e=>(0,b.createElement)(bR,{value:t[e],label:Op[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:u(e),spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}))))}const kR=["vertical","horizontal"];function xR(e){let{onChange:t,values:n,sides:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=e=>r=>{if(!t)return;const o={...n};"vertical"===e&&(o.top=r,o.bottom=r),"horizontal"===e&&(o.left=r,o.right=r),t(o)},u=null!=r&&r.length?kR.filter((e=>r.includes(e))):kR;return(0,b.createElement)(b.Fragment,null,u.map((e=>{const t="vertical"===e?n.top:n.left;return(0,b.createElement)(bR,{value:t,onChange:c(e),label:Op[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s})})))}function wR(e){let{isLinked:t,onClick:n}=e;const r=t?(0,O.__)("Unlink sides"):(0,O.__)("Link sides");return(0,b.createElement)(kp.Z,{text:r},(0,b.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,b.createElement)(ia.ZP,{isSmall:!0,icon:t?mT.Z:hT.Z,iconSize:24,"aria-label":r,onClick:n})))}function CR(e){let{inputProps:t,onChange:n,label:r=(0,O.__)("Spacing Control"),values:o,sides:i,splitOnAxis:l=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:c,onMouseOut:u}=e;const d=[{name:0,slug:"0",size:0},...am("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,O.__)("Default"),slug:"default",size:void 0});const p=o||Fp,m=zp(o),h=1===(null==i?void 0:i.length),[f,g]=(0,b.useState)(!m||!jp(p,i)||h),v={...t,onChange:e=>{const t={...o,...e};n(t)},isLinked:f,sides:i,values:p,spacingSizes:d,useSelect:a,type:r,minimumCustomValue:s,onMouseOver:c,onMouseOut:u};return(0,b.createElement)("fieldset",{className:C()("component-spacing-sizes-control",{"is-unlinked":!f})},(0,b.createElement)(Hd.ZP.VisualLabel,{as:"legend"},r),!h&&(0,b.createElement)(wR,{onClick:()=>{g(!f)},isLinked:f}),f&&(0,b.createElement)(yR,(0,ta.Z)({"aria-label":r},v)),!f&&l&&(0,b.createElement)(xR,v),!f&&!l&&(0,b.createElement)(_R,v))}const ER={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function SR(e){var t,n,r,o,i;let{label:l=(0,O.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),u=Lm({availableUnits:am("spacing.units")||["%","px","em","rem","vh","vw"]}),d=(0,b.useMemo)((()=>Pm(s)),[s])[1]||(null===(t=u[0])||void 0===t?void 0:t.value)||"px";return(0,b.createElement)("fieldset",{className:"block-editor-height-control"},(0,b.createElement)(Hd.ZP.VisualLabel,{as:"legend"},l),(0,b.createElement)(Od.Z,null,(0,b.createElement)(Fd.Z,{isBlock:!0},(0,b.createElement)($m,{value:s,units:u,onChange:a,onUnitChange:e=>{const[t,n]=Pm(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,b.createElement)(Fd.Z,{isBlock:!0},(0,b.createElement)(Ow.Z,{marginX:2,marginBottom:0},(0,b.createElement)(fN,{value:c,min:0,max:null!==(n=null===(r=ER[d])||void 0===r?void 0:r.max)&&void 0!==n?n:100,step:null!==(o=null===(i=ER[d])||void 0===i?void 0:i.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{a([e,d].join(""))},__nextHasNoMarginBottom:!0})))))}function IR(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,O.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,O.__)("Specify a fixed width."):"fixed"===e?(0,O.__)("Specify a fixed height."):(0,O.__)("Fit contents.")}function TR(e){let{value:t={},onChange:n,parentLayout:r}=e;const{selfStretch:o,flexSize:i}=t;return(0,b.useEffect)((()=>{"fixed"!==o||i||n({...t,selfStretch:"fit"})}),[]),(0,b.createElement)(b.Fragment,null,(0,b.createElement)(pp,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:NR(r),value:o||"fit",help:IR(o,r),onChange:e=>{const r="fixed"!==e?null:i;n({...t,selfStretch:e,flexSize:r})},isBlock:!0},(0,b.createElement)(wA,{key:"fit",value:"fit",label:(0,O.__)("Fit")}),(0,b.createElement)(wA,{key:"fill",value:"fill",label:(0,O.__)("Fill")}),(0,b.createElement)(wA,{key:"fixed",value:"fixed",label:(0,O.__)("Fixed")})),"fixed"===o&&(0,b.createElement)($m,{size:"__unstable-large",onChange:e=>{n({...t,flexSize:e})},value:i}))}function NR(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,O.__)("Width"):(0,O.__)("Height")}const BR=["horizontal","vertical"];function PR(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.contentSize}function AR(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.wideSize}function LR(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.padding}function RR(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.margin}function DR(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.blockGap}function MR(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.minHeight}function OR(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=null==e?void 0:e.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n)&&o;return!(null==e||!e.layout)&&i}function FR(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=null==e?void 0:e[t]})),n}function ZR(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function jR(e){let{resetAllFilter:t,onChange:n,value:r,panelId:o,children:i}=e;return(0,b.createElement)(zf,{label:(0,O.__)("Dimensions"),resetAll:()=>{const e=t(r);n(e)},panelId:o},i)}const zR={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0};function HR(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,y,_,k;let{as:x=jR,value:w,onChange:E,inheritedValue:S=w,settings:I,panelId:T,defaultControls:N=zR,onVisualize:B=(()=>{}),includeLayoutControls:P=!1}=e;const A=e=>tL({settings:I},"",e),L=function(e){var t,n,r;const{custom:o,theme:i,default:l}=(null==e||null===(t=e.spacing)||void 0===t?void 0:t.spacingSizes)||{};return(null!==(n=null!==(r=null!=o?o:i)&&void 0!==r?r:l)&&void 0!==n?n:[]).length>0}(I),R=Lm({availableUnits:(null==I||null===(t=I.spacing)||void 0===t?void 0:t.units)||["%","px","em","rem","vw"]}),D=PR(I)&&P,M=A(null==S||null===(n=S.layout)||void 0===n?void 0:n.contentSize),F=e=>{E({...w,layout:{...null==w?void 0:w.layout,contentSize:e}})},Z=AR(I)&&P,j=A(null==S||null===(r=S.layout)||void 0===r?void 0:r.wideSize),z=e=>{E({...w,layout:{...null==w?void 0:w.layout,wideSize:e}})},H=LR(I),V=ZR(A(null==S||null===(o=S.spacing)||void 0===o?void 0:o.padding)),W=Array.isArray(null==I||null===(i=I.spacing)||void 0===i?void 0:i.padding)?null==I||null===(l=I.spacing)||void 0===l?void 0:l.padding:null==I||null===(a=I.spacing)||void 0===a||null===(s=a.padding)||void 0===s?void 0:s.sides,U=W&&W.some((e=>BR.includes(e))),$=e=>{const t=FR(e,W);E({...w,spacing:{...null==w?void 0:w.spacing,padding:t}})},G=()=>B("padding"),q=RR(I),K=ZR(A(null==S||null===(c=S.spacing)||void 0===c?void 0:c.margin)),Y=Array.isArray(null==I||null===(u=I.spacing)||void 0===u?void 0:u.margin)?null==I||null===(d=I.spacing)||void 0===d?void 0:d.margin:null==I||null===(p=I.spacing)||void 0===p||null===(m=p.margin)||void 0===m?void 0:m.sides,X=Y&&Y.some((e=>BR.includes(e))),Q=e=>{const t=FR(e,Y);E({...w,spacing:{...null==w?void 0:w.spacing,margin:t}})},J=()=>B("margin"),ee=DR(I),te=A(null==S||null===(h=S.spacing)||void 0===h?void 0:h.blockGap),ne=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}(te),re=Array.isArray(null==I||null===(f=I.spacing)||void 0===f?void 0:f.blockGap)?null==I||null===(g=I.spacing)||void 0===g?void 0:g.blockGap:null==I||null===(v=I.spacing)||void 0===v||null===(y=v.blockGap)||void 0===y?void 0:y.sides,oe=re&&re.some((e=>BR.includes(e))),ie=e=>{E({...w,spacing:{...null==w?void 0:w.spacing,blockGap:e}})},le=e=>{e||ie(null),!oe&&null!=e&&e.hasOwnProperty("top")?ie(e.top):ie({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},ae=MR(I),se=A(null==S||null===(_=S.dimensions)||void 0===_?void 0:_.minHeight),ce=e=>{E({...w,dimensions:{...null==w?void 0:w.dimensions,minHeight:e}})},ue=OR(I),de=null==S?void 0:S.layout,{orientation:pe="horizontal"}=null!==(k=null==I?void 0:I.parentLayout)&&void 0!==k?k:{},me="horizontal"===pe?(0,O.__)("Width"):(0,O.__)("Height"),he=e=>{E({...w,layout:{...null==w?void 0:w.layout,...e}})},fe=(0,b.useCallback)((e=>({...e,layout:sm({...null==e?void 0:e.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...null==e?void 0:e.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...null==e?void 0:e.dimensions,minHeight:void 0}})),[]),ge=()=>B(!1);return(0,b.createElement)(x,{resetAllFilter:fe,value:w,onChange:E,panelId:T},(D||Z)&&(0,b.createElement)("span",{className:"span-columns"},(0,O.__)("Set the width of the main content area.")),D&&(0,b.createElement)(pT,{className:"single-column",label:(0,O.__)("Content size"),hasValue:()=>{var e;return!(null==w||null===(e=w.layout)||void 0===e||!e.contentSize)},onDeselect:()=>F(void 0),isShownByDefault:N.contentSize,panelId:T},(0,b.createElement)(kf.Z,{alignment:"flex-end",justify:"flex-start"},(0,b.createElement)($m,{label:(0,O.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:M||"",onChange:e=>{F(e)},units:R}),(0,b.createElement)(rp.Z,null,(0,b.createElement)(Gm.Z,{icon:qm.Z})))),Z&&(0,b.createElement)(pT,{className:"single-column",label:(0,O.__)("Wide size"),hasValue:()=>{var e;return!(null==w||null===(e=w.layout)||void 0===e||!e.wideSize)},onDeselect:()=>z(void 0),isShownByDefault:N.wideSize,panelId:T},(0,b.createElement)(kf.Z,{alignment:"flex-end",justify:"flex-start"},(0,b.createElement)($m,{label:(0,O.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:j||"",onChange:e=>{z(e)},units:R}),(0,b.createElement)(rp.Z,null,(0,b.createElement)(Gm.Z,{icon:Km.Z})))),H&&(0,b.createElement)(pT,{hasValue:()=>{var e,t;return!(null==w||null===(e=w.spacing)||void 0===e||!e.padding)&&Object.keys(null==w||null===(t=w.spacing)||void 0===t?void 0:t.padding).length},label:(0,O.__)("Padding"),onDeselect:()=>$(void 0),isShownByDefault:N.padding,className:C()({"tools-panel-item-spacing":L}),panelId:T},!L&&(0,b.createElement)(gR,{values:V,onChange:$,label:(0,O.__)("Padding"),sides:W,units:R,allowReset:!1,splitOnAxis:U,onMouseOver:G,onMouseOut:ge}),L&&(0,b.createElement)(CR,{values:V,onChange:$,label:(0,O.__)("Padding"),sides:W,units:R,allowReset:!1,splitOnAxis:U,onMouseOver:G,onMouseOut:ge})),q&&(0,b.createElement)(pT,{hasValue:()=>{var e,t;return!(null==w||null===(e=w.spacing)||void 0===e||!e.margin)&&Object.keys(null==w||null===(t=w.spacing)||void 0===t?void 0:t.margin).length},label:(0,O.__)("Margin"),onDeselect:()=>Q(void 0),isShownByDefault:N.margin,className:C()({"tools-panel-item-spacing":L}),panelId:T},!L&&(0,b.createElement)(gR,{values:K,onChange:Q,label:(0,O.__)("Margin"),sides:Y,units:R,allowReset:!1,splitOnAxis:X,onMouseOver:J,onMouseOut:ge}),L&&(0,b.createElement)(CR,{values:K,onChange:Q,label:(0,O.__)("Margin"),sides:Y,units:R,allowReset:!1,splitOnAxis:X,onMouseOver:J,onMouseOut:ge})),ee&&(0,b.createElement)(pT,{hasValue:()=>{var e;return!(null==w||null===(e=w.spacing)||void 0===e||!e.blockGap)},label:(0,O.__)("Block spacing"),onDeselect:()=>ie(void 0),isShownByDefault:N.blockGap,className:C()({"tools-panel-item-spacing":L}),panelId:T},!L&&(oe?(0,b.createElement)(gR,{label:(0,O.__)("Block spacing"),min:0,onChange:le,units:R,sides:re,values:ne,allowReset:!1,splitOnAxis:oe}):(0,b.createElement)($m,{label:(0,O.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:ie,units:R,value:te})),L&&(0,b.createElement)(CR,{label:(0,O.__)("Block spacing"),min:0,onChange:le,sides:oe?re:["top"],values:ne,allowReset:!1,splitOnAxis:oe})),ae&&(0,b.createElement)(pT,{hasValue:()=>{var e;return!(null==w||null===(e=w.dimensions)||void 0===e||!e.minHeight)},label:(0,O.__)("Min. height"),onDeselect:()=>{ce(void 0)},isShownByDefault:N.minHeight,panelId:T},(0,b.createElement)(SR,{label:(0,O.__)("Min. height"),value:se,onChange:ce})),ue&&(0,b.createElement)(Mw.Z,{as:pT,spacing:2,hasValue:()=>!(null==w||!w.layout),label:me,onDeselect:()=>{he({selfStretch:void 0,flexSize:void 0})},isShownByDefault:N.childLayout,panelId:T},(0,b.createElement)(TR,{value:de,onChange:he,parentLayout:null==I?void 0:I.parentLayout})))}function VR(e){var t,n;let{clientId:r,attributes:o,forceShow:i}=e;const l=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,b.useMemo)((()=>{const e=null!=l&&l.top?Dp(null==l?void 0:l.top):0,t=null!=l&&l.right?Dp(null==l?void 0:l.right):0,n=null!=l&&l.bottom?Dp(null==l?void 0:l.bottom):0,r=null!=l&&l.left?Dp(null==l?void 0:l.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:r,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:r?`calc(${r} * -1)`:0}}),[l]),[s,c]=(0,b.useState)(!1),u=(0,b.useRef)(l),d=(0,b.useRef)();return(0,b.useEffect)((()=>((0,P.default)(l,u.current)||i||(c(!0),u.current=l,d.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),d.current&&window.clearTimeout(d.current)})),[l,i]),s||i?(0,b.createElement)(QC,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,b.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function WR(e){var t,n;let{clientId:r,attributes:o,forceShow:i}=e;const l=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,b.useMemo)((()=>({borderTopWidth:null!=l&&l.top?Dp(null==l?void 0:l.top):0,borderRightWidth:null!=l&&l.right?Dp(null==l?void 0:l.right):0,borderBottomWidth:null!=l&&l.bottom?Dp(null==l?void 0:l.bottom):0,borderLeftWidth:null!=l&&l.left?Dp(null==l?void 0:l.left):0})),[l]),[s,c]=(0,b.useState)(!1),u=(0,b.useRef)(l),d=(0,b.useRef)();return(0,b.useEffect)((()=>((0,P.default)(l,u.current)||i||(c(!0),u.current=l,d.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),d.current&&window.clearTimeout(d.current)})),[l,i]),s||i?(0,b.createElement)(QC,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,b.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const UR="dimensions",$R="spacing";function GR(e){let{children:t,resetAllFilter:n}=e;const r=(0,b.useCallback)((e=>{const t=e.style,r=n(t);return{...e,style:r}}),[n]);return(0,b.createElement)(Gf,{group:"dimensions",resetAllFilter:r},t)}function qR(e){var t,n;const{clientId:r,name:o,attributes:i,setAttributes:l,__unstableParentLayout:a}=e,s=mm(o,a),c=function(e){const t=PR(e),n=AR(e),r=LR(e),o=RR(e),i=DR(e),l=MR(e),a=OR(e);return"web"===Pa.Z.OS&&(t||n||r||o||i||l||a)}(s),u=i.style,[d,p]=function(){const[e,t]=(0,b.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=ud((0,dn.Z)(pd));return(0,b.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!c)return null;const m={...Yn(e.name,[UR,"__experimentalDefaultControls"]),...Yn(e.name,[$R,"__experimentalDefaultControls"])};return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(HR,{as:GR,panelId:r,name:o,settings:s,value:u,onChange:e=>{l({style:sm(e)})},defaultControls:m,onVisualize:p}),!(null==s||null===(t=s.spacing)||void 0===t||!t.padding)&&(0,b.createElement)(WR,(0,ta.Z)({forceShow:"padding"===d},e)),!(null==s||null===(n=s.spacing)||void 0===n||!n.margin)&&(0,b.createElement)(VR,(0,ta.Z)({forceShow:"margin"===d},e)))}const KR=[...kL,FB,QP,UR,$R],YR=e=>KR.some((t=>Xn(e,t)));function XR(){const e={};return Th(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).forEach((t=>{e[t.key]=t.value})),e}const QR={[`${FB}.__experimentalSkipSerialization`]:["border"],[`${QP}.__experimentalSkipSerialization`]:[QP],[`${_L}.__experimentalSkipSerialization`]:[_L],[`${UR}.__experimentalSkipSerialization`]:[UR],[`${$R}.__experimentalSkipSerialization`]:[$R]},JR={...QR,[`${$R}`]:["spacing.blockGap"]},eD={gradients:"gradient"};function tD(e,t){if(!e)return e;let n=e;return arguments.length>2&&void 0!==arguments[2]&&arguments[2]||(n=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...r]=e;tD(n[t],[r],!0)}else 1===e.length&&delete n[e[0]]})),n}function nD(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:JR;if(!YR(t))return e;let{style:o}=n;return Object.entries(r).forEach((e=>{let[n,r]=e;const i=Yn(t,n);!0===i&&(o=tD(o,r)),Array.isArray(i)&&i.forEach((e=>{const t=eD[e]||e;o=tD(o,[[...r,t]])}))})),e.style={...XR(o),...e.style},e}const rD=(0,na.o)((e=>t=>{const n=bd();return(0,b.createElement)(b.Fragment,null,n&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(uA,t),(0,b.createElement)(EL,t),(0,b.createElement)(WB,t),(0,b.createElement)(qR,t)),(0,b.createElement)(e,t))}),"withToolbarControls"),oD=(0,na.o)((e=>t=>{var n,r;const o=`wp-elements-${(0,ep.Z)(e)}`,i=pm(t.name,QP,"link"),l=(0,b.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,r=[];if(n&&Object.keys(n).length>0){var l;const e={...n,link:{...n.link,color:i||null===(l=n.link)||void 0===l?void 0:l.color}};for(const[t,n]of Object.entries(e)){const e=Ih(n,{selector:`.editor-styles-wrapper .${o} ${On[t]}`});e&&r.push(e)}}return r.length>0?r:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),a=(0,b.useContext)(eT.__unstableElementContext);return(0,b.createElement)(b.Fragment,null,l&&a&&(0,y.createPortal)((0,b.createElement)("style",{dangerouslySetInnerHTML:{__html:l}}),a),(0,b.createElement)(e,(0,ta.Z)({},t,{className:null!==(r=t.attributes.style)&&void 0!==r&&r.elements?C()(t.className,o):t.className})))}));(0,tr.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return YR(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",nD),(0,tr.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!YR(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),nD(r,e,n,QR)},e})),(0,tr.addFilter)("editor.BlockEdit","core/style/with-block-controls",rD),(0,tr.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",oD),(0,tr.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t;return Xn(e,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var iD=n(42253);function lD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"90deg";const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,Tn.l7)([Nn.Z]);const aD=function(e){let{values:t}=e;return t?(0,b.createElement)(ZT,{colorValue:lD(t,"135deg")}):(0,b.createElement)(Ip.Z,{icon:iD.Z})};function sD(e){let{label:t,value:n,colors:r,disableCustomColors:o,enableAlpha:i,onChange:l}=e;const[a,s]=(0,b.useState)(!1);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ia.ZP,{className:"components-color-list-picker__swatch-button",onClick:()=>s((e=>!e))},(0,b.createElement)(kf.Z,{justify:"flex-start",spacing:2},n?(0,b.createElement)(ZT,{colorValue:n,className:"components-color-list-picker__swatch-color"}):(0,b.createElement)(Ip.Z,{icon:iD.Z}),(0,b.createElement)("span",null,t))),a&&(0,b.createElement)(sB,{className:"components-color-list-picker__color-picker",colors:r,value:n,clearable:!1,onChange:l,disableCustomColors:o,enableAlpha:i}))}const cD=function(e){let{colors:t,labels:n,value:r=[],disableCustomColors:o,enableAlpha:i,onChange:l}=e;return(0,b.createElement)("div",{className:"components-color-list-picker"},n.map(((e,n)=>(0,b.createElement)(sD,{key:n,label:e,value:r[n],colors:t,disableCustomColors:o,enableAlpha:i,onChange:e=>{const t=r.slice();t[n]=e,l(t)}}))))},uD=["#333","#CCC"];function dD(e){let{value:t,onChange:n}=e;const r=!!t,o=r?t:uD,i=lD(o),l=(a=o).map(((e,t)=>({position:100*t/(a.length-1),color:e})));var a;return(0,b.createElement)(bP,{disableInserter:!0,background:i,hasGradient:r,value:l,onChange:e=>{const t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{let{color:t}=e;return t}))}(e);n(t)}})}const pD=function(e){let{clearable:t=!0,unsetable:n=!0,colorPalette:r,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:l,value:a,onChange:s}=e;const[c,u]=(0,b.useMemo)((()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map((e=>{let{color:t}=e;return{color:t,brightness:(0,Tn.Vi)(t).brightness()}})).reduce(((e,t)=>{let[n,r]=e;return[t.brightness<=n.brightness?t:n,t.brightness>=r.brightness?t:r]}),[{brightness:1},{brightness:0}]).map((e=>{let{color:t}=e;return t}));var e}),[r]),d="unset"===a,p=(0,b.createElement)(eB.Option,{key:"unset",value:"unset",isSelected:d,tooltipText:(0,O.__)("Unset"),className:"components-duotone-picker__color-indicator",onClick:()=>{s(d?void 0:"unset")}}),m=o.map((e=>{let{colors:t,slug:n,name:r}=e;const o={background:lD(t,"135deg"),color:"transparent"},i=null!=r?r:(0,O.sprintf)((0,O.__)("Duotone code: %s"),n),l=r?(0,O.sprintf)((0,O.__)("Duotone: %s"),r):i,c=T()(t,a);return(0,b.createElement)(eB.Option,{key:n,value:t,isSelected:c,"aria-label":l,tooltipText:i,style:o,onClick:()=>{s(c?void 0:t)}})}));return(0,b.createElement)(eB,{options:n?[p,...m]:m,actions:!!t&&(0,b.createElement)(eB.ButtonAction,{onClick:()=>s(void 0)},(0,O.__)("Clear"))},(0,b.createElement)(Ow.Z,{paddingTop:4},(0,b.createElement)(Mw.Z,{spacing:3},!i&&!l&&(0,b.createElement)(dD,{value:d?void 0:a,onChange:s}),!l&&(0,b.createElement)(cD,{labels:[(0,O.__)("Shadows"),(0,O.__)("Highlights")],colors:r,value:d?void 0:a,disableCustomColors:i,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=c),e[1]||(e[1]=u);const t=e.length>=2?e:void 0;s(t)}}))))};var mD=n(5057);const hD=function(e){let t,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}=e;return t="unset"===l?(0,b.createElement)(ZT,{className:"block-editor-duotone-control__unset-indicator"}):l?(0,b.createElement)(aD,{values:l}):(0,b.createElement)(Gm.Z,{icon:mD.Z}),(0,b.createElement)(W_.Z,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,O.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,b.createElement)(sa,{showTooltip:!0,onClick:r,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==T_.DOWN||(e.preventDefault(),r())},label:(0,O.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,b.createElement)(Td.Z,{label:(0,O.__)("Duotone")},(0,b.createElement)("div",{className:"block-editor-duotone-control__description"},(0,O.__)("Create a two-tone color effect without losing your original image.")),(0,b.createElement)(pD,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}))})},fD=[];function gD(e){let{selector:t,id:n,colors:r}=e;return"unset"===r?(0,b.createElement)(ux,{selector:t}):(0,b.createElement)(b.Fragment,null,(0,b.createElement)(dx,{id:n,colors:r}),(0,b.createElement)(cx,{id:n,selector:t}))}function vD(e){let{presetSetting:t,defaultSetting:n}=e;const r=!am(n),o=am(`${t}.custom`)||fD,i=am(`${t}.theme`)||fD,l=am(`${t}.default`)||fD;return(0,b.useMemo)((()=>[...o,...i,...r?fD:l]),[r,o,i,l])}function bD(e,t){if(!e)return;const n=null==t?void 0:t.find((t=>{let{slug:n}=t;return e===`var:preset|duotone|${n}`}));return n?n.colors:void 0}function yD(e){var t;let{attributes:n,setAttributes:r}=e;const o=null==n?void 0:n.style,i=null==o||null===(t=o.color)||void 0===t?void 0:t.duotone,l=vD({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=vD({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!am("color.custom"),c=!am("color.customDuotone")||0===(null==a?void 0:a.length)&&s;if(0===(null==l?void 0:l.length)&&c)return null;const u=Array.isArray(i)?i:bD(i,l);return(0,b.createElement)(Sd,{group:"block",__experimentalShareWithChildBlocks:!0},(0,b.createElement)(hD,{duotonePalette:l,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:u,onChange:e=>{const t=function(e,t){if(!e||!Array.isArray(e))return;const n=null==t?void 0:t.find((t=>{var n;return null==t||null===(n=t.colors)||void 0===n?void 0:n.every(((t,n)=>t===e[n]))}));return n?`var:preset|duotone|${n.slug}`:void 0}(e,l),n={...o,color:{...null==o?void 0:o.color,duotone:null!=t?t:e}};r({style:n})}}))}(0,Tn.l7)([Nn.Z]);const _D=(0,na.o)((e=>t=>{const n=Xn(t.name,"color.__experimentalDuotone"),r=(0,un.Z)((e=>e(pd).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,b.createElement)(b.Fragment,null,n&&!r&&(0,b.createElement)(yD,t),(0,b.createElement)(e,t))}),"withDuotoneControls");function kD(e){let{name:t,duotoneStyle:n,id:r}=e;const o=vD({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=(0,b.useContext)(eT.__unstableElementContext);if(!i||!n)return null;let l=n;Array.isArray(l)||"unset"===l||(l=bD(l,o));const a=function(e,t){const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}(`.editor-styles-wrapper .${r}`,Yn(t,"color.__experimentalDuotone"));return(0,y.createPortal)((0,b.createElement)(gD,{selector:a,id:r,colors:l}),i)}const xD=(0,na.o)((e=>t=>{var n,r,o;const i=Yn(t.name,"color.__experimentalDuotone"),l=`wp-duotone-${(0,ep.Z)(e)}`,a=i?C()(null==t?void 0:t.className,l):null==t?void 0:t.className,s=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.duotone;return(0,b.createElement)(b.Fragment,null,i&&s&&(0,b.createElement)(kD,{name:null==t?void 0:t.name,duotoneStyle:s,id:l}),(0,b.createElement)(e,(0,ta.Z)({},t,{className:a})))}),"withDuotoneStyles");(0,tr.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Xn(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,tr.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",_D),(0,tr.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",xD);var wD=n(43892);const CD="__experimentalLayout";function ED(e){let{clientId:t,setAttributes:n,attributes:r,name:o}=e;const{layout:i}=r,l=am("layout"),{themeSupportsLayout:a,isContentLocked:s}=(0,un.Z)((e=>{const{getSettings:n,__unstableGetContentLockingParent:r}=e(pd);return{themeSupportsLayout:n().supportsLayout,isContentLocked:r(t)}}),[t]),c=Yn(o,CD,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:p=!0,default:m}=c;if(!d)return null;const h=!(!p||!l||null!=i&&i.type&&"default"!==(null==i?void 0:i.type)&&"constrained"!==(null==i?void 0:i.type)&&(null==i||!i.inherit)),f=i||m||{},{inherit:g=!1,type:v="default",contentSize:y=null}=f;if(("default"===v||"constrained"===v)&&!a)return null;const _=Ph(v),k=Ph("constrained"),x=!f.type&&(y||g),w=!!g||!!y,C=e=>n({layout:e});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Gf,null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Layout")},h&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,O.__)("Inner blocks use content width"),checked:"constrained"===(null==_?void 0:_.name)||w,onChange:()=>n({layout:{type:"constrained"===(null==_?void 0:_.name)||w?"default":"constrained"}}),help:"constrained"===(null==_?void 0:_.name)||w?(0,O.__)("Nested blocks use content width with options for full and wide widths."):(0,O.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!g&&u&&(0,b.createElement)(SD,{type:v,onChange:e=>n({layout:{type:e}})}),_&&"default"!==_.name&&(0,b.createElement)(_.inspectorControls,{layout:f,onChange:C,layoutBlockSupport:c}),k&&x&&(0,b.createElement)(k.inspectorControls,{layout:f,onChange:C,layoutBlockSupport:c}))),!g&&!s&&_&&(0,b.createElement)(_.toolBarControls,{layout:f,onChange:C,layoutBlockSupport:c}))}function SD(e){let{type:t,onChange:n}=e;return(0,b.createElement)(wD.Z,null,Bh.map((e=>{let{name:r,label:o}=e;return(0,b.createElement)(ia.ZP,{key:r,isPressed:t===r,onClick:()=>n(r)},o)})))}const ID=(0,na.o)((e=>t=>{const{name:n}=t;return[Xn(n,CD)&&(0,b.createElement)(ED,(0,ta.Z)({key:"layout"},t)),(0,b.createElement)(e,(0,ta.Z)({key:"edit"},t))]}),"withInspectorControls"),TD=(0,na.o)((e=>t=>{const{name:n,attributes:r,block:o}=t,i=Xn(n,CD),l=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return!!t().disableLayoutStyles})),a=i&&!l,s=(0,ep.Z)(e),c=am("layout")||{},u=(0,b.useContext)(eT.__unstableElementContext),{layout:d}=r,{default:p}=Yn(n,CD)||{},m=null!=d&&d.inherit||null!=d&&d.contentSize||null!=d&&d.wideSize?{...d,type:"constrained"}:d||p||{},h=i?function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,un.Z)((e=>{var t;const{getSettings:n}=e(pd);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),o=am("layout")||{},{attributes:i={},name:l}=n,{layout:a}=i,{default:s}=Yn(l,CD)||{},c=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||s||{},u=[];var d,p;return null!=o&&null!==(e=o.definitions)&&void 0!==e&&null!==(t=e[(null==c?void 0:c.type)||"default"])&&void 0!==t&&t.className&&u.push(null==o||null===(d=o.definitions)||void 0===d||null===(p=d[(null==c?void 0:c.type)||"default"])||void 0===p?void 0:p.className),(null!=c&&c.inherit||null!=c&&c.contentSize||"constrained"===(null==c?void 0:c.type))&&r&&u.push("has-global-padding"),null!=c&&c.orientation&&u.push(`is-${(0,N.kebabCase)(c.orientation)}`),null!=c&&c.justifyContent&&u.push(`is-content-justification-${(0,N.kebabCase)(c.justifyContent)}`),null!=c&&c.flexWrap&&"nowrap"===c.flexWrap&&u.push("is-nowrap"),u}(o):null,f=`.wp-container-${s}.wp-container-${s}`,g=null!==am("spacing.blockGap");let v;if(a){var _;const e=Ph((null==m?void 0:m.type)||"default");v=null==e||null===(_=e.getLayoutStyle)||void 0===_?void 0:_.call(e,{blockName:n,selector:f,layout:m,layoutDefinitions:null==c?void 0:c.definitions,style:null==r?void 0:r.style,hasBlockGapSupport:g})}const k=C()({[`wp-container-${s}`]:a&&!!v},h);return(0,b.createElement)(b.Fragment,null,a&&u&&!!v&&(0,y.createPortal)((0,b.createElement)(Mh,{blockName:n,selector:f,css:v,layout:m,style:null==r?void 0:r.style}),u),(0,b.createElement)(e,(0,ta.Z)({},t,{__unstableLayoutClassNames:k})))})),ND=(0,na.o)((e=>t=>{const{attributes:n}=t,{style:{layout:r={}}={}}=n,{selfStretch:o,flexSize:i}=r,l=o||i,a=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return!!t().disableLayoutStyles})),s=l&&!a,c=(0,b.useContext)(eT.__unstableElementContext),u=(0,ep.Z)(e),d=`.wp-container-content-${u}`;let p="";"fixed"===o&&i?p+=`${d} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o&&(p+=`${d} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const m=C()(null==t?void 0:t.className,{[`wp-container-content-${u}`]:s&&!!p});return(0,b.createElement)(b.Fragment,null,s&&c&&!!p&&(0,y.createPortal)((0,b.createElement)("style",null,p),c),(0,b.createElement)(e,(0,ta.Z)({},t,{className:m})))}));function BD(e){let{clientId:t,stopEditingAsBlock:n}=e;const r=(0,un.Z)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=e(pd);return n(t)||r(t,!0)}),[t]);return(0,b.useEffect)((()=>{r||n()}),[r]),null}(0,tr.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||Xn(e,CD)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,tr.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",TD),(0,tr.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",ND),(0,tr.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",ID);const PD=(0,na.o)((e=>t=>{const{getBlockListSettings:n,getSettings:r}=(0,un.Z)(pd),o=(0,b.useRef)(),{templateLock:i,isLockedByParent:l,isEditingAsBlocks:a}=(0,un.Z)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:r,__unstableGetTemporarilyEditingAsBlocks:o}=e(pd);return{templateLock:r(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:o()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:c,__unstableSetTemporarilyEditingAsBlocks:u}=(0,dn.Z)(pd),d=!l&&"contentOnly"===i,{__unstableMarkNextChangeAsNotPersistent:p,updateBlockAttributes:m}=(0,dn.Z)(pd),h=(0,b.useCallback)((()=>{p(),m(t.clientId,{templateLock:"contentOnly"}),c(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:o.current}),u()}),[t.clientId,o,s,c,n,p,m,u]);return d||a?(0,b.createElement)(b.Fragment,null,a&&!d&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(BD,{clientId:t.clientId,stopEditingAsBlock:h}),(0,b.createElement)(Sd,{group:"other"},(0,b.createElement)(sa,{onClick:()=>{h()}},(0,O.__)("Done")))),!a&&d&&t.isSelected&&(0,b.createElement)(OS,null,(e=>{let{onClose:i}=e;return(0,b.createElement)(Nd.Z,{onClick:()=>{p(),m(t.clientId,{templateLock:void 0}),c(t.clientId,{...n(t.clientId),templateLock:!1}),o.current=r().focusMode,s({focusMode:!0}),u(t.clientId),i()}},(0,O.__)("Modify"))})),(0,b.createElement)(e,(0,ta.Z)({},t,{className:C()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,b.createElement)(e,t)}),"withToolbarControls");(0,tr.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",PD);const AD="metadata";function LD(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=Yn(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function RD(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:qB(e)||void 0,style:XR({border:n})}}function DD(e){const{colors:t}=OB(),n=RD(e),{borderColor:r}=e;if(r){const e=HB({colors:t,namedColor:r});n.style.borderColor=e.color}return n}(0,tr.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t[AD])&&void 0!==n&&n.type||LD(e,"name")&&(e.attributes={...e.attributes,[AD]:{type:"object"}}),e})),(0,tr.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return LD(t)&&(e[AD]=n[AD]),e})),(0,tr.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||LD(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:r}=e;if("list-view"===n&&null!=r&&r.name)return r.name}),e}));var MD=n(40566),OD=n(36760),FD=n(28994);const ZD=[{icon:MD.Z,title:(0,O.__)("Align text left"),align:"left"},{icon:OD.Z,title:(0,O.__)("Align text center"),align:"center"},{icon:FD.Z,title:(0,O.__)("Align text right"),align:"right"}],jD={position:"bottom right",variant:"toolbar"},zD=function(e){let{value:t,onChange:n,alignmentControls:r=ZD,label:o=(0,O.__)("Align text"),describedBy:i=(0,O.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const c=r.find((e=>e.align===t)),u=a?pa:Id,d=a?{isCollapsed:l}:{toggleProps:{describedBy:i},popoverProps:jD};return(0,b.createElement)(u,(0,ta.Z)({icon:c?c.icon:(0,O.isRTL)()?FD.Z:MD.Z,label:o,controls:r.map((e=>{const{align:n}=e,r=t===n;return{...e,isActive:r,role:l?"menuitemradio":void 0,onClick:s(n)}}))},d))},HD=e=>(0,b.createElement)(zD,(0,ta.Z)({},e,{isToolbar:!1})),VD=(0,b.createElement)(Vp.Wj,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,b.createElement)(Vp.y$,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})),WD=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:l,preview:a,isColumnLayout:s,withIllustration:c,...u}=e,[d,{width:p}]=(0,Jd.Z)();let m;"number"==typeof p&&(m={"is-large":p>=480,"is-medium":p>=160&&p<480,"is-small":p<160});const h=C()("components-placeholder",i,m,c?"has-illustration":null),f=C()("components-placeholder__fieldset",{"is-column-layout":s});return(0,b.createElement)("div",(0,ta.Z)({},u,{className:h}),c?VD:null,d,l,a&&(0,b.createElement)("div",{className:"components-placeholder__preview"},a),(0,b.createElement)("div",{className:"components-placeholder__label"},(0,b.createElement)(Ip.Z,{icon:t}),r),(0,b.createElement)("fieldset",{className:f},!!o&&(0,b.createElement)("legend",{className:"components-placeholder__instructions"},o),n))};var UD=n(99231);const $D=function(e){let{icon:t=UD.Z,label:n=(0,O.__)("Choose variation"),instructions:r=(0,O.__)("Select a variation to start with."),variations:o,onSelect:i,allowSkip:l}=e;const a=C()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,b.createElement)(WD,{icon:t,label:n,instructions:r,className:a},(0,b.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,O.__)("Block variations")},o.map((e=>(0,b.createElement)("li",{key:e.name},(0,b.createElement)(ia.ZP,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>i(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,b.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),l&&(0,b.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,b.createElement)(ia.ZP,{variant:"link",onClick:()=>i()},(0,O.__)("Skip"))))},GD=(0,na.o)((e=>t=>{const n=am("color.palette"),r=!am("color.custom"),o=void 0===t.colors?n:t.colors,i=void 0===t.disableCustomColors?r:t.disableCustomColors,l=!(0,N.isEmpty)(o)||!i;return(0,b.createElement)(e,(0,ta.Z)({},t,{colors:o,disableCustomColors:i,hasColorsToChoose:l}))}),"withColorContext")(sB),qD=(0,b.createContext)({}),KD=()=>(0,b.useContext)(qD);function YD(e){let{id:t,url:n,naturalWidth:r,naturalHeight:o,onFinishEditing:i,onSaveImage:l,children:a}=e;const s=function(e){let{url:t,naturalWidth:n,naturalHeight:r}=e;const[o,i]=(0,b.useState)(),[l,a]=(0,b.useState)(),[s,c]=(0,b.useState)({x:0,y:0}),[u,d]=(0,b.useState)(100),[p,m]=(0,b.useState)(0),h=n/r,[f,g]=(0,b.useState)(h),v=(0,b.useCallback)((()=>{const e=(p+90)%360;let n=h;if(p%180==90&&(n=1/h),0===e)return i(),m(e),g(h),void c({x:-s.y*n,y:s.x*n});const r=new window.Image;r.src=t,r.onload=function(t){const r=document.createElement("canvas");let o=0,l=0;e%180?(r.width=t.target.height,r.height=t.target.width):(r.width=t.target.width,r.height=t.target.height),90!==e&&180!==e||(o=r.width),270!==e&&180!==e||(l=r.height);const a=r.getContext("2d");a.translate(o,l),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),r.toBlob((t=>{i(URL.createObjectURL(t)),m(e),g(r.width/r.height),c({x:-s.y*n,y:s.x*n})}))};const o=(0,tr.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof o&&(r.crossOrigin=o)}),[p,h]);return(0,b.useMemo)((()=>({editedUrl:o,setEditedUrl:i,crop:l,setCrop:a,position:s,setPosition:c,zoom:u,setZoom:d,rotation:p,setRotation:m,rotateClockwise:v,aspect:f,setAspect:g,defaultAspect:h})),[o,l,s,u,p,v,f,h])}({url:n,naturalWidth:r,naturalHeight:o}),c=function(e){let{crop:t,rotation:n,height:r,width:o,aspect:i,url:l,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:u}=(0,dn.Z)(aw.h),[d,p]=(0,b.useState)(!1),m=(0,b.useCallback)((()=>{p(!1),c()}),[p,c]),h=(0,b.useCallback)((()=>{p(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=l,(0,_.Z)({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:r&&o?o/i:void 0})})).catch((e=>{u((0,O.sprintf)((0,O.__)("Could not edit image. %s"),(0,Ln.Z)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{p(!1),c()}))}),[p,t,n,r,o,i,l,s,u,p,c]);return(0,b.useMemo)((()=>({isInProgress:d,apply:h,cancel:m})),[d,h,m])}({id:t,url:n,onSaveImage:l,onFinishEditing:i,...s}),u=(0,b.useMemo)((()=>({...s,...c})),[s,c]);return(0,b.createElement)(qD.Provider,{value:u},a)}var XD=function(e,t){return XD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},XD(e,t)},QD=function(){return QD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},QD.apply(this,arguments)};Object.create,Object.create;var JD=n(91544),eM=n.n(JD);function tM(e,t,n,r,o){void 0===o&&(o=0);var i=sM(t.width,t.height,o),l=i.width,a=i.height;return{x:nM(e.x,l,n.width,r),y:nM(e.y,a,n.height,r)}}function nM(e,t,n,r){var o=t*r/2-n/2;return cM(e,-o,o)}function rM(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function oM(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function iM(e,t){return Math.min(e,Math.max(0,t))}function lM(e,t){return t}function aM(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function sM(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function cM(e,t,n){return Math.min(Math.max(e,t),n)}function uM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var dM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=b.createRef(),n.videoRef=b.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var l=sM(t.width,t.height,n),a=cM(r.width/l.width*(100/e.width),o,i);return{crop:{x:a*l.width/2-r.width/2-l.width*a*(e.x/100),y:a*l.height/2-r.height/2-l.height*a*(e.y/100)},zoom:a}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var l=sM(t.naturalWidth,t.naturalHeight,n),a=cM(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),s=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((l.width-e.width)/2-e.x)*s,y:((l.height-e.height)/2-e.y)*s},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,l,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidth<c||a.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=s>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=QD(QD({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var l=sM(e,t,i),a=l.width,s=l.height,c=Math.min(a,n),u=Math.min(s,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===m.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=QD({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},l=n.props.restrictPosition?tM(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(l)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=eM()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,l=o.zoom;return{x:(t+i.x)/l,y:(r+i.y)/l}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var l=cM(e,n.props.minZoom,n.props.maxZoom);if(i){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*l-a.x,y:s.y*l-a.y},u=n.props.restrictPosition?tM(c,n.mediaSize,n.state.cropSize,l,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,l){void 0===i&&(i=0),void 0===l&&(l=!0);var a=l?iM:lM,s=sM(t.width,t.height,i),c=sM(t.naturalWidth,t.naturalHeight,i),u={x:a(100,((s.width-n.width/o)/2-e.x/o)/s.width*100),y:a(100,((s.height-n.height/o)/2-e.y/o)/s.height*100),width:a(100,n.width/s.width*100/o),height:a(100,n.height/s.height*100/o)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*r?{width:Math.round(p*r),height:p}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:QD(QD({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}(n.props.restrictPosition?tM(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?tM(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}XD(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,l,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(l=this.props.crop)||void 0===l?void 0:l.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=rM(n,r),this.lastPinchRotation=oM(n,r),this.onDragStart(aM(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=aM(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=rM(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var l=oM(r,o),a=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=l}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,i=t.transform,l=t.crop,a=l.x,s=l.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,h=m.containerStyle,f=m.cropAreaStyle,g=m.mediaStyle,v=t.classes,y=v.containerClassName,_=v.cropAreaClassName,k=v.mediaClassName,x=t.objectFit;return b.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:h,className:uM("reactEasyCrop_Container",y)},n?b.createElement("img",QD({alt:"",className:uM("reactEasyCrop_Image","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical","auto-cover"===x&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},o,{src:n,ref:this.imageRef,style:QD(QD({},g),{transform:i||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):r&&b.createElement("video",QD({autoPlay:!0,loop:!0,muted:!0,className:uM("reactEasyCrop_Video","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical","auto-cover"===x&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:QD(QD({},g),{transform:i||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return b.createElement("source",QD({key:e.src},e))}))),this.state.cropSize&&b.createElement("div",{style:QD(QD({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:uM("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(b.Component);const pM=100,mM=300,hM={placement:"bottom-start",variant:"toolbar"};function fM(e){let{url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:l,borderProps:a}=e;const{isInProgress:s,editedUrl:c,position:u,zoom:d,aspect:p,setPosition:m,setCrop:h,setZoom:f,rotation:g}=KD();let v=r||o*i/l;return g%180==90&&(v=o*l/i),(0,b.createElement)("div",{className:C()("wp-block-image__crop-area",null==a?void 0:a.className,{"is-applying":s}),style:{...null==a?void 0:a.style,width:n||o,height:v}},(0,b.createElement)(dM,{image:c||t,disabled:s,minZoom:pM/100,maxZoom:mM/100,crop:u,zoom:d/100,aspect:p,onCropChange:e=>{m(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{f(100*e)}}),s&&(0,b.createElement)(cC.ZP,null))}var gM=n(13356);function vM(){const{isInProgress:e,zoom:t,setZoom:n}=KD();return(0,b.createElement)(W_.Z,{contentClassName:"wp-block-image__zoom",popoverProps:hM,renderToggle:t=>{let{isOpen:n,onToggle:r}=t;return(0,b.createElement)(sa,{icon:gM.Z,label:(0,O.__)("Zoom"),onClick:r,"aria-expanded":n,disabled:e})},renderContent:()=>(0,b.createElement)(fN,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Zoom"),min:pM,max:mM,value:Math.round(t),onChange:n})})}var bM=n(2618);function yM(e){let{aspectRatios:t,isDisabled:n,label:r,onClick:o,value:i}=e;return(0,b.createElement)(Td.Z,{label:r},t.map((e=>{let{title:t,aspect:r}=e;return(0,b.createElement)(Nd.Z,{key:r,disabled:n,onClick:()=>{o(r)},role:"menuitemradio",isSelected:r===i,icon:r===i?bf.Z:void 0},t)})))}function _M(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:r,setAspect:o,defaultAspect:i}=KD();return(0,b.createElement)(ua.Z,{icon:bM.Z,label:(0,O.__)("Aspect Ratio"),popoverProps:hM,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(yM,{isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,O.__)("Original"),aspect:i},{title:(0,O.__)("Square"),aspect:1}]}),(0,b.createElement)(yM,{label:(0,O.__)("Landscape"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,O.__)("16:10"),aspect:1.6},{title:(0,O.__)("16:9"),aspect:16/9},{title:(0,O.__)("4:3"),aspect:4/3},{title:(0,O.__)("3:2"),aspect:1.5}]}),(0,b.createElement)(yM,{label:(0,O.__)("Portrait"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,O.__)("10:16"),aspect:.625},{title:(0,O.__)("9:16"),aspect:9/16},{title:(0,O.__)("3:4"),aspect:3/4},{title:(0,O.__)("2:3"),aspect:2/3}]}))}))}var kM=n(46335);function xM(){const{isInProgress:e,rotateClockwise:t}=KD();return(0,b.createElement)(sa,{icon:kM.Z,label:(0,O.__)("Rotate"),onClick:t,disabled:e})}function wM(){const{isInProgress:e,apply:t,cancel:n}=KD();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(sa,{onClick:t,disabled:e},(0,O.__)("Apply")),(0,b.createElement)(sa,{onClick:n},(0,O.__)("Cancel")))}function CM(e){let{id:t,url:n,width:r,height:o,clientWidth:i,naturalHeight:l,naturalWidth:a,onSaveImage:s,onFinishEditing:c,borderProps:u}=e;return(0,b.createElement)(YD,{id:t,url:n,naturalWidth:a,naturalHeight:l,onSaveImage:s,onFinishEditing:c},(0,b.createElement)(fM,{borderProps:u,url:n,width:r,height:o,clientWidth:i,naturalHeight:l,naturalWidth:a}),(0,b.createElement)(Sd,null,(0,b.createElement)(pa,null,(0,b.createElement)(vM,null),(0,b.createElement)(la.Z,null,(e=>(0,b.createElement)(_M,{toggleProps:e}))),(0,b.createElement)(xM,null)),(0,b.createElement)(pa,null,(0,b.createElement)(wM,null))))}const EM=[25,50,75,100],SM=()=>{};function IM(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:r,imageSizeOptions:o=[],isResizable:i=!0,slug:l,width:a,height:s,onChange:c,onChangeImage:u=SM}=e;const{currentHeight:d,currentWidth:p,updateDimension:m,updateDimensions:h}=function(e,t,n,r,o){var i,l;const[a,s]=(0,b.useState)(null!==(i=null!=t?t:r)&&void 0!==i?i:""),[c,u]=(0,b.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");return(0,b.useEffect)((()=>{void 0===t&&void 0!==r&&s(r),void 0===e&&void 0!==n&&u(n)}),[r,n]),(0,b.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&u(e)}),[t,e]),{currentHeight:c,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):u(t),o({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{u(null!=e?e:n),s(null!=t?t:r),o({height:e,width:t})}}}(s,a,r,n,c);return(0,b.createElement)(b.Fragment,null,o&&o.length>0&&(0,b.createElement)(jT.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Image size"),value:l,options:o,onChange:u,help:t}),i&&(0,b.createElement)("div",{className:"block-editor-image-size-control"},(0,b.createElement)("p",null,(0,O.__)("Image dimensions")),(0,b.createElement)(kf.Z,{align:"baseline",spacing:"3"},(0,b.createElement)(Mm.Z,{className:"block-editor-image-size-control__width",label:(0,O.__)("Width"),value:p,min:1,onChange:e=>m("width",e)}),(0,b.createElement)(Mm.Z,{className:"block-editor-image-size-control__height",label:(0,O.__)("Height"),value:d,min:1,onChange:e=>m("height",e)})),(0,b.createElement)(kf.Z,null,(0,b.createElement)(wD.Z,{"aria-label":(0,O.__)("Image size presets")},EM.map((e=>{const t=Math.round(n*(e/100)),o=Math.round(r*(e/100)),i=p===t&&d===o;return(0,b.createElement)(ia.ZP,{key:e,isSmall:!0,variant:i?"primary":void 0,isPressed:i,onClick:()=>h(o,t)},e,"%")}))),(0,b.createElement)(ia.ZP,{isSmall:!0,onClick:()=>h()},(0,O.__)("Reset")))))}var TM=n(95073);const NM=()=>{},BM=e=>{let{value:t,onChange:n=NM,settings:r}=e;if(!r||!r.length)return null;const o=e=>r=>{n({...t,[e.id]:r})},i=r.map((e=>(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:o(e),checked:!!t&&!!t[e.id]})));return(0,b.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,b.createElement)(U_.Z,{as:"legend"},(0,O.__)("Currently selected link settings")),i)},PM=function e(t){let{settingsOpen:n,setSettingsOpen:r,showTextControl:o,showSettings:i,textInputRef:l,internalTextInputValue:a,setInternalTextInputValue:s,handleSubmitWithEnter:c,value:u,settings:d,onChange:p}=t;const m=(0,i_.Z)(),h=m?b.Fragment:TM.M,f=m?"div":Gw.E.div,g=`link-control-settings-drawer-${(0,ep.Z)(e)}`;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ia.ZP,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:mA.Z,label:(0,O.__)("Link Settings"),"aria-controls":g}),(0,b.createElement)(h,null,n&&(0,b.createElement)(f,{className:"block-editor-link-control__drawer",hidden:!n,id:g,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,b.createElement)("div",{className:"block-editor-link-control__drawer-inner"},o&&(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,ref:l,className:"block-editor-link-control__setting block-editor-link-control__text-content",label:"Text",value:a,onChange:s,onKeyDown:c}),i&&(0,b.createElement)(BM,{value:u,settings:d,onChange:p})))))};var AM=n(63162),LM=n.n(AM);const RM=(0,na.o)((e=>t=>(0,b.createElement)(e,(0,ta.Z)({},t,{speak:Xc.speak,debouncedSpeak:(0,ng.Z)(Xc.speak,500)}))),"withSpokenMessages");var DM=n(22706),MM=n(75192),OM=n(9299);function FM(e){return"function"==typeof e}class ZM extends b.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,b.createRef)(),this.inputRef=(0,b.createRef)(),this.updateSuggestions=(0,rg.D)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,LM()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===r||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(null!=r&&r.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:r}=this.props;if(!n)return;const o=!(null!==(e=t)&&void 0!==e&&e.length);var i,l;if(t=t.trim(),!o&&(t.length<2||!r&&(0,OM.P)(t)))return null===(i=this.suggestionsRequest)||void 0===i||null===(l=i.cancel)||void 0===l||l.call(i),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const a=n(t,{isInitialSuggestions:o});a.then((e=>{this.suggestionsRequest===a&&(this.setState({suggestions:e,isUpdatingSuggestions:!1,suggestionsValue:t,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,O.sprintf)((0,O._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,O.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===a&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=a}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case T_.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case T_.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case T_.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case T_.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case T_.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case T_.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,O.__)("Link selected.")));break;case T_.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:r,disableSuggestions:o,__experimentalShowInitialSuggestions:i=!1}=e,{showSuggestions:l}=t,a=l;const s=n&&n.length;return i||s||(a=!1),!0===o&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${r}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${r}`}}render(){return(0,b.createElement)(b.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,O.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:a=""}=this.props,{loading:s,showSuggestions:c,selectedSuggestion:u,suggestionsListboxId:d,suggestionOptionIdPrefix:p}=this.state,m=`url-input-control-${o}`,h={id:m,label:t,className:C()("block-editor-url-input",n,{"is-full-width":r})},f={id:m,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,O.__)("URL"),"aria-expanded":c,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==u?`${p}-${u}`:void 0,ref:this.inputRef};return l?l(h,f,s):(e||(0,j.default)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,b.createElement)(Hd.ZP,(0,ta.Z)({__nextHasNoMarginBottom:e},h),(0,b.createElement)("input",f),s&&(0,b.createElement)(cC.ZP,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:l,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===r.length)return null;const c={id:l,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return FM(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=o&&o.length),currentInputValue:o}):(0,b.createElement)(mn.Z,{placement:"bottom",focusOnMount:!1},(0,b.createElement)("div",(0,ta.Z)({},c,{className:C()("block-editor-url-input__suggestions",`${e}__suggestions`)}),r.map(((e,t)=>(0,b.createElement)(ia.ZP,(0,ta.Z)({},u(0,t),{key:e.id,className:C()("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)}),e.title)))))}}const jM=(0,B.Z)(DM.Z,RM,MM.Z,(0,ig.Z)(((e,t)=>{if(FM(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(pd);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(ZM),zM=e=>{let t,{searchTerm:n,onClick:r,itemProps:o,isSelected:i,buttonText:l}=e;return n?(t=l?"function"==typeof l?l(n):l:(0,G_.Z)((0,O.sprintf)((0,O.__)("Create: <mark>%s</mark>"),n),{mark:(0,b.createElement)("mark",null)}),(0,b.createElement)(ia.ZP,(0,ta.Z)({},o,{className:C()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":i}),onClick:r}),(0,b.createElement)(Gm.Z,{className:"block-editor-link-control__search-item-icon",icon:yf.Z}),(0,b.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,b.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var HM=n(24782),VM=n(51817);function WM(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}new RegExp(`[${["-","~","­","֊","־","᐀","᠆","‐","‑","‒","–","—","―","⁓","⁻","₋","−","⸗","⸺","⸻","〜","〰","゠","︱","︲","﹘","﹣","-"].join("")}]`,"g");const UM=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,b.createElement)(b.Fragment,null,t);const o=new RegExp(`(${WM(r)})`,"gi");return(0,G_.Z)(t.replace(o,"<mark>$&</mark>"),{mark:(0,b.createElement)("mark",null)})};var $M=n(31606),GM=n(64955),qM=n(46945),KM=n(57114),YM=n(41743),XM=n(57405);const QM={post:$M.Z,page:GM.Z,post_tag:qM.Z,category:KM.Z,attachment:YM.Z};function JM(e){let{isURL:t,suggestion:n}=e,r=null;return t?r=XM.Z:n.type in QM&&(r=QM[n.type]),r?(0,b.createElement)(Gm.Z,{className:"block-editor-link-control__search-item-icon",icon:r}):null}const eO=e=>{let{itemProps:t,suggestion:n,isSelected:r=!1,onClick:o,isURL:i=!1,searchTerm:l="",shouldShowType:a=!1}=e;return(0,b.createElement)(ia.ZP,(0,ta.Z)({},t,{onClick:o,className:C()("block-editor-link-control__search-item",{"is-selected":r,"is-url":i,"is-entity":!i})}),(0,b.createElement)(JM,{suggestion:n,isURL:i}),(0,b.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,b.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,b.createElement)(UM,{text:n.title,highlight:l})),(0,b.createElement)("span",{"aria-hidden":!i,className:"block-editor-link-control__search-item-info"},!i&&((0,HM.w)((0,VM.x)(n.url))||""),i&&(0,O.__)("Press ENTER to add this link"))),a&&n.type&&(0,b.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))},tO="__CREATE__",nO="mailto",rO="internal",oO=["URL",nO,"tel",rO],iO=[{id:"opensInNewTab",title:(0,O.__)("Open in new tab")}];function lO(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:r,handleSuggestionClick:o,suggestionsListProps:i,buildSuggestionItemProps:l,suggestions:a,selectedSuggestion:s,isLoading:c,isInitialSuggestions:u,createSuggestionButtonText:d,suggestionsQuery:p}=e;const m=C()("block-editor-link-control__search-results",{"is-loading":c}),h=1===a.length&&oO.includes(a[0].type),f=n&&!h&&!u,g=!(null!=p&&p.type),v=`block-editor-link-control-search-results-label-${t}`,y=u?(0,O.__)("Recently updated"):(0,O.sprintf)((0,O.__)('Search results for "%s"'),r),_=(0,b.createElement)(u?b.Fragment:U_.Z,{},(0,b.createElement)("span",{className:"block-editor-link-control__search-results-label",id:v},y));return(0,b.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},_,(0,b.createElement)("div",(0,ta.Z)({},i,{className:m,"aria-labelledby":v}),a.map(((e,t)=>f&&tO===e.type?(0,b.createElement)(zM,{searchTerm:r,buttonText:d,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===s}):tO===e.type?null:(0,b.createElement)(eO,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===s,isURL:oO.includes(e.type),searchTerm:r,shouldShowType:g,isFrontPage:null==e?void 0:e.isFrontPage})))))}var aO=n(52915),sO=n(34849);function cO(e){const t=null==e?void 0:e.startsWith("#");return(0,OM.P)(e)||e&&e.includes("www.")||t}const uO=()=>Promise.resolve([]),dO=e=>{let t="URL";const n=(0,aO.E)(e)||"";return n.includes("mailto")&&(t=nO),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=rO),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,sO.u)(e):e,type:t}])};const pO=()=>Promise.resolve([]),mO=()=>{},hO=(0,b.forwardRef)(((e,t)=>{let{value:n,children:r,currentLink:o={},className:i=null,placeholder:l=null,withCreateSuggestion:a=!1,onCreateSuggestion:s=mO,onChange:c=mO,onSelect:u=mO,showSuggestions:d=!0,renderSuggestions:p=(e=>(0,b.createElement)(lO,e)),fetchSuggestions:m=null,allowDirectEntry:h=!0,showInitialSuggestions:f=!1,suggestionsQuery:g={},withURLSuggestion:v=!0,createSuggestionButtonText:y,useLabel:_=!1}=e;const k=function(e,t,n,r){const{fetchSearchSuggestions:o,pageOnFront:i}=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?dO:uO;return(0,b.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return cO(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,r,o,i,l)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),r(e)]);c[0]=c[0].map((e=>Number(e.id)===l?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&i&&!a?c[0].concat(c[1]):c[0],a||cO(e)||!o?c:c.concat({title:e,url:e,type:tO})})(t,{...e,isInitialSuggestions:s},o,l,n,r,i)}),[l,o,n])}(g,h,a,v),x=d?m||k:pO,w=(0,ep.Z)(hO),[E,S]=(0,b.useState)(),I=async e=>{let t=e;if(tO!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:n,...r}=null!=o?o:{};u({...r,...t},t)}}else try{var n;t=await s(e.title),null!==(n=t)&&void 0!==n&&n.url&&u(t)}catch(e){}},T=C()(i,{"has-no-label":!_});return(0,b.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,b.createElement)(jM,{__nextHasNoMarginBottom:!0,label:_?"URL":void 0,className:T,value:n,onChange:(e,t)=>{c(e),S(t)},placeholder:null!=l?l:(0,O.__)("Search or type url"),__experimentalRenderSuggestions:d?e=>p({...e,instanceId:w,withCreateSuggestion:a,createSuggestionButtonText:y,suggestionsQuery:g,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:x,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:f,onSubmit:(e,t)=>{var r;const o=e||E;o||null!=n&&null!==(r=n.trim())&&void 0!==r&&r.length?I(o||{url:n}):t.preventDefault()},ref:t}),r)})),fO=hO;var gO=n(17654),vO=n(76731);const{Slot:bO,Fill:yO}=(0,pn.up)("BlockEditorLinkControlViewer");function _O(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const kO=function(e){const[t,n]=(0,b.useReducer)(_O,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,b.useEffect)((()=>{if(null!=e&&e.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function xO(e){var t;let{value:n,onEditClick:r,hasRichPreviews:o=!1,hasUnlinkControl:i=!1,onRemove:l}=e;const a=o?null==n?void 0:n.url:null,{richData:s,isFetching:c}=kO(a),u=s&&Object.keys(s).length,d=n&&(0,HM.w)((0,VM.x)(n.url),16)||"",p=(null==s?void 0:s.title)||(null==n?void 0:n.title)||d,m=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let h;return h=null!=s&&s.icon?(0,b.createElement)("img",{src:null==s?void 0:s.icon,alt:""}):m?(0,b.createElement)(Gm.Z,{icon:gO.Z,size:32}):(0,b.createElement)(Gm.Z,{icon:XM.Z}),(0,b.createElement)("div",{"aria-label":(0,O.__)("Currently selected"),className:C()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":m})},(0,b.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,b.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,b.createElement)("span",{className:C()("block-editor-link-control__search-item-icon",{"is-image":null==s?void 0:s.icon})},h),(0,b.createElement)("span",{className:"block-editor-link-control__search-item-details"},m?(0,b.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,O.__)("Link is empty")):(0,b.createElement)(b.Fragment,null,(0,b.createElement)(tf.Z,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Ln.Z)(p)),(null==n?void 0:n.url)&&(0,b.createElement)("span",{className:"block-editor-link-control__search-item-info"},d)))),(0,b.createElement)(ia.ZP,{icon:vO.Z,label:(0,O.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:r,iconSize:24}),i&&(0,b.createElement)(ia.ZP,{icon:hT.Z,label:(0,O.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,b.createElement)(bO,{fillProps:n})),!!(u&&(null!=s&&s.image||null!=s&&s.description)||c)&&(0,b.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==s?void 0:s.image)||c)&&(0,b.createElement)("div",{"aria-hidden":!(null!=s&&s.image),className:C()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=s&&s.image)})},(null==s?void 0:s.image)&&(0,b.createElement)("img",{src:null==s?void 0:s.image,alt:""})),((null==s?void 0:s.description)||c)&&(0,b.createElement)("div",{"aria-hidden":!(null!=s&&s.description),className:C()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=s&&s.description)})},(null==s?void 0:s.description)&&(0,b.createElement)(HE.Z,{truncate:!0,numberOfLines:"2"},s.description))))}function wO(e){const[t,n]=(0,b.useState)(e||"");return(0,b.useEffect)((()=>{e&&e!==t&&n(e)}),[e]),[t,n]}const CO=()=>{};function EO(e){var t,n,r;let{searchInputPlaceholder:o,value:i,settings:l=iO,onChange:a=CO,onRemove:s,onCancel:c,noDirectEntry:u=!1,showSuggestions:d=!0,showInitialSuggestions:p,forceIsEditingLink:m,createSuggestion:h,withCreateSuggestion:f,inputValue:g="",suggestionsQuery:v={},noURLSuggestion:y=!1,createSuggestionButtonText:_,hasRichPreviews:k=!1,hasTextControl:x=!1,renderControlBottom:w=null}=e;void 0===f&&h&&(f=!0);const E=(0,b.useRef)(!0),S=(0,b.useRef)(),I=(0,b.useRef)(),T=(0,b.useRef)(!1),[N,B]=(0,b.useState)(!1),[P,A]=wO((null==i?void 0:i.url)||""),[L,R]=wO((null==i?void 0:i.title)||""),[D,M]=(0,b.useState)(void 0!==m?m:!i||!i.url),{createPage:F,isCreatingPage:Z,errorMessage:j}=function(e){const t=(0,b.useRef)(),[n,r]=(0,b.useState)(!1),[o,i]=(0,b.useState)(null);return(0,b.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,O.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(h);(0,b.useEffect)((()=>{void 0!==m&&m!==D&&M(m)}),[m]),(0,b.useEffect)((()=>{if(E.current)return void(E.current=!1);const e=null!=I&&I.current?1:0;(u_.focus.focusable.find(S.current)[e]||S.current).focus(),T.current=!1}),[D,Z]);const z=(null==i||null===(t=i.url)||void 0===t||null===(n=t.trim())||void 0===n?void 0:n.length)>0,H=()=>{var e;T.current=!(null===(e=S.current)||void 0===e||!e.contains(S.current.ownerDocument.activeElement)),B(!1),M(!1)},V=()=>{W===(null==i?void 0:i.url)&&L===(null==i?void 0:i.title)||a({...i,url:W,title:L}),H()},W=g||P,U=!(null!=W&&null!==(r=W.trim())&&void 0!==r&&r.length),$=s&&i&&!D&&!Z,G=!(null==l||!l.length),q=z&&x,K=(D||!i)&&!Z;return(0,b.createElement)("div",{tabIndex:-1,ref:S,className:"block-editor-link-control"},Z&&(0,b.createElement)("div",{className:"block-editor-link-control__loading"},(0,b.createElement)(cC.ZP,null)," ",(0,O.__)("Creating"),"…"),K&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:C()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":q})},(0,b.createElement)(fO,{currentLink:i,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:o,value:W,withCreateSuggestion:f,onCreateSuggestion:F,onChange:A,onSelect:e=>{a({...e,title:L||(null==e?void 0:e.title)}),H()},showInitialSuggestions:p,allowDirectEntry:!u,showSuggestions:d,suggestionsQuery:v,withURLSuggestion:!y,createSuggestionButtonText:_,useLabel:q})),j&&(0,b.createElement)(qP.Z,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},j)),i&&!D&&!Z&&(0,b.createElement)(xO,{key:null==i?void 0:i.url,value:i,onEditClick:()=>M(!0),hasRichPreviews:k,hasUnlinkControl:$,onRemove:s}),K&&(0,b.createElement)("div",{className:"block-editor-link-control__tools"},(G||q)&&(0,b.createElement)(PM,{settingsOpen:N,setSettingsOpen:B,showTextControl:q,showSettings:G,textInputRef:I,internalTextInputValue:L,setInternalTextInputValue:R,handleSubmitWithEnter:e=>{const{keyCode:t}=e;t!==T_.ENTER||U||(e.preventDefault(),V())},value:i,settings:l,onChange:a}),(0,b.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,b.createElement)(ia.ZP,{variant:"primary",onClick:V,className:"xblock-editor-link-control__search-submit",disabled:U},(0,O.__)("Apply")),(0,b.createElement)(ia.ZP,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),A(null==i?void 0:i.url),R(null==i?void 0:i.title),z?H():null==s||s(),null==c||c()}},(0,O.__)("Cancel")))),w&&w())}EO.ViewerFill=yO;const SO=EO,IO=function(e){let{accept:t,children:n,multiple:r=!1,onChange:o,onClick:i,render:l,...a}=e;const s=(0,b.useRef)(null),c=()=>{var e;null===(e=s.current)||void 0===e||e.click()},u=l?l({openFileDialog:c}):(0,b.createElement)(ia.ZP,(0,ta.Z)({onClick:c},a),n);return(0,b.createElement)("div",{className:"components-form-file-upload"},u,(0,b.createElement)("input",{type:"file",ref:s,multiple:r,style:{display:"none"},accept:t,onChange:o,onClick:i,"data-testid":"form-file-upload-input"}))};var TO=n(64446),NO=n(2787),BO=n(50934);const PO=()=>{};let AO=0;const LO=(0,B.Z)([(0,lg.Z)((e=>{const{createNotice:t,removeNotice:n}=e(aw.h);return{createNotice:t,removeNotice:n}})),og("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:r,allowedTypes:o,accept:i,onError:l,onSelect:a,onSelectURL:s,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:d=PO,name:p=(0,O.__)("Replace"),createNotice:m,removeNotice:h,children:f,multiple:g=!1,addToGallery:v,handleUpload:y=!0}=e;const _=(0,un.Z)((e=>e(pd).getSettings().mediaUpload),[]),k=(0,b.useRef)(),x="block-editor/media-replace-flow/error-notice/"+ ++AO,w=e=>{const t=(0,Ln.Z)(e);l?l(t):setTimeout((()=>{m("error",t,{speak:!0,id:x,isDismissible:!0})}),1e3)},C=(e,t)=>{u&&c&&c(),t(),a(e),(0,Xc.speak)((0,O.__)("The media file has been replaced")),h(x)},E=e=>{e.keyCode===T_.DOWN&&(e.preventDefault(),e.target.click())},S=g&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,b.createElement)(W_.Z,{popoverProps:{variant:"toolbar"},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,b.createElement)(sa,{ref:k,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:E},p)},renderContent:e=>{let{onClose:l}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(IE.Z,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,b.createElement)(b.Fragment,null,(0,b.createElement)(CC,{gallery:S,addToGallery:v,multiple:g,value:g?r:n,onSelect:e=>C(e,l),allowedTypes:o,render:e=>{let{open:t}=e;return(0,b.createElement)(Nd.Z,{icon:TO.Z,onClick:t},(0,O.__)("Open Media Library"))}}),(0,b.createElement)(wC,null,(0,b.createElement)(IO,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),a(n);d(n),_({allowedTypes:o,filesList:n,onFileChange:e=>{let[n]=e;C(n,t)},onError:w})})(e,l)},accept:i,multiple:g,render:e=>{let{openFileDialog:t}=e;return(0,b.createElement)(Nd.Z,{icon:NO.Z,onClick:()=>{t()}},(0,O.__)("Upload"))}}))),c&&(0,b.createElement)(Nd.Z,{icon:BO.Z,onClick:c,isPressed:u},(0,O.__)("Use featured image")),f),s&&(0,b.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,b.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,O.__)("Current media URL:")),(0,b.createElement)(kp.Z,{text:t,position:"bottom"},(0,b.createElement)("div",null,(0,b.createElement)(SO,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;s(t),k.current.focus()}})))))}})})),RO=function(e){let{className:t,label:n,onFilesDrop:r,onHTMLDrop:o,onDrop:i,...l}=e;const[a,s]=(0,b.useState)(),[c,u]=(0,b.useState)(),[d,p]=(0,b.useState)(),m=(0,jI.Z)({onDrop(e){var t;const n=e.dataTransfer?(0,zI.f)(e.dataTransfer):[],l=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/html");l&&o?o(l):n.length&&r?r(n):i&&i(e)},onDragStart(e){var t,n;s(!0);let r="default";null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("text/html")?r="html":(null!==(n=e.dataTransfer)&&void 0!==n&&n.types.includes("Files")||(e.dataTransfer?(0,zI.f)(e.dataTransfer):[]).length>0)&&(r="file"),p(r)},onDragEnd(){s(!1),p(void 0)},onDragEnter(){u(!0)},onDragLeave(){u(!1)}}),h=(0,i_.Z)();let f;c&&(f=(0,b.createElement)(Gw.E.div,{variants:{hidden:{scaleY:0,opacity:0},show:{scaleY:1,opacity:1,transition:{type:"tween",duration:.2,delay:.1,delayChildren:.2}},exit:{scaleY:1,opacity:0,transition:{duration:.3,delayChildren:0}}},initial:h?"show":"hidden",animate:"show",exit:h?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"}},(0,b.createElement)(Gw.E.div,{variants:{hidden:{opacity:0,scale:.75},show:{opacity:1,scale:1},exit:{opacity:0,scale:.9}}},(0,b.createElement)(Gm.Z,{icon:NO.Z,className:"components-drop-zone__content-icon"}),(0,b.createElement)("span",{className:"components-drop-zone__content-text"},n||(0,O.__)("Drop files to upload")))));const g=C()("components-drop-zone",t,{"is-active":(a||c)&&("file"===d&&r||"html"===d&&o||"default"===d&&i),"is-dragging-over-document":a,"is-dragging-over-element":c,[`is-dragging-${d}`]:!!d});return(0,b.createElement)("div",(0,ta.Z)({},l,{ref:m,className:g}),h?f:(0,b.createElement)(TM.M,null,f))};var DO=n(98616);function MO(e){let{url:t,urlLabel:n,className:r}=e;const o=C()(r,"block-editor-url-popover__link-viewer-url");return t?(0,b.createElement)(tf.Z,{className:o,href:t},n||(0,HM.w)((0,VM.x)(t))):(0,b.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:OO}=ud(pI);function FO(e){let t,{additionalControls:n,children:r,renderSettings:o,placement:i,focusOnMount:l="firstElement",position:a,...s}=e;void 0!==a&&(0,j.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==i?t=i:void 0!==a&&(t=OO(a)),t=t||"bottom";const[c,u]=(0,b.useState)(!1),d=!!o&&c;return(0,b.createElement)(mn.Z,(0,ta.Z)({className:"block-editor-url-popover",focusOnMount:l,placement:t,shift:!0},s),(0,b.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,b.createElement)("div",{className:"block-editor-url-popover__row"},r,!!o&&(0,b.createElement)(ia.ZP,{className:"block-editor-url-popover__settings-toggle",icon:pE.Z,label:(0,O.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,b.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),n&&!d&&(0,b.createElement)("div",{className:"block-editor-url-popover__additional-controls"},n))}FO.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:r,value:o,...i}=e;return(0,b.createElement)("form",(0,ta.Z)({className:C()("block-editor-url-popover__link-editor",n)},i),(0,b.createElement)(jM,{__nextHasNoMarginBottom:!0,value:o,onChange:r,autocompleteRef:t}),(0,b.createElement)(ia.ZP,{icon:DO.Z,label:(0,O.__)("Apply"),type:"submit"}))},FO.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:r,url:o,urlLabel:i,...l}=e;return(0,b.createElement)("div",(0,ta.Z)({className:C()("block-editor-url-popover__link-viewer",t)},l),(0,b.createElement)(MO,{url:o,urlLabel:i,className:n}),r&&(0,b.createElement)(ia.ZP,{icon:vO.Z,label:(0,O.__)("Edit"),onClick:r}))};const ZO=FO,jO=()=>{},zO=e=>{let{src:t,onChange:n,onSubmit:r,onClose:o}=e;return(0,b.createElement)(ZO,{onClose:o},(0,b.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:r},(0,b.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,O.__)("URL"),placeholder:(0,O.__)("Paste or type URL"),onChange:n,value:t}),(0,b.createElement)(ia.ZP,{className:"block-editor-media-placeholder__url-input-submit-button",icon:DO.Z,label:(0,O.__)("Apply"),type:"submit"})))},HO=og("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:r,icon:o,labels:i={},mediaPreview:l,notices:a,isAppender:s,accept:c,addToGallery:u,multiple:d=!1,handleUpload:p=!0,disableDropZone:m,disableMediaButtons:h,onError:f,onSelect:g,onCancel:v,onSelectURL:y,onToggleFeaturedImage:_,onDoubleClick:k,onFilesPreUpload:x=jO,onHTMLDrop:w=jO,children:E,mediaLibraryButton:S,placeholder:I,style:T}=e;const N=(0,un.Z)((e=>{const{getSettings:t}=e(pd);return t().mediaUpload}),[]),[B,P]=(0,b.useState)(""),[A,L]=(0,b.useState)(!1);(0,b.useEffect)((()=>{var e;P(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const R=e=>{P(e.target.value)},D=()=>{L(!0)},M=()=>{L(!1)},F=e=>{e.preventDefault(),B&&y&&(y(B),M())},Z=e=>{if(!p)return g(e);let r;if(x(e),d)if(u){let e=[];r=n=>{const r=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));g(r.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=g;else r=e=>{let[t]=e;return g(t)};N({allowedTypes:n,filesList:e,onFileChange:r,onError:f})},j=e=>{Z(e.target.files)},z=null!=I?I:e=>{let{instructions:t,title:c}=i;if(N||y||(t=(0,O.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[r]=e,o=1===e.length,i=o&&"audio"===r,l=o&&"image"===r,a=o&&"video"===r;void 0===t&&N&&(t=(0,O.__)("Upload a media file or pick one from your media library."),i?t=(0,O.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?t=(0,O.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,O.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,O.__)("Media"),i?c=(0,O.__)("Audio"):l?c=(0,O.__)("Image"):a&&(c=(0,O.__)("Video")))}const u=C()("block-editor-media-placeholder",r,{"is-appender":s});return(0,b.createElement)(WD,{icon:o,label:c,instructions:t,className:u,notices:a,onDoubleClick:k,preview:l,style:T},e,E)},H=()=>m?null:(0,b.createElement)(RO,{onFilesDrop:Z,onHTMLDrop:w}),V=()=>v&&(0,b.createElement)(ia.ZP,{className:"block-editor-media-placeholder__cancel-button",title:(0,O.__)("Cancel"),variant:"link",onClick:v},(0,O.__)("Cancel")),W=()=>y&&(0,b.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,b.createElement)(ia.ZP,{className:"block-editor-media-placeholder__button",onClick:D,isPressed:A,variant:"tertiary"},(0,O.__)("Insert from URL")),A&&(0,b.createElement)(zO,{src:B,onChange:R,onSubmit:F,onClose:M})),U=()=>_&&(0,b.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,b.createElement)(ia.ZP,{className:"block-editor-media-placeholder__button",onClick:_,variant:"tertiary"},(0,O.__)("Use featured image")));return h?(0,b.createElement)(wC,null,H()):(0,b.createElement)(wC,{fallback:z(W())},(()=>{const e=null!=S?S:e=>{let{open:t}=e;return(0,b.createElement)(ia.ZP,{variant:"tertiary",onClick:()=>{t()}},(0,O.__)("Media Library"))},r=(0,b.createElement)(CC,{addToGallery:u,gallery:d&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:d,onSelect:g,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(N&&s)return(0,b.createElement)(b.Fragment,null,H(),(0,b.createElement)(IO,{onChange:j,accept:c,multiple:d,render:e=>{let{openFileDialog:t}=e;const n=(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ia.ZP,{variant:"primary",className:C()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,O.__)("Upload")),r,W(),U(),V());return z(n)}}));if(N){const e=(0,b.createElement)(b.Fragment,null,H(),(0,b.createElement)(IO,{variant:"primary",className:C()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:j,accept:c,multiple:d},(0,O.__)("Upload")),r,W(),U(),V());return z(e)}return z(r)})())}));function VO(e){const t=e.useItems?e.useItems:function(e){return t=>{const[n,r]=(0,b.useState)([]);return(0,b.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,rg.D)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),l=new RegExp("(?:\\b|\\s|^)"+WM(t),"i");r(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=[];for(let o=0;o<t.length;o++){const i=t[o];let{keywords:l=[]}=i;if("string"==typeof i.label&&(l=[...l,i.label]),l.some((t=>e.test(Ar()(t))))&&(r.push(i),r.length===n))break}return r}(l,i))}));return o}),o?250:0),l=i();return()=>{i.cancel(),l&&(l.canceled=!0)}}),[t]),[n]}}(e);return function(e){let{filterValue:n,instanceId:r,listBoxId:o,className:i,selectedIndex:l,onChangeOptions:a,onSelect:s,onReset:c,reset:u,value:d,contentRef:p}=e;const[m]=t(n),h=(0,La.useAnchor)({editableContentElement:p.current,value:d}),[f,g]=(0,b.useState)(!1),v=(0,b.useRef)(),_=(0,np.Z)([v,(0,__.Z)((e=>{p.current&&g(e.ownerDocument!==p.current.ownerDocument)}),[p])]);var k,x;if(k=v,x=u,(0,b.useEffect)((()=>{const e=e=>{k.current&&!k.current.contains(e.target)&&x(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[x]),(0,b.useLayoutEffect)((()=>{a(m)}),[m]),!m.length>0)return null;const w=e=>{let{Component:t="div"}=e;return(0,b.createElement)(t,{id:o,role:"listbox",className:"components-autocomplete__results"},m.map(((e,t)=>(0,b.createElement)(ia.ZP,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===l,disabled:e.isDisabled,className:C()("components-autocomplete__result",i,{"is-selected":t===l}),onClick:()=>s(e)},e.label))))};return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(mn.Z,{focusOnMount:!1,onClose:c,placement:"top-start",className:"components-autocomplete__popover",anchor:h,ref:_},(0,b.createElement)(w,null)),p.current&&f&&(0,y.createPortal)((0,b.createElement)(w,{Component:U_.Z}),p.current.ownerDocument.body))}}const WO=[];function UO(e){let{record:t,onChange:n,onReplace:r,completers:o,contentRef:i}=e;const l=(0,ng.Z)(Xc.speak,500),a=(0,ep.Z)(UO),[s,c]=(0,b.useState)(0),[u,d]=(0,b.useState)(WO),[p,m]=(0,b.useState)(""),[h,f]=(0,b.useState)(null),[g,v]=(0,b.useState)(null),y=(0,b.useRef)(!1);function _(e){const{getOptionCompletion:o}=h||{};if(!e.isDisabled){if(o){const i=o(e.value,p),{action:l,value:a}=void 0===i.action||void 0===i.value?{action:"insert-at-caret",value:i}:i;if("replace"===l)return void r([a]);"insert-at-caret"===l&&function(e){const r=t.start,o=r-h.triggerPrefix.length-p.length,i=(0,La.create)({html:(0,Uo.ZP)(e)});n((0,La.insert)(t,i,o,r))}(a)}k()}}function k(){c(0),d(WO),m(""),f(null),v(null)}const x=(0,b.useMemo)((()=>{if((0,La.isCollapsed)(t))return(0,La.getTextContent)((0,La.slice)(t,0))}),[t]);(0,b.useEffect)((()=>{if(!x)return void(h&&k());const e=null==o?void 0:o.find((e=>{let{triggerPrefix:n,allowContext:r}=e;const o=x.lastIndexOf(n);if(-1===o)return!1;const i=x.slice(o+n.length);if(i.length>50)return!1;const l=0===u.length,a=1===i.split(/\s/).length,s=y.current&&i.split(/\s/).length<=3;if(l&&!s&&!a)return!1;const c=(0,La.getTextContent)((0,La.slice)(t,void 0,(0,La.getTextContent)(t).length));return!(r&&!r(x.slice(0,o),c))&&!/^\s/.test(i)&&!/\s\s+$/.test(i)&&/[\u0000-\uFFFF]*$/.test(i)}));if(!e)return void(h&&k());const n=WM(e.triggerPrefix),r=Ar()(x),i=r.slice(r.lastIndexOf(e.triggerPrefix)).match(new RegExp(`${n}([\0-￿]*)$`)),l=i&&i[1];f(e),v((()=>e!==h?VO(e):g)),m(l)}),[x]);const{key:w=""}=u[s]||{},{className:C}=h||{},E=!!h&&u.length>0,S=E?`components-autocomplete-listbox-${a}`:null;return{listBoxId:S,activeId:E?`components-autocomplete-item-${a}-${w}`:null,onKeyDown:function(e){if(y.current="Backspace"===e.key,h&&0!==u.length&&!e.defaultPrevented&&!e.isComposing&&229!==e.keyCode){switch(e.key){case"ArrowUp":c((0===s?u.length:s)-1);break;case"ArrowDown":c((s+1)%u.length);break;case"Escape":f(null),v(null),e.preventDefault();break;case"Enter":_(u[s]);break;case"ArrowLeft":case"ArrowRight":return void k();default:return}e.preventDefault()}},popover:void 0!==t.start&&g&&(0,b.createElement)(g,{className:C,filterValue:p,instanceId:a,listBoxId:S,selectedIndex:s,onChangeOptions:function(e){c(e.length===u.length?s:0),d(e),function(e){l&&(e.length?l((0,O.sprintf)((0,O._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):l((0,O.__)("No results."),"assertive"))}(e)},onSelect:_,value:t,contentRef:i,reset:k})}}const $O=()=>{},GO={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,un.Z)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:r}=e(pd),o=t();return{selectedBlockName:o?n(o):null,rootClientId:r().rootClientId}}),[]),[r,o,i]=Fx(t,$O),l=(0,b.useMemo)((()=>(e.trim()?Nw(r,o,i,e):Da(r,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,o,i]),a=(0,b.useMemo)((()=>l.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(tk,{key:"icon",icon:n,showColors:!0}),t),isDisabled:r}}))),[l]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r}=e;return{action:"replace",value:nr(t,n,rr(r))}}};var qO=n(26426);const KO={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,_.Z)({path:(0,Z.f)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Gm.Z,{key:"icon",icon:"page"===e.subtype?GM.Z:qO.Z}),e.title),getOptionCompletion:e=>(0,b.createElement)("a",{href:e.url},e.title)},YO=[];function XO(e){let{completers:t=YO}=e;const{name:n}=vd();return(0,b.useMemo)((()=>{let e=[...t,KO];return(n===Gn()||Yn(n,"__experimentalSlashInserter",!1))&&(e=[...e,GO]),(0,tr.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,tr.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const QO={position:"bottom right",variant:"toolbar"},JO=()=>(0,b.createElement)(b.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,b.createElement)(pn.g7,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,b.createElement)(pn.g7,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})),n=t.some((e=>{let{isActive:t}=e;return t}));return(0,b.createElement)(la.Z,null,(t=>(0,b.createElement)(ua.Z,{icon:pE.Z,label:(0,O.__)("More"),toggleProps:{...t,className:C()(t.className,{"is-pressed":n}),describedBy:(0,O.__)("Displays more block tools")},controls:Da(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:QO})))})));function eF(e){let{value:t,editableContentElement:n,activeFormats:r}=e;const o=r[r.length-1],i=null==o?void 0:o.type,l=(0,un.Z)((e=>e(La.store).getFormatType(i)),[i]),a=(0,La.useAnchor)({editableContentElement:n,value:t,settings:l});return(0,b.createElement)(tF,{popoverAnchor:a})}function tF(e){let{popoverAnchor:t}=e;return(0,b.createElement)(mn.Z,{placement:"top",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,b.createElement)(NE,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,O.__)("Format tools")},(0,b.createElement)(pa,null,(0,b.createElement)(JO,null))))}const nF=e=>{let{inline:t,editableContentElement:n,value:r}=e;const o=(0,un.Z)((e=>e(pd).getSettings().hasInlineToolbar),[]);if(t)return(0,b.createElement)(tF,{popoverAnchor:n});if(o){const e=(0,La.getActiveFormats)(r);return(0,La.isCollapsed)(r)&&!e.length?null:(0,b.createElement)(eF,{editableContentElement:n,value:r,activeFormats:e})}return(0,b.createElement)(Sd,{group:"inline"},(0,b.createElement)(JO,null))};function rF(){const{didAutomaticChange:e,getSettings:t}=(0,un.Z)(pd);return(0,__.Z)((n=>{function r(n){const{keyCode:r}=n;if(n.defaultPrevented)return;if(r!==T_.DELETE&&r!==T_.BACKSPACE&&r!==T_.ESCAPE)return;const{__experimentalUndo:o}=t();o&&e()&&(n.preventDefault(),o())}return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}),[])}function oF(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function iF(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function lF(e){let{allowedFormats:t,disableFormats:n}=e;return n?lF.EMPTY_ARRAY:t}lF.EMPTY_ARRAY=[];function aF(e){let{value:t,pastedBlocks:n=[],onReplace:r,onSplit:o,onSplitMiddle:i,multilineTag:l}=e;if(!r||!o)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,La.split)(c),m=n.length>0;let h=-1;const f=(0,La.isEmpty)(d)&&!(0,La.isEmpty)(p);m&&(0,La.isEmpty)(d)||(u.push(o((0,La.toHTMLString)({value:d,multilineTag:l}),!f)),h+=1),m?(u.push(...n),h+=n.length):i&&u.push(i()),(m||i)&&(0,La.isEmpty)(p)||u.push(o((0,La.toHTMLString)({value:p,multilineTag:l}),f)),r(u,m?h:1,m?-1:0)}function sF(e,t){return t?(0,La.replace)(e,/\n+/g,La.__UNSTABLE_LINE_SEPARATOR):(0,La.replace)(e,new RegExp(La.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function cF(e){const t=(0,b.useRef)(e);return t.current=e,(0,__.Z)((e=>{function n(e){const{isSelected:n,disableFormats:r,onChange:o,value:i,formatTypes:l,tagName:a,onReplace:s,onSplit:c,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:p,preserveWhiteSpace:m,pastePlainText:h}=t.current;if(!n)return;const{clipboardData:f}=e;let g="",v="";try{g=f.getData("text/plain"),v=f.getData("text/html")}catch(e){try{v=f.getData("Text")}catch(e){return}}if(v=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const r=(e=e.substring(n+t.length)).indexOf("\x3c!--EndFragment--\x3e");return r>-1&&(e=e.substring(0,r)),e}(v),v=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",g),r)return void o((0,La.insert)(i,g));const b=l.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:v,plainText:g})),e}),i);if(b!==i)return void o(b);const y=[...(0,zI.f)(f)];if("true"===f.getData("rich-text")){const e=f.getData("rich-text-multi-line-tag")||void 0;let t=(0,La.create)({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:m});return t=sF(t,!!p),oF(t,i.activeFormats),void o((0,La.insert)(i,t))}if(h)return void o((0,La.insert)(i,(0,La.create)({text:g})));if(null!=y&&y.length&&window.console.log("Received items:\n\n",y),null!=y&&y.length&&!function(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const r=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(r))return!0}return!1}(y,v)){const e=ur("from"),t=y.reduce(((t,n)=>{const r=cr(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat();if(!t.length)return;return void(s&&(0,La.isEmpty)(i)?s(t):aF({value:i,pastedBlocks:t,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}let _=s&&c?"AUTO":"INLINE";var k;"AUTO"===_&&(0,La.isEmpty)(i)&&(k=g,gl(".*").test(k))&&(_="BLOCKS"),d&&(0,La.isEmpty)(i)&&(0,OM.P)(g.trim())&&(_="BLOCKS");const x=Ql({HTML:v,plainText:g,mode:_,tagName:a,preserveWhiteSpace:m});if("string"==typeof x){let e=(0,La.create)({html:x});e=sF(e,!!p),oF(e,i.activeFormats),o((0,La.insert)(i,e))}else x.length>0&&(s&&(0,La.isEmpty)(i)?s(x,x.length-1,-1):aF({value:i,pastedBlocks:x,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const uF=["`",'"',"'","“”","‘’"];function dF(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,dn.Z)(pd),r=(0,b.useRef)(e);return r.current=e,(0,__.Z)((e=>{function o(o){const{inputType:i,data:l}=o,{value:a,onChange:s}=r.current;if("insertText"!==i)return;if((0,La.isCollapsed)(a))return;const c=(0,tr.applyFilters)("blockEditor.wrapSelectionSettings",uF).find((e=>{let[t,n]=e;return t===l||n===l}));if(!c)return;const[u,d=u]=c,p=a.start,m=a.end+u.length;let h=(0,La.insert)(a,u,p,p);h=(0,La.insert)(h,d,m,m),t(),s(h),n();const f={};for(const e in o)f[e]=o[e];f.data=d;const{ownerDocument:g}=e,{defaultView:v}=g,b=new v.InputEvent("input",f);window.queueMicrotask((()=>{o.target.dispatchEvent(b)})),o.preventDefault()}return e.addEventListener("beforeinput",o),()=>{e.removeEventListener("beforeinput",o)}}),[])}function pF(e){let t=e.length;for(;t--;){const n=Jc(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Qc,""),[e[t].clientId,n,0,0];const r=pF(e[t].innerBlocks);if(r)return r}return[]}function mF(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,dn.Z)(pd),r=(0,b.useRef)(e);return r.current=e,(0,__.Z)((e=>{function o(){const{getValue:e,onReplace:t,selectionChange:o}=r.current;if(!t)return;const i=e(),{start:l,text:a}=i;if(" "!==a.slice(l-1,l))return;const s=a.slice(0,l).trim(),c=ur("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=cr(c,(e=>{let{prefix:t}=e;return s===t}));if(!u)return;const d=(0,La.toHTMLString)({value:(0,La.insert)(i,Qc,0,l)}),p=u.transform(d);return o(...pF([p])),t([p]),n(),!0}function i(e){const{inputType:i,type:l}=e,{getValue:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=r.current;if("insertText"!==i&&"compositionend"!==l)return;if(c&&o&&o())return;const d=a(),p=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:r}=e;return n<t.length||r.slice(n-t.length,n).toLowerCase()!==t?e:(0,La.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d));p!==d&&(t(),s({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function hF(e){const t=(0,b.useRef)(e);return t.current=e,(0,__.Z)((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:r,onMerge:o,onRemove:i}=t.current;if(n===T_.DELETE||n===T_.BACKSPACE){const{start:t,end:l,text:a}=r,s=n===T_.BACKSPACE,c=r.activeFormats&&!!r.activeFormats.length;if(!(0,La.isCollapsed)(r)||c||s&&0!==t||!s&&l!==a.length)return;o&&o(!s),i&&(0,La.isEmpty)(r)&&s&&i(!s),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function fF(e){const{__unstableMarkAutomaticChange:t}=(0,dn.Z)(pd),n=(0,b.useRef)(e);return n.current=e,(0,__.Z)((e=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==T_.ENTER)return;const{removeEditorOnlyFormats:r,value:o,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s,onChange:c,disableLineBreaks:u,onSplitAtEnd:d}=n.current;e.preventDefault();const p={...o};p.formats=r(o);const m=i&&l;if(i){const e=ur("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=cr(e,(e=>e.regExp.test(p.text)));n&&(i([n.transform({content:p.text})]),t())}if(s)e.shiftKey?u||c((0,La.insert)(p,"\n")):m&&(0,La.__unstableIsEmptyLine)(p)?aF({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s}):c((0,La.__unstableInsertLineSeparator)(p));else{const{text:t,start:n,end:r}=p,o=d&&n===r&&r===t.length;e.shiftKey||!m&&!o?u||c((0,La.insert)(p,"\n")):!m&&o?d():m&&aF({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s})}}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function gF(e){return e(La.store).getFormatTypes()}const vF=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function bF(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;return[`${t}.${n}`,r]})))}function yF(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,r)=>(n[r.slice(t.length+1)]=e[r],n)),{})}function _F(e){return(0,__.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function kF(e){return(0,__.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function xF(){const{__unstableMarkLastChangeAsPersistent:e}=(0,dn.Z)(pd);return(0,__.Z)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function wF(){const{isMultiSelecting:e}=(0,un.Z)(pd);return(0,__.Z)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function CF(e){let{formatTypes:t,onChange:n,onFocus:r,value:o,forwardedRef:i}=e;return t.map((e=>{const{name:t,edit:l}=e;if(!l)return null;const a=(0,La.getActiveFormat)(o,t);let s=void 0!==a;const c=(0,La.getActiveObject)(o),u=void 0!==c&&c.type===t;if("core/link"===t&&!(0,La.isCollapsed)(o)){var d,p;const e=o.formats,t=null===(d=e[o.start])||void 0===d?void 0:d.find((e=>{let{type:t}=e;return"core/link"===t})),n=null===(p=e[o.end-1])||void 0===p?void 0:p.find((e=>{let{type:t}=e;return"core/link"===t}));t&&n&&t===n||(s=!1)}return(0,b.createElement)(l,{key:t,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:u,activeObjectAttributes:u&&c.attributes||{},value:o,onChange:n,onFocus:r,contentRef:i})}))}const EF=(0,b.createContext)(),SF=(0,b.createContext)(),IF=(0,b.forwardRef)((function e(t,n){let{children:r,tagName:o="div",value:i="",onChange:l,isSelected:a,multiline:s,inlineToolbar:c,wrapperClassName:u,autocompleters:d,onReplace:p,placeholder:m,allowedFormats:h,withoutInteractiveFormatting:f,onRemove:g,onMerge:v,onSplit:y,__unstableOnSplitAtEnd:_,__unstableOnSplitMiddle:k,identifier:x,preserveWhiteSpace:w,__unstablePastePlainText:E,__unstableEmbedURLOnPaste:S,__unstableDisableFormats:I,disableLineBreaks:T,__unstableAllowPrefixTransformations:N,...B}=t;s&&(0,j.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const P=(0,ep.Z)(e);x=x||P,B=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:r,textAlign:o,selectionColor:i,tagsToEliminate:l,rootTagsToEliminate:a,disableEditingMenu:s,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:h,setRef:f,disableSuggestions:g,disableAutocorrection:v,...b}=e;return b}(B);const A=(0,b.useRef)(),{clientId:L}=vd(),{selectionStart:R,selectionEnd:D,isSelected:M}=(0,un.Z)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(pd),r=t(),o=n();let i;return void 0===a?i=r.clientId===L&&o.clientId===L&&r.attributeKey===x:a&&(i=r.clientId===L),{selectionStart:i?r.offset:void 0,selectionEnd:i?o.offset:void 0,isSelected:i}})),{getSelectionStart:O,getSelectionEnd:F,getBlockRootClientId:Z}=(0,un.Z)(pd),{selectionChange:z}=(0,dn.Z)(pd),H=iF(s),V=lF({allowedFormats:h,disableFormats:I}),W=!V||V.length>0;let U=i,$=l;Array.isArray(i)&&((0,j.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),U=Hi.toHTML(i),$=e=>l(Hi.fromDOM((0,La.__unstableCreateElement)(document,e).childNodes)));const G=(0,b.useCallback)(((e,t)=>{const n={},r=void 0===e&&void 0===t;if("number"==typeof e||r){if(void 0===t&&Z(L)!==Z(F().clientId))return;n.start={clientId:L,attributeKey:x,offset:e}}if("number"==typeof t||r){if(void 0===e&&Z(L)!==Z(O().clientId))return;n.end={clientId:L,attributeKey:x,offset:t}}z(n)}),[L,x]),{formatTypes:q,prepareHandlers:K,valueHandlers:Y,changeHandlers:X,dependencies:Q}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:r,allowedFormats:o}=e;const i=(0,un.Z)(gF,[]),l=(0,b.useMemo)((()=>i.filter((e=>{let{name:t,tagName:n}=e;return!(o&&!o.includes(t)||r&&vF.has(n))}))),[i,o,vF]),a=(0,un.Z)((e=>l.reduce(((r,o)=>o.__experimentalGetPropsForEditableTreePreparation?{...r,...bF(o.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),o.name)}:r),{})),[l,t,n]),s=(0,dn.Z)(),c=[],u=[],d=[],p=[];for(const e in a)p.push(a[e]);return l.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const r=e.__experimentalCreatePrepareEditableTree(yF(a,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?u.push(r):c.push(r)}if(e.__experimentalCreateOnChangeEditableValue){let r={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(r=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t}));const o=yF(a,e.name);d.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof o?o:{},...r},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:l,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:L,identifier:x,withoutInteractiveFormatting:f,allowedFormats:V});function J(e){return q.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,La.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ee,getValue:te,onChange:ne,ref:re}=(0,La.__unstableUseRichText)({value:U,onChange(e,t){let{__unstableFormats:n,__unstableText:r}=t;$(e),Object.values(X).forEach((e=>{e(n,r)}))},selectionStart:R,selectionEnd:D,onSelectionChange:G,placeholder:m,__unstableIsSelected:M,__unstableMultilineTag:H,__unstableDisableFormats:I,preserveWhiteSpace:w,__unstableDependencies:[...Q,o],__unstableAfterParse:function(e){return Y.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:J,__unstableAddInvisibleFormats:function(e){return K.reduce(((t,n)=>n(t,e.text)),e.formats)}}),oe=function(e){return function(e){const t=(0,b.useRef)(),n=(0,b.useRef)(),{record:r}=e,o=function(e){const t=(0,b.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:l,activeId:a,onKeyDown:s}=UO({...e,contentRef:t});n.current=s;const c=(0,np.Z)([t,(0,__.Z)((e=>{function t(e){n.current(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==(null==o?void 0:o.text)?{ref:c,children:i,"aria-autocomplete":l?"list":void 0,"aria-owns":l,"aria-activedescendant":a}:{ref:c}}({...e,completers:XO(e)})}({onReplace:p,completers:d,record:ee,onChange:ne});!function(e){let{html:t,value:n}=e;const r=(0,b.useRef)(),o=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:i}=(0,dn.Z)(pd);(0,b.useLayoutEffect)((()=>{if(r.current){if(r.current!==n.text){const e=window.setTimeout((()=>{i()}),1e3);return r.current=n.text,()=>{window.clearTimeout(e)}}i()}else r.current=n.text}),[t,o])}({html:U,value:ee});const ie=(0,b.useRef)(new Set),le=(0,b.useRef)(new Set);function ae(){var e;null===(e=A.current)||void 0===e||e.focus()}const se=o;return(0,b.createElement)(b.Fragment,null,M&&(0,b.createElement)(EF.Provider,{value:ie},(0,b.createElement)(SF.Provider,{value:le},(0,b.createElement)(mn.Z.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},r&&r({value:ee,onChange:ne,onFocus:ae}),(0,b.createElement)(CF,{value:ee,onChange:ne,onFocus:ae,formatTypes:q,forwardedRef:A})))),M&&W&&(0,b.createElement)(nF,{inline:c,editableContentElement:A.current,value:ee}),(0,b.createElement)(se,(0,ta.Z)({role:"textbox","aria-multiline":!T,"aria-label":m},B,oe,{ref:(0,np.Z)([n,oe.ref,B.ref,re,dF({value:ee,onChange:ne}),mF({getValue:te,onChange:ne,__unstableAllowPrefixTransformations:N,formatTypes:q,onReplace:p,selectionChange:z}),xF(),(0,__.Z)((e=>{function t(e){(T_.isKeyboardEvent.primary(e,"z")||T_.isKeyboardEvent.primary(e,"y")||T_.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),_F(ie),kF(le),rF(),cF({isSelected:M,disableFormats:I,onChange:ne,value:ee,formatTypes:q,tagName:o,onReplace:p,onSplit:y,onSplitMiddle:k,__unstableEmbedURLOnPaste:S,multilineTag:H,preserveWhiteSpace:w,pastePlainText:E}),hF({value:ee,onMerge:v,onRemove:g}),fF({removeEditorOnlyFormats:J,value:ee,onReplace:p,onSplit:y,onSplitMiddle:k,multilineTag:H,onChange:ne,disableLineBreaks:T,onSplitAtEnd:_}),wF(),A]),contentEditable:!0,suppressContentEditableWarning:!0,className:C()("block-editor-rich-text__editable",B.className,"rich-text")})))}));IF.Content=e=>{let{value:t,tagName:n,multiline:r,...o}=e;Array.isArray(t)&&((0,j.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=Hi.toHTML(t));const i=iF(r);!t&&i&&(t=`<${i}></${i}>`);const l=(0,b.createElement)(Wo.Z,null,t);if(n){const{format:e,...t}=o;return(0,b.createElement)(n,t,l)}return l},IF.isEmpty=e=>!e||0===e.length;const TF=IF;function NF(e){let{character:t,type:n,onUse:r}=e;const o=(0,b.useContext)(EF),i=(0,b.useRef)();return i.current=r,(0,b.useEffect)((()=>{function e(e){T_.isKeyboardEvent[n](e,t)&&(i.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t,n]),null}function BF(e){let t,{name:n,shortcutType:r,shortcutCharacter:o,...i}=e,l="RichText.ToolbarControls";return n&&(l+=`.${n}`),r&&o&&(t=T_.displayShortcut[r](o)),(0,b.createElement)(pn.de,{name:l},(0,b.createElement)(sa,(0,ta.Z)({},i,{shortcut:t})))}function PF(e){let{inputType:t,onInput:n}=e;const r=(0,b.useContext)(SF),o=(0,b.useRef)();return o.current=n,(0,b.useEffect)((()=>{function e(e){e.inputType===t&&(o.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t]),null}var AF=n(45709);const LF="none",RF="custom",DF="media",MF="attachment",OF=["noreferrer","noopener"],FF=(0,b.createElement)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,b.createElement)(Vp.y$,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,b.createElement)(Vp.y$,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),ZF=e=>{let{linkDestination:t,onChangeUrl:n,url:r,mediaType:o="image",mediaUrl:i,mediaLink:l,linkTarget:a,linkClass:s,rel:c}=e;const[u,d]=(0,b.useState)(!1),[p,m]=(0,b.useState)(null),h=(0,b.useCallback)((()=>{d(!0)})),[f,g]=(0,b.useState)(!1),[v,y]=(0,b.useState)(null),_=(0,b.useRef)(null),k=(0,b.useCallback)((()=>{t!==DF&&t!==MF||y(""),g(!0)})),x=(0,b.useCallback)((()=>{g(!1)})),w=(0,b.useCallback)((()=>{y(null),x(),d(!1)})),C=(0,b.useCallback)((()=>e=>{const t=_.current;t&&t.contains(e.target)||(d(!1),y(null),x())})),E=(0,b.useCallback)((()=>e=>{if(v){var t;const e=(null===(t=I().find((e=>e.url===v)))||void 0===t?void 0:t.linkDestination)||RF;n({href:v,linkDestination:e})}x(),y(null),e.preventDefault()})),S=(0,b.useCallback)((()=>{n({linkDestination:LF,href:""})})),I=()=>{const e=[{linkDestination:DF,title:(0,O.__)("Media File"),url:"image"===o?i:void 0,icon:FF}];return"image"===o&&l&&e.push({linkDestination:MF,title:(0,O.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,b.createElement)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,b.createElement)(Vp.y$,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,b.createElement)(Mw.Z,{spacing:"3"},(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");OF.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===OF.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Link rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Link CSS Class"),value:s||"",onChange:e=>{n({linkClass:e})}})),N=null!==v?v:r,B=(I().find((e=>e.linkDestination===t))||{}).title;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(sa,{icon:mT.Z,className:"components-toolbar__control",label:r?(0,O.__)("Edit link"):(0,O.__)("Insert link"),"aria-expanded":u,onClick:h,ref:m}),u&&(0,b.createElement)(ZO,{anchor:p,onFocusOutside:C(),onClose:w,renderSettings:()=>T,additionalControls:!N&&(0,b.createElement)(IE.Z,null,I().map((e=>(0,b.createElement)(Nd.Z,{key:e.linkDestination,icon:e.icon,onClick:()=>{y(null),(e=>{const t=I();let r;r=e?(t.find((t=>t.url===e))||{linkDestination:RF}).linkDestination:LF,n({linkDestination:r,href:e})})(e.url),x()}},e.title))))},(!r||f)&&(0,b.createElement)(ZO.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:y,onSubmit:E(),autocompleteRef:_}),r&&!f&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(ZO.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:r,onEditLinkClick:k,urlLabel:B}),(0,b.createElement)(ia.ZP,{icon:AF.Z,label:(0,O.__)("Remove link"),onClick:S}))))},jF=(0,ig.Z)((e=>({selectedBlockClientId:e(pd).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=R_(t);return t?(0,b.createElement)(ia.ZP,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,O.__)("Skip to the selected block")):null})),zF={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function HF(e,t){return t.replace(e.HTMLRegExp,"\n")}function VF(e,t){return t.replace(e.astralRegExp,"a")}function WF(e,t){return t.replace(e.HTMLEntityRegExp,"")}function UF(e,t){return t.replace(e.connectorRegExp," ")}function $F(e,t){return t.replace(e.removeRegExp,"")}function GF(e,t){return t.replace(e.HTMLcommentRegExp,"")}function qF(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function KF(e,t){return t.replace(e.spaceRegExp," ")}function YF(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function XF(e,t,n){var r,o;return e=[HF.bind(null,n),GF.bind(null,n),qF.bind(null,n),VF.bind(null,n),KF.bind(null,n),YF.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}const QF=(0,ig.Z)((e=>{const{getMultiSelectedBlocks:t}=e(pd);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=function(e,t,n){const r=function(e,t){var n,r;const o=Object.assign({},zF,t);return o.shortcodes=null!==(n=null===(r=o.l10n)||void 0===r?void 0:r.shortcodes)&&void 0!==n?n:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,"characters_excluding_spaces"!==o.type&&"characters_including_spaces"!==o.type&&(o.type="words"),o}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r,o;return e=[HF.bind(null,n),GF.bind(null,n),qF.bind(null,n),KF.bind(null,n),WF.bind(null,n),UF.bind(null,n),$F.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,XF(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,XF(e,o,r);default:return 0}}(ei(t),"words");return(0,b.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,b.createElement)(tk,{icon:OE.Z,showColors:!0}),(0,b.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,b.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,O.sprintf)((0,O._n)("%d block","%d blocks",t.length),t.length)),(0,b.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,O.sprintf)((0,O._n)("%d word","%d words",n),n))))})),JF=()=>{},eZ=function(e){let{choices:t=[],onHover:n=JF,onSelect:r,value:o}=e;return(0,b.createElement)(b.Fragment,null,t.map((e=>{const t=o===e.value;return(0,b.createElement)(Nd.Z,{key:e.value,role:"menuitemradio",icon:t&&bf.Z,info:e.info,isSelected:t,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{t||r(e.value)},onMouseEnter:()=>n(e.value),onMouseLeave:()=>n(null),"aria-label":e["aria-label"]},e.label)})))};function tZ(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;return(0,b.createElement)("fieldset",{className:t},(0,b.createElement)(U_.Z,{as:"legend"},(0,O.__)("Transform to variation")),o.map((e=>(0,b.createElement)(ia.ZP,{key:e.name,icon:(0,b.createElement)(tk,{icon:e.icon,showColors:!0}),isPressed:r===e.name,label:r===e.name?e.title:(0,O.sprintf)((0,O.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function nZ(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;const i=o.map((e=>{let{name:t,title:n,description:r}=e;return{value:t,label:n,info:r}}));return(0,b.createElement)(ua.Z,{className:t,label:(0,O.__)("Transform to variation"),text:(0,O.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:pE.Z,toggleProps:{iconPosition:"right"}},(()=>(0,b.createElement)("div",{className:`${t}__container`},(0,b.createElement)(Td.Z,null,(0,b.createElement)(eZ,{choices:i,value:r,onSelect:n})))))}const rZ=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,dn.Z)(pd),{activeBlockVariation:r,variations:o}=(0,un.Z)((e=>{const{getActiveBlockVariation:n,getBlockVariations:r}=e(Bo),{getBlockName:o,getBlockAttributes:i}=e(pd),l=t&&o(t);return{activeBlockVariation:n(l,i(t)),variations:l&&r(l,"transform")}}),[t]),i=null==r?void 0:r.name,l=(0,b.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===o.length)}),[o]);if(null==o||!o.length)return null;const a=l?tZ:nZ;return(0,b.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...o.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:o})};function oZ(e){var t;let{genericPreviewBlock:n,style:r,className:o,activeStyle:i}=e;const l=null===(t=qn(n.name))||void 0===t?void 0:t.example,a=WE(o,i,r),s=(0,b.useMemo)((()=>({...n,title:r.label||r.name,description:r.description,initialAttributes:{...n.attributes,className:a+" block-editor-block-styles__block-preview-container"},example:l})),[n,a]);return(0,b.createElement)(bx,{item:s,isStylePreview:!0})}const iZ=()=>{};function lZ(e){let{clientId:t,onSwitch:n=iZ,onHoverClassName:r=iZ}=e;const{onSelect:o,stylesToRender:i,activeStyle:l,genericPreviewBlock:a,className:s}=$E({clientId:t,onSwitch:n}),[c,u]=(0,b.useState)(null),d=(0,tg.Z)("medium","<");if(!i||0===i.length)return null;const p=(0,rg.D)(u,250),m=e=>{var t;c!==e?(p(e),r(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):p.cancel()};return(0,b.createElement)("div",{className:"block-editor-block-styles"},(0,b.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.isDefault?(0,O.__)("Default"):e.label||e.name;return(0,b.createElement)(ia.ZP,{className:C()("block-editor-block-styles__item",{"is-active":l.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>m(e),onFocus:()=>m(e),onMouseLeave:()=>m(null),onBlur:()=>m(null),onClick:()=>(e=>{o(e),r(null),u(null),p.cancel()})(e),"aria-current":l.name===e.name},(0,b.createElement)(kx,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!d&&(0,b.createElement)(mn.Z,{placement:"left-start",offset:20,focusOnMount:!1},(0,b.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>m(null)},(0,b.createElement)(oZ,{activeStyle:l,className:s,genericPreviewBlock:a,style:c}))))}const aZ=lZ;function sZ(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:r,styles:o}=(0,un.Z)((e=>{var n,r;const o=e(pd).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==o||null===(n=o.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(r=null==o?void 0:o.onChange)&&void 0!==r?r:null,styles:e(Bo).getBlockStyles(t)}}),[t]),i=(0,b.useMemo)((()=>[{label:(0,O.__)("Not set"),value:""},...o.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[o]),l=(0,b.useMemo)((()=>{var e;return null===(e=UE(o))||void 0===e?void 0:e.name}),[o]),a=(0,b.useCallback)((e=>{r(t,e)}),[t,r]);return n&&n!==l?r&&(0,b.createElement)("div",{className:"default-style-picker__default-switcher"},(0,b.createElement)(jT.Z,{__nextHasNoMarginBottom:!0,options:i,value:n||"",label:(0,O.__)("Default Style"),onChange:a})):null}lZ.Slot=()=>((0,j.default)("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var cZ=n(45029),uZ=n(44451),dZ=n(71295);const pZ={name:"settings",title:"Settings",value:"settings",icon:cZ.Z,className:"block-editor-block-inspector__tab-item"},mZ={name:"styles",title:"Styles",value:"styles",icon:uZ.Z,className:"block-editor-block-inspector__tab-item"},hZ={name:"list",title:"List View",value:"list-view",icon:dZ.Z,className:"block-editor-block-inspector__tab-item"},fZ=()=>{const e=xd($f.slotName);return Boolean(e&&e.length)?(0,b.createElement)(nf.Z,{className:"block-editor-block-inspector__advanced",title:(0,O.__)("Advanced"),initialOpen:!1},(0,b.createElement)(Gf.Slot,{group:"advanced"})):null},gZ=()=>{const e=xd(hf.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,b.createElement)(nf.Z,{className:"block-editor-block-inspector__position",title:(0,O.__)("Position"),initialOpen:!1},(0,b.createElement)(Gf.Slot,{group:"position"})):null};var vZ=n(40806);const bZ="isInspectorControlsTabsHintVisible";function yZ(){const e=(0,un.Z)((e=>{var t;return null===(t=e(vZ.h).get("core",bZ))||void 0===t||t}),[]),t=(0,b.useRef)(),{set:n}=(0,dn.Z)(vZ.h);return e?(0,b.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,b.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,O.__)("Looking for other block settings? They've moved to the styles tab.")),(0,b.createElement)(ia.ZP,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:AF.Z,iconSize:"16",label:(0,O.__)("Dismiss hint"),onClick:()=>{const e=u_.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",bZ,!1)},showTooltip:!1})):null}const _Z=e=>{let{showAdvancedControls:t=!1}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Gf.Slot,null),(0,b.createElement)(gZ,null),t&&(0,b.createElement)("div",null,(0,b.createElement)(fZ,null)),(0,b.createElement)(yZ,null))},kZ=e=>{let{blockName:t,clientId:n,hasBlockStyles:r}=e;return(0,b.createElement)(b.Fragment,null,r&&(0,b.createElement)("div",null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Styles")},(0,b.createElement)(aZ,{clientId:n}),Xn(t,"defaultStylePicker",!0)&&(0,b.createElement)(sZ,{blockName:t}))),(0,b.createElement)(Gf.Slot,{group:"color",label:(0,O.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,b.createElement)(Gf.Slot,{group:"typography",label:(0,O.__)("Typography")}),(0,b.createElement)(Gf.Slot,{group:"dimensions",label:(0,O.__)("Dimensions")}),(0,b.createElement)(Gf.Slot,{group:"border",label:(0,O.__)("Border")}),(0,b.createElement)(Gf.Slot,{group:"styles"}))},xZ=["core/navigation"],wZ=e=>!xZ.includes(e);function CZ(e){let{blockName:t,clientId:n,hasBlockStyles:r,tabs:o}=e;const i=wZ(t)?void 0:hZ.name;return(0,b.createElement)(AC.Z,{className:"block-editor-block-inspector__tabs",tabs:o,initialTabName:i,key:n},(e=>e.name===pZ.name?(0,b.createElement)(_Z,{showAdvancedControls:!!t}):e.name===mZ.name?(0,b.createElement)(kZ,{blockName:t,clientId:n,hasBlockStyles:r}):e.name===hZ.name?(0,b.createElement)(Gf.Slot,{group:"list"}):void 0))}const EZ=[];function SZ(e){const t=[],{border:n,color:r,default:o,dimensions:i,list:l,position:a,styles:s,typography:c}=hf,u=wZ(e),d=xd(l.Slot.__unstableName),p=!u&&!!d&&d.length,m=[...xd(n.Slot.__unstableName)||[],...xd(r.Slot.__unstableName)||[],...xd(i.Slot.__unstableName)||[],...xd(s.Slot.__unstableName)||[],...xd(c.Slot.__unstableName)||[]].length,h=xd($f.slotName)||[],f=[...xd(o.Slot.__unstableName)||[],...xd(a.Slot.__unstableName)||[],...p&&m>1?h:[]];p&&t.push(hZ),f.length&&t.push(pZ),m&&t.push(mZ);const g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,un.Z)((e=>e(pd).getSettings().blockInspectorTabs),[]));return g?t:EZ}function IZ(e,t){const n=(0,b.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),r=(0,b.useCallback)((e=>!!n[e]),[n]);return(0,b.useMemo)((()=>TZ([t],r)),[t,r])}function TZ(e,t){const n=[];for(const r of e)t(r.name)&&n.push(r),n.push(...TZ(r.innerBlocks,t));return n}function NZ(e){let{blockTypes:t,block:n,selectedBlock:r}=e;const{selectBlock:o}=(0,dn.Z)(pd),i=t.find((e=>{let{name:t}=e;return t===n.name})),l=r&&r.clientId===n.clientId;return(0,b.createElement)(ia.ZP,{isPressed:l,onClick:()=>o(n.clientId)},(0,b.createElement)(kf.Z,{justify:"flex-start"},(0,b.createElement)(tk,{icon:i.icon}),(0,b.createElement)(Fd.Z,null,i.title)))}function BZ(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:r,selectedBlock:o}=(0,un.Z)((e=>({blockTypes:e(Bo).getBlockTypes(),block:e(pd).getBlock(t),selectedBlock:e(pd).getSelectedBlock()})),[t]),i=aE(t),l=IZ(n,r);return(0,b.createElement)("div",{className:"block-editor-block-inspector"},(0,b.createElement)(nk,(0,ta.Z)({},i,{className:i.isSynced&&"is-synced"})),(0,b.createElement)(rZ,{blockClientId:t}),(0,b.createElement)(Mw.Z,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,b.createElement)("h2",{className:"block-editor-block-card__title"},(0,O.__)("Content")),l.map((e=>(0,b.createElement)(NZ,{selectedBlock:o,key:e.clientId,block:e,blockTypes:n})))))}const PZ=e=>{let{animate:t,wrapper:n,children:r}=e;return t?n(r):r},AZ=e=>{let{blockInspectorAnimationSettings:t,selectedBlockClientId:n,children:r}=e;const o=t&&"leftToRight"===t.enterDirection?-50:50;return(0,b.createElement)(Gw.E.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:n},r)},LZ=e=>{let{clientId:t,blockName:n}=e;const r=SZ(n),o=(null==r?void 0:r.length)>1,i=(0,un.Z)((e=>{const{getBlockStyles:t}=e(Bo),r=t(n);return r&&r.length>0}),[n]),l=aE(t);return(0,b.createElement)("div",{className:"block-editor-block-inspector"},(0,b.createElement)(nk,(0,ta.Z)({},l,{className:l.isSynced&&"is-synced"})),(0,b.createElement)(rZ,{blockClientId:t}),o&&(0,b.createElement)(CZ,{hasBlockStyles:i,clientId:t,blockName:n,tabs:r}),!o&&(0,b.createElement)(b.Fragment,null,i&&(0,b.createElement)("div",null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Styles")},(0,b.createElement)(aZ,{clientId:t}),Xn(n,"defaultStylePicker",!0)&&(0,b.createElement)(sZ,{blockName:n}))),(0,b.createElement)(Gf.Slot,null),(0,b.createElement)(Gf.Slot,{group:"color",label:(0,O.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,b.createElement)(Gf.Slot,{group:"typography",label:(0,O.__)("Typography")}),(0,b.createElement)(Gf.Slot,{group:"dimensions",label:(0,O.__)("Dimensions")}),(0,b.createElement)(Gf.Slot,{group:"border",label:(0,O.__)("Border")}),(0,b.createElement)(Gf.Slot,{group:"styles"}),(0,b.createElement)(gZ,null),(0,b.createElement)("div",null,(0,b.createElement)(fZ,null))),(0,b.createElement)(jF,{key:"back"}))},RZ=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:r,selectedBlockClientId:o,blockType:i,topLevelLockedBlock:l}=(0,un.Z)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r,__unstableGetContentLockingParent:o,getTemplateLock:i}=e(pd),l=t(),a=l&&r(l),s=a&&qn(a);return{count:n(),selectedBlockClientId:l,selectedBlockName:a,blockType:s,topLevelLockedBlock:o(l)||("contentOnly"===i(l)?l:void 0)}}),[]),a=SZ(null==i?void 0:i.name),s=(null==a?void 0:a.length)>1,c=function(e,t){return(0,un.Z)((t=>{if(e){const n=t(pd).getSettings().blockInspectorAnimation,r=null==n?void 0:n.animationParent,{getSelectedBlockClientId:o,getBlockParentsByBlockName:i}=t(pd);return i(o(),r,!0)[0]||e.name===r?null==n?void 0:n[e.name]:null}return null}),[t,e])}(i,o);if(n>1)return(0,b.createElement)("div",{className:"block-editor-block-inspector"},(0,b.createElement)(QF,null),s?(0,b.createElement)(CZ,{tabs:a}):(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Gf.Slot,null),(0,b.createElement)(Gf.Slot,{group:"color",label:(0,O.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,b.createElement)(Gf.Slot,{group:"typography",label:(0,O.__)("Typography")}),(0,b.createElement)(Gf.Slot,{group:"dimensions",label:(0,O.__)("Dimensions")}),(0,b.createElement)(Gf.Slot,{group:"border",label:(0,O.__)("Border")}),(0,b.createElement)(Gf.Slot,{group:"styles"})));const u=r===$n();return i&&o&&!u?l?(0,b.createElement)(BZ,{topLevelLockedBlock:l}):(0,b.createElement)(PZ,{animate:c,wrapper:e=>(0,b.createElement)(AZ,{blockInspectorAnimationSettings:c,selectedBlockClientId:o},e)},(0,b.createElement)(LZ,{clientId:o,blockName:i.name})):t?(0,b.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,O.__)("No block selected.")):null},DZ=function(e){let{__unstableContentRef:t}=e;const[n,r]=(0,b.useState)(!1),o=(0,un.Z)((e=>e(pd).getBlockOrder()),[]);return(0,b.useEffect)((()=>{const e=setTimeout((()=>{r(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?o.map(((e,n)=>n===o.length-1?null:(0,b.createElement)(YC,{key:e,previousClientId:e,nextClientId:o[n+1],__unstableContentRef:t},(0,b.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,b.createElement)(HC,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function MZ(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:r}=e(pd);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:r()}}function OZ(e){let{children:t,__unstableContentRef:n,...r}=e;const o=(0,tg.Z)("medium"),{hasFixedToolbar:i,isZoomOutMode:l,isTyping:a}=(0,un.Z)(MZ,[]),s=(0,Nk.sx)(),{getSelectedBlockClientIds:c,getBlockRootClientId:u}=(0,un.Z)(pd),{duplicateBlocks:d,removeBlocks:p,insertAfterBlock:m,insertBeforeBlock:h,clearSelectedBlock:f,moveBlocksUp:g,moveBlocksDown:v}=(0,dn.Z)(pd),y=qC(n),_=qC(n);return(0,b.createElement)("div",(0,ta.Z)({},r,{onKeyDown:function(e){if(!e.defaultPrevented)if(s("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);g(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);v(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),d(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),p(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),m(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),h(t[0]))}else s("core/block-editor/unselect",e)&&c().length&&(e.preventDefault(),f(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}),(0,b.createElement)(tE.Provider,{value:(0,b.useRef)(!1)},!a&&(0,b.createElement)(rE,{__unstableContentRef:n}),!l&&(i||!o)&&(0,b.createElement)(QS,{isFixed:!0}),(0,b.createElement)(LI,{__unstableContentRef:n}),(0,b.createElement)(mn.Z.Slot,{name:"block-toolbar",ref:y}),t,(0,b.createElement)(mn.Z.Slot,{name:"__unstable-block-tools-after",ref:_}),l&&(0,b.createElement)(DZ,{__unstableContentRef:n})))}const FZ=()=>{},ZZ=(0,b.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:s,onSelect:c=FZ,shouldFocusBlock:u=!1}=e;const{destinationRootClientId:d,prioritizePatterns:p}=(0,un.Z)((e=>{const{getBlockRootClientId:t,getSettings:o}=e(pd);return{destinationRootClientId:n||t(r)||void 0,prioritizePatterns:o().__experimentalPreferPatternsOnRoot}}),[r,n]);return(0,b.createElement)(FC,{onSelect:c,rootClientId:d,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l,__experimentalInsertionIndex:a,__experimentalFilterValue:s,shouldFocusBlock:u,prioritizePatterns:p,ref:t})}));function jZ(){return null}jZ.Register=function(){const{registerShortcut:e}=(0,dn.Z)(Nk.h);return(0,b.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,O.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,O.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,O.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,O.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,O.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,O.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,O.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,O.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,O.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,O.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};const zZ=jZ,HZ=new Set([T_.UP,T_.RIGHT,T_.DOWN,T_.LEFT,T_.ENTER,T_.BACKSPACE]);function VZ(){const{isTyping:e,hasInlineToolbar:t}=(0,un.Z)((e=>{const{isTyping:t,getSettings:n}=e(pd);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:r}=(0,dn.Z)(pd),o=function(){const e=(0,un.Z)((e=>e(pd).isTyping()),[]),{stopTyping:t}=(0,dn.Z)(pd);return(0,__.Z)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function l(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",l),()=>{r.removeEventListener("mousemove",l)}}),[e,t])}(),i=(0,__.Z)((o=>{const{ownerDocument:i}=o,{defaultView:l}=i,a=l.getSelection();if(e){let c;function u(e){const{target:t}=e;c=l.setTimeout((()=>{(0,d_.Z)(t)||r()}))}function d(e){const{keyCode:t}=e;t!==T_.ESCAPE&&t!==T_.TAB||r()}function p(){a.isCollapsed||r()}return o.addEventListener("focus",u),o.addEventListener("keydown",d),t||i.addEventListener("selectionchange",p),()=>{l.clearTimeout(c),o.removeEventListener("focus",u),o.removeEventListener("keydown",d),i.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:r}=e;(0,d_.Z)(r)&&o.contains(r)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&HZ.has(t)}(e))&&n()}return o.addEventListener("keypress",s),o.addEventListener("keydown",s),()=>{o.removeEventListener("keypress",s),o.removeEventListener("keydown",s)}}),[e,t,n,r]);return(0,np.Z)([o,i])}const WZ=function(e){let{children:t}=e;return(0,b.createElement)("div",{ref:VZ()},t)},UZ={button:"wp-element-button",caption:"wp-element-caption"},$Z=e=>UZ[e]?UZ[e]:"";var GZ=n(82342),qZ=n(83201),KZ=n(17816);const YZ=async function(e){let{perPage:t=20}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await(0,_.Z)({path:(0,Z.f)("/wp/v2/search",{search:e,per_page:t,type:"post"})});return Array.isArray(n)?n.map((e=>({id:e.id,url:e.url,title:(0,si.decodeEntities)(e.title)||`(${KZ.x.I18n.t("noName")})`,type:e.subtype||e.type}))):[]};var XZ=n(39519),QZ=n.n(XZ),JZ=n(35250);function ej(e){let{isActive:t,label:n,info:r,onToggle:o}=e;return(0,JZ.jsx)(Nd.Z,{icon:t&&bf.Z,isSelected:t,onClick:o,role:"menuitemcheckbox",info:r,children:n})}var tj=n(17734);const nj="mailpoet-form-editor",rj=fa.fontSizes.map((e=>({...e,size:`${e.size}${Number.isNaN(Number(`${e.size}`||NaN))?"":"px"}`}))),oj=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,N.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,N.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,N.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,N.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,N.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,N.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,N.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,N.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,N.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},ij=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.color:n},lj=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.gradient:n},aj=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.size:n},sj=(e,t,n,r)=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=i=>{if(!Array.isArray(i))throw new Error("Mapper expects blocks to be an array.");return i.map((i=>{var l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,x,w,C,E,S,I,T,B,P,A,L,R,D,M,O,F;const Z={type:"text",params:{label:i.attributes.label,class_name:i.attributes.className||null}};switch(i.attributes.mandatory&&(Z.params.required="1"),i.attributes.labelWithinInput&&(Z.params.label_within="1"),i.name){case"core/heading":return{type:"heading",id:"heading",params:{content:i.attributes.content,level:i.attributes.level,align:i.attributes.textAlign||"left",font_size:aj(e,i.attributes.fontSize,(null===(l=i.attributes.style)||void 0===l||null===(a=l.typography)||void 0===a?void 0:a.fontSize)||null),text_color:ij(t,i.attributes.textColor,(null===(s=i.attributes.style)||void 0===s||null===(c=s.color)||void 0===c?void 0:c.text)||null),line_height:null===(u=i.attributes.style)||void 0===u||null===(d=u.typography)||void 0===d?void 0:d.lineHeight,background_color:ij(t,i.attributes.backgroundColor,(null===(p=i.attributes.style)||void 0===p||null===(m=p.color)||void 0===m?void 0:m.background)||null),anchor:i.attributes.anchor||null,class_name:i.attributes.className||null}};case"core/paragraph":return{type:"paragraph",id:"paragraph",params:{content:i.attributes.content,drop_cap:i.attributes.dropCap?"1":"0",align:i.attributes.align||"left",font_size:aj(e,i.attributes.fontSize,(null===(h=i.attributes.style)||void 0===h||null===(f=h.typography)||void 0===f?void 0:f.fontSize)||null),line_height:null===(g=i.attributes.style)||void 0===g||null===(v=g.typography)||void 0===v?void 0:v.lineHeight,text_color:ij(t,i.attributes.textColor,(null===(b=i.attributes.style)||void 0===b||null===(y=b.color)||void 0===y?void 0:y.text)||null),background_color:ij(t,i.attributes.backgroundColor,(null===(_=i.attributes.style)||void 0===_||null===(k=_.color)||void 0===k?void 0:k.background)||null),class_name:i.attributes.className||null}};case"core/image":return{type:"image",id:"image",params:{class_name:i.attributes.className||null,align:i.attributes.align||null,url:i.attributes.url||null,alt:i.attributes.alt||null,title:i.attributes.title||null,caption:i.attributes.caption||null,link_destination:i.attributes.linkDestination||null,link:i.attributes.link||null,href:i.attributes.href||null,link_class:i.attributes.linkClass||null,rel:i.attributes.rel||null,link_target:i.attributes.linkTarget||null,id:i.attributes.id||null,size_slug:i.attributes.sizeSlug||null,width:i.attributes.width||null,height:i.attributes.height||null}};case"core/column":return{type:"column",body:o(i.innerBlocks),params:{class_name:i.attributes.className||null,vertical_alignment:i.attributes.verticalAlignment||null,width:i.attributes.width||null,padding:(null===(x=i.attributes.style)||void 0===x||null===(w=x.spacing)||void 0===w?void 0:w.padding)||null,text_color:ij(t,i.attributes.textColor,(null===(C=i.attributes.style)||void 0===C||null===(E=C.color)||void 0===E?void 0:E.text)||null),background_color:ij(t,i.attributes.backgroundColor,(null===(S=i.attributes.style)||void 0===S||null===(I=S.color)||void 0===I?void 0:I.background)||null),gradient:lj(n,i.attributes.gradient,(null===(T=i.attributes.style)||void 0===T||null===(B=T.color)||void 0===B?void 0:B.gradient)||null)}};case"core/columns":return{type:"columns",body:o(i.innerBlocks),params:{vertical_alignment:i.attributes.verticalAlignment||null,is_stacked_on_mobile:i.attributes.isStackedOnMobile||void 0===i.attributes.isStackedOnMobile?"1":"0",class_name:i.attributes.className||null,padding:(null===(P=i.attributes.style)||void 0===P||null===(A=P.spacing)||void 0===A?void 0:A.padding)||null,text_color:ij(t,i.attributes.textColor,(null===(L=i.attributes.style)||void 0===L||null===(R=L.color)||void 0===R?void 0:R.text)||null),background_color:ij(t,i.attributes.backgroundColor,(null===(D=i.attributes.style)||void 0===D||null===(M=D.color)||void 0===M?void 0:M.background)||null),gradient:lj(n,i.attributes.gradient,(null===(O=i.attributes.style)||void 0===O||null===(F=O.color)||void 0===F?void 0:F.gradient)||null)}};case"mailpoet-form/email-input":return{...Z,id:"email",name:"Email",params:{...Z.params,required:"1"},styles:oj(i.attributes.styles)};case"mailpoet-form/first-name-input":return{...Z,id:"first_name",name:"First name",styles:oj(i.attributes.styles)};case"mailpoet-form/last-name-input":return{...Z,id:"last_name",name:"Last name",styles:oj(i.attributes.styles)};case"mailpoet-form/segment-select":return{...Z,id:"segments",type:"segment",name:"List selection",params:{...Z.params,values:i.attributes.values.map((e=>({id:e.id,is_checked:e.isChecked?"1":void 0})))}};case"mailpoet-form/submit-button":return{...Z,id:"submit",type:"submit",name:"Submit",styles:oj(i.attributes.styles)};case"mailpoet-form/divider":return{...Z,id:"divider",type:"divider",name:"Divider",params:{class_name:i.attributes.className||null,height:i.attributes.height,type:i.attributes.type,style:i.attributes.style,divider_height:i.attributes.dividerHeight,divider_width:i.attributes.dividerWidth,color:i.attributes.color}};case"mailpoet-form/html":return{...Z,id:"html",type:"html",name:"Custom text or HTML",params:{text:i.attributes&&i.attributes.content?i.attributes.content:"",nl2br:i.attributes&&i.attributes.nl2br?"1":"0",class_name:i.attributes.className||null}};default:return i.name.startsWith("mailpoet-form/custom-")?((e,t,n)=>{const r=t.find((t=>t.id===e.attributes.customFieldId));if(!r)return null;const o={...n,id:e.attributes.customFieldId.toString(),name:r.name};return e.name.startsWith("mailpoet-form/custom-date")&&(o.type="date"),e.name.startsWith("mailpoet-form/custom-text")&&(o.type="text",o.styles=oj(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(o.type="textarea",o.styles=oj(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-radio")&&(o.type="radio"),e.name.startsWith("mailpoet-form/custom-checkbox")&&(o.type="checkbox"),e.name.startsWith("mailpoet-form/custom-select")&&(o.type="select"),(0,N.has)(e.attributes,"validate")&&(o.params.validate=e.attributes.validate),(0,N.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(o.params.hide_label="1"),(0,N.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(o.params.is_default_today="1"),(0,N.has)(e.attributes,"dateType")&&(o.params.date_type=e.attributes.dateType),(0,N.has)(e.attributes,"lines")&&(o.params.lines=e.attributes.lines),(0,N.has)(e.attributes,"dateFormat")&&(o.params.date_format=e.attributes.dateFormat),(0,N.has)(e.attributes,"values")&&(o.params.values=e.attributes.values.map((e=>{const t={value:e.name};return(0,N.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t}))),o})(i,r,Z):null}})).filter(Boolean)};return o};function cj(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,P,A,L,R,D,M,O,F,Z,j,z,H,V,W,U,$,G,q,K,Y,X,Q,J,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,he,fe,ge,ve,be,ye,_e,ke,xe,we,Ce,Ee,Se,Ie,Te,Ne,Be,Pe,Ae,Le,Re,De,Me,Oe,Fe,Ze,je,ze,He,Ve,We,Ue,$e,Ge,qe,Ke,Ye,Xe,Qe,Je,et,tt,nt,rt,ot,it,lt,at,st,ct,ut,dt,pt,mt,ht,ft,gt,vt,bt,yt,_t,kt,xt,wt,Ct,Et,St,It,Tt,Nt,Bt,Pt,At,Lt,Rt,Dt,Mt,Ot,Ft,Zt,jt;const zt={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===(null===(t=e.settings.formPlacement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled)?"1":"",exit_intent_enabled:null!==(r=e.settings.formPlacement)&&void 0!==r&&null!==(o=r.popup)&&void 0!==o&&o.exitIntentEnabled?"1":"",delay:null===(i=e.settings.formPlacement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay,cookieExpiration:null===(a=e.settings.formPlacement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.cookieExpiration,styles:null===(c=e.settings.formPlacement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.styles,animation:null===(d=e.settings.formPlacement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.animation,categories:(null===(m=e.settings.formPlacement)||void 0===m||null===(h=m.popup)||void 0===h?void 0:h.categories)??[],tags:(null===(f=e.settings.formPlacement)||void 0===f||null===(g=f.popup)||void 0===g?void 0:g.tags)??[],posts:{all:!0===(null===(v=e.settings.formPlacement)||void 0===v||null===(b=v.popup)||void 0===b||null===(y=b.posts)||void 0===y?void 0:y.all)?"1":"",selected:null===(_=e.settings.formPlacement)||void 0===_||null===(k=_.popup)||void 0===k||null===(x=k.posts)||void 0===x?void 0:x.selected},pages:{all:!0===(null===(w=e.settings.formPlacement)||void 0===w||null===(C=w.popup)||void 0===C||null===(E=C.pages)||void 0===E?void 0:E.all)?"1":"",selected:null===(S=e.settings.formPlacement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.pages)||void 0===T?void 0:T.selected},homepage:!0===(null===(N=e.settings.formPlacement)||void 0===N||null===(B=N.popup)||void 0===B?void 0:B.homepage)?"1":"",tagArchives:{all:!0===(null===(P=e.settings.formPlacement)||void 0===P||null===(A=P.popup)||void 0===A||null===(L=A.tagArchives)||void 0===L?void 0:L.all)?"1":"",selected:null===(R=e.settings.formPlacement)||void 0===R||null===(D=R.popup)||void 0===D||null===(M=D.tagArchives)||void 0===M?void 0:M.selected},categoryArchives:{all:!0===(null===(O=e.settings.formPlacement)||void 0===O||null===(F=O.popup)||void 0===F||null===(Z=F.categoryArchives)||void 0===Z?void 0:Z.all)?"1":"",selected:null===(j=e.settings.formPlacement)||void 0===j||null===(z=j.popup)||void 0===z||null===(H=z.categoryArchives)||void 0===H?void 0:H.selected}},fixed_bar:{enabled:!0===(null===(V=e.settings.formPlacement)||void 0===V||null===(W=V.fixedBar)||void 0===W?void 0:W.enabled)?"1":"",delay:null===(U=e.settings.formPlacement)||void 0===U||null===($=U.fixedBar)||void 0===$?void 0:$.delay,cookieExpiration:null===(G=e.settings.formPlacement)||void 0===G||null===(q=G.fixedBar)||void 0===q?void 0:q.cookieExpiration,styles:null===(K=e.settings.formPlacement)||void 0===K||null===(Y=K.fixedBar)||void 0===Y?void 0:Y.styles,position:null===(X=e.settings.formPlacement)||void 0===X||null===(Q=X.fixedBar)||void 0===Q?void 0:Q.position,animation:null===(J=e.settings.formPlacement)||void 0===J||null===(ee=J.fixedBar)||void 0===ee?void 0:ee.animation,categories:(null===(te=e.settings.formPlacement)||void 0===te||null===(ne=te.fixedBar)||void 0===ne?void 0:ne.categories)??[],tags:(null===(re=e.settings.formPlacement)||void 0===re||null===(oe=re.fixedBar)||void 0===oe?void 0:oe.tags)??[],posts:{all:!0===(null===(ie=e.settings.formPlacement)||void 0===ie||null===(le=ie.fixedBar)||void 0===le||null===(ae=le.posts)||void 0===ae?void 0:ae.all)?"1":"",selected:null===(se=e.settings.formPlacement)||void 0===se||null===(ce=se.fixedBar)||void 0===ce||null===(ue=ce.posts)||void 0===ue?void 0:ue.selected},pages:{all:!0===(null===(de=e.settings.formPlacement)||void 0===de||null===(pe=de.fixedBar)||void 0===pe||null===(me=pe.pages)||void 0===me?void 0:me.all)?"1":"",selected:null===(he=e.settings.formPlacement)||void 0===he||null===(fe=he.fixedBar)||void 0===fe||null===(ge=fe.pages)||void 0===ge?void 0:ge.selected},homepage:!0===(null===(ve=e.settings.formPlacement)||void 0===ve||null===(be=ve.fixedBar)||void 0===be?void 0:be.homepage)?"1":"",tagArchives:{all:!0===(null===(ye=e.settings.formPlacement)||void 0===ye||null===(_e=ye.fixedBar)||void 0===_e||null===(ke=_e.tagArchives)||void 0===ke?void 0:ke.all)?"1":"",selected:null===(xe=e.settings.formPlacement)||void 0===xe||null===(we=xe.fixedBar)||void 0===we||null===(Ce=we.tagArchives)||void 0===Ce?void 0:Ce.selected},categoryArchives:{all:!0===(null===(Ee=e.settings.formPlacement)||void 0===Ee||null===(Se=Ee.fixedBar)||void 0===Se||null===(Ie=Se.categoryArchives)||void 0===Ie?void 0:Ie.all)?"1":"",selected:null===(Te=e.settings.formPlacement)||void 0===Te||null===(Ne=Te.fixedBar)||void 0===Ne||null===(Be=Ne.categoryArchives)||void 0===Be?void 0:Be.selected}},below_posts:{enabled:!0===(null===(Pe=e.settings.formPlacement)||void 0===Pe||null===(Ae=Pe.belowPosts)||void 0===Ae?void 0:Ae.enabled)?"1":"",styles:null===(Le=e.settings.formPlacement)||void 0===Le||null===(Re=Le.belowPosts)||void 0===Re?void 0:Re.styles,categories:(null===(De=e.settings.formPlacement)||void 0===De||null===(Me=De.belowPosts)||void 0===Me?void 0:Me.categories)??[],tags:(null===(Oe=e.settings.formPlacement)||void 0===Oe||null===(Fe=Oe.belowPosts)||void 0===Fe?void 0:Fe.tags)??[],posts:{all:!0===(null===(Ze=e.settings.formPlacement)||void 0===Ze||null===(je=Ze.belowPosts)||void 0===je||null===(ze=je.posts)||void 0===ze?void 0:ze.all)?"1":"",selected:null===(He=e.settings.formPlacement)||void 0===He||null===(Ve=He.belowPosts)||void 0===Ve||null===(We=Ve.posts)||void 0===We?void 0:We.selected},pages:{all:!0===(null===(Ue=e.settings.formPlacement)||void 0===Ue||null===($e=Ue.belowPosts)||void 0===$e||null===(Ge=$e.pages)||void 0===Ge?void 0:Ge.all)?"1":"",selected:null===(qe=e.settings.formPlacement)||void 0===qe||null===(Ke=qe.belowPosts)||void 0===Ke||null===(Ye=Ke.pages)||void 0===Ye?void 0:Ye.selected}},slide_in:{enabled:!0===(null===(Xe=e.settings.formPlacement)||void 0===Xe||null===(Qe=Xe.slideIn)||void 0===Qe?void 0:Qe.enabled)?"1":"",delay:null===(Je=e.settings.formPlacement)||void 0===Je||null===(et=Je.slideIn)||void 0===et?void 0:et.delay,cookieExpiration:null===(tt=e.settings.formPlacement)||void 0===tt||null===(nt=tt.slideIn)||void 0===nt?void 0:nt.cookieExpiration,position:null===(rt=e.settings.formPlacement)||void 0===rt||null===(ot=rt.slideIn)||void 0===ot?void 0:ot.position,animation:null===(it=e.settings.formPlacement)||void 0===it||null===(lt=it.slideIn)||void 0===lt?void 0:lt.animation,styles:null===(at=e.settings.formPlacement)||void 0===at||null===(st=at.slideIn)||void 0===st?void 0:st.styles,categories:(null===(ct=e.settings.formPlacement)||void 0===ct||null===(ut=ct.slideIn)||void 0===ut?void 0:ut.categories)??[],tags:(null===(dt=e.settings.formPlacement)||void 0===dt||null===(pt=dt.slideIn)||void 0===pt?void 0:pt.tags)??[],posts:{all:!0===(null===(mt=e.settings.formPlacement)||void 0===mt||null===(ht=mt.slideIn)||void 0===ht||null===(ft=ht.posts)||void 0===ft?void 0:ft.all)?"1":"",selected:null===(gt=e.settings.formPlacement)||void 0===gt||null===(vt=gt.slideIn)||void 0===vt||null===(bt=vt.posts)||void 0===bt?void 0:bt.selected},pages:{all:!0===(null===(yt=e.settings.formPlacement)||void 0===yt||null===(_t=yt.slideIn)||void 0===_t||null===(kt=_t.pages)||void 0===kt?void 0:kt.all)?"1":"",selected:null===(xt=e.settings.formPlacement)||void 0===xt||null===(wt=xt.slideIn)||void 0===wt||null===(Ct=wt.pages)||void 0===Ct?void 0:Ct.selected},homepage:!0===(null===(Et=e.settings.formPlacement)||void 0===Et||null===(St=Et.slideIn)||void 0===St?void 0:St.homepage)?"1":"",tagArchives:{all:!0===(null===(It=e.settings.formPlacement)||void 0===It||null===(Tt=It.slideIn)||void 0===Tt||null===(Nt=Tt.tagArchives)||void 0===Nt?void 0:Nt.all)?"1":"",selected:null===(Bt=e.settings.formPlacement)||void 0===Bt||null===(Pt=Bt.slideIn)||void 0===Pt||null===(At=Pt.tagArchives)||void 0===At?void 0:At.selected},categoryArchives:{all:!0===(null===(Lt=e.settings.formPlacement)||void 0===Lt||null===(Rt=Lt.slideIn)||void 0===Rt||null===(Dt=Rt.categoryArchives)||void 0===Dt?void 0:Dt.all)?"1":"",selected:null===(Mt=e.settings.formPlacement)||void 0===Mt||null===(Ot=Mt.slideIn)||void 0===Ot||null===(Ft=Ot.categoryArchives)||void 0===Ft?void 0:Ft.selected}},others:{styles:null===(Zt=e.settings.formPlacement)||void 0===Zt||null===(jt=Zt.others)||void 0===jt?void 0:jt.styles}},border_radius:e.settings.borderRadius,border_size:e.settings.borderSize,form_padding:e.settings.formPadding,input_padding:e.settings.inputPadding,border_color:e.settings.borderColor,font_family:e.settings.fontFamily,success_validation_color:e.settings.successValidationColor,error_validation_color:e.settings.errorValidationColor,background_image_url:e.settings.backgroundImageUrl,background_image_display:e.settings.backgroundImageDisplay,close_button:e.settings.closeButton}};return""===zt.settings.font_family&&delete zt.settings.font_family,delete zt.settings.formPlacement,delete zt.settings.successValidationColor,delete zt.settings.errorValidationColor,delete zt.settings.borderRadius,delete zt.settings.borderSize,delete zt.settings.formPadding,delete zt.settings.inputPadding,delete zt.settings.borderColor,delete zt.settings.backgroundImageUrl,delete zt.settings.backgroundImageDisplay,delete zt.settings.fontFamily,delete zt.settings.closeButton,zt}function uj(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function dj(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function pj(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*mj(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function hj(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function fj(e){return{type:"CHANGE_FORM_NAME",name:e}}function gj(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function vj(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function bj(){return{type:"DELETE_CUSTOM_FIELD_FAILED",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0}}function yj(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function _j(){return{type:"CUSTOM_FIELD_EDITED"}}function kj(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function xj(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function wj(){return{type:"SAVE_CUSTOM_FIELD_FAILED",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0}}function Cj(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function Ej(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function Sj(){return{type:"CREATE_CUSTOM_FIELD_FAILED",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0}}function Ij(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*Tj(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function Nj(){return{type:"SAVE_FORM_STARTED"}}function Bj(){return{type:"SAVE_FORM_FAILED",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0}}function Pj(e){return"placement_settings"===e&&(0,S.dispatch)(pd).clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*Aj(e){const t=(0,S.select)(nj).getFormData();null!==t.id&&(yield{type:"STORE_LOCALLY",key:`mailpoet_form_preview_settings${t.id}`,value:e}),yield{type:"CHANGE_PREVIEW_SETTINGS",settings:e}}function*Lj(e){const t={...(0,S.select)(nj).getPreviewSettings(),formType:e};return yield*Aj(t),Pj("placement_settings")}function*Rj(){yield{type:"SHOW_PREVIEW"},yield Pj("default");const e=(0,S.select)(nj).getAllAvailableCustomFields(),t=(0,S.select)(nj).getFormData(),n=(0,S.select)(nj).getFormBlocks(),r=sj(rj,fa.colors,fa.gradients,e),{success:o,error:i}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...cj(t),body:r(n)}};return o?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:i}}function Dj(){return{type:"HIDE_PREVIEW"}}function Mj(e){return{type:"REMOVE_NOTICE",id:e}}function Oj(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function Fj(e){return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0}}function*Zj(){yield{type:"SAVE_FORM"}}function*jj(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*zj(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*Hj(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*Vj(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*Wj(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function Uj(){return{type:"HISTORY_UNDO"}}function $j(){return{type:"HISTORY_REDO"}}function*Gj(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const qj=(e,t)=>e.reduce(((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?qj(n.innerBlocks,t):null)),null),Kj=(e,t)=>{if(!e||!e.settings||!Array.isArray(e.settings.segments))throw new Error("formData.settings.segments are expected to be an array.");if(!Array.isArray(t))throw new Error("formBlocks are expected to be an array.");const n=qj(t,"mailpoet-form/segment-select"),r=[];n&&0!==n.attributes.values.length||e.settings.segments&&0!==e.settings.segments.length||r.push("missing-lists"),n&&0===n.attributes.values.length&&r.push("missing-lists-in-custom-segments-block");const o=qj(t,"mailpoet-form/email-input"),i=qj(t,"mailpoet-form/submit-button");return o||r.push("missing-email-input"),i||r.push("missing-submit"),r},Yj=e=>{let t=e.editorHistory,n=e.editorHistoryOffset;const r=((e,t)=>{const n=e[e.length-1],r=Date.now();if(void 0!==n&&r-n.time<1e3&&e.length>1)return e.pop(),{blocks:t.formBlocks,data:t.formData,time:n.time};const o={blocks:t.formBlocks,data:t.formData,time:r};return void 0!==n&&(0,N.isEqual)(n.data,o.data)&&(0,N.isEqual)(n.blocks,o.blocks)?null:o})(t,e);if(null===r)return e;if(0!==e.editorHistoryOffset){const r=e.editorHistory.length-(e.editorHistoryOffset+1);n=0,t=t.slice(0,r)}return t.length>=100&&t.shift(),t.push(r),{...e,editorHistory:t,editorHistoryOffset:n}},Xj=(e,t)=>{let n=e.editorHistoryOffset;0===n&&Yj(e),n+=t;const r=e.editorHistory.length-(n+1);let o,i;if(void 0===e.editorHistory[r])return e;{const t=e.editorHistory[r];o=t.blocks,i=t.data}return{...e,editorHistoryOffset:n,formBlocks:o,formData:i}},Qj=(Jj=KZ.x,(e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id)),r=(0,N.trim)(t.customField.name),o=e.customFields.find((e=>e.name===r));return o&&n.push({id:"custom-field",content:Jj.I18n.t("customFieldWithNameExists").replace("[name]",r),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!o,notices:n}});var Jj;const ez=(e=>t=>{const n=t.notices.filter((e=>!["missing-lists-in-custom-segments-block","save-form","missing-lists","missing-block"].includes(e.id))),r=t.formErrors.includes("missing-lists")||t.formErrors.includes("missing-lists-in-custom-segments-block"),o=[...t.sidebar.openedPanels];r&&(n.push({id:"missing-lists",content:e.I18n.t("settingsPleaseSelectList"),isDismissible:!0,status:"error"}),o.includes("basic-settings")||o.push("basic-settings"));const i=t.formErrors.includes("missing-email-input"),l=t.formErrors.includes("missing-submit");return(i||l)&&n.push({id:"missing-block",content:e.I18n.t("missingObligatoryBlock"),isDismissible:!0,status:"error"}),{...t,isFormSaving:!r,sidebar:{...t.sidebar,activeTab:r?"form":t.sidebar.activeTab,openedPanels:o},notices:n}})(KZ.x),tz=e=>function(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=((e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?Yj(e):e)(arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,t);return((e,t)=>{switch(t.type){case"ENABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"enabled"}}))(e);case"DISABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"disabled"}}))(e);case"TOGGLE_FULLSCREEN":return((e,t)=>({...e,fullscreenStatus:t.toggleTo}))(e,t);case"CREATE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:KZ.x.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=[...e.customFields];return r.push(t.response),{...e,isCustomFieldCreating:!1,notices:n,customFields:r}})(e,t);case"CREATE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!1,notices:n}})(e,t);case"CREATE_CUSTOM_FIELD_STARTED":return Qj(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:Kj(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_NAME":return((e,t)=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,name:t.name}}))(e,t);case"CHANGE_FORM_SETTINGS":return((e,t)=>{const n={...e,formData:{...e.formData,settings:t.settings}};return{...n,hasUnsavedChanges:!0,formErrors:Kj(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_STYLES":return((e,t)=>({...e,formData:{...e.formData,styles:t.styles,hasUnsavedChanges:!0}}))(e,t);case"CHANGE_PREVIEW_SETTINGS":return((e,t)=>{let{settings:n}=t;return{...e,previewSettings:n}})(e,t);case"CUSTOM_FIELD_EDITED":return(e=>({...e,hasUnsavedChanges:!0}))(e);case"REMOVE_NOTICE":return((e,t)=>({...e,notices:[...e.notices].filter((e=>e.id!==t.id))}))(e,t);case"SHOW_PREVIEW":return(e=>({...e,isPreviewShown:!0}))(e);case"HIDE_PREVIEW":return(e=>({...e,isPreviewShown:!1,isPreviewReady:!1}))(e);case"PREVIEW_DATA_NOT_SAVED":return(e=>({...e,isPreviewReady:!1}))(e);case"PREVIEW_DATA_SAVED":return(e=>({...e,isPreviewReady:!0}))(e);case"SAVE_FORM_DONE":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:`${KZ.x.I18n.t("formSaved")} ${KZ.x.I18n.t("formSavedAppendix")}`,isDismissible:!0,status:"success"}),{...e,formData:{...e.formData,id:parseInt(t.formId,10)},isFormSaving:!1,hasUnsavedChanges:!1,notices:n}})(e,t);case"SAVE_FORM_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:t.message,isDismissible:!0,status:"error"}),{...e,isFormSaving:!1,notices:n}})(e,t);case"SAVE_FORM_STARTED":return ez(e);case"SAVE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:KZ.x.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=e.customFields.map((e=>e.id===t.customFieldId?t.response:e));return{...e,isCustomFieldSaving:!1,notices:n,customFields:r}})(e,t);case"SAVE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"SAVE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,isCustomFieldSaving:!0,notices:t}})(e);case"SWITCH_DEFAULT_SIDEBAR_TAB":return((e,t)=>({...e,sidebar:{...e.sidebar,activeTab:t.id}}))(e,t);case"TOGGLE_SIDEBAR":return((e,t)=>({...e,sidebarOpened:t.toggleTo}))(e,t);case"TOGGLE_INSERTER_SIDEBAR":return((e,t)=>{let n;return n=t.value?!0===t.value?{rootClientId:void 0,insertionIndex:void 0}:t.value:null,{...e,inserterPanel:n}})(e,t);case"TOGGLE_SIDEBAR_PANEL":return((e,t)=>{let n;!0===t.toggleTo&&(n="opened"),!1===t.toggleTo&&(n="closed");const r=[...e.sidebar.openedPanels],o=((e,t,n)=>{const r=e.includes(t);let o=n;return void 0===o&&(o=r?"closed":"opened"),r&&"closed"===o?"close":r||"opened"!==o?null:"open"})(r,t.id,n);return"open"===o?r.push(t.id):"close"===o&&(0,N.remove)(r,(e=>e===t.id)),{...e,sidebar:{...e.sidebar,openedPanels:r}}})(e,t);case"DELETE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,...t,isCustomFieldDeleting:!0}})(e);case"DELETE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.customFields.filter((e=>e.id!==t.customFieldId)),r=e.formBlocks.filter((e=>e.clientId!==t.clientId));return{...e,formBlocks:r,isCustomFieldDeleting:!1,customFields:n}})(e,t);case"DELETE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"CHANGE_ACTIVE_SIDEBAR":return((e,t)=>({...e,sidebar:{...e.sidebar,activeSidebar:t.sidebar}}))(e,t);case"HISTORY_UNDO":return(e=>Xj(e,1))(e);case"HISTORY_REDO":return(e=>Xj(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}})(n,t)},nz=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.reduce(((e,r)=>{if(e.length)return e;if(Array.isArray(r.innerBlocks)&&r.innerBlocks.length){n.push(r);const e=r.innerBlocks.find((e=>e.clientId===t));return e?n:nz(r.innerBlocks,t,n)}return[]}),[])},rz={isFormSaved:e=>"number"==typeof e.formData.id,isFormEnabled:e=>"enabled"===e.formData.status,isFullscreenEnabled:e=>e.fullscreenStatus,isInserterOpened:e=>!!e.inserterPanel,getInserterPanelInsertPoint:e=>e.inserterPanel,getSidebarOpened:e=>e.sidebarOpened,getFormName:e=>e.formData.name,getFormData:e=>e.formData,getFormStyles:e=>e.formData.styles,getFormExports:e=>Object.fromEntries(Object.entries(e.formExports).map((t=>{let[n,r]=t;return[n,r.replace(":form_id:",`${e.formData.id}`)]}))),getFormSettings:e=>e.formData.settings,getAllAvailableSegments:e=>e.segments,getAllAvailableCustomFields:e=>e.customFields,getAllAvailablePages:e=>e.allWpPages.map((e=>({id:e.id,title:e.name}))),getIsFormSaving:e=>e.isFormSaving,getIsPreviewShown:e=>e.isPreviewShown,getIsPreviewReady:e=>e.isPreviewReady,getPreviewSettings(e){if(e.previewSettings)return e.previewSettings;const t={displayType:"desktop",formType:"others"},n=e.formData.settings;return n.formPlacement.belowPosts.enabled&&(t.formType="below_posts"),n.formPlacement.popup.enabled&&(t.formType="popup"),n.formPlacement.fixedBar.enabled&&(t.formType="fixed_bar"),n.formPlacement.slideIn.enabled&&(t.formType="slide_in"),t},getFormWidth(e,t){const n=e.formData.settings;switch(t){case"below_posts":return n.formPlacement.belowPosts.styles.width;case"popup":return n.formPlacement.popup.styles.width;case"slide_in":return n.formPlacement.slideIn.styles.width;case"fixed_bar":return n.formPlacement.fixedBar.styles.width;case"others":return n.formPlacement.others.styles.width;default:throw Error(`Invalid form display type ${t}`)}},getIsCustomFieldSaving:e=>e.isCustomFieldSaving,getIsCustomFieldDeleting:e=>e.isCustomFieldDeleting,getDismissibleNotices:e=>e.notices.filter((e=>!0===e.isDismissible)),getNonDismissibleNotices:e=>e.notices.filter((e=>!1===e.isDismissible)),getNotice:(e,t)=>e.notices.find((e=>e.id===t)),getFormErrors:e=>e.formErrors,getDefaultSidebarActiveTab:e=>e.sidebar.activeTab,getSidebarOpenedPanels:e=>e.sidebar.openedPanels,getFormBlocks:e=>e.formBlocks,getDateSettingsData:e=>e.dateSettingData,getIsCustomFieldCreating:e=>e.isCustomFieldCreating,hasUnsavedChanges:e=>e.hasUnsavedChanges,getEditorUrl:e=>e.editorUrl,getPreviewPageUrl:e=>e.previewPageUrl,getCloseIconsUrl:e=>e.closeIconsUrl,getAllCustomFonts:e=>e.customFonts,getActiveSidebar:e=>e.sidebar.activeSidebar,getAllWPPosts:e=>e.allWpPosts,getAllWPPages:e=>e.allWpPages,getAllWPCategories:e=>e.allWpCategories,getAllWPTags:e=>e.allWpTags,getAllWooCommerceProducts:e=>e.allWooCommerceProducts,getAllWooCommerceCategories:e=>e.allWooCommerceCategories,getAllWooCommerceTags:e=>e.allWooCommerceTags,getTutorialSeen:e=>e.tutorialSeen,getFormEditorUrl:e=>e.formEditorUrl,getTutorialUrl:e=>e.tutorialUrl,getClosestParentAttribute:(e,t,n)=>nz(e.formBlocks,t).reduce(((e,t)=>t.attributes&&void 0!==t.attributes[n]?t.attributes[n]:e),null),hasEditorUndo(e){let t=e.editorHistory.length;return e.editorHistory.length>1&&(t-=1),t>0&&t>e.editorHistoryOffset},hasEditorRedo:e=>e.editorHistoryOffset>0,isUserAdministrator:e=>e.user.isAdministrator};function oz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var iz=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=oz({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var l in o)o[l]&&(i+="; "+l,!0!==o[l]&&(i+="="+o[l].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),l=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=t.read(l,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",oz({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,oz({},this.attributes,t))},withConverter:function(t){return e(oz({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const lz=iz;var az=n(83602),sz=n(88245),cz=n.n(sz);function uz(e,t){return`${e}-${cz()(t.name,{lower:!0}).replace(/[^a-z0-9]+/g,"").replace(/-$/,"")}`}const dz=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,JZ.jsx)(Vp.y$,{d:"M20,4H4C2.9,4,2,4.9,2,6v12c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V6C22,4.9,21.1,4,20,4z M20,18H4V6h16V18z"}),(0,JZ.jsx)(Vp.UL,{x:"6",y:"10",width:"2",height:"2"}),(0,JZ.jsx)(Vp.UL,{x:"6",y:"14",width:"8",height:"2"}),(0,JZ.jsx)(Vp.UL,{x:"16",y:"14",width:"2",height:"2"}),(0,JZ.jsx)(Vp.UL,{x:"10",y:"10",width:"8",height:"2"})]});var pz=n(73136),mz=n.n(pz),hz=n(53890);function fz(e){let{isBusy:t,onDelete:n}=e;const r=(0,b.useCallback)((()=>{window.confirm(KZ.x.I18n.t("customFieldDeleteConfirm"))&&n()}),[n]);return(0,JZ.jsx)(ia.ZP,{isDestructive:!0,isLink:!0,isBusy:t,onClick:r,className:"button-on-top",children:KZ.x.I18n.t("customFieldDeleteCTA")})}function gz(e){let{label:t,mandatory:n,dateType:r,dateFormat:o,defaultToday:i,dateSettings:l,isSaving:a,onSave:s,isDeleting:c,onCustomFieldDelete:u,onChange:d}=e;const[p,m]=(0,b.useState)(t),[h,f]=(0,b.useState)(n),[g,v]=(0,b.useState)(i),[y,_]=(0,b.useState)(r),[k,x]=(0,b.useState)(o),w=(0,b.useMemo)((()=>({label:p,mandatory:h,dateType:y,dateFormat:k,defaultToday:g})),[p,h,y,k,g]),C=h!==n||g!==i||y!==r||k!==o||p!==t;return(0,b.useEffect)((()=>{d&&d(w,C)}),[w,d,C]),(0,JZ.jsxs)("div",{className:"custom-field-settings",children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:p,"data-automation-id":"settings_custom_date_label_input",onChange:m}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:h,onChange:f}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("customFieldDefaultToday"),checked:g,onChange:v}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:y,onChange:e=>{_(e);const t=l.dateFormats[e];x(t[0])},options:l.dateTypes}),(()=>{const e=l.dateFormats[y];return Array.isArray(e)&&1===e.length?null:(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:k,onChange:e=>x(e),options:e.map((e=>({value:e,label:e})))})})(),s?(0,JZ.jsx)(ia.ZP,{isPrimary:!0,onClick:()=>s({mandatory:h,dateType:y,dateFormat:k,defaultToday:g,label:p}),isBusy:a,disabled:a||!C,className:"button-on-top","data-automation-id":"custom_field_save",children:KZ.x.I18n.t("customFieldSaveCTA")}):null,u?(0,JZ.jsx)(fz,{isBusy:a||c,onDelete:u}):null]})}fz.propTypes={isBusy:QZ().bool,onDelete:QZ().func},fz.defaultProps={isBusy:!1,onDelete:()=>{}},gz.propTypes={mandatory:QZ().bool,label:QZ().string,dateType:QZ().string,dateFormat:QZ().string,defaultToday:QZ().bool,onSave:QZ().func,isSaving:QZ().bool,dateSettings:QZ().shape({dateTypes:QZ().arrayOf(QZ().shape({label:QZ().string,value:QZ().string})),dateFormats:QZ().objectOf(QZ().arrayOf(QZ().string)),months:QZ().arrayOf(QZ().string)}).isRequired,isDeleting:QZ().bool,onCustomFieldDelete:QZ().func,onChange:QZ().func},gz.defaultProps={label:"",mandatory:!1,isSaving:!1,dateType:null,dateFormat:null,defaultToday:!1,isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const vz=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function bz(e){const t=[];void 0!==e.placeholder&&t.push((0,JZ.jsx)("option",{value:"",children:e.placeholder},0));const n=mz()().year();for(let e=n;e>=n-100;e-=1)t.push((0,JZ.jsx)("option",{value:e,children:e},e));return(0,JZ.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:C()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function yz(e){const t=[];void 0!==e.placeholder&&t.push((0,JZ.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,JZ.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,JZ.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:C()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function _z(e){const t=[];void 0!==e.placeholder&&t.push((0,JZ.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,JZ.jsx)("option",{value:e,children:e},e));return(0,JZ.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:C()({mailpoet_date_day:e.addDefaultClasses}),children:t})}bz.propTypes={name:QZ().string.isRequired,placeholder:QZ().string.isRequired,onValueChange:QZ().func.isRequired,year:QZ().oneOfType([QZ().string,QZ().number]).isRequired,addDefaultClasses:QZ().bool.isRequired},yz.propTypes={name:QZ().string.isRequired,placeholder:QZ().string.isRequired,onValueChange:QZ().func.isRequired,month:QZ().oneOfType([QZ().string,QZ().number]).isRequired,monthNames:QZ().arrayOf(QZ().string).isRequired,addDefaultClasses:QZ().bool.isRequired},_z.propTypes={name:QZ().string.isRequired,placeholder:QZ().string.isRequired,onValueChange:QZ().func.isRequired,day:QZ().oneOfType([QZ().string,QZ().number]).isRequired,addDefaultClasses:QZ().bool.isRequired};class kz extends b.Component{constructor(e){super(e),this.state={year:"",month:"",day:""},this.onValueChange=this.onValueChange.bind(this)}componentDidMount(){this.extractDateParts()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}onValueChange(e){const t=e.target.name.match(/(.*?)\[(.*?)\]/);let n=null,r=null;if(null!==t&&3===t.length){[,n,r]=t;const o=Number(e.target.value);this.setState({[`${r}`]:o},(()=>{this.props.onValueChange({target:{name:n,value:this.formatValue()}})}))}}formatValue(){let e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}extractDateParts(){const e=void 0!==this.props.item[this.props.field.name]?this.props.item[this.props.field.name].trim():"";if(""===e)return;const t=mz()(e);this.setState({year:t.format("YYYY"),month:t.format("M"),day:t.format("D")})}render(){const e=window.mailpoet_month_names||[];let t=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(t=this.props.field.params.date_format);const n=t.split("/").map((t=>{switch(t){case"YYYY":return(0,JZ.jsx)(bz,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,year:this.state.year,placeholder:this.props.field.year_placeholder},"year");case"MM":return(0,JZ.jsx)(yz,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,month:this.state.month,monthNames:e,placeholder:this.props.field.month_placeholder},"month");case"DD":return(0,JZ.jsx)(_z,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,day:this.state.day,placeholder:this.props.field.day_placeholder},"day");default:return(0,JZ.jsx)("div",{children:"Invalid date type"})}}));return(0,JZ.jsx)("div",{children:n})}}function xz(e){let{children:t,className:n}=e;return(0,JZ.jsx)("div",{className:C()("mailpoet_paragraph",n),children:t})}function wz(e,t){switch(e){case"checkbox":return{label:t.label,required:t.mandatory?"1":"",values:[{is_checked:t.isChecked?"1":"",value:t.checkboxLabel}]};case"date":return{label:t.label,required:t.mandatory?"1":"",date_type:t.dateType,date_format:t.dateFormat,is_default_today:t.defaultToday?"1":""};case"radio":case"select":return{required:t.mandatory?"1":"",label:t.label,values:t.values.map((e=>{const t={value:e.name};return e.isChecked?t.is_checked="1":t.is_checked="",t}))};case"text":return{required:t.mandatory?"1":"",validate:t.validate,label:t.label};case"textarea":return{required:t.mandatory?"1":"",validate:t.validate,lines:t.lines?t.lines:"1",label:t.label};default:throw new Error(`Invalid custom field type ${e}!`)}}function Cz(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),i=(0,un.Z)((e=>e(nj).getDateSettingsData()),[]),l=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,dn.Z)(nj),u=(0,JZ.jsx)(Gf,{children:(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(gz,{label:t.label,mandatory:t.mandatory,dateSettings:i,defaultToday:t.defaultToday,dateFormat:t.dateFormat,dateType:t.dateType,isSaving:o,onSave:e=>a({customFieldId:t.customFieldId,data:{params:wz("date",e)},onFinish:()=>n({mandatory:e.mandatory,dateType:e.dateType,dateFormat:e.dateFormat,defaultToday:e.defaultToday,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})})});return(0,JZ.jsx)(xz,{className:t.className,children:(0,JZ.jsxs)("div",{className:"mailpoet_custom_date",children:[u,(0,JZ.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:r,children:vz(t)}),(0,JZ.jsx)(kz,{field:{name:r,day_placeholder:KZ.x.I18n.t("customFieldDay"),month_placeholder:KZ.x.I18n.t("customFieldMonth"),year_placeholder:KZ.x.I18n.t("customFieldYear"),params:{date_type:t.dateType,date_format:t.dateFormat}},item:{[r]:t.defaultToday?mz()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function Ez(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},defaultToday:{type:"boolean",default:!1},dateType:{type:"string",default:e.params.date_type},dateFormat:{type:"string",default:e.params.date_format},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Cz,save:()=>null}}kz.propTypes={item:QZ().object.isRequired,field:QZ().shape({name:QZ().string,day_placeholder:QZ().string,month_placeholder:QZ().string,year_placeholder:QZ().string,params:QZ().object}).isRequired,onValueChange:QZ().func.isRequired,addDefaultClasses:QZ().bool},kz.defaultProps={addDefaultClasses:!1},xz.propTypes={children:QZ().node.isRequired,className:QZ().string},xz.defaultProps={className:""},Cz.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,dateFormat:QZ().string.isRequired,dateType:QZ().string.isRequired,defaultToday:QZ().bool,mandatory:QZ().bool.isRequired,customFieldId:QZ().number.isRequired,className:QZ().string}).isRequired,clientId:QZ().string.isRequired,setAttributes:QZ().func.isRequired};const Sz={fullWidth:!0,inheritFromTheme:!0},Iz={fullWidth:!1,inheritFromTheme:!0},Tz=e=>{if(!e)return Iz;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,N.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,N.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,N.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,N.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,N.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number(e.font_size)),(0,N.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,N.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,N.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,N.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,N.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},Nz=(e,t)=>{const n=e.find((e=>e.color===t));return n?n.slug:void 0};function Bz(e){let{label:t,mandatory:n,validate:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,fieldType:c}=e;const[u,d]=(0,b.useState)(t),[p,m]=(0,b.useState)(n),[h,f]=(0,b.useState)(r),g=(0,b.useMemo)((()=>({label:u,mandatory:p,validate:h})),[u,p,h]),v=p!==n||h!==r||u!==t;return(0,b.useEffect)((()=>{s&&s(g,v)}),[g,s,v,c]),(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,JZ.jsx)(jT.Z,{label:`${KZ.x.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:KZ.x.I18n.t("customFieldValidateNothing"),value:""},{label:KZ.x.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:KZ.x.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:KZ.x.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:h,onChange:f}),i?(0,JZ.jsx)(ia.ZP,{isPrimary:!0,onClick:()=>i(g),isBusy:o,disabled:o||l||!v,className:"button-on-top","data-automation-id":"custom_field_save",children:KZ.x.I18n.t("customFieldSaveCTA")}):null,a?(0,JZ.jsx)(fz,{isBusy:o||l,onDelete:a}):null]})}Bz.propTypes={label:QZ().string,mandatory:QZ().bool,validate:QZ().string,onSave:QZ().func,isSaving:QZ().bool,isDeleting:QZ().bool,onCustomFieldDelete:QZ().func,onChange:QZ().func,fieldType:QZ().string},Bz.defaultProps={label:"",mandatory:!1,fieldType:"",isSaving:!1,validate:"",isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const Pz=["colors","disableCustomColors","gradients","disableCustomGradients"],Az=e=>{let{className:t,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,children:l,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d}=e;const p=(0,ep.Z)(Az),{batch:m}=(0,Jf.Z)();return(0,N.isEmpty)(n)&&(0,N.isEmpty)(r)&&o&&i&&null!=a&&a.every((e=>(0,N.isEmpty)(e.colors)&&(0,N.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,b.createElement)(zf,{className:C()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{m((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:r,onGradientChange:o}=e;t?r():n&&o()}))}))},panelId:p,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,b.createElement)(GP,{settings:a,panelId:p,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!l&&(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Ow.Z,{marginY:4})," ",l))},Lz=e=>{const t=OB();return(0,b.createElement)(Az,(0,ta.Z)({},t,e))},Rz=e=>Pz.every((t=>e.hasOwnProperty(t)))?(0,b.createElement)(Az,e):(0,b.createElement)(Lz,e);function Dz(e){let{title:t,settings:n}=e;const r=am("color.palette"),o=am("color.gradients");return(0,JZ.jsx)("div",{children:(0,JZ.jsx)(Rz,{title:t,colors:r,gradients:o,settings:n})})}Dz.displayName="ColorGradientSettings";const Mz=(0,qZ.withBoundary)(Dz);function Oz(e){let{styles:t,onChange:n}=e;const r=(0,b.useRef)(t),o=r.current,{applyStylesToAllTextInputs:i}=(0,dn.Z)(nj),l=(e,t)=>{const o={...r.current};o[e]=t,n(o),r.current=o};return(0,JZ.jsx)(hz.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsDisplayFullWidth"),checked:o.fullWidth,onChange:(0,N.partial)(l,"fullWidth")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:o.inheritFromTheme,onChange:e=>{if(e)return void l("inheritFromTheme",e);const t={...r.current};t.backgroundColor="#ffffff",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.inheritFromTheme=e,n(t),r.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),o.inheritFromTheme?null:(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(Mz,{title:KZ.x.I18n.t("formSettingsColor"),settings:[{label:KZ.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,N.partial)(l,"fontColor")},{label:KZ.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,onColorChange:(0,N.partial)(l,"backgroundColor")},{label:KZ.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,N.partial)(l,"borderColor")}]}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsBold"),checked:o.bold||!1,onChange:(0,N.partial)(l,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderSize"),value:void 0===o.borderSize?1:o.borderSize,min:0,max:10,allowReset:!0,onChange:(0,N.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderRadius"),value:void 0===o.borderRadius?1:o.borderRadius,min:0,max:40,allowReset:!0,onChange:(0,N.partial)(l,"borderRadius"),className:"mailpoet-automation-styles-border-radius-size"})]}),(0,JZ.jsx)("div",{children:(0,JZ.jsx)(ia.ZP,{isPrimary:!0,onClick:()=>i(o),"data-automation-id":"styles_apply_to_all",children:KZ.x.I18n.t("formSettingsApplyToAll")})})]})})})}const Fz=QZ().shape({fullWidth:QZ().bool.isRequired,inheritFromTheme:QZ().bool.isRequired,bold:QZ().bool,backgroundColor:QZ().string,borderSize:QZ().number,borderRadius:QZ().number,borderColor:QZ().string});let Zz;function jz(e){return e===Zz.Right?"0 0 0 auto":e===Zz.Center?"0 auto":"auto 0"}function zz(e){let{label:t,labelWithinInput:n,name:r,mandatory:o,styles:i,className:l}=e;const a=(0,un.Z)((e=>e(nj).getFormSettings()),[]),s=(0,b.useRef)(null),c=`${r}_${Math.random().toString(36).substring(2,15)}`,[u,d]=(0,b.useState)(""),p=i.inheritFromTheme?{}:{fontWeight:i.bold?"bold":"inherit"},m=i.inheritFromTheme?{}:{borderRadius:i.borderRadius?`${i.borderRadius}px`:0,borderWidth:void 0!==i.borderSize?`${i.borderSize}px`:"1px",borderColor:i.borderColor||"initial",borderStyle:"solid"};void 0!==a.inputPadding&&(m.padding=a.inputPadding),void 0!==a.inputPadding&&(m.padding=a.inputPadding),void 0!==a.alignment&&(m.textAlign=a.alignment,m.margin=jz(m.textAlign)),i.fullWidth&&(m.width="100%"),i.backgroundColor&&!i.inheritFromTheme&&(m.backgroundColor=i.backgroundColor);const h={};return i.fontColor&&!i.inheritFromTheme&&(m.color=i.fontColor,n&&(h.color=i.fontColor)),(0,JZ.jsxs)(xz,{className:l,children:[n?null:(0,JZ.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${r}_label`,htmlFor:c,style:p,children:vz({label:t,mandatory:o})}),(e=>{let t=`#${c}::placeholder {`;return void 0!==h.color&&(t+=`color: ${h.color};`),a.fontFamily&&(t+=`font-family: ${a.fontFamily};`),t+="}",(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("style",{children:t}),(0,JZ.jsx)("input",{id:c,ref:s,className:"mailpoet_text",type:"text",name:r,value:u,onChange:()=>d(""),placeholder:e,"data-automation-id":`editor_${r}_input`,style:m,autoComplete:"off"})]})})(n?vz({label:t,mandatory:o}):"")]})}function Hz(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),i=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,dn.Z)(nj),c=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bz,{updateAttributes:e=>n(e),customFieldId:t.customFieldId,label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:o,onSave:e=>{l({customFieldId:t.customFieldId,data:{params:wz("text",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,label:e.label})})},onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})}),(0,JZ.jsx)(Oz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,JZ.jsxs)(JZ.Fragment,{children:[c,(0,JZ.jsx)(zz,{className:t.className,name:"custom_text",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}function Vz(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:Sz}},supports:{html:!1,multiple:!1},edit:Hz,save:()=>null}}function Wz(e){let{name:t,attributes:n,setAttributes:r,clientId:o}=e;const i=`${t.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,l=(0,un.Z)((e=>e(nj).getFormSettings()),[]),a=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),s=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),[c,u]=(0,b.useState)(""),{saveCustomField:d,deleteCustomField:p,customFieldEdited:m}=(0,dn.Z)(nj),h=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bz,{label:n.label,mandatory:n.mandatory,validate:n.validate,isSaving:a,onSave:e=>d({customFieldId:n.customFieldId,data:{params:wz("textarea",e)},onFinish:()=>r({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>p(n.customFieldId,o),isDeleting:s,onChange:(e,t)=>t&&m()})})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:n.labelWithinInput,onChange:e=>r({labelWithinInput:e})}),(0,JZ.jsx)(jT.Z,{label:`${KZ.x.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:n.lines,options:[{label:KZ.x.I18n.t("customField1Line"),value:"1"},{label:KZ.x.I18n.t("customField2Lines"),value:"2"},{label:KZ.x.I18n.t("customField3Lines"),value:"3"},{label:KZ.x.I18n.t("customField4Lines"),value:"4"},{label:KZ.x.I18n.t("customField5Lines"),value:"5"}],onChange:e=>r({lines:e})})]})}),(0,JZ.jsx)(Oz,{styles:n.styles,onChange:e=>r({styles:e})})]}),f=n.styles.inheritFromTheme?{}:{fontWeight:n.styles.bold?"bold":"inherit"},g=n.styles.inheritFromTheme?{}:{borderRadius:n.styles.borderRadius?`${n.styles.borderRadius}px`:0,borderWidth:void 0!==n.styles.borderSize?`${n.styles.borderSize}px`:"1px",borderColor:n.styles.borderColor||"initial",borderStyle:"solid"};n.styles.fullWidth&&(g.width="100%"),n.styles.backgroundColor&&!n.styles.inheritFromTheme&&(g.backgroundColor=n.styles.backgroundColor),void 0!==l.inputPadding&&(g.padding=l.inputPadding),void 0!==l.alignment&&(g.textAlign=l.alignment,g.margin=jz(g.textAlign)),g.resize="none";const v={};n.styles.fontColor&&!n.styles.inheritFromTheme&&(g.color=n.styles.fontColor,n.labelWithinInput&&(v.color=n.styles.fontColor));const y=(0,b.useRef)(null),_=e=>{let t=`#${i}::placeholder {`;return void 0!==v.color&&(t+=`color: ${v.color};`),l.fontFamily&&(t+=`font-family: ${l.fontFamily};`),t+="}",(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("style",{children:t}),(0,JZ.jsx)("textarea",{id:i,ref:y,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:n.lines,style:g,onChange:()=>u(""),placeholder:e,value:c})]})};return(0,JZ.jsxs)(xz,{className:n.className,children:[h,n.labelWithinInput?_(vz(n)):(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:i,style:f,children:vz(n)}),_("")]})]})}function Uz(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},lines:{type:"string",default:"1"},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:Sz}},supports:{html:!1,multiple:!1},edit:Wz,save:()=>null}}!function(e){e.Left="left",e.Center="center",e.Right="right"}(Zz||(Zz={})),zz.propTypes={label:QZ().string.isRequired,labelWithinInput:QZ().bool.isRequired,name:QZ().string.isRequired,mandatory:QZ().bool.isRequired,className:QZ().string,styles:Fz.isRequired},zz.defaultProps={className:""},Hz.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,validate:QZ().string,labelWithinInput:QZ().bool.isRequired,mandatory:QZ().bool.isRequired,customFieldId:QZ().number.isRequired,styles:Fz.isRequired,className:QZ().string}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired},Wz.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,customFieldId:QZ().number.isRequired,validate:QZ().string,labelWithinInput:QZ().bool.isRequired,mandatory:QZ().bool.isRequired,lines:QZ().string,styles:Fz.isRequired,className:QZ().string}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired,name:QZ().string.isRequired};var $z=n(17933),Gz=n(61004),qz=n(86215),Kz=n(72930),Yz=b.createContext(null),Xz=function(e){e()},Qz=function(){return Xz},Jz={notify:function(){}},eH=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=Jz,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=Qz(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=Jz)},e}();const tH=function(e){var t=e.store,n=e.context,r=e.children,o=(0,b.useMemo)((function(){var e=new eH(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),i=(0,b.useMemo)((function(){return t.getState()}),[t]);(0,b.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var l=n||Yz;return b.createElement(l.Provider,{value:o},r)};var nH=n(45675),rH=n(92897),oH=n(26095),iH=n.n(oH),lH=n(65566),aH="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?b.useLayoutEffect:b.useEffect,sH=[],cH=[null,null];function uH(e,t){var n=e[1];return[t.payload,n+1]}function dH(e,t,n){aH((function(){return e.apply(void 0,t)}),n)}function pH(e,t,n,r,o,i,l){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,l())}function mH(e,t,n,r,o,i,l,a,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?l.current||s():(i.current=e,a.current=e,l.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var hH=function(){return[null,0]};function fH(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,l=void 0===i?"connectAdvanced":i,a=n.renderCountProp,s=void 0===a?void 0:a,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,p=void 0===d?"store":d,m=(n.withRef,n.forwardRef),h=void 0!==m&&m,f=n.context,g=void 0===f?Yz:f,v=(0,rH.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),y=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=(0,nH.Z)({},v,{getDisplayName:o,methodName:l,renderCountProp:s,shouldHandleStateChanges:u,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),a=v.pure,c=a?b.useMemo:function(e){return e()};function d(n){var r=(0,b.useMemo)((function(){var e=n.forwardedRef,t=(0,rH.Z)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],l=r[1],a=r[2],s=(0,b.useMemo)((function(){return o&&o.Consumer&&(0,lH.isContextConsumer)(b.createElement(o.Consumer,null))?o:y}),[o,y]),d=(0,b.useContext)(s),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var m=p?n.store:d.store,h=(0,b.useMemo)((function(){return function(t){return e(t.dispatch,i)}(m)}),[m]),f=(0,b.useMemo)((function(){if(!u)return cH;var e=new eH(m,p?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[m,p,d]),g=f[0],v=f[1],_=(0,b.useMemo)((function(){return p?d:(0,nH.Z)({},d,{subscription:g})}),[p,d,g]),k=(0,b.useReducer)(uH,sH,hH),x=k[0][0],w=k[1];if(x&&x.error)throw x.error;var C=(0,b.useRef)(),E=(0,b.useRef)(a),S=(0,b.useRef)(),I=(0,b.useRef)(!1),T=c((function(){return S.current&&a===E.current?S.current:h(m.getState(),a)}),[m,x,a]);dH(pH,[E,C,I,a,T,S,v]),dH(mH,[u,m,g,h,E,C,I,S,v,w],[m,g,h]);var N=(0,b.useMemo)((function(){return b.createElement(t,(0,nH.Z)({},T,{ref:l}))}),[l,t,T]);return(0,b.useMemo)((function(){return u?b.createElement(s.Provider,{value:_},N):N}),[s,N,_])}var m=a?b.memo(d):d;if(m.WrappedComponent=t,m.displayName=r,h){var f=b.forwardRef((function(e,t){return b.createElement(m,(0,nH.Z)({},e,{forwardedRef:t}))}));return f.displayName=r,f.WrappedComponent=t,iH()(f,t)}return iH()(m,t)}}function gH(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function vH(e,t){if(gH(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!gH(e[n[o]],t[n[o]]))return!1;return!0}function bH(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function yH(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function _H(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=yH(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=yH(o),o=r(t,n)),o},r}}const kH=[function(e){return"function"==typeof e?_H(e):void 0},function(e){return e?void 0:bH((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?bH((function(t){return(0,Kz.DE)(e,t)})):void 0}],xH=[function(e){return"function"==typeof e?_H(e):void 0},function(e){return e?void 0:bH((function(){return{}}))}];function wH(e,t,n){return(0,nH.Z)({},n,{},e,{},t)}const CH=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,l=!1;return function(t,n,a){var s=e(t,n,a);return l?o&&i(s,r)||(r=s):(l=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return wH}}];function EH(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function SH(e,t,n,r,o){var i,l,a,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,m=!1;return function(o,h){return m?function(o,m){var h,f,g=!d(m,l),v=!u(o,i);return i=o,l=m,g&&v?(a=e(i,l),t.dependsOnOwnProps&&(s=t(r,l)),c=n(a,s,l)):g?(e.dependsOnOwnProps&&(a=e(i,l)),t.dependsOnOwnProps&&(s=t(r,l)),c=n(a,s,l)):v?(h=e(i,l),f=!p(h,a),a=h,f&&(c=n(a,s,l)),c):c}(o,h):(a=e(i=o,l=h),s=t(r,l),c=n(a,s,l),m=!0,c)}}function IH(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=(0,rH.Z)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),l=n(e,i),a=r(e,i),s=o(e,i);return(i.pure?SH:EH)(l,a,s,e,i)}function TH(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function NH(e,t){return e===t}function BH(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?fH:n,o=t.mapStateToPropsFactories,i=void 0===o?xH:o,l=t.mapDispatchToPropsFactories,a=void 0===l?kH:l,s=t.mergePropsFactories,c=void 0===s?CH:s,u=t.selectorFactory,d=void 0===u?IH:u;return function(e,t,n,o){void 0===o&&(o={});var l=o,s=l.pure,u=void 0===s||s,p=l.areStatesEqual,m=void 0===p?NH:p,h=l.areOwnPropsEqual,f=void 0===h?vH:h,g=l.areStatePropsEqual,v=void 0===g?vH:g,b=l.areMergedPropsEqual,y=void 0===b?vH:b,_=(0,rH.Z)(l,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=TH(e,i,"mapStateToProps"),x=TH(t,a,"mapDispatchToProps"),w=TH(n,c,"mergeProps");return r(d,(0,nH.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:x,initMergeProps:w,pure:u,areStatesEqual:m,areOwnPropsEqual:f,areStatePropsEqual:v,areMergedPropsEqual:y},_))}}const PH=BH();var AH;AH=y.unstable_batchedUpdates,Xz=AH;var LH=n(66344),RH=n(34986),DH=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},MH=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},OH=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},FH={top:0,right:0,bottom:0,left:0},ZH=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?FH:n,o=e.border,i=void 0===o?FH:o,l=e.padding,a=void 0===l?FH:l,s=DH(MH(t,r)),c=DH(OH(t,i)),u=DH(OH(c,a));return{marginBox:s,borderBox:DH(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:a}},jH=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&(0,RH.Z)(!1),n},zH=function(e,t){var n,r,o=e.borderBox,i=e.border,l=e.margin,a=e.padding,s=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return ZH({borderBox:s,border:i,margin:l,padding:a})},HH=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),zH(e,t)},VH=function(e,t){var n={top:jH(t.marginTop),right:jH(t.marginRight),bottom:jH(t.marginBottom),left:jH(t.marginLeft)},r={top:jH(t.paddingTop),right:jH(t.paddingRight),bottom:jH(t.paddingBottom),left:jH(t.paddingLeft)},o={top:jH(t.borderTopWidth),right:jH(t.borderRightWidth),bottom:jH(t.borderBottomWidth),left:jH(t.borderLeftWidth)};return ZH({borderBox:e,margin:n,padding:r,border:o})},WH=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return VH(t,n)},UH=n(84471);const $H=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function GH(e,t){}function qH(){}function KH(e,t,n){var r=t.map((function(t){var r,o,i=(r=n,o=t.options,(0,qz.Z)({},r,{},o));return e.addEventListener(t.eventName,t.fn,i),function(){e.removeEventListener(t.eventName,t.fn,i)}}));return function(){r.forEach((function(e){e()}))}}GH.bind(null,"warn"),GH.bind(null,"error");var YH=!0,XH="Invariant failed";function QH(e){this.message=e}function JH(e,t){if(!e)throw new QH(YH?XH:XH+": "+(t||""))}QH.prototype.toString=function(){return this.message};var eV=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=qH,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof QH&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}(0,Gz.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=KH(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof QH))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(b.Component),tV=function(e){return e+1},nV=function(e,t){var n=e.droppableId===t.droppableId,r=tV(e.index),o=tV(t.index);return n?"\n      You have moved the item from position "+r+"\n      to position "+o+"\n    ":"\n    You have moved the item from position "+r+"\n    in list "+e.droppableId+"\n    to list "+t.droppableId+"\n    in position "+o+"\n  "},rV=function(e,t,n){return t.droppableId===n.droppableId?"\n      The item "+e+"\n      has been combined with "+n.draggableId:"\n      The item "+e+"\n      in list "+t.droppableId+"\n      has been combined with "+n.draggableId+"\n      in list "+n.droppableId+"\n    "},oV=function(e){return"\n  The item has returned to its starting position\n  of "+tV(e.index)+"\n"},iV={dragHandleUsageInstructions:"\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:function(e){return"\n  You have lifted an item in position "+tV(e.source.index)+"\n"},onDragUpdate:function(e){var t=e.destination;if(t)return nV(e.source,t);var n=e.combine;return n?rV(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:function(e){if("CANCEL"===e.reason)return"\n      Movement cancelled.\n      "+oV(e.source)+"\n    ";var t=e.destination,n=e.combine;return t?"\n      You have dropped the item.\n      "+nV(e.source,t)+"\n    ":n?"\n      You have dropped the item.\n      "+rV(e.draggableId,e.source,n)+"\n    ":"\n    The item has been dropped while not over a drop area.\n    "+oV(e.source)+"\n  "}},lV={x:0,y:0},aV=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},sV=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},cV=function(e,t){return e.x===t.x&&e.y===t.y},uV=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},dV=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},pV=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},mV=function(e,t){return Math.min.apply(Math,t.map((function(t){return pV(e,t)})))},hV=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},fV=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},gV=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},vV=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=DH({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):DH(e)},bV=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,o=e.frame,i=function(e,t){return t?fV(e,t.scroll.diff.displacement):e}(t.marginBox,o),l=function(e,t,n){var r;return n&&n.increasedBy?(0,qz.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(i,r,n);return{page:t,withPlaceholder:n,active:vV(l,o)}},yV=function(e,t){e.frame||JH(!1);var n=e.frame,r=sV(t,n.scroll.initial),o=uV(r),i=(0,qz.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}}),l=bV({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return(0,qz.Z)({},e,{frame:i,subject:l})};function _V(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function kV(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function xV(e,t){if(e.find)return e.find(t);var n=kV(e,t);return-1!==n?e[n]:void 0}function wV(e){return Array.prototype.slice.call(e)}var CV=(0,UH.Z)((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),EV=(0,UH.Z)((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),SV=(0,UH.Z)((function(e){return _V(e)})),IV=(0,UH.Z)((function(e){return _V(e)})),TV=(0,UH.Z)((function(e,t){var n=IV(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function NV(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function BV(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var PV=(0,UH.Z)((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),AV=function(e,t){return e.descriptor.droppableId===t.descriptor.id},LV={point:lV,value:0},RV={invisible:{},visible:{},all:[]},DV={displaced:RV,displacedBy:LV,at:null},MV=function(e,t){return function(n){return e<=n&&n<=t}},OV=function(e){var t=MV(e.top,e.bottom),n=MV(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var o=t(r.top)||t(r.bottom),i=n(r.left)||n(r.right);if(o&&i)return!0;var l=r.top<e.top&&r.bottom>e.bottom,a=r.left<e.left&&r.right>e.right;return!(!l||!a)||l&&i||a&&o}},FV=function(e){var t=MV(e.top,e.bottom),n=MV(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},ZV={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},jV={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},zV=function(e){var t=e.target,n=e.destination,r=e.viewport,o=e.withDroppableDisplacement,i=e.isVisibleThroughFrameFn,l=o?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:lV;return fV(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(l,n,i)&&function(e,t,n){return n(t)(e)}(l,r,i)},HV=function(e){return zV((0,qz.Z)({},e,{isVisibleThroughFrameFn:OV}))},VV=function(e){return zV((0,qz.Z)({},e,{isVisibleThroughFrameFn:FV}))},WV=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,o=t.visible;if(r[e])return!1;var i=o[e];return!i||i.shouldAnimate};function UV(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,o=e.viewport,i=e.forceShouldAnimate,l=e.last;return t.reduce((function(e,t){var a=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return DH(MH(n,r))}(t,r),s=t.descriptor.id;if(e.all.push(s),!HV({target:a,destination:n,viewport:o,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:s,shouldAnimate:WV(s,l,i)};return e.visible[s]=c,e}),{all:[],visible:{},invisible:{}})}function $V(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,o=e.destination,i=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:RV,displacedBy:r,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:i}}}}function GV(e){var t=e.draggable,n=e.insideDestination,r=e.destination,o=e.viewport,i=e.displacedBy,l=e.last,a=e.index,s=e.forceShouldAnimate,c=AV(t,r);if(null==a)return $V({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var u=xV(n,(function(e){return e.descriptor.index===a}));if(!u)return $V({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var d=PV(t,n),p=n.indexOf(u);return{displaced:UV({afterDragging:d.slice(p),destination:r,displacedBy:i,last:l,viewport:o.frame,forceShouldAnimate:s}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function qV(e,t){return Boolean(t.effected[e])}var KV=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},YV=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},XV=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return dV(t.line,n.marginBox[t.end]+KV(t,r),YV(t,n.marginBox,r))},QV=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return dV(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),YV(t,n.marginBox,r))},JV=function(e,t){var n=e.frame;return n?aV(t,n.scroll.diff.displacement):t},eW=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.afterCritical,l=n.page.borderBox.center,a=t.at;return r&&a?"REORDER"===a.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,o=e.droppable,i=e.afterCritical,l=TV(o.descriptor.id,r),a=n.page,s=o.axis;if(!l.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return dV(t.line,n.contentBox[t.start]+KV(t,r),YV(t,n.contentBox,r))}({axis:s,moveInto:o.page,isMoving:a});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=r[d];if(qV(d,i))return QV({axis:s,moveRelativeTo:p.page,isMoving:a});var m=zH(p.page,u.point);return QV({axis:s,moveRelativeTo:m,isMoving:a})}var h=l[l.length-1];if(h.descriptor.id===n.descriptor.id)return a.borderBox.center;if(qV(h.descriptor.id,i)){var f=zH(h.page,uV(i.displacedBy.point));return XV({axis:s,moveRelativeTo:f,isMoving:a})}return XV({axis:s,moveRelativeTo:h.page,isMoving:a})}({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:i}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,o=BV(n);o||JH(!1);var i=o.draggableId,l=r[i].page.borderBox.center,a=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,o=e.displacedBy,i=Boolean(t.visible[r]||t.invisible[r]);return qV(r,n)?i?lV:uV(o.point):i?o.point:lV}({displaced:n.displaced,afterCritical:t,combineWith:i,displacedBy:n.displacedBy});return aV(l,a)}({impact:t,draggables:o,afterCritical:i}):l}(e),n=e.droppable;return n?JV(n,t):t},tW=function(e,t){var n=sV(t,e.scroll.initial),r=uV(n);return{frame:DH({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function nW(e,t){return e.map((function(e){return t[e]}))}var rW=function(e){var t,n,r=e.pageBorderBoxCenter,o=e.draggable,i=(t=e.viewport,n=r,aV(t.scroll.diff.displacement,n)),l=sV(i,o.page.borderBox.center);return aV(o.client.borderBox.center,l)},oW=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,o=e.viewport,i=e.withDroppableDisplacement,l=e.onlyOnMainAxis,a=void 0!==l&&l,s=sV(r,t.page.borderBox.center),c={target:fV(t.page.borderBox,s),destination:n,withDroppableDisplacement:i,viewport:o};return a?function(e){return zV((0,qz.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=MV(e.top,e.bottom),r=MV(e.left,e.right);return function(e){return t===ZV?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):VV(c)},iW=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.draggables,i=e.previousImpact,l=e.viewport,a=e.previousPageBorderBoxCenter,s=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=TV(r.descriptor.id,o),d=AV(n,r),p=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.previousImpact;if(!r.isCombineEnabled)return null;if(!NV(i))return null;function l(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,qz.Z)({},i,{at:t})}var a=i.displaced.all,s=a.length?a[0]:null;if(t)return s?l(s):null;var c=PV(n,o);if(!s)return c.length?l(c[c.length-1].descriptor.id):null;var u=kV(c,(function(e){return e.descriptor.id===s}));-1===u&&JH(!1);var d=u-1;return d<0?null:l(c[d].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:i})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,o=e.draggables,i=e.destination,l=e.insideDestination,a=e.previousImpact,s=e.viewport,c=e.afterCritical,u=a.at;if(u||JH(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,o=e.location;if(!r.length)return null;var i=o.index,l=t?i+1:i-1,a=r[0].descriptor.index,s=r[r.length-1].descriptor.index;return l<a||l>(n?s:s+1)?null:l}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:l});return null==d?null:GV({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:d})}var p=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,o=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var i=r.draggableId,l=n[i].descriptor.index;return qV(i,o)?t?l:l-1:t?l+1:l}({isMovingForward:t,destination:i,displaced:a.displaced,draggables:o,combine:u.combine,afterCritical:c});return null==p?null:GV({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:p})}({isMovingForward:t,isInHomeList:d,draggable:n,draggables:o,destination:r,insideDestination:u,previousImpact:i,viewport:l,afterCritical:c});if(!p)return null;var m=eW({impact:p,draggable:n,droppable:r,draggables:o,afterCritical:c});if(oW({draggable:n,destination:r,newPageBorderBoxCenter:m,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:rW({pageBorderBoxCenter:m,draggable:n,viewport:l}),impact:p,scrollJumpRequest:null};var h=sV(m,a),f=function(e){var t=e.impact,n=e.viewport,r=e.destination,o=e.draggables,i=e.maxScrollChange,l=tW(n,aV(n.scroll.current,i)),a=r.frame?yV(r,aV(r.frame.scroll.current,i)):r,s=t.displaced,c=UV({afterDragging:nW(s.all,o),destination:r,displacedBy:t.displacedBy,viewport:l.frame,last:s,forceShouldAnimate:!1}),u=UV({afterDragging:nW(s.all,o),destination:a,displacedBy:t.displacedBy,viewport:n.frame,last:s,forceShouldAnimate:!1}),d={},p={},m=[s,c,u];return s.all.forEach((function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,m);t?p[e]=t:d[e]=!0})),(0,qz.Z)({},t,{displaced:{all:s.all,invisible:d,visible:p}})}({impact:p,viewport:l,destination:r,draggables:o,maxScrollChange:h});return{clientSelection:s,impact:f,scrollJumpRequest:h}},lW=function(e){var t=e.subject.active;return t||JH(!1),t},aW=function(e,t){var n=e.page.borderBox.center;return qV(e.descriptor.id,t)?sV(n,t.displacedBy.point):n},sW=function(e,t){var n=e.page.borderBox;return qV(e.descriptor.id,t)?fV(n,uV(t.displacedBy.point)):n},cW=(0,UH.Z)((function(e,t){var n=t[e.line];return{value:n,point:dV(e.line,n)}})),uW=function(e,t){return(0,qz.Z)({},e,{scroll:(0,qz.Z)({},e.scroll,{max:t})})},dW=function(e,t,n){var r=e.frame;AV(t,e)&&JH(!1),e.subject.withPlaceholder&&JH(!1);var o=cW(e.axis,t.displaceBy).point,i=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return dV(r.line,t[r.line]);var o=e.subject.page.contentBox[r.size],i=TV(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-o;return i<=0?null:dV(r.line,i)}(e,o,n),l={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var a=bV({page:e.subject.page,withPlaceholder:l,axis:e.axis,frame:e.frame});return(0,qz.Z)({},e,{subject:a})}var s=i?aV(r.scroll.max,i):r.scroll.max,c=uW(r,s),u=bV({page:e.subject.page,withPlaceholder:l,axis:e.axis,frame:c});return(0,qz.Z)({},e,{subject:u,frame:c})},pW=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},mW=function(e){var t=e.state,n=e.type,r=function(e,t){var n=pW(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),o=Boolean(r),i=t.dimensions.droppables[t.critical.droppable.id],l=r||i,a=l.axis.direction,s="vertical"===a&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===a&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(s&&!o)return null;var c="MOVE_DOWN"===n||"MOVE_RIGHT"===n,u=t.dimensions.draggables[t.critical.draggable.id],d=t.current.page.borderBoxCenter,p=t.dimensions,m=p.draggables,h=p.droppables;return s?iW({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:l,draggables:m,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,o=e.isOver,i=e.draggables,l=e.droppables,a=e.viewport,s=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,o=e.droppables,i=e.viewport,l=r.subject.active;if(!l)return null;var a=r.axis,s=MV(l[a.start],l[a.end]),c=SV(o).filter((function(e){return e!==r})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return OV(i.frame)(lW(e))})).filter((function(e){var n=lW(e);return t?l[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<l[a.crossAxisStart]})).filter((function(e){var t=lW(e),n=MV(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(l[a.start])||n(l[a.end])})).sort((function(e,n){var r=lW(e)[a.crossAxisStart],o=lW(n)[a.crossAxisStart];return t?r-o:o-r})).filter((function(e,t,n){return lW(e)[a.crossAxisStart]===lW(n[0])[a.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return MV(lW(e)[a.start],lW(e)[a.end])(n[a.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return lW(e)[a.start]-lW(t)[a.start]}))[0]:c.sort((function(e,t){var r=mV(n,gV(lW(e))),o=mV(n,gV(lW(t)));return r!==o?r-o:lW(e)[a.start]-lW(t)[a.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:o,droppables:l,viewport:a});if(!c)return null;var u=TV(c.descriptor.id,i),d=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,o=e.afterCritical,i=e.insideDestination.filter((function(e){return VV({target:sW(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=pV(t,JV(r,aW(e,o))),l=pV(t,JV(r,aW(n,o)));return i<l?-1:l<i?1:e.descriptor.index-n.descriptor.index}));return i[0]||null}({pageBorderBoxCenter:n,viewport:a,destination:c,insideDestination:u,afterCritical:s}),p=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,o=e.draggable,i=e.draggables,l=e.destination,a=e.viewport,s=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:RV,displacedBy:LV,at:{type:"REORDER",destination:{droppableId:l.descriptor.id,index:0}}},u=eW({impact:c,draggable:o,droppable:l,draggables:i,afterCritical:s}),d=AV(o,l)?l:dW(l,o,i);return oW({draggable:o,destination:d,newPageBorderBoxCenter:u,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var p,m=Boolean(t[l.axis.line]<=n.page.borderBox.center[l.axis.line]),h=(p=n.descriptor.index,n.descriptor.id===o.descriptor.id||m?p:p+1);return GV({draggable:o,insideDestination:r,destination:l,viewport:a,displacedBy:cW(l.axis,o.displaceBy),last:RV,index:h})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:i,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:s});if(!p)return null;var m=eW({impact:p,draggable:r,droppable:c,draggables:i,afterCritical:s});return{clientSelection:rW({pageBorderBoxCenter:m,draggable:r,viewport:a}),impact:p,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:l,draggables:m,droppables:h,viewport:t.viewport,afterCritical:t.afterCritical})};function hW(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function fW(e){var t=MV(e.top,e.bottom),n=MV(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var gW=function(e,t){return DH(fV(e,t))};function vW(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var bW=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,o=e.droppables,i=e.previousImpact,l=e.viewport,a=e.afterCritical,s=gW(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,o=SV(r).filter((function(e){if(!e.isEnabled)return!1;var n,r,o=e.subject.active;if(!o)return!1;if(r=o,!((n=t).left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top))return!1;if(fW(o)(t.center))return!0;var i=e.axis,l=o.center[i.crossAxisLine],a=t[i.crossAxisStart],s=t[i.crossAxisEnd],c=MV(o[i.crossAxisStart],o[i.crossAxisEnd]),u=c(a),d=c(s);return!u&&!d||(u?a<l:s>l)}));return o.length?1===o.length?o[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,o=n.map((function(e){var n=e.axis,o=dV(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:pV(r,o)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:n,candidates:o}):null}({pageBorderBox:s,draggable:n,droppables:o});if(!c)return DV;var u=o[c],d=TV(u.descriptor.id,r),p=function(e,t){var n=e.frame;return n?gW(t,n.scroll.diff.value):t}(u,s);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,o=e.destination,i=e.insideDestination,l=e.afterCritical;if(!o.isCombineEnabled)return null;var a=o.axis,s=cW(o.axis,t.displaceBy),c=s.value,u=n[a.start],d=n[a.end],p=xV(PV(t,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox,o=n[a.size]/4,i=qV(t,l),s=vW({displaced:r.displaced,id:t});return i?s?d>n[a.start]+o&&d<n[a.end]-o:u>n[a.start]-c+o&&u<n[a.end]-c-o:s?d>n[a.start]+c+o&&d<n[a.end]+c-o:u>n[a.start]+o&&u<n[a.end]-o}));return p?{displacedBy:s,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:p.descriptor.id,droppableId:o.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:p,draggable:n,previousImpact:i,destination:u,insideDestination:d,afterCritical:a})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.last,l=e.viewport,a=e.afterCritical,s=r.axis,c=cW(r.axis,n.displaceBy),u=c.value,d=t[s.start],p=t[s.end],m=xV(PV(n,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=qV(t,a),o=vW({displaced:i,id:t});return r?o?p<=n:d<n-u:o?p<=n+u:d<n})),h=function(e){var t=e.draggable,n=e.closest;return n?e.inHomeList&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:m,inHomeList:AV(n,r)});return GV({draggable:n,insideDestination:o,destination:r,viewport:l,last:i,displacedBy:c,index:h})}({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:u,insideDestination:d,last:i.displaced,viewport:l,afterCritical:a})},yW=function(e,t){var n;return(0,qz.Z)({},e,((n={})[t.descriptor.id]=t,n))},_W=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,o=e.viewport,i=e.impact,l=e.scrollJumpRequest,a=o||t.viewport,s=r||t.dimensions,c=n||t.current.client.selection,u=sV(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:aV(t.initial.client.borderBoxCenter,u)},p={selection:aV(d.selection,a.scroll.current),borderBoxCenter:aV(d.borderBoxCenter,a.scroll.current),offset:aV(d.offset,a.scroll.diff.value)},m={client:d,page:p};if("COLLECTING"===t.phase)return(0,qz.Z)({phase:"COLLECTING"},t,{dimensions:s,viewport:a,current:m});var h=s.draggables[t.critical.draggable.id],f=i||bW({pageOffset:p.offset,draggable:h,draggables:s.draggables,droppables:s.droppables,previousImpact:t.impact,viewport:a,afterCritical:t.afterCritical}),g=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,o=e.impact,i=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,o=pW(t),i=pW(n);if(!o)return r;if(o===i)return r;var l=r[o];if(!l.subject.withPlaceholder)return r;var a=function(e){var t=e.subject.withPlaceholder;t||JH(!1);var n=e.frame;if(!n){var r=bV({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,qz.Z)({},e,{subject:r})}var o=t.oldFrameMaxScroll;o||JH(!1);var i=uW(n,o),l=bV({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return(0,qz.Z)({},e,{subject:l,frame:i})}(l);return yW(r,a)}({previousImpact:e.previousImpact,impact:o,droppables:r}),l=pW(o);if(!l)return i;var a=r[l];if(AV(t,a))return i;if(a.subject.withPlaceholder)return i;var s=dW(a,t,n);return yW(i,s)}({draggable:h,impact:f,previousImpact:t.impact,draggables:s.draggables,droppables:s.droppables});return(0,qz.Z)({},t,{current:m,dimensions:{draggables:s.draggables,droppables:g},impact:f,viewport:a,scrollJumpRequest:l||null,forceShouldAnimate:!l&&null})},kW=function(e){var t=e.impact,n=e.viewport,r=e.draggables,o=e.destination,i=e.forceShouldAnimate,l=t.displaced,a=function(e,t){return e.map((function(e){return t[e]}))}(l.all,r),s=UV({afterDragging:a,destination:o,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:i,last:l});return(0,qz.Z)({},t,{displaced:s})},xW=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.viewport,l=e.afterCritical,a=eW({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:l});return rW({pageBorderBoxCenter:a,draggable:n,viewport:i})},wW=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&JH(!1);var o=t.impact,i=r||t.viewport,l=n||t.dimensions,a=l.draggables,s=l.droppables,c=a[t.critical.draggable.id],u=pW(o);u||JH(!1);var d=s[u],p=kW({impact:o,viewport:i,destination:d,draggables:a}),m=xW({impact:p,draggable:c,droppable:d,draggables:a,viewport:i,afterCritical:t.afterCritical});return _W({impact:p,clientSelection:m,state:t,dimensions:l,viewport:i})},CW=function(e){var t=e.draggable,n=e.home,r=e.draggables,o=e.viewport,i=cW(n.axis,t.displaceBy),l=TV(n.descriptor.id,r),a=l.indexOf(t);-1===a&&JH(!1);var s,c=l.slice(a+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),d={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:i,effected:u};return{impact:{displaced:UV({afterDragging:c,destination:n,displacedBy:i,last:null,viewport:o.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(s=t.descriptor,{index:s.index,droppableId:s.droppableId})}},afterCritical:d}},EW=function(e){return"SNAP"===e.movementMode},SW=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:yW(e.droppables,t)}}(e.dimensions,t);return!EW(e)||n?_W({state:e,dimensions:r}):wW({state:e,dimensions:r})};function IW(e){return e.isDragging&&"SNAP"===e.movementMode?(0,qz.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var TW={phase:"IDLE",completed:null,shouldFlush:!1},NW=function(e,t){if(void 0===e&&(e=TW),"FLUSH"===t.type)return(0,qz.Z)({},TW,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&JH(!1);var n=t.payload,r=n.critical,o=n.clientSelection,i=n.viewport,l=n.dimensions,a=n.movementMode,s=l.draggables[r.draggable.id],c=l.droppables[r.droppable.id],u={selection:o,borderBoxCenter:s.client.borderBox.center,offset:lV},d={client:u,page:{selection:aV(u.selection,i.scroll.initial),borderBoxCenter:aV(u.selection,i.scroll.initial),offset:aV(u.selection,i.scroll.diff.value)}},p=SV(l.droppables).every((function(e){return!e.isFixedOnPage})),m=CW({draggable:s,home:c,draggables:l.draggables,viewport:i}),h=m.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:a,dimensions:l,initial:d,current:d,isWindowScrollAllowed:p,impact:h,afterCritical:m.afterCritical,onLiftImpact:h,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&JH(!1),(0,qz.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&JH(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return yV(n,e.scroll)})),o=(0,qz.Z)({},t.dimensions.droppables,{},CV(r)),i=EV(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,o=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,i=function(e){var t=e.frame;return t||JH(!1),t}(n[t]),l=i.scroll.diff.value,a=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,o=zH(t.client,n),i=HH(o,r);return(0,qz.Z)({},t,{placeholder:(0,qz.Z)({},t.placeholder,{client:o}),client:o,page:i})}({draggable:e,offset:aV(o,l),initialWindowScroll:r.scroll.initial});return a}))}({additions:n.additions,updatedDroppables:o,viewport:t.viewport})),l=(0,qz.Z)({},t.dimensions.draggables,{},i);n.removals.forEach((function(e){delete l[e]}));var a={droppables:o,draggables:l},s=pW(t.impact),c=s?a.droppables[s]:null,u=a.draggables[t.critical.draggable.id],d=a.droppables[t.critical.droppable.id],p=CW({draggable:u,home:d,draggables:l,viewport:t.viewport}),m=p.impact,h=p.afterCritical,f=c&&c.isCombineEnabled?t.impact:m,g=bW({pageOffset:t.current.page.offset,draggable:a.draggables[t.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:f,viewport:t.viewport,afterCritical:h}),v=(0,qz.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:g,onLiftImpact:m,dimensions:a,afterCritical:h,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:(0,qz.Z)({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;hW(e)||JH(!1);var f=t.payload.client;return cV(f,e.current.client.selection)?e:_W({state:e,clientSelection:f,impact:EW(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return IW(e);if("COLLECTING"===e.phase)return IW(e);hW(e)||JH(!1);var g=t.payload,v=g.id,b=g.newScroll,y=e.dimensions.droppables[v];if(!y)return e;var _=yV(y,b);return SW(e,_,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;hW(e)||JH(!1);var k=t.payload,x=k.id,w=k.isEnabled,C=e.dimensions.droppables[x];C||JH(!1),C.isEnabled===w&&JH(!1);var E=(0,qz.Z)({},C,{isEnabled:w});return SW(e,E,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;hW(e)||JH(!1);var S=t.payload,I=S.id,T=S.isCombineEnabled,N=e.dimensions.droppables[I];N||JH(!1),N.isCombineEnabled===T&&JH(!1);var B=(0,qz.Z)({},N,{isCombineEnabled:T});return SW(e,B,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;hW(e)||JH(!1),e.isWindowScrollAllowed||JH(!1);var P=t.payload.newScroll;if(cV(e.viewport.scroll.current,P))return IW(e);var A=tW(e.viewport,P);return EW(e)?wW({state:e,viewport:A}):_W({state:e,viewport:A})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!hW(e))return e;var L=t.payload.maxScroll;if(cV(L,e.viewport.scroll.max))return e;var R=(0,qz.Z)({},e.viewport,{scroll:(0,qz.Z)({},e.viewport.scroll,{max:L})});return(0,qz.Z)({phase:"DRAGGING"},e,{viewport:R})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&JH(!1);var D=mW({state:e,type:t.type});return D?_W({state:e,impact:D.impact,clientSelection:D.clientSelection,scrollJumpRequest:D.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var M=t.payload.reason;return"COLLECTING"!==e.phase&&JH(!1),(0,qz.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:M})}if("DROP_ANIMATE"===t.type){var O=t.payload,F=O.completed,Z=O.dropDuration,j=O.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&JH(!1),{phase:"DROP_ANIMATING",completed:F,dropDuration:Z,newHomeClientOffset:j,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},BW=function(e){return{type:"LIFT",payload:e}},PW=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},AW=function(){return{type:"COLLECTION_STARTING",payload:null}},LW=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},RW=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},DW=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},MW=function(e){return{type:"MOVE",payload:e}},OW=function(){return{type:"MOVE_UP",payload:null}},FW=function(){return{type:"MOVE_DOWN",payload:null}},ZW=function(){return{type:"MOVE_RIGHT",payload:null}},jW=function(){return{type:"MOVE_LEFT",payload:null}},zW=function(){return{type:"FLUSH",payload:null}},HW=function(e){return{type:"DROP_COMPLETE",payload:e}},VW=function(e){return{type:"DROP",payload:e}},WW="cubic-bezier(.2,1,.1,1)",UW=0,$W=.7,GW=.75,qW="0.2s cubic-bezier(0.2, 0, 0, 1)",KW={fluid:"opacity "+qW,snap:"transform "+qW+", opacity "+qW,drop:function(e){var t=e+"s "+WW;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+qW,placeholder:"height "+qW+", width "+qW+", margin "+qW},YW=function(e){return cV(e,lV)?null:"translate("+e.x+"px, "+e.y+"px)"},XW=YW,QW=function(e,t){var n=YW(e);return n?t?n+" scale("+GW+")":n:null},JW=.33,eU=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var o=t(),i=r.payload.reason;if("COLLECTING"!==o.phase){if("IDLE"!==o.phase){"DROP_PENDING"===o.phase&&o.isWaiting&&JH(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&JH(!1);var l=o.critical,a=o.dimensions,s=a.draggables[o.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,o=e.home,i=e.viewport,l=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,qz.Z)({},r,{displaced:RV}),didDropInsideDroppable:!0}:{impact:kW({draggables:t,impact:l,destination:o,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=c.impact,d=c.didDropInsideDroppable,p=d?NV(u):null,m=d?BV(u):null,h={index:l.draggable.index,droppableId:l.droppable.id},f={draggableId:s.descriptor.id,type:s.descriptor.type,source:h,reason:i,mode:o.movementMode,destination:p,combine:m},g=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,o=e.viewport,i=e.afterCritical,l=r.draggables,a=r.droppables,s=pW(t),c=s?a[s]:null,u=a[n.descriptor.droppableId],d=xW({impact:t,draggable:n,draggables:l,afterCritical:i,droppable:c||u,viewport:o});return sV(d,n.client.borderBox.center)}({impact:u,draggable:s,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),v={critical:o.critical,afterCritical:o.afterCritical,result:f,impact:u};if(!cV(o.current.client.offset,g)||Boolean(f.combine)){var b=function(e){var t=e.reason,n=pV(e.current,e.destination);if(n<=0)return JW;if(n>=1500)return.55;var r=JW+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:o.current.client.offset,destination:g,reason:i});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:g,dropDuration:b,completed:v}})}else n(HW({completed:v}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:i}))}else e(r)}}},tU=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var nU=function(e){var t=function(e){var t=e.onWindowScroll,n=$H((function(){t(tU())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(n),o=qH;function i(){return o!==qH}return{start:function(){i()&&JH(!1),o=KH(window,[r])},stop:function(){i()||JH(!1),n.cancel(),o(),o=qH},isActive:i}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},rU=function(e,t){t()},oU=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},iU=function(e,t,n,r){if(e){var o=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),o=function(o){t||n||(t=!0,e(o),clearTimeout(r))};return o.wasCalled=function(){return t},o}(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}else n(r(t))},lU=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=kV(n,(function(t){return t.timerId===e}));-1===t&&JH(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),o=null,i=function(n){o||JH(!1),o=null,rU(0,(function(){return iU(e().onDragEnd,n,t,iV.onDragEnd)}))};return{beforeCapture:function(t,n){o&&JH(!1),rU(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){o&&JH(!1),rU(0,(function(){var r=e().onBeforeDragStart;r&&r(oU(t,n))}))},start:function(n,i){o&&JH(!1);var l=oU(n,i);o={mode:i,lastCritical:n,lastLocation:l.source,lastCombine:null},r.add((function(){rU(0,(function(){return iU(e().onDragStart,l,t,iV.onDragStart)}))}))},update:function(n,i){var l=NV(i),a=BV(i);o||JH(!1);var s=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,o.lastCritical);s&&(o.lastCritical=n);var c,u,d=(u=l,!(null==(c=o.lastLocation)&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(o.lastLocation=l);var p=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(o.lastCombine,a);if(p&&(o.lastCombine=a),s||d||p){var m=(0,qz.Z)({},oU(n,o.mode),{combine:a,destination:l});r.add((function(){rU(0,(function(){return iU(e().onDragUpdate,m,t,iV.onDragUpdate)}))}))}},flush:function(){o||JH(!1),r.flush()},drop:i,abort:function(){if(o){var e=(0,qz.Z)({},oU(o.lastCritical,o.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var o=r.payload.critical;return n.beforeStart(o,r.payload.movementMode),t(r),void n.start(o,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var i=r.payload.completed.result;return n.flush(),t(r),void n.drop(i)}if(t(r),"FLUSH"!==r.type){var l=e.getState();"DRAGGING"===l.phase&&n.update(l.critical,l.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},aU=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&JH(!1),e.dispatch(HW({completed:r.completed}))}else t(n)}}},sU=function(e){var t=null,n=null;return function(r){return function(o){if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),"DROP_ANIMATE"===o.type){var i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=KH(window,[i])}))}}}},cU=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(VW({reason:r.reason})))}}}},uU=Kz.qC,dU=function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,o=e.styleMarshal,i=e.getResponders,l=e.announce,a=e.autoScroller;return(0,Kz.MT)(NW,uU((0,Kz.md)((t=o,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(o){if("LIFT"===o.type){var i=o.payload,l=i.id,a=i.clientSelection,s=i.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(HW({completed:c.completed})),"IDLE"!==n().phase&&JH(!1),r(zW()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:l,movementMode:s}});var u={draggableId:l,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},d=e.startPublishing(u),p=d.critical,m=d.dimensions,h=d.viewport;r({type:"INITIAL_PUBLISH",payload:{critical:p,dimensions:m,clientSelection:a,movementMode:s,viewport:h}})}else t(o)}}}}(n),eU,aU,sU,cU,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var o=t.getState();return"DRAGGING"!==o.phase&&JH(!1),void e.start(o)}n(r),e.scroll(t.getState())}}}}(a),nU,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(r),lU(i,l))))},pU=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,o=e.width,i=sV({x:n,y:t},{x:o,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},mU=function(){var e=document.documentElement;return e||JH(!1),e},hU=function(){var e=mU();return pU({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function fU(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var gU,vU,bU=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},o=null,i=function(){o||(n.collectionStarting(),o=requestAnimationFrame((function(){o=null;var e=r,i=e.additions,l=e.removals,a=e.modified,s=Object.keys(i).map((function(e){return t.draggable.getById(e).getDimension(lV)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(a).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:s,removals:Object.keys(l),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],i()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],i()},stop:function(){o&&(cancelAnimationFrame(o),o=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=function(t){n||JH(!1);var o=n.critical.draggable;"ADDITION"===t.type&&fU(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&fU(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:function(r,o){e.droppable.exists(r)||JH(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:function(r,o){n&&(e.droppable.exists(r)||JH(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,o){n&&(e.droppable.exists(r)||JH(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:function(t){n&&JH(!1);var r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),l={draggable:r.descriptor,droppable:i.descriptor},a=e.subscribe(o);return n={critical:l,unsubscribe:a},function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,o=function(){var e=tU(),t=hU(),n=e.y,r=e.x,o=mU(),i=o.clientWidth,l=o.clientHeight;return{frame:DH({top:n,left:r,right:r+i,bottom:n+l}),scroll:{initial:e,current:e,max:t,diff:{value:lV,displacement:lV}}}}(),i=o.scroll.current,l=t.droppable,a=r.droppable.getAllByType(l.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(i,n)})),s=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(i)}));return{dimensions:{draggables:EV(s),droppables:CV(a)},critical:t,viewport:o}}({critical:l,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return i},yU=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},_U=function(e){window.scrollBy(e.x,e.y)},kU=(0,UH.Z)((function(e){return SV(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),xU=function(e){return Math.pow(e,2)},wU=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,o=n-t;return 0===o?0:(r-t)/o},CU=360,EU=1200,SU=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,o=e.shouldUseTimeDampening,i=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=wU({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*xU(1-n);return Math.ceil(r)}(t,n);return 0===i?0:o?Math.max(function(e,t){var n=t,r=EU,o=Date.now()-n;if(o>=EU)return e;if(o<CU)return 1;var i=wU({startOfRange:CU,endOfRange:r,current:o}),l=e*xU(i);return Math.ceil(l)}(i,r),1):i},IU=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,o=e.axis,i=e.shouldUseTimeDampening,l=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,o);return n[o.end]<n[o.start]?SU({distanceToEdge:n[o.end],thresholds:l,dragStartTime:r,shouldUseTimeDampening:i}):-1*SU({distanceToEdge:n[o.start],thresholds:l,dragStartTime:r,shouldUseTimeDampening:i})},TU=hV((function(e){return 0===e?0:e})),NU=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,o=e.center,i=e.shouldUseTimeDampening,l={top:o.y-n.top,right:n.right-o.x,bottom:n.bottom-o.y,left:o.x-n.left},a=IU({container:n,distanceToEdges:l,dragStartTime:t,axis:ZV,shouldUseTimeDampening:i}),s=IU({container:n,distanceToEdges:l,dragStartTime:t,axis:jV,shouldUseTimeDampening:i}),c=TU({x:s,y:a});if(cV(c,lV))return null;var u=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,o=n.height>t.height,i=n.width>t.width;return i||o?i&&o?null:{x:i?0:r.x,y:o?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?cV(u,lV)?null:u:null},BU=hV((function(e){return 0===e?0:e>0?1:-1})),PU=(gU=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,o=aV(t,r),i={x:gU(o.x,n.x),y:gU(o.y,n.y)};return cV(i,lV)?null:i}),AU=function(e){var t=e.max,n=e.current,r=e.change,o={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},i=BU(r),l=PU({max:o,current:n,change:i});return!l||0!==i.x&&0===l.x||0!==i.y&&0===l.y},LU=function(e,t){return AU({current:e.scroll.current,max:e.scroll.max,change:t})},RU=function(e,t){var n=e.frame;return!!n&&AU({current:n.scroll.current,max:n.scroll.max,change:t})},DU=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,o=e.scrollWindow,i=e.scrollDroppable,l=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var s=function(e){var t=e.viewport,n=e.subject,r=e.center,o=e.shouldUseTimeDampening,i=NU({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return i&&LU(t,i)?i:null}({dragStartTime:n,viewport:t.viewport,subject:a,center:l,shouldUseTimeDampening:r});if(s)return void o(s)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var o=r[n];return o.frame?o:null}var i=function(e,t){var n=xV(kU(t),(function(t){return t.frame||JH(!1),fW(t.frame.pageMarginBox)(e)}));return n}(t,r);return i}({center:l,destination:pW(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,o=e.dragStartTime,i=e.shouldUseTimeDampening,l=t.frame;if(!l)return null;var a=NU({dragStartTime:o,container:l.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:i});return a&&RU(t,a)?a:null}({dragStartTime:n,droppable:c,subject:a,center:l,shouldUseTimeDampening:r});u&&i(c.descriptor.id,u)}},MU=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var o=e.scrollJumpRequest;if(o){var i=pW(e.impact);i||JH(!1);var l=function(e,t){if(!RU(e,t))return t;var r=function(e,t){var n=e.frame;return n&&RU(e,t)?PU({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var o=sV(t,r);return n(e.descriptor.id,o),sV(t,o)}(e.dimensions.droppables[i],o);if(l){var a=e.viewport,s=function(e,t,n){if(!e)return n;if(!LU(t,n))return n;var o=function(e,t){if(!LU(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return PU({current:r,max:n,change:t})}(t,n);if(!o)return r(n),null;var i=sV(n,o);return r(i),sV(n,i)}(e.isWindowScrollAllowed,a,l);s&&function(e,n){var r=aV(e.current.client.selection,n);t({client:r})}(e,s)}}}},OU=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,o=function(e){var t=e.scrollDroppable,n=$H(e.scrollWindow),r=$H(t),o=null,i=function(e){o||JH(!1);var t=o,i=t.shouldUseTimeDampening,l=t.dragStartTime;DU({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:l,shouldUseTimeDampening:i})};return{start:function(e){o&&JH(!1);var t=Date.now(),n=!1,r=function(){n=!0};DU({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),o={dragStartTime:t,shouldUseTimeDampening:n},n&&i(e)},stop:function(){o&&(n.cancel(),r.cancel(),o=null)},scroll:i}}({scrollWindow:n,scrollDroppable:t}),i=MU({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}},FU="data-rbd",ZU={base:vU=FU+"-drag-handle",draggableId:vU+"-draggable-id",contextId:vU+"-context-id"},jU=function(){var e=FU+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),zU=function(){var e=FU+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),HU={contextId:FU+"-scroll-container-context-id"},VU=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},WU=function(e){var t,n,r=function(e){return function(t){return"["+t+'="'+e+'"]'}}(e),o=(t="\n      cursor: -webkit-grab;\n      cursor: grab;\n    ",{selector:r(ZU.contextId),styles:{always:"\n          -webkit-touch-callout: none;\n          -webkit-tap-highlight-color: rgba(0,0,0,0);\n          touch-action: manipulation;\n        ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),i=[(n="\n      transition: "+KW.outOfTheWay+";\n    ",{selector:r(jU.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),o,{selector:r(zU.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n        user-select: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        overflow-anchor: none;\n      "}}];return{always:VU(i,"always"),resting:VU(i,"resting"),dragging:VU(i,"dragging"),dropAnimating:VU(i,"dropAnimating"),userCancel:VU(i,"userCancel")}},UU="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?b.useLayoutEffect:b.useEffect,$U=function(){var e=document.querySelector("head");return e||JH(!1),e},GU=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},qU=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function KU(e){return e instanceof qU(e).HTMLElement}function YU(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}var o={register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||JH(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return _V(e.draggables).filter((function(e){return e.descriptor.type===t}))}};function i(t){return e.droppables[t]||null}var l={register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||JH(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return _V(e.droppables).filter((function(e){return e.descriptor.type===t}))}};return{draggable:o,droppable:l,subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var XU=b.createContext(null),QU=function(){var e=document.body;return e||JH(!1),e},JU={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},e$=function(e){return"rbd-announcement-"+e},t$=0,n$={separator:"::"};function r$(e,t){return void 0===t&&(t=n$),(0,LH.Ye)((function(){return""+e+t.separator+t$++}),[t.separator,e])}var o$=b.createContext(null);function i$(e){var t=(0,b.useRef)(e);return(0,b.useEffect)((function(){t.current=e})),t}var l$,a$,s$=27,c$=((l$={})[13]=!0,l$[9]=!0,l$),u$=function(e){c$[e.keyCode]&&e.preventDefault()},d$=function(){var e="visibilitychange";return"undefined"==typeof document?e:xV([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),p$={type:"IDLE"};function m$(){}var h$=((a$={})[34]=!0,a$[33]=!0,a$[36]=!0,a$[35]=!0,a$);var f$={type:"IDLE"},g$={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function v$(e,t){if(null==t)return!1;if(Boolean(g$[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&v$(e,t.parentElement)}function b$(e,t){var n=t.target;return!!KU(n)&&v$(e,n)}var y$=function(e){return DH(e.getBoundingClientRect()).center},_$=function(){var e="matches";return"undefined"==typeof document?e:xV([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function k$(e,t){return null==e?null:e[_$](t)?e:k$(e.parentElement,t)}function x$(e,t){return e.closest?e.closest(t):k$(e,t)}function w$(e){e.preventDefault()}function C$(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function E$(e){var t=e.lockAPI,n=e.store,r=e.registry,o=e.draggableId;if(t.isClaimed())return!1;var i=r.draggable.findById(o);return!!i&&!!i.options.isEnabled&&!!yU(n.getState(),o)}var S$=[function(e){var t=(0,b.useRef)(p$),n=(0,b.useRef)(qH),r=(0,LH.Ye)((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,l,{sourceEvent:t});if(o){t.preventDefault();var i={x:t.clientX,y:t.clientY};n.current(),c(o,i)}}}}}}),[e]),o=(0,LH.Ye)((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),i=(0,LH.I4)((function(){n.current=KH(window,[o,r],{passive:!1,capture:!0})}),[o,r]),l=(0,LH.I4)((function(){"IDLE"!==t.current.type&&(t.current=p$,n.current(),i())}),[i]),a=(0,LH.I4)((function(){var e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),s=(0,LH.I4)((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,o=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,i=e.clientY;if(0===t){var l={x:n,y:i},a=r();if("DRAGGING"===a.type)return e.preventDefault(),void a.actions.move(l);if("PENDING"!==a.type&&JH(!1),s=a.point,c=l,Math.abs(c.x-s.x)>=5||Math.abs(c.y-s.y)>=5){var s,c;e.preventDefault();var u=a.actions.fluidLift(l);o({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return e.keyCode===s$?(e.preventDefault(),void t()):void u$(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&JH(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:d$,fn:t}]}({cancel:a,completed:l,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=KH(window,e,{capture:!0,passive:!1})}),[a,l]),c=(0,LH.I4)((function(e,n){"IDLE"!==t.current.type&&JH(!1),t.current={type:"PENDING",point:n,actions:e},s()}),[s]);UU((function(){return i(),function(){n.current()}}),[i])},function(e){var t=(0,b.useRef)(m$),n=(0,LH.Ye)((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var o=e.findClosestDraggableId(n);if(o){var i=e.tryGetLock(o,s,{sourceEvent:n});if(i){n.preventDefault();var l=!0,a=i.snapLift();t.current(),t.current=KH(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return r.keyCode===s$?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(h$[r.keyCode]?r.preventDefault():u$(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:d$,fn:n}]}(a,s),{capture:!0,passive:!1})}}}function s(){l||JH(!1),l=!1,t.current(),r()}}}}),[e]),r=(0,LH.I4)((function(){t.current=KH(window,[n],{passive:!1,capture:!0})}),[n]);UU((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,b.useRef)(f$),n=(0,b.useRef)(qH),r=(0,LH.I4)((function(){return t.current}),[]),o=(0,LH.I4)((function(e){t.current=e}),[]),i=(0,LH.Ye)((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,a,{sourceEvent:t});if(o){var i=t.touches[0],l={x:i.clientX,y:i.clientY};n.current(),d(o,l)}}}}}}),[e]),l=(0,LH.I4)((function(){n.current=KH(window,[i],{capture:!0,passive:!1})}),[i]),a=(0,LH.I4)((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(f$),n.current(),l())}),[l,o]),s=(0,LH.I4)((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),c=(0,LH.I4)((function(){var e={capture:!0,passive:!1},t={cancel:s,completed:a,getPhase:r},o=KH(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var o=e.touches[0],i={x:o.clientX,y:o.clientY};e.preventDefault(),n.actions.move(i)}else t()}},{eventName:"touchend",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&JH(!1);var o=e.touches[0];if(o&&o.force>=.15){var i=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return i?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();i&&t()}}},{eventName:d$,fn:t}]}(t),e),i=KH(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(e.keyCode===s$&&e.preventDefault(),t()):t()}},{eventName:d$,fn:t}]}(t),e);n.current=function(){o(),i()}}),[s,r,a]),u=(0,LH.I4)((function(){var e=r();"PENDING"!==e.type&&JH(!1);var t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,o]),d=(0,LH.I4)((function(e,t){"IDLE"!==r().type&&JH(!1);var n=setTimeout(u,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,o,u]);UU((function(){return l(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(f$))}}),[r,l,o]),UU((function(){return KH(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function I$(e){var t=e.contextId,n=e.store,r=e.registry,o=e.customSensors,i=e.enableDefaultSensors,l=[].concat(i?S$:[],o||[]),a=(0,b.useState)((function(){return function(){var e=null;function t(){e||JH(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&JH(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],s=(0,LH.I4)((function(e,t){e.isDragging&&!t.isDragging&&a.tryAbandon()}),[a]);UU((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();s(e,t),e=t}))}),[a,n,s]),UU((function(){return a.tryAbandon}),[a.tryAbandon]);for(var c=(0,LH.I4)((function(e){return E$({lockAPI:a,registry:r,store:n,draggableId:e})}),[a,r,n]),u=(0,LH.I4)((function(e,o,i){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,o=e.registry,i=e.draggableId,l=e.forceSensorStop,a=e.sourceEvent;if(!E$({lockAPI:t,store:r,registry:o,draggableId:i}))return null;var s=o.draggable.getById(i),c=function(e,t){var n="["+jU.contextId+'="'+e+'"]',r=xV(wV(document.querySelectorAll(n)),(function(e){return e.getAttribute(jU.id)===t}));return r&&KU(r)?r:null}(n,s.descriptor.id);if(!c)return null;if(a&&!s.options.canDragInteractiveElements&&b$(c,a))return null;var u=t.claim(l||qH),d="PRE_DRAG";function p(){return s.options.shouldRespectForcePress}function m(){return t.isActive(u)}var h=function(e,t){C$({expected:e,phase:d,isLockActive:m,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function f(e){function n(){t.release(),d="COMPLETED"}function o(t,o){if(void 0===o&&(o={shouldBlockNextClick:!1}),e.cleanup(),o.shouldBlockNextClick){var i=KH(window,[{eventName:"click",fn:w$,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(i)}n(),r.dispatch(VW({reason:t}))}return"PRE_DRAG"!==d&&(n(),"PRE_DRAG"!==d&&JH(!1)),r.dispatch(BW(e.liftActionArgs)),d="DRAGGING",(0,qz.Z)({isActive:function(){return C$({expected:"DRAGGING",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(e){return o("DROP",e)},cancel:function(e){return o("CANCEL",e)}},e.actions)}var g={isActive:function(){return C$({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=$H((function(e){h((function(){return MW({client:e})}))})),n=f({liftActionArgs:{id:i,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,qz.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return h(OW)},moveRight:function(){return h(ZW)},moveDown:function(){return h(FW)},moveLeft:function(){return h(jW)}};return f({liftActionArgs:{id:i,clientSelection:y$(c),movementMode:"SNAP"},cleanup:qH,actions:e})},abort:function(){C$({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!0})&&t.release()}};return g}({lockAPI:a,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})}),[t,a,r,n]),d=(0,LH.I4)((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof qU(n).Element))return null;var o=function(e){return"["+ZU.contextId+'="'+e+'"]'}(e),i=x$(r,o);return i&&KU(i)?i:null}(e,t);return n?n.getAttribute(ZU.draggableId):null}(t,e)}),[t]),p=(0,LH.I4)((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),m=(0,LH.I4)((function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch(zW()))}),[a,n]),h=(0,LH.I4)(a.isClaimed,[a]),f=(0,LH.Ye)((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:m,isLockClaimed:h}}),[c,u,d,p,m,h]),g=0;g<l.length;g++)l[g](f)}var T$=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function N$(e){return e.current||JH(!1),e.current}function B$(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,o=e.nonce,i=e.dragHandleUsageInstructions,l=(0,b.useRef)(null),a=i$(e),s=(0,LH.I4)((function(){return T$(a.current)}),[a]),c=function(e){var t=(0,LH.Ye)((function(){return e$(e)}),[e]),n=(0,b.useRef)(null);return(0,b.useEffect)((function(){var e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,qz.Z)(e.style,JU),QU().appendChild(e),function(){setTimeout((function(){var t=QU();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),(0,LH.I4)((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,n=e.text,r=r$("hidden-text",{separator:"-"}),o=(0,LH.Ye)((function(){return function(e){return"rbd-hidden-text-"+e.contextId+"-"+e.uniqueId}({contextId:t,uniqueId:r})}),[r,t]);return(0,b.useEffect)((function(){var e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",QU().appendChild(e),function(){var t=QU();t.contains(e)&&t.removeChild(e)}}),[o,n]),o}({contextId:t,text:i}),d=function(e,t){var n=(0,LH.Ye)((function(){return WU(e)}),[e]),r=(0,b.useRef)(null),o=(0,b.useRef)(null),i=(0,LH.I4)((0,UH.Z)((function(e){var t=o.current;t||JH(!1),t.textContent=e})),[]),l=(0,LH.I4)((function(e){var t=r.current;t||JH(!1),t.textContent=e}),[]);UU((function(){(r.current||o.current)&&JH(!1);var a=GU(t),s=GU(t);return r.current=a,o.current=s,a.setAttribute(FU+"-always",e),s.setAttribute(FU+"-dynamic",e),$U().appendChild(a),$U().appendChild(s),l(n.always),i(n.resting),function(){var e=function(e){var t=e.current;t||JH(!1),$U().removeChild(t),e.current=null};e(r),e(o)}}),[t,l,i,n.always,n.resting,e]);var a=(0,LH.I4)((function(){return i(n.dragging)}),[i,n.dragging]),s=(0,LH.I4)((function(e){i("DROP"!==e?n.userCancel:n.dropAnimating)}),[i,n.dropAnimating,n.userCancel]),c=(0,LH.I4)((function(){o.current&&i(n.resting)}),[i,n.resting]);return(0,LH.Ye)((function(){return{dragging:a,dropping:s,resting:c}}),[a,s,c])}(t,o),p=(0,LH.I4)((function(e){N$(l).dispatch(e)}),[]),m=(0,LH.Ye)((function(){return(0,Kz.DE)({publishWhileDragging:PW,updateDroppableScroll:LW,updateDroppableIsEnabled:RW,updateDroppableIsCombineEnabled:DW,collectionStarting:AW},p)}),[p]),h=function(){var e=(0,LH.Ye)(YU,[]);return(0,b.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),f=(0,LH.Ye)((function(){return bU(h,m)}),[h,m]),g=(0,LH.Ye)((function(){return OU((0,qz.Z)({scrollWindow:_U,scrollDroppable:f.scrollDroppable},(0,Kz.DE)({move:MW},p)))}),[f.scrollDroppable,p]),v=function(e){var t=(0,b.useRef)({}),n=(0,b.useRef)(null),r=(0,b.useRef)(null),o=(0,b.useRef)(!1),i=(0,LH.I4)((function(e,n){var r={id:e,focus:n};return t.current[e]=r,function(){var n=t.current;n[e]!==r&&delete n[e]}}),[]),l=(0,LH.I4)((function(t){var n=function(e,t){var n="["+ZU.contextId+'="'+e+'"]',r=wV(document.querySelectorAll(n));if(!r.length)return null;var o=xV(r,(function(e){return e.getAttribute(ZU.draggableId)===t}));return o&&KU(o)?o:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),a=(0,LH.I4)((function(e,t){n.current===e&&(n.current=t)}),[]),s=(0,LH.I4)((function(){r.current||o.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&l(e)})))}),[l]),c=(0,LH.I4)((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(ZU.draggableId)===e&&(n.current=e)}),[]);return UU((function(){return o.current=!0,function(){o.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),(0,LH.Ye)((function(){return{register:i,tryRecordFocus:c,tryRestoreFocusRecorded:s,tryShiftRecord:a}}),[i,c,s,a])}(t),y=(0,LH.Ye)((function(){return dU({announce:c,autoScroller:g,dimensionMarshal:f,focusMarshal:v,getResponders:s,styleMarshal:d})}),[c,g,f,v,s,d]);l.current=y;var _=(0,LH.I4)((function(){var e=N$(l);"IDLE"!==e.getState().phase&&e.dispatch(zW())}),[]),k=(0,LH.I4)((function(){var e=N$(l).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n((0,LH.Ye)((function(){return{isDragging:k,tryAbort:_}}),[k,_]));var x=(0,LH.I4)((function(e){return yU(N$(l).getState(),e)}),[]),w=(0,LH.I4)((function(){return hW(N$(l).getState())}),[]),C=(0,LH.Ye)((function(){return{marshal:f,focus:v,contextId:t,canLift:x,isMovementAllowed:w,dragHandleUsageInstructionsId:u,registry:h}}),[t,f,u,v,x,w,h]);return I$({contextId:t,store:y,registry:h,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,b.useEffect)((function(){return _}),[_]),b.createElement(o$.Provider,{value:C},b.createElement(tH,{context:XU,store:y},e.children))}var P$=0;function A$(e){var t=(0,LH.Ye)((function(){return""+P$++}),[]),n=e.dragHandleUsageInstructions||iV.dragHandleUsageInstructions;return b.createElement(eV,null,(function(r){return b.createElement(B$,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))}var L$=function(e){return function(t){return e===t}},R$=L$("scroll"),D$=L$("auto"),M$=(L$("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),O$=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return M$(n,R$)||M$(n,D$)}(t)?t:e(t.parentElement)},F$=function(e){return{x:e.scrollLeft,y:e.scrollTop}},Z$=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},j$={passive:!1},z$={passive:!0},H$=function(e){return e.shouldPublishImmediately?j$:z$};function V$(e){var t=(0,b.useContext)(e);return t||JH(!1),t}var W$=function(e){return e&&e.env.closestScrollable||null};function U$(){}var $$={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},G$=b.memo((function(e){var t=(0,b.useRef)(null),n=(0,LH.I4)((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,o=e.onTransitionEnd,i=e.onClose,l=e.contextId,a=(0,b.useState)("open"===e.animate),s=a[0],c=a[1];(0,b.useEffect)((function(){return s?"open"!==r?(n(),c(!1),U$):t.current?U$:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):U$}),[r,s,n]);var u=(0,LH.I4)((function(e){"height"===e.propertyName&&(o(),"close"===r&&i())}),[r,i,o]),d=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,o=function(e){var t=e.placeholder;return e.isAnimatingOpenOnMount||"close"===e.animate?$$:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}}({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:o.width,height:o.height,marginTop:o.margin.top,marginRight:o.margin.right,marginBottom:o.margin.bottom,marginLeft:o.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?KW.placeholder:null}}({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return b.createElement(e.placeholder.tagName,{style:d,"data-rbd-placeholder-context-id":l,onTransitionEnd:u,ref:e.innerRef})})),q$=b.createContext(null),K$=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return(0,Gz.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(b.PureComponent),Y$=5e3,X$=4500,Q$=function(e,t){return t?KW.drop(t.duration):e?KW.snap:KW.fluid},J$=function(e,t){return e?t?UW:$W:null};function eG(e){e.preventDefault()}var tG=function(e,t){return e===t},nG=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function rG(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var oG={mapped:{type:"SECONDARY",offset:lV,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:rG(null)}},iG=PH((function(){var e,t,n,r=(e=(0,UH.Z)((function(e,t){return{x:e,y:t}})),t=(0,UH.Z)((function(e,t,n,r,o){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}})),n=(0,UH.Z)((function(e,n,r,o,i,l,a){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:l,mode:n,offset:e,dimension:r,forceShouldAnimate:a,snapshot:t(n,o,i,l,null)}}})),function(r,o){if(r.isDragging){if(r.critical.draggable.id!==o.draggableId)return null;var i=r.current.client.offset,l=r.dimensions.draggables[o.draggableId],a=pW(r.impact),s=(u=r.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(i.x,i.y),r.movementMode,l,o.isClone,a,s,c)}var u;if("DROP_ANIMATING"===r.phase){var d=r.completed;if(d.result.draggableId!==o.draggableId)return null;var p=o.isClone,m=r.dimensions.draggables[o.draggableId],h=d.result,f=h.mode,g=nG(h),v=function(e){return e.combine?e.combine.draggableId:null}(h),b={duration:r.dropDuration,curve:WW,moveTo:r.newHomeClientOffset,opacity:v?UW:null,scale:v?GW:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:m,dropping:b,draggingOver:g,combineWith:v,mode:f,forceShouldAnimate:null,snapshot:t(f,p,g,v,b)}}}return null}),o=function(){var e=(0,UH.Z)((function(e,t){return{x:e,y:t}})),t=(0,UH.Z)(rG),n=(0,UH.Z)((function(e,n,r){return void 0===n&&(n=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}})),r=function(e){return e?n(lV,e,!0):null},o=function(t,o,i,l){var a=i.displaced.visible[t],s=Boolean(l.inVirtualList&&l.effected[t]),c=BV(i),u=c&&c.draggableId===t?o:null;if(!a){if(!s)return r(u);if(i.displaced.invisible[t])return null;var d=uV(l.displacedBy.point),p=e(d.x,d.y);return n(p,u,!0)}if(s)return r(u);var m=i.displacedBy.point,h=e(m.x,m.y);return n(h,u,a.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return function(e,t){return r(e,t)||o(e,t)||oG}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:XU,pure:!0,areStatePropsEqual:tG})((function(e){var t=(0,b.useRef)(null),n=(0,LH.I4)((function(e){t.current=e}),[]),r=(0,LH.I4)((function(){return t.current}),[]),o=V$(o$),i=o.contextId,l=o.dragHandleUsageInstructionsId,a=o.registry,s=V$(q$),c=s.type,u=s.droppableId,d=(0,LH.Ye)((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),p=e.children,m=e.draggableId,h=e.isEnabled,f=e.shouldRespectForcePress,g=e.canDragInteractiveElements,v=e.isClone,y=e.mapped,_=e.dropAnimationFinished;v||function(e){var t=r$("draggable"),n=e.descriptor,r=e.registry,o=e.getDraggableRef,i=e.canDragInteractiveElements,l=e.shouldRespectForcePress,a=e.isEnabled,s=(0,LH.Ye)((function(){return{canDragInteractiveElements:i,shouldRespectForcePress:l,isEnabled:a}}),[i,a,l]),c=(0,LH.I4)((function(e){var t=o();return t||JH(!1),function(e,t,n){void 0===n&&(n=lV);var r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=VH(o,r),l=HH(i,n);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:l}}(n,t,e)}),[n,o]),u=(0,LH.Ye)((function(){return{uniqueId:t,descriptor:n,options:s,getDimension:c}}),[n,c,s,t]),d=(0,b.useRef)(u),p=(0,b.useRef)(!0);UU((function(){return r.draggable.register(d.current),function(){return r.draggable.unregister(d.current)}}),[r.draggable]),UU((function(){if(p.current)p.current=!1;else{var e=d.current;d.current=u,r.draggable.update(u,e)}}),[u,r.draggable])}((0,LH.Ye)((function(){return{descriptor:d,registry:a,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:h}}),[d,a,r,g,f,h]));var k=(0,LH.Ye)((function(){return h?{tabIndex:0,role:"button","aria-describedby":l,"data-rbd-drag-handle-draggable-id":m,"data-rbd-drag-handle-context-id":i,draggable:!1,onDragStart:eG}:null}),[i,l,m,h]),x=(0,LH.I4)((function(e){"DRAGGING"===y.type&&y.dropping&&"transform"===e.propertyName&&_()}),[_,y]),w=(0,LH.Ye)((function(){var e=function(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,o=e.dropping,i=Boolean(r),l=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),a=Boolean(o),s=a?QW(n,i):XW(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Q$(l,o),transform:s,opacity:J$(i,a),zIndex:a?X$:Y$,pointerEvents:"none"}}(e):{transform:XW((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}(y),t="DRAGGING"===y.type&&y.dropping?x:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":i,"data-rbd-draggable-id":m,style:e,onTransitionEnd:t},dragHandleProps:k}}),[i,k,m,y,x,n]),C=(0,LH.Ye)((function(){return{draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}}),[d.droppableId,d.id,d.index,d.type]);return p(w,y.snapshot,C)}));function lG(e){return V$(q$).isUsingCloneFor!==e.draggableId||e.isClone?b.createElement(iG,e):null}function aG(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return b.createElement(lG,(0,qz.Z)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var sG=function(e,t){return e===t.droppable.type},cG=function(e,t){return t.draggables[e.draggable.id]},uG={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||JH(!1),document.body}},dG=PH((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,qz.Z)({},e,{shouldAnimatePlaceholder:!1}),n=(0,UH.Z)((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=(0,UH.Z)((function(r,o,i,l,a,s){var c=a.descriptor.id;if(a.descriptor.droppableId===r){var u=s?{render:s,dragging:n(a.descriptor)}:null,d={isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!1,snapshot:d,useClone:u}}if(!o)return t;if(!l)return e;var p={isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!0,snapshot:p,useClone:null}}));return function(n,o){var i=o.droppableId,l=o.type,a=!o.isDropDisabled,s=o.renderClone;if(n.isDragging){var c=n.critical;if(!sG(l,c))return t;var u=cG(c,n.dimensions),d=pW(n.impact)===i;return r(i,a,d,d,u,s)}if("DROP_ANIMATING"===n.phase){var p=n.completed;if(!sG(l,p.critical))return t;var m=cG(p.critical,n.dimensions);return r(i,a,nG(p.result)===i,pW(p.impact)===i,m,s)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var h=n.completed;if(!sG(l,h.critical))return t;var f=pW(h.impact)===i,g=Boolean(h.impact.at&&"COMBINE"===h.impact.at.type),v=h.critical.droppable.id===i;return f?g?e:t:v?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:XU,pure:!0,areStatePropsEqual:tG})((function(e){var t=(0,b.useContext)(o$);t||JH(!1);var n=t.contextId,r=t.isMovementAllowed,o=(0,b.useRef)(null),i=(0,b.useRef)(null),l=e.children,a=e.droppableId,s=e.type,c=e.mode,u=e.direction,d=e.ignoreContainerClipping,p=e.isDropDisabled,m=e.isCombineEnabled,h=e.snapshot,f=e.useClone,g=e.updateViewportMaxScroll,v=e.getContainerForClone,_=(0,LH.I4)((function(){return o.current}),[]),k=(0,LH.I4)((function(e){o.current=e}),[]),x=((0,LH.I4)((function(){return i.current}),[]),(0,LH.I4)((function(e){i.current=e}),[])),w=(0,LH.I4)((function(){r()&&g({maxScroll:hU()})}),[r,g]);!function(e){var t=(0,b.useRef)(null),n=V$(o$),r=r$("droppable"),o=n.registry,i=n.marshal,l=i$(e),a=(0,LH.Ye)((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),s=(0,b.useRef)(a),c=(0,LH.Ye)((function(){return(0,UH.Z)((function(e,n){t.current||JH(!1);var r={x:e,y:n};i.updateDroppableScroll(a.id,r)}))}),[a.id,i]),u=(0,LH.I4)((function(){var e=t.current;return e&&e.env.closestScrollable?F$(e.env.closestScrollable):lV}),[]),d=(0,LH.I4)((function(){var e=u();c(e.x,e.y)}),[u,c]),p=(0,LH.Ye)((function(){return $H(d)}),[d]),m=(0,LH.I4)((function(){var e=t.current,n=W$(e);e&&n||JH(!1),e.scrollOptions.shouldPublishImmediately?d():p()}),[p,d]),h=(0,LH.I4)((function(e,r){t.current&&JH(!1);var o=l.current,i=o.getDroppableRef();i||JH(!1);var s=function(e){return{closestScrollable:O$(e),isFixedOnPage:Z$(e)}}(i),c={ref:i,descriptor:a,env:s,scrollOptions:r};t.current=c;var u=function(e){var t=e.ref,n=e.descriptor,r=e.env,o=e.windowScroll,i=e.direction,l=e.isDropDisabled,a=e.isCombineEnabled,s=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=WH(e);if(!t)return n;if(e!==t)return n;var r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,l=o+t.scrollWidth,a=MH({top:r,right:l,bottom:i,left:o},n.border);return ZH({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})}(t,c),d=HH(u,o),p=function(){if(!c)return null;var e=WH(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:HH(e,o),scroll:F$(c),scrollSize:t,shouldClipSubject:s}}(),m=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,o=e.isFixedOnPage,i=e.direction,l=e.client,a=e.page,s=e.closest,c=function(){if(!s)return null;var e=s.scrollSize,t=s.client,n=pU({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:n,diff:{value:lV,displacement:lV}}}}(),u="vertical"===i?ZV:jV;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:o,axis:u,isEnabled:n,client:l,page:a,frame:c,subject:bV({page:a,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!l,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:i,client:u,page:d,closest:p});return m}({ref:i,descriptor:a,env:s,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),d=s.closestScrollable;return d&&(d.setAttribute(HU.contextId,n.contextId),d.addEventListener("scroll",m,H$(c.scrollOptions))),u}),[n.contextId,a,m,l]),f=(0,LH.I4)((function(){var e=t.current,n=W$(e);return e&&n||JH(!1),F$(n)}),[]),g=(0,LH.I4)((function(){var e=t.current;e||JH(!1);var n=W$(e);t.current=null,n&&(p.cancel(),n.removeAttribute(HU.contextId),n.removeEventListener("scroll",m,H$(e.scrollOptions)))}),[m,p]),v=(0,LH.I4)((function(e){var n=t.current;n||JH(!1);var r=W$(n);r||JH(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),y=(0,LH.Ye)((function(){return{getDimensionAndWatchScroll:h,getScrollWhileDragging:f,dragStopped:g,scroll:v}}),[g,h,f,v]),_=(0,LH.Ye)((function(){return{uniqueId:r,descriptor:a,callbacks:y}}),[y,a,r]);UU((function(){return s.current=_.descriptor,o.droppable.register(_),function(){t.current&&g(),o.droppable.unregister(_)}}),[y,a,g,_,i,o.droppable]),UU((function(){t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)}),[e.isDropDisabled,i]),UU((function(){t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,i])}({droppableId:a,type:s,mode:c,direction:u,isDropDisabled:p,isCombineEnabled:m,ignoreContainerClipping:d,getDroppableRef:_});var C=b.createElement(K$,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,o=e.animate;return b.createElement(G$,{placeholder:r,onClose:t,innerRef:x,animate:o,contextId:n,onTransitionEnd:w})})),E=(0,LH.Ye)((function(){return{innerRef:k,placeholder:C,droppableProps:{"data-rbd-droppable-id":a,"data-rbd-droppable-context-id":n}}}),[n,a,C,k]),S=f?f.dragging.draggableId:null,I=(0,LH.Ye)((function(){return{droppableId:a,type:s,isUsingCloneFor:S}}),[a,S,s]);return b.createElement(q$.Provider,{value:I},l(E,h),function(){if(!f)return null;var e=f.dragging,t=f.render,n=b.createElement(lG,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return y.createPortal(n,v())}())}));function pG(e){let{value:t,remove:n,onUpdate:r,onCheck:o,index:i}=e;return(0,JZ.jsxs)("div",{className:"mailpoet-form-segments-settings-list","data-automation-id":"custom_field_value_settings",children:[(0,JZ.jsx)("input",{type:"checkbox",defaultChecked:t.isChecked||!1,onChange:e=>o(t.id,e.target.checked)},`check-${t.id}`),(0,JZ.jsx)("input",{type:"text",value:t.name,"data-automation-id":"custom_field_value_settings_value",onChange:e=>r(t.id,e.target.value)}),0!==i&&(0,JZ.jsx)($z.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,N.partial)(n,t.id)})]},t.id)}function mG(e){let{values:t,update:n,remove:r,onReorder:o}=e;const[i,l]=(0,b.useState)(t);if((0,b.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.name=t,n(r)},s=(e,t)=>{const r=i.find((t=>t.id===e));if(t){const e=i.find((e=>e.isChecked));e&&(delete e.isChecked,n(e)),r.isChecked=!0}else delete r.isChecked;n(r)};return(0,JZ.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,JZ.jsx)(A$,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,JZ.jsx)(dG,{droppableId:"droppable",children:e=>(0,JZ.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,JZ.jsx)(aG,{draggableId:e.id,index:t,children:n=>(0,JZ.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,JZ.jsx)(pG,{index:t,value:e,remove:r,onCheck:s,onUpdate:a},`inner${e.id}`)})},e.id))),e.placeholder]})})})})}function hG(e){let{label:t,mandatory:n,values:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,useDragAndDrop:c}=e;const[u,d]=(0,b.useState)(t),[p,m]=(0,b.useState)(n),[h,f]=(0,b.useState)(JSON.parse(JSON.stringify(r))),g=(0,b.useMemo)((()=>({label:u,mandatory:p,values:h,isValid:(0,N.reduce)(h,((e,t)=>!(0,N.isEmpty)(t.name)&&e),!0)})),[u,p,h]),v=p!==n||!(0,N.isEqualWith)(r,h)||u!==t;return(0,b.useEffect)((()=>{s&&s(g,v)}),[g,s,v]),(0,JZ.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,JZ.jsx)(mG,{remove:e=>{f(h.filter((t=>e!==t.id)))},update:e=>{f(h.map((t=>e.id!==t.id?t:e)))},values:h,onReorder:f,useDragAndDrop:c}),(0,JZ.jsx)(ia.ZP,{isLink:!0,onClick:()=>f([...h,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${h.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:KZ.x.I18n.t("customFieldAddItem")}),(0,JZ.jsx)("br",{}),i?(0,JZ.jsx)(ia.ZP,{isPrimary:!0,onClick:()=>i({mandatory:p,values:h,label:u}),isBusy:o,disabled:o||!v,className:"button-on-top","data-automation-id":"custom_field_save",children:KZ.x.I18n.t("customFieldSaveCTA")}):null,a?(0,JZ.jsx)(fz,{isBusy:o||l,onDelete:a}):null]})}function fG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),i=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,dn.Z)(nj),c=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(hG,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:o,onSave:e=>l({customFieldId:t.customFieldId,data:{params:wz("radio",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});return(0,JZ.jsxs)(xz,{className:t.className,children:[c,(0,JZ.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:t.hideLabel?null:vz(t)}),Array.isArray(t.values)&&t.values.map((e=>(0,JZ.jsx)("div",{children:(0,JZ.jsxs)("label",{children:[(0,JZ.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id)))]})}function gG(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}let vG,bG;dG.defaultProps=uG,pG.propTypes={value:QZ().shape({name:QZ().string.isRequired,id:QZ().string.isRequired,isChecked:QZ().bool}).isRequired,onUpdate:QZ().func.isRequired,onCheck:QZ().func.isRequired,index:QZ().number.isRequired,remove:QZ().func.isRequired},mG.propTypes={values:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,id:QZ().string.isRequired}).isRequired).isRequired,update:QZ().func.isRequired,remove:QZ().func.isRequired,onReorder:QZ().func.isRequired},hG.propTypes={label:QZ().string,mandatory:QZ().bool,values:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,id:QZ().string.isRequired})),onSave:QZ().func,isSaving:QZ().bool,isDeleting:QZ().bool,onCustomFieldDelete:QZ().func,onChange:QZ().func,useDragAndDrop:QZ().bool},hG.defaultProps={label:"",mandatory:!1,isSaving:!1,values:[],isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null,useDragAndDrop:!0},fG.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,customFieldId:QZ().number.isRequired,values:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,id:QZ().string.isRequired,isChecked:QZ().bool})),mandatory:QZ().bool.isRequired,hideLabel:QZ().bool,className:QZ().string}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired},function(e){e.Divider="divider",e.Spacer="spacer"}(vG||(vG={})),function(e){e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted"}(bG||(bG={}));const yG={className:void 0,height:1,type:vG.Divider,style:bG.Solid,dividerHeight:1,dividerWidth:100,color:"black"},_G=()=>`${Math.random().toString()}-${Date.now()}`,kG=e=>e.map((e=>{const t={name:e.value,id:_G()};return(0,N.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t})),xG=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");return o=>{if(!Array.isArray(o))throw new Error("Mapper expects form body to be an array.");return o.map((o=>{var i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,x,w,C,E,S,I,T,B,P,A,L,R,D;if(["column","columns"].includes(o.type))return function(e,t,n,r){const o=xG(t,n,r,arguments.length>4&&void 0!==arguments[4]?arguments[4]:[]),i={clientId:_G(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:o(e.body?e.body:[])},l=Nz(n,e.params.text_color),a=Nz(n,e.params.background_color),s=((e,t)=>{const n=e.find((e=>e.gradient===t));return n?n.slug:void 0})(r,e.params.gradient);return(0,N.has)(e.params,"width")&&(i.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,N.has)(e.params,"vertical_alignment")&&(i.attributes.verticalAlignment=e.params.vertical_alignment),(0,N.has)(e.params,"text_color")&&(i.attributes.textColor=l,i.attributes.style.color.text=l?void 0:e.params.text_color),(0,N.has)(e.params,"background_color")&&(i.attributes.backgroundColor=a,i.attributes.style.color.background=a?void 0:e.params.background_color),(0,N.has)(e.params,"gradient")&&(i.attributes.gradient=s,i.attributes.style.color.gradient=s?void 0:e.params.gradient),(0,N.has)(e.params,"class_name")&&e.params.class_name&&(i.attributes.className=e.params.class_name),(0,N.has)(e.params,"padding")&&(i.attributes.style.spacing={padding:e.params.padding}),(0,N.has)(e.params,"is_stacked_on_mobile")&&(i.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,N.has)(e.params,"is_stacked_on_mobile")||(i.attributes.isStackedOnMobile=!0),i}(o,e,t,n,r);const M={clientId:`${o.id}_${_G()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(o.type)&&(M.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),o.params&&(0,N.has)(o.params,"class_name")&&(M.attributes.className=o.params.class_name),o.params&&(0,N.has)(o.params,"required")&&(M.attributes.mandatory=!!o.params.required),o.params&&(0,N.has)(o.params,"label_within")&&(M.attributes.labelWithinInput=!!o.params.label_within),o.params&&(M.attributes.label=o.params.label?o.params.label:""),o.params&&(0,N.has)(o.params,"text_color")){const e=Nz(t,o.params.text_color);M.attributes.textColor=e,["heading","paragraph"].includes(o.type)&&!e?M.attributes.style.color.text=o.params.text_color:e||(M.attributes.customTextColor=o.params.text_color)}if(o.params&&(0,N.has)(o.params,"background_color")){const e=Nz(t,o.params.background_color);M.attributes.backgroundColor=e,["heading","paragraph"].includes(o.type)&&!e?M.attributes.style.color.background=o.params.background_color:e||(M.attributes.customBackgroundColor=o.params.background_color)}if(o.params&&(0,N.has)(o.params,"font_size")){const t=`${o.params.font_size}${Number.isNaN(Number(`${o.params.font_size}`||NaN))?"":"px"}`,n=((e,t)=>{const n=e.find((e=>e.size===t));return n?n.slug:void 0})(e,t);M.attributes.fontSize=n,M.attributes.style.typography.fontSize=n?void 0:t}o.params&&(0,N.has)(o.params,"line_height")&&(M.attributes.style.typography.lineHeight=o.params.line_height);let O=2;switch(o.id){case"email":return{...M,name:"mailpoet-form/email-input",attributes:{...M.attributes,styles:Tz(o.styles)}};case"heading":return o.params&&(0,N.has)(o.params,"level")&&(O=gG(o.params.level),void 0===O&&(O=2)),{...M,attributes:{...M.attributes,content:(null===(i=o.params)||void 0===i?void 0:i.content)||"",level:O,textAlign:null===(l=o.params)||void 0===l?void 0:l.align,anchor:null===(a=o.params)||void 0===a?void 0:a.anchor,className:null===(s=o.params)||void 0===s?void 0:s.class_name},name:"core/heading"};case"paragraph":return{...M,attributes:{...M.attributes,content:(null===(c=o.params)||void 0===c?void 0:c.content)||"",align:null===(u=o.params)||void 0===u?void 0:u.align,className:null===(d=o.params)||void 0===d?void 0:d.class_name,dropCap:"1"===(null===(p=o.params)||void 0===p?void 0:p.drop_cap)},name:"core/paragraph"};case"image":return{...M,name:"core/image",attributes:{className:(null===(m=o.params)||void 0===m?void 0:m.class_name)||"",align:null===(h=o.params)||void 0===h?void 0:h.align,url:null===(f=o.params)||void 0===f?void 0:f.url,alt:null===(g=o.params)||void 0===g?void 0:g.alt,title:null===(v=o.params)||void 0===v?void 0:v.title,caption:null===(b=o.params)||void 0===b?void 0:b.caption,linkDestination:null===(y=o.params)||void 0===y?void 0:y.link_destination,link:null===(_=o.params)||void 0===_?void 0:_.link,href:null===(k=o.params)||void 0===k?void 0:k.href,linkClass:null===(x=o.params)||void 0===x?void 0:x.link_class,rel:null===(w=o.params)||void 0===w?void 0:w.rel,linkTarget:null===(C=o.params)||void 0===C?void 0:C.link_target,id:null===(E=o.params)||void 0===E?void 0:E.id,sizeSlug:null===(S=o.params)||void 0===S?void 0:S.size_slug,width:null===(I=o.params)||void 0===I?void 0:I.width,height:null===(T=o.params)||void 0===T?void 0:T.height}};case"first_name":return{...M,name:"mailpoet-form/first-name-input",attributes:{...M.attributes,styles:Tz(o.styles)}};case"last_name":return{...M,name:"mailpoet-form/last-name-input",attributes:{...M.attributes,styles:Tz(o.styles)}};case"segments":return o.params&&(0,N.has)(o.params,"values")&&Array.isArray(o.params.values)?M.attributes.values=o.params.values.map((e=>({id:e.id,isChecked:"1"===e.is_checked||void 0}))):M.attributes.values=[],{...M,name:"mailpoet-form/segment-select"};case"submit":return{...M,name:"mailpoet-form/submit-button",attributes:{...M.attributes,styles:Tz(o.styles)}};case"divider":return delete M.attributes.label,{...M,name:"mailpoet-form/divider",attributes:{className:M.attributes.className,height:gG((null===(B=o.params)||void 0===B?void 0:B.height)??yG.height),type:(null===(P=o.params)||void 0===P?void 0:P.type)??yG.type,style:(null===(A=o.params)||void 0===A?void 0:A.style)??yG.style,dividerHeight:gG((null===(L=o.params)||void 0===L?void 0:L.divider_height)??yG.dividerHeight),dividerWidth:gG((null===(R=o.params)||void 0===R?void 0:R.divider_width)??yG.dividerWidth),color:(null===(D=o.params)||void 0===D?void 0:D.color)??yG.color}};case"html":return{...M,name:"mailpoet-form/html",attributes:{className:M.attributes.className,content:o.params&&o.params.text?o.params.text:"",nl2br:!(!o.params||!o.params.nl2br||!o.params.nl2br)}};default:return Number.isInteger(parseInt(o.id,10))?((e,t,n)=>{const r=t.find((t=>t.id===parseInt(e.id,10)));if(!r)return null;const o={...n,name:uz({text:"mailpoet-form/custom-text",textarea:"mailpoet-form/custom-textarea",radio:"mailpoet-form/custom-radio",checkbox:"mailpoet-form/custom-checkbox",select:"mailpoet-form/custom-select",date:"mailpoet-form/custom-date"}[r.type],r)};return o.attributes.customFieldId=r.id,e.params&&((0,N.has)(e.params,"validate")&&e.params.validate&&(o.attributes.validate=e.params.validate),(0,N.has)(e.params,"hide_label")&&(o.attributes.hideLabel=!!e.params.hide_label),(0,N.has)(e.params,"lines")&&(o.attributes.lines=e.params.lines),(0,N.has)(e.params,"date_type")&&(o.attributes.dateType=e.params.date_type),(0,N.has)(e.params,"date_format")&&(o.attributes.dateFormat=e.params.date_format),(0,N.has)(e.params,"is_default_today")&&(o.attributes.defaultToday=!!e.params.is_default_today),(0,N.has)(e.params,"values")&&Array.isArray(e.params.values)&&(o.attributes.values=kG(e.params.values))),"text"!==r.type&&"textarea"!==r.type||(o.attributes.styles=Tz(e.styles)),o})(o,r,M):null}})).filter(Boolean)}};function wG(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?kG(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:fG,save:()=>null}}function CG(e){let{label:t,mandatory:n,isSaving:r,onSave:o,isChecked:i,checkboxLabel:l,isDeleting:a,onCustomFieldDelete:s,onChange:c}=e;const[u,d]=(0,b.useState)(t),[p,m]=(0,b.useState)(n),[h,f]=(0,b.useState)(i),[g,v]=(0,b.useState)(l),y=p!==n||h!==i||u!==t||g!==l,_=(0,b.useMemo)((()=>({mandatory:p,isChecked:h,label:u,checkboxLabel:g,isValid:!(0,N.isEmpty)(g)})),[u,p,h,g]);return(0,b.useEffect)((()=>{c(_,y)}),[_,c,y]),(0,JZ.jsxs)("div",{className:"custom-field-settings",children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,JZ.jsxs)(Hd.ZP,{children:[(0,JZ.jsx)("input",{type:"checkbox",checked:h,onChange:e=>f(!!e.target.checked)}),(0,JZ.jsx)("input",{value:g,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>v(e.target.value)})]}),o?(0,JZ.jsx)(ia.ZP,{isPrimary:!0,onClick:()=>o(_),isBusy:r,disabled:r||!y,className:"button-on-top","data-automation-id":"custom_field_save",children:KZ.x.I18n.t("customFieldSaveCTA")}):null,s?(0,JZ.jsx)(fz,{isBusy:r||a,onDelete:s}):null]})}function EG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),i=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,dn.Z)(nj),c=()=>{if(Array.isArray(t.values)){const e=t.values[0];if(e)return e.name}return""},u=()=>{let e=!1;if(Array.isArray(t.values)){const n=t.values[0];n&&n.isChecked&&(e=!0)}return e},d=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(CG,{label:t.label,mandatory:t.mandatory,isSaving:o,isChecked:u(),checkboxLabel:c(),onSave:e=>l({customFieldId:t.customFieldId,data:{params:wz("checkbox",e)},onFinish:()=>n({mandatory:e.mandatory,label:e.label,values:[{isChecked:e.isChecked,name:e.checkboxLabel}]})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});let p=c();return t.mandatory&&(p+=" *"),(0,JZ.jsxs)(xz,{className:t.className,children:[d,(0,JZ.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:t.hideLabel||!t.label?null:t.label}),(0,JZ.jsx)("div",{children:(0,JZ.jsxs)("label",{children:[(0,JZ.jsx)("input",{type:"checkbox",disabled:!0,checked:u(),className:"mailpoet_checkbox"}),(0,JZ.jsx)("span",{dangerouslySetInnerHTML:{__html:p}})]})})]})}function SG(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?kG(e.params.values):[]},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:EG,save:()=>null}}function IG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,un.Z)((e=>e(nj).getFormSettings()),[]),i=(0,un.Z)((e=>e(nj).getIsCustomFieldSaving()),[]),l=(0,un.Z)((e=>e(nj).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,dn.Z)(nj),u=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,JZ.jsx)(hG,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:i,onSave:e=>a({customFieldId:t.customFieldId,data:{params:wz("select",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})})]});return(0,JZ.jsxs)(xz,{className:t.className,children:[u,(0,JZ.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[t.labelWithinInput?null:(0,JZ.jsx)("label",{className:"mailpoet_select_label",htmlFor:r,children:vz(t)}),(()=>{let e=t.labelWithinInput?vz(t):"-";const n=[{label:e}];!Array.isArray(t.values)&&t.values.length||t.values.forEach((r=>{n.push({label:r.name}),!t.labelWithinInput&&r.isChecked&&(e=r.name)}));const i={};return void 0!==o.inputPadding&&(i.padding=o.inputPadding),void 0!==o.alignment&&(i.textAlign=o.alignment,i.margin=jz(i.textAlign)),o.fontFamily&&(i.fontFamily=o.fontFamily),(0,JZ.jsx)("select",{style:i,className:"mailpoet_select",id:r,value:e,readOnly:!0,children:n.map(((e,t)=>(0,JZ.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label)))})})()]})]})}function TG(e){return{title:e.name,description:"",icon:dz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?kG(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:IG,save:()=>null}}function NG(e){return{date:{name:"mailpoet-form/custom-date",settings:Ez(e)},text:{name:"mailpoet-form/custom-text",settings:Vz(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:Uz(e)},radio:{name:"mailpoet-form/custom-radio",settings:wG(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:SG(e)},select:{name:"mailpoet-form/custom-select",settings:TG(e)}}}CG.propTypes={label:QZ().string,mandatory:QZ().bool,onSave:QZ().func,isSaving:QZ().bool,isChecked:QZ().bool,checkboxLabel:QZ().string,isDeleting:QZ().bool,onCustomFieldDelete:QZ().func,onChange:QZ().func},CG.defaultProps={label:"",mandatory:!1,onSave:null,isSaving:!1,isChecked:!1,checkboxLabel:"",isDeleting:!1,onCustomFieldDelete:null,onChange:()=>{}},EG.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,customFieldId:QZ().number.isRequired,mandatory:QZ().bool.isRequired,hideLabel:QZ().bool,className:QZ().string,values:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,isChecked:QZ().bool}))}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired},IG.propTypes={attributes:QZ().shape({customFieldId:QZ().number.isRequired,labelWithinInput:QZ().bool.isRequired,label:QZ().string.isRequired,values:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,isChecked:QZ().bool,id:QZ().string.isRequired})),mandatory:QZ().bool.isRequired,className:QZ().string}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired};const BG=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,JZ.jsx)(Vp.y$,{d:"M19 13H5v-2h14v2z"})]}),PG={title:KZ.x.I18n.t("blockDivider"),description:null,icon:BG,category:"design",attributes:{height:{type:"number",default:yG.height},type:{type:"string",default:yG.type},style:{type:"string",default:yG.style},dividerHeight:{type:"number",default:yG.dividerHeight},dividerWidth:{type:"number",default:yG.dividerWidth},color:{type:"string",default:yG.color}},supports:{html:!1,multiple:!0},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=t.dividerHeight??yG.dividerHeight,o=t.dividerWidth??yG.dividerWidth,i=t.height??yG.height,l=(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:t.style,onChange:e=>n({style:e}),options:[{value:bG.Solid,label:KZ.x.I18n.t("blockDividerStyleSolid")},{value:bG.Dashed,label:KZ.x.I18n.t("blockDividerStyleDashed")},{value:bG.Dotted,label:KZ.x.I18n.t("blockDividerStyleDotted")}]}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:r,min:1,max:40,allowReset:!0,onChange:e=>{let t=i;void 0!==e&&(t=Math.max(e,i)),n({dividerHeight:e,height:t})}}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:o,min:1,max:100,allowReset:!0,onChange:e=>n({dividerWidth:e})}),(0,JZ.jsx)(Mz,{title:KZ.x.I18n.t("formSettingsColor"),settings:[{label:KZ.x.I18n.t("blockDividerBackground"),colorValue:t.color,onColorChange:e=>n({color:e})}]})]}),a={};return t.type===vG.Divider&&(a.borderTopStyle=t.style,a.borderTopWidth=r,a.borderTopColor=t.color,a.height=r,a.width=`${o}%`),(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(Gf,{children:(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:i,min:1,max:400,allowReset:!0,onChange:e=>{let t=r;t=void 0!==e?Math.min(e,r):1,n({height:e,dividerHeight:t})}}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:t.type===vG.Divider,onChange:e=>n({type:e?vG.Divider:vG.Spacer})}),t.type===vG.Divider&&l]})})}),(0,JZ.jsx)("div",{className:C()("mailpoet_spacer",t.className),"data-automation-id":"editor_spacer_block",style:{height:i,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,JZ.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:a})})]})},save:()=>null};function AG(e){let{attributes:t,setAttributes:n}=e;const r=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_email_label_input",onChange:e=>n({label:e})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})]})}),(0,JZ.jsx)(Oz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,JZ.jsxs)(JZ.Fragment,{children:[r,(0,JZ.jsx)(zz,{className:t.className,name:"email",label:t.label,labelWithinInput:!!t.labelWithinInput,mandatory:!0,styles:t.styles})]})}AG.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,labelWithinInput:QZ().bool.isRequired,className:QZ().string,styles:Fz.isRequired}).isRequired,setAttributes:QZ().func.isRequired};const LG=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{fill:"#32373C",d:"m18.82592,6.5l-14,0c-0.8,0 -1.5,0.7 -1.5,1.5l0,8c0,0.8 0.7,1.5 1.5,1.5l14,0c0.8,0 1.5,-0.7 1.5,-1.5l0,-8c0,-0.8 -0.7,-1.5 -1.5,-1.5zm-1.2,1l-5.8,4.9l-5.8,-4.9l11.6,0zm1.7,8.5c0,0.3 -0.2,0.5 -0.5,0.5l-14,0c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-8c0,-0.2 0.1,-0.4 0.3,-0.4l6.9,5.9c0.1,0.1 0.2,0.1 0.3,0.1s0.2,0 0.3,-0.1l6.9,-5.9c0.2,0.1 0.3,0.2 0.3,0.4l0,8z"})})]}),RG={title:KZ.x.I18n.t("blockEmail"),description:KZ.x.I18n.t("blockEmailDescription"),icon:LG,category:"obligatory",attributes:{label:{type:"string",default:KZ.x.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:Sz}},supports:{html:!1,inserter:!1,multiple:!1},edit:AG,save:()=>null};function DG(e){let{value:t,onChange:n}=e;const r=am("typography.fontSizes");return(0,JZ.jsx)(TA,{value:t,onChange:n,fontSizes:r})}const MG=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function OG(e){let{onChange:t,value:n,name:r,hideLabelFromVision:o=!1}=e;const i=(0,un.Z)((e=>e(nj).getAllCustomFonts()),[]),l={color:"lightgray",backgroundColor:"white",cursor:"default"},a=e=>({fontFamily:e,cursor:"default",marginLeft:16}),s=[{key:KZ.x.I18n.t("formFontsDefaultTheme"),name:KZ.x.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:KZ.x.I18n.t("formFontsStandard"),name:KZ.x.I18n.t("formFontsStandard"),selectable:!1,style:l},...MG.map((e=>({key:e,name:e,selectable:!0,style:a(e),value:e})))];KZ.x.libs3rdPartyEnabled&&(s.push({key:KZ.x.I18n.t("formFontsCustom"),name:KZ.x.I18n.t("formFontsCustom"),selectable:!1,style:l}),i.forEach((e=>{s.push({key:e,name:e,selectable:!0,style:a(e),value:e})})));let c=void 0!==n&&s.find((e=>e.value===n));return c||(c=s[0]),(0,JZ.jsx)(sI,{__nextUnconstrainedWidth:!0,options:s,onChange:e=>{const n=e.selectedItem;n.selectable&&t(n.value)},value:c,label:r,className:"mailpoet-font-family-select",hideLabelFromVision:o})}function FG(){const e=(0,un.Z)((e=>e(nj).getAllCustomFonts()),[]);if(!KZ.x.libs3rdPartyEnabled)return null;const t=e.map((e=>e.replace(" ","+"))).map((e=>e.concat(":400,400i,700,700i"))).join("|");return(0,JZ.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function ZG(e){let{styles:t,onChange:n,formInputPadding:r,formFontFamily:o}=e;const i=(0,b.useRef)(t),l=i.current,a=(e,t)=>{const r={...i.current};r[e]=t,n(r),i.current=r};return(0,JZ.jsx)(hz.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsDisplayFullWidth"),checked:l.fullWidth,onChange:(0,N.partial)(a,"fullWidth")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:l.inheritFromTheme,onChange:e=>{if(e)return void a("inheritFromTheme",e);const t={...i.current};t.backgroundColor="#eeeeee",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.fontColor="#313131",t.fontSize=void 0,t.padding=r,t.inheritFromTheme=e,n(t),i.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),l.inheritFromTheme?null:(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(Mz,{title:KZ.x.I18n.t("formSettingsColor"),settings:[{label:KZ.x.I18n.t("formSettingsStylesBackground"),colorValue:t.backgroundColor,gradientValue:t.gradient,onColorChange:(0,N.partial)(a,"backgroundColor"),onGradientChange:(0,N.partial)(a,"gradient")},{label:KZ.x.I18n.t("formSettingsStylesFont"),colorValue:t.fontColor,onColorChange:(0,N.partial)(a,"fontColor")},{label:KZ.x.I18n.t("formSettingsBorder"),colorValue:l.borderColor,onColorChange:(0,N.partial)(a,"borderColor")}]}),(0,JZ.jsx)(DG,{value:t.fontSize,onChange:(0,N.partial)(a,"fontSize")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("formSettingsBold"),checked:l.bold||!1,onChange:(0,N.partial)(a,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,JZ.jsx)(OG,{name:KZ.x.I18n.t("formSettingsStylesFontFamily"),value:t.fontFamily||o,onChange:(0,N.partial)(a,"fontFamily")}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsInputPadding"),value:void 0!==l.padding?l.padding:r,min:0,max:30,allowReset:!0,onChange:(0,N.partial)(a,"padding")}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderSize"),value:void 0!==l.borderSize?l.borderSize:1,min:0,max:10,allowReset:!0,onChange:(0,N.partial)(a,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderRadius"),value:void 0!==l.borderRadius?l.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,N.partial)(a,"borderRadius")})]})]})})})}const jG=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]}),zG={title:KZ.x.I18n.t("blockSubmit"),description:KZ.x.I18n.t("blockSubmitDescription"),icon:jG,category:"obligatory",attributes:{label:{type:"string",default:KZ.x.I18n.t("blockSubmitLabel")},styles:{type:"object",default:{fullWidth:!0,inheritFromTheme:!0}}},supports:{html:!1,inserter:!1,multiple:!1},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=(0,un.Z)((e=>e(nj).getFormSettings()),[]),o=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:t.label,onChange:e=>n({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,JZ.jsx)(ZG,{onChange:e=>n({styles:e}),styles:t.styles,formInputPadding:r.inputPadding,formFontFamily:r.fontFamily})]}),i=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit",borderRadius:void 0!==t.styles.borderRadius?`${t.styles.borderRadius}px`:0,borderWidth:void 0!==t.styles.borderSize?`${t.styles.borderSize}px`:"1px",borderColor:t.styles.borderColor||"transparent",borderStyle:"solid",fontSize:t.styles.fontSize?`${t.styles.fontSize}px`:"inherit",color:t.styles.fontColor||"inherit"};t.styles.fullWidth&&(i.width="100%"),void 0===t.styles.padding||t.styles.inheritFromTheme?void 0!==r.inputPadding&&(i.padding=r.inputPadding):i.padding=t.styles.padding,t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.gradient&&!t.styles.inheritFromTheme&&(i.backgroundColor=void 0,i.background=t.styles.gradient),t.styles.fontFamily&&!t.styles.inheritFromTheme&&(i.fontFamily=t.styles.fontFamily);const l=C()("mailpoet_submit",{button:t.styles.inheritFromTheme});return(0,JZ.jsxs)(xz,{className:t.className,children:[o,(0,JZ.jsx)("input",{className:l,type:"submit",value:t.label,"data-automation-id":"editor_submit_input",style:i})]})},save:()=>null},HG=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function VG(e){let{attributes:t,setAttributes:n}=e;const r=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>n({label:e})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,JZ.jsx)(Oz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,JZ.jsxs)(JZ.Fragment,{children:[r,(0,JZ.jsx)(zz,{className:t.className,name:"first_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}VG.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,labelWithinInput:QZ().bool.isRequired,mandatory:QZ().bool.isRequired,className:QZ().string,styles:Fz.isRequired}).isRequired,setAttributes:QZ().func.isRequired};const WG={title:KZ.x.I18n.t("blockFirstName"),description:KZ.x.I18n.t("blockFirstNameDescription"),icon:HG,category:"fields",attributes:{label:{type:"string",default:KZ.x.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:Sz}},supports:{html:!1,multiple:!1},edit:VG,save:()=>null},UG=(0,JZ.jsxs)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,JZ.jsx)(Vp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function $G(e){let{attributes:t,setAttributes:n}=e;const r=(0,JZ.jsxs)(Gf,{children:[(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>n({label:e})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,JZ.jsx)(Oz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,JZ.jsxs)(JZ.Fragment,{children:[r,(0,JZ.jsx)(zz,{className:t.className,name:"last_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}$G.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,labelWithinInput:QZ().bool.isRequired,mandatory:QZ().bool.isRequired,className:QZ().string,styles:Fz.isRequired}).isRequired,setAttributes:QZ().func.isRequired};const GG={title:KZ.x.I18n.t("blockLastName"),description:KZ.x.I18n.t("blockLastNameDescription"),icon:UG,category:"fields",attributes:{label:{type:"string",default:KZ.x.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:Sz}},supports:{html:!1,multiple:!1},edit:$G,save:()=>null},qG=(0,JZ.jsx)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{d:"M9 19h12v-2H9v2zm0-6h12v-2H9v2zm0-8v2h12V5H9zm-4-.5c-.828 0-1.5.672-1.5 1.5S4.172 7.5 5 7.5 6.5 6.828 6.5 6 5.828 4.5 5 4.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5z"})})});var KG=n(17554);function YG(e){let{segment:t,removeSegment:n,onCheck:r}=e;return(0,JZ.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,JZ.jsx)(TS.C,{label:t.name,defaultChecked:!!t.isChecked,onChange:(0,N.partial)(r,t.id)},`check-${t.id}`),(0,JZ.jsx)($z.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,N.partial)(n,t.id)})]},t.id)}function XG(e){let{segments:t,updateSegment:n,removeSegment:r,onSegmentsReorder:o}=e;const[i,l]=(0,b.useState)(t);if((0,b.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.isChecked=t,n(r)};return(0,JZ.jsx)(A$,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,JZ.jsx)(dG,{droppableId:"droppable",children:e=>(0,JZ.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,JZ.jsx)(aG,{draggableId:e.id,index:t,children:n=>(0,JZ.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,JZ.jsx)(YG,{index:t,segment:e,onCheck:a,removeSegment:r},e.id)})},e.id))),e.placeholder]})})})}YG.propTypes={segment:QZ().shape({name:QZ().string.isRequired,isChecked:QZ().bool,id:QZ().string.isRequired}).isRequired,onCheck:QZ().func.isRequired,removeSegment:QZ().func.isRequired},XG.propTypes={segments:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,isChecked:QZ().bool,id:QZ().string.isRequired}).isRequired).isRequired,updateSegment:QZ().func.isRequired,removeSegment:QZ().func.isRequired,onSegmentsReorder:QZ().func.isRequired};const QG=(e,t)=>e.find((e=>e.id===t));function JG(e){let{label:t,onLabelChanged:n,segmentsAddedIntoSelection:r,addSegmentIntoSelection:o,setNewSelection:i}=e;const l=(0,un.Z)((e=>e(nj).getAllAvailableSegments()),[]),a=l.map((e=>({label:e.name,value:e.id}))).filter((e=>!QG(r,e.value)));return(0,JZ.jsx)(Gf,{children:(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(KG.Z,{children:(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("label"),value:t,"data-automation-id":"settings_first_name_label_input",onChange:n})}),(0,JZ.jsx)(KG.Z,{children:a.length?(0,JZ.jsx)(jT.Z,{label:`${KZ.x.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:KZ.x.I18n.t("settingsPleaseSelectList"),value:null},...a],onChange:e=>{const t=QG(l,e);o({name:t.name,isChecked:!1,id:e})}}):null}),(0,JZ.jsx)(XG,{segments:r,updateSegment:e=>{i(r.map((t=>e.id!==t?t:e)))},removeSegment:e=>{i(r.filter((t=>e!==t.id)))},onSegmentsReorder:i})]})})})}function eq(e){let{attributes:t,setAttributes:n}=e;const r=(0,un.Z)((e=>e(nj).getAllAvailableSegments()),[]),o=(0,b.useMemo)((()=>t.values.map((e=>{const t={...e},n=r.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t.name=n?n.name:"",t}))),[t.values,r]),i=e=>e.map((e=>{const t={...e};return delete t.name,t}));return(0,JZ.jsxs)(xz,{className:t.className,children:[(0,JZ.jsx)(JG,{label:t.label,onLabelChanged:e=>n({label:e}),segmentsAddedIntoSelection:o,setNewSelection:e=>n({values:i(e)}),addSegmentIntoSelection:e=>n({values:i([...t.values,e])})}),(0,JZ.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:t.label}),0===t.values.length?(0,JZ.jsx)("p",{className:"mailpoet_error",children:KZ.x.I18n.t("blockSegmentSelectNoLists")}):o.map((e=>(0,JZ.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,JZ.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id)))]})}JG.propTypes={label:QZ().string.isRequired,onLabelChanged:QZ().func.isRequired,addSegmentIntoSelection:QZ().func.isRequired,setNewSelection:QZ().func.isRequired,segmentsAddedIntoSelection:QZ().arrayOf(QZ().shape({name:QZ().string.isRequired,isChecked:QZ().bool,id:QZ().string.isRequired}).isRequired).isRequired},eq.propTypes={attributes:QZ().shape({label:QZ().string.isRequired,className:QZ().string,values:QZ().arrayOf(QZ().shape({isChecked:QZ().bool,id:QZ().string.isRequired})).isRequired}).isRequired,setAttributes:QZ().func.isRequired};const tq={title:KZ.x.I18n.t("blockSegmentSelect"),description:KZ.x.I18n.t("blockLastNameDescription"),icon:qG,category:"fields",attributes:{label:{type:"string",default:KZ.x.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:eq,save:()=>null},nq=(0,JZ.jsx)(Vp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,JZ.jsx)(Vp.y$,{d:"M4.5,11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5V11z M7,10.5h1.5V15H10v-4.5h1.5V9H7V10.5z M14.5,10l-1-1H12v6h1.5v-3.9  l1,1l1-1V15H17V9h-1.5L14.5,10z M19.5,13.5V9H18v6h5v-1.5H19.5z"})});var rq=n(91763),oq=n(36454);const iq=function(){const{MutationObserver:e}=window;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vmin|vmax|vh|vw)$/.test(e.style[t])&&(e.style[t]="")}))}e&&document.body&&window.parent&&(new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0))},lq=function(e){let{html:t="",title:n="",type:r,styles:o=[],scripts:i=[],onFocus:l}=e;const a=(0,b.useRef)(),[s,c]=(0,b.useState)(0),[u,d]=(0,b.useState)(0);function p(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!function(){try{var e,t;return!(null===(e=a.current)||void 0===e||null===(t=e.contentDocument)||void 0===t||!t.body)}catch(e){return!1}}())return;const{contentDocument:l,ownerDocument:s}=a.current;if(!e&&null!==(null==l?void 0:l.body.getAttribute("data-resizable-iframe-connected")))return;const c=(0,b.createElement)("html",{lang:s.documentElement.lang,className:r},(0,b.createElement)("head",null,(0,b.createElement)("title",null,n),(0,b.createElement)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),o.map(((e,t)=>(0,b.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,b.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:r},(0,b.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),(0,b.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${iq.toString()})();`}}),i.map((e=>(0,b.createElement)("script",{key:e,src:e})))));l.open(),l.write("<!DOCTYPE html>"+(0,Uo.ZP)(c)),l.close()}return(0,b.useEffect)((()=>{var e;function t(){p(!1)}function n(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(c(n.width),d(n.height))}p();const r=a.current,o=null==r||null===(e=r.ownerDocument)||void 0===e?void 0:e.defaultView;return null==r||r.addEventListener("load",t,!1),null==o||o.addEventListener("message",n),()=>{null==r||r.removeEventListener("load",t,!1),null==o||o.addEventListener("message",n)}}),[]),(0,b.useEffect)((()=>{p()}),[n,o,i]),(0,b.useEffect)((()=>{p(!0)}),[t,r]),(0,b.createElement)("iframe",{ref:(0,np.Z)([a,(0,oq.Z)()]),title:n,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:l,width:Math.ceil(s),height:Math.ceil(u)})};function aq(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=am("color.palette"),{fontColor:i,fontSize:l,alignment:a,fontFamily:s}=(0,un.Z)((e=>{const t=e(nj).getFormSettings(),n=ij(o,e(nj).getClosestParentAttribute(r,"backgroundColor"),e(nj).getClosestParentAttribute(r,"customBackgroundColor")),i=ij(o,e(nj).getClosestParentAttribute(r,"textColor"),e(nj).getClosestParentAttribute(r,"customTextColor"));return{backgroundColor:n||t.backgroundColor,fontColor:i||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}}),[]),[c,u]=(0,b.useState)(t.content),d=(0,b.useCallback)((0,N.debounce)((e=>{u(e)}),300),[]),p=(0,JZ.jsx)(Gf,{children:(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,JZ.jsx)(rq.Z,{label:KZ.x.I18n.t("blockCustomHtmlContentLabel"),value:t.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{n({content:e}),d(e)}}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("blockCustomHtmlNl2br"),checked:t.nl2br,onChange:e=>n({nl2br:e})})]})})}),m=t.nl2br?["body { white-space: pre-line; }"]:[];m.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),i?m.push(` body {color: ${i};}`):m.push(` body {color: ${getComputedStyle(document.body).color};}`),l?m.push(` body {font-size: ${l}px }`):m.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),a&&m.push(` body {text-align: ${a}}`),s&&m.push(` body {font-family: "${s}"}`);const h=`${c}_${m}`;return(0,JZ.jsxs)(xz,{className:t.className,children:[p,(0,JZ.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,JZ.jsx)(lq,{html:c,styles:m},h)})]})}aq.propTypes={attributes:QZ().shape({content:QZ().string.isRequired,nl2br:QZ().bool.isRequired,className:QZ().string}).isRequired,setAttributes:QZ().func.isRequired,clientId:QZ().string.isRequired};const sq={title:KZ.x.I18n.t("blockCustomHtml"),description:KZ.x.I18n.t("blockCustomHtmlDescription"),icon:nq,category:"fields",attributes:{content:{type:"string",default:KZ.x.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:aq,save:()=>null},cq=(0,JZ.jsx)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,JZ.jsx)(Vp.G,{children:(0,JZ.jsx)(Vp.y$,{d:"m 347,44.407738 c 25.64881,0 46.33333,21.800595 46.33333,47.96131 V 299.03869 h 195.26191 c 24.82143,0 45.50595,21.8006 45.50595,47.96131 0,27.03274 -20.68452,48.83333 -45.50595,48.83333 H 393.33333 v 205.79762 c 0,26.16072 -20.68452,47.96131 -46.33333,47.96131 -24.82143,0 -45.50595,-21.80059 -45.50595,-47.96131 V 395.83333 H 105.40476 c -24.821427,0 -45.50595,-21.80059 -45.50595,-48.83333 0,-26.16071 20.684523,-47.96131 45.50595,-47.96131 H 301.49405 V 92.369048 c 0,-26.160715 20.68452,-47.96131 45.50595,-47.96131 z",fillRule:"evenodd",clipRule:"evenodd"})})}),uq=[{value:"text",label:KZ.x.I18n.t("customFieldTypeText")},{value:"textarea",label:KZ.x.I18n.t("customFieldTypeTextarea")},{value:"radio",label:KZ.x.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:KZ.x.I18n.t("customFieldTypeCheckbox")},{value:"select",label:KZ.x.I18n.t("customFieldTypeSelect")},{value:"date",label:KZ.x.I18n.t("customFieldTypeDate")}];function dq(e){let{dateSettings:t,onSubmit:n}=e;const[r,o]=(0,b.useState)("text"),[i,l]=(0,b.useState)(null),[a,s]=(0,b.useState)({}),c=i&&!(0,N.isEmpty)(a)&&!1!==a.isValid,u=t.dateTypes[0].value,d=t.dateFormats[u][0];return(0,JZ.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,JZ.jsx)("hr",{}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("selectCustomFieldType"),options:uq,"data-automation-id":"create_custom_field_type_select",onChange:e=>{s({}),o(e)}}),(0,JZ.jsx)(ef.Z,{label:KZ.x.I18n.t("customFieldName"),onChange:l,"data-automation-id":"create_custom_field_name_input"}),(0,JZ.jsx)("hr",{}),(()=>{switch(r){case"checkbox":return(0,JZ.jsx)(CG,{mandatory:!!a.mandatory&&a.mandatory,isChecked:!!a.isChecked&&a.isChecked,checkboxLabel:a.checkboxLabel?a.checkboxLabel:"",onChange:s});case"date":return(0,JZ.jsx)(gz,{dateSettings:t,mandatory:!!a.mandatory&&a.mandatory,dateFormat:a.dateFormat?a.dateFormat:d,dateType:a.dateType?a.dateType:u,defaultToday:!!a.defaultToday&&a.defaultToday,onChange:s});case"radio":case"select":return(0,JZ.jsx)(hG,{mandatory:!!a.mandatory&&a.mandatory,values:a.values?a.values:[{name:"",id:Math.random().toString()}],onChange:s});default:return(0,JZ.jsx)(Bz,{mandatory:!!a.mandatory&&a.mandatory,validate:a.validate?a.validate:"",fieldType:r,onChange:s})}})(),(0,JZ.jsx)(ia.ZP,{isSecondary:!0,disabled:!c,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:i,type:r,params:wz(r,a)};n(e)},children:KZ.x.I18n.t("blockCreateButton")})]})}function pq(e){let{clientId:t}=e;const{createCustomField:n}=(0,dn.Z)(nj),r=(0,un.Z)((e=>e(nj).getDateSettingsData()),[]),o=(0,un.Z)((e=>e(nj).getIsCustomFieldCreating()),[]);return(0,JZ.jsx)(WD,{icon:(0,JZ.jsx)(tk,{icon:cq,showColors:!0}),label:KZ.x.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:o?(0,JZ.jsx)(cC.ZP,{}):(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:KZ.x.I18n.t("blockAddCustomFieldDescription")}),(0,JZ.jsx)(dq,{onSubmit:e=>{n(e,t)},dateSettings:r})]})})}dq.propTypes={dateSettings:QZ().shape({dateTypes:QZ().arrayOf(QZ().shape({label:QZ().string,value:QZ().string})),dateFormats:QZ().objectOf(QZ().arrayOf(QZ().string)),months:QZ().arrayOf(QZ().string)}).isRequired,onSubmit:QZ().func.isRequired},pq.propTypes={clientId:QZ().string.isRequired};const mq={title:KZ.x.I18n.t("blockAddCustomField"),description:KZ.x.I18n.t("blockAddCustomFieldDescription"),icon:cq,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:pq,save:()=>null};var hq=n(42173);function fq(e){let t,{doc:n}=fq;n||(n=document.implementation.createHTMLDocument(""),fq.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}const gq=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:r,...o}=e;return{...o,style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:r,customBackgroundColor:o,textColor:i,customTextColor:l}=t,a=MB("background-color",r),s=MB("color",i),c=C()({"has-background":r||o,"has-text-color":i||l,[a]:a,[s]:s,[`are-vertically-aligned-${n}`]:n}),u={backgroundColor:a?void 0:o,color:s?void 0:l};return(0,b.createElement)("div",{className:c||void 0,style:u},(0,b.createElement)(KI.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==fq(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=fq(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>nr("core/column",{},e))),{columns:r,...o}=e;return[{...o,isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return(0,b.createElement)("div",{className:`has-${n}-columns`},(0,b.createElement)(KI.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...r}=e;return[e={...r,isStackedOnMobile:!0},t]},save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:r}=t,o=C()(`has-${r}-columns`,{[`are-vertically-aligned-${n}`]:n});return(0,b.createElement)("div",{className:o},(0,b.createElement)(KI.Content,null))}}],vq=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function bq(e,t){const{width:n=100/t}=e.attributes;return vq(n)}function yq(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>e+bq(n,t)),0)}(e,n);return(0,N.mapValues)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>{const r=bq(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}(e,n),(e=>vq(t*e/r)))}function _q(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const kq=["core/column"],xq=(0,lg.Z)(((e,t,n)=>({updateAlignment(r){const{clientId:o,setAttributes:i}=t,{updateBlockAttributes:l}=e(pd),{getBlockOrder:a}=n.select(pd);i({verticalAlignment:r}),a(o).forEach((e=>{l(e,{verticalAlignment:r})}))},updateColumns(r,o){const{clientId:i}=t,{replaceInnerBlocks:l}=e(pd),{getBlocks:a}=n.select(pd);let s=a(i);const c=function(e){return e.every((e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}))}(s),u=o>r;if(u&&c){const e=vq(100/o);s=[..._q(s,yq(s,100-e)),...Array.from({length:o-r}).map((()=>nr("core/column",{width:`${e}%`})))]}else u?s=[...s,...Array.from({length:o-r}).map((()=>nr("core/column")))]:(s=s.slice(0,-(r-o)),c&&(s=_q(s,yq(s,100))));l(i,s)}})))((function(e){let{attributes:t,setAttributes:n,updateAlignment:r,updateColumns:o,clientId:i}=e;const{isStackedOnMobile:l,verticalAlignment:a}=t,{count:s}=(0,un.Z)((e=>({count:e(pd).getBlockCount(i)})),[i]),c=qI(F_({className:C()({[`are-vertically-aligned-${a}`]:a,"is-not-stacked-on-mobile":!l})}),{allowedBlocks:kq,orientation:"horizontal",renderAppender:!1});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,null,(0,b.createElement)(Jp,{onChange:r,value:a})),(0,b.createElement)(Gf,null,(0,b.createElement)(nf.Z,null,(0,b.createElement)(fN,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Columns"),value:s,onChange:e=>o(s,e),min:1,max:Math.max(6,s)}),s>6&&(0,b.createElement)(qP.Z,{status:"warning",isDismissible:!1},(0,O.__)("This column count exceeds the recommended amount and may cause visual breakage.")),(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}))),(0,b.createElement)("div",c))}));function wq(e){let{clientId:t,name:n,setAttributes:r}=e;const{blockType:o,defaultVariation:i,variations:l}=(0,un.Z)((e=>{const{getBlockVariations:t,getBlockType:r,getDefaultBlockVariation:o}=e(Bo);return{blockType:r(n),defaultVariation:o(n,"block"),variations:t(n,"block")}}),[n]),{replaceInnerBlocks:a}=(0,dn.Z)(pd),s=F_();return(0,b.createElement)("div",s,(0,b.createElement)($D,{icon:(0,N.get)(o,["icon","src"]),label:(0,N.get)(o,["title"]),variations:l,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;e.attributes&&r(e.attributes),e.innerBlocks&&a(t,rr(e.innerBlocks),!0)},allowSkip:!0}))}const Cq=[{name:"one-column-full",title:(0,O.__)("100"),description:(0,O.__)("One column"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,O.__)("50 / 50"),description:(0,O.__)("Two columns; equal split"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,O.__)("33 / 66"),description:(0,O.__)("Two columns; one-third, two-thirds split"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,O.__)("66 / 33"),description:(0,O.__)("Two columns; two-thirds, one-third split"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,O.__)("33 / 33 / 33"),description:(0,O.__)("Three columns; equal split"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,O.__)("25 / 50 / 25"),description:(0,O.__)("Three columns; wide center column"),icon:(0,b.createElement)(Vp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,b.createElement)(Vp.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],Eq={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map((e=>{let{name:n,attributes:r,innerBlocks:o}=e;return["core/column",{width:`${t}%`},[[n,{...r},o]]]}));return nr("core/columns",{},rr(n))},isMatch:(e,t)=>{let{length:n}=e;return(1!==t.length||"core/columns"!==t[0].name)&&n&&n<=6}},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:r,textColor:o,style:i,mediaAlt:l,mediaId:a,mediaPosition:s,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:m}=e;let h;h="image"!==u&&u?["core/video",{id:a,src:d}]:["core/image",{id:a,alt:l,url:d,sizeSlug:c,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const f=[["core/column",{width:`${p}%`},[h]],["core/column",{width:100-p+"%"},t]];return"right"===s&&f.reverse(),nr("core/columns",{align:n,backgroundColor:r,textColor:o,style:i,verticalAlignment:m},rr(f))}}],to:[{type:"block",blocks:["*"],transform:(e,t)=>t.flatMap((e=>e.innerBlocks))}]},Sq=Eq,Iq={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Tq}=Iq,Nq={icon:hq.Z,variations:Cq,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,O.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,O.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,O.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,O.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:gq,edit:e=>{const{clientId:t}=e,n=(0,un.Z)((e=>e(pd).getBlocks(t).length>0),[t])?xq:wq;return(0,b.createElement)(n,e)},save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,verticalAlignment:r}=t,o=C()({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!n}),i=F_.save({className:o}),l=qI.save(i);return(0,b.createElement)("div",l)},transforms:Sq},Bq="core/columns",Pq={name:Bq,examples:null,deprecated:null,save:()=>null},Aq={...Iq,...Nq,...Pq,category:"design",supports:{...Iq.supports,anchor:!1}};var Lq=n(36420);const Rq=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:`${e.width}%`}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=C()({[`is-vertically-aligned-${n}`]:n}),i={flexBasis:r+"%"};return(0,b.createElement)("div",{className:o,style:i},(0,b.createElement)(KI.Content,null))}}],Dq=Rq,Mq={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalLayout:!0}},{name:Oq}=Mq,Fq={icon:Lq.Z,edit:function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:r,allowedBlocks:o},setAttributes:i,clientId:l}=e;const a=C()("block-core-columns",{[`is-vertically-aligned-${t}`]:t}),s=Lm({availableUnits:am("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:c,hasChildBlocks:u,rootClientId:d}=(0,un.Z)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(pd),r=n(l);return{hasChildBlocks:t(l).length>0,rootClientId:r,columnsIds:t(r)}}),[l]),{updateBlockAttributes:p}=(0,dn.Z)(pd),m=Number.isFinite(n)?n+"%":n,h=F_({className:a,style:m?{flexBasis:m}:void 0}),f=c.length,g=c.indexOf(l)+1,v=(0,O.sprintf)((0,O.__)("%1$s (%2$d of %3$d)"),h["aria-label"],g,f),y=qI({...h,"aria-label":v},{templateLock:r,allowedBlocks:o,renderAppender:u?void 0:KI.ButtonBlockAppender});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,null,(0,b.createElement)(Jp,{onChange:e=>{i({verticalAlignment:e}),p(d,{verticalAlignment:null})},value:t})),(0,b.createElement)(Gf,null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Column settings")},(0,b.createElement)($m,{label:(0,O.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,i({width:e})},units:s}))),(0,b.createElement)("div",y))},save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=C()({[`is-vertically-aligned-${n}`]:n});let i;if(r&&/\d/.test(r)){let e=Number.isFinite(r)?r+"%":r;if(!Number.isFinite(r)&&null!=r&&r.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(r)*t)/t+"%"}i={flexBasis:e}}const l=F_.save({className:o,style:i}),a=qI.save(l);return(0,b.createElement)("div",a)},deprecated:Dq},Zq="core/column",jq={name:Zq,examples:null,deprecated:null,save:()=>null},zq={...Mq,...Fq,...jq,category:"design",supports:{...Mq.supports,anchor:!1}};var Hq=n(78991);const Vq={className:!1,anchor:!0},Wq={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},Uq=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:n,...r}=e;return{...r,style:t}},$q=["left","right","center"],Gq=e=>{const{align:t,...n}=e;return $q.includes(t)?{...n,textAlign:t}:e},qq={supports:Vq,attributes:{...Wq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Uq(Gq(e)),save(e){let{attributes:t}=e;const{align:n,level:r,content:o,textColor:i,customTextColor:l}=t,a="h"+r,s=MB("color",i),c=C()({[s]:s});return(0,b.createElement)(TF.Content,{className:c||void 0,tagName:a,style:{textAlign:n,color:s?void 0:l},value:o})}},Kq={attributes:{...Wq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Uq(Gq(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=MB("color",l),c=C()({[s]:s,[`has-text-align-${n}`]:n});return(0,b.createElement)(TF.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})},supports:Vq},Yq={supports:Vq,attributes:{...Wq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Uq(Gq(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=MB("color",l),c=C()({[s]:s,"has-text-color":l||o,[`has-text-align-${n}`]:n});return(0,b.createElement)(TF.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})}},Xq=[{supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save(e){let{attributes:t}=e;const{textAlign:n,content:r,level:o}=t,i="h"+o,l=C()({[`has-text-align-${n}`]:n});return(0,b.createElement)(i,F_.save({className:l}),(0,b.createElement)(TF.Content,{value:r}))}},{supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:Wq,isEligible:e=>{let{align:t}=e;return $q.includes(t)},migrate:Gq,save(e){let{attributes:t}=e;const{align:n,content:r,level:o}=t,i="h"+o,l=C()({[`has-text-align-${n}`]:n});return(0,b.createElement)(i,F_.save({className:l}),(0,b.createElement)(TF.Content,{value:r}))}},Yq,Kq,qq];function Qq(e){let{level:t,isPressed:n=!1}=e;const r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?(0,b.createElement)(Vp.Wj,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},(0,b.createElement)(Vp.y$,{d:r[t]})):null}const Jq=[1,2,3,4,5,6],eK={className:"block-library-heading-level-dropdown"};function tK(e){let{selectedLevel:t,onChange:n}=e;return(0,b.createElement)(Id,{popoverProps:eK,icon:(0,b.createElement)(Qq,{level:t}),label:(0,O.__)("Change heading level"),controls:Jq.map((e=>{{const r=e===t;return{icon:(0,b.createElement)(Qq,{level:e,isPressed:r}),label:(0,O.sprintf)((0,O.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}}))})}const nK={},rK=(e,t)=>{const n=(e=>Ar()((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""))(t);if(""===n)return null;delete nK[e];let r=n,o=0;for(;Object.values(nK).includes(r);)o+=1,r=n+"-"+o;return r},oK=(e,t)=>{nK[e]=t},{name:iK}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},lK={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,anchor:n,align:r}=e;return nr(iK,{content:t,anchor:n,textAlign:r})}))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;const r={children:t,attributes:n?[]:["style","id"]};return{h1:r,h2:r,h3:r,h4:r,h5:r,h6:r}},transform(e){const t=Gi(iK,e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),nr(iK,t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>nr(iK,{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>nr(iK,{level:e,content:t})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,textAlign:n}=e;return nr("core/paragraph",{content:t,align:n})}))}]},aK=lK,sK={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:cK}=sK,uK={icon:Hq.Z,example:{attributes:{content:(0,O.__)("Code is Poetry"),level:2}},__experimentalLabel(e,t){let{context:n}=t;const{content:r,level:o}=e;return"list-view"===n&&r?r:"accessibility"===n?r&&0!==r.length?(0,O.sprintf)((0,O.__)("Level %1$s. %2$s"),o,r):(0,O.sprintf)((0,O.__)("Level %s. Empty."),o):void 0},transforms:aK,deprecated:Xq,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:r,onReplace:o,style:i,clientId:l}=e;const{textAlign:a,content:s,level:c,placeholder:u,anchor:d}=t,p="h"+c,m=F_({className:C()({[`has-text-align-${a}`]:a}),style:i}),{canGenerateAnchors:h}=(0,un.Z)((e=>{const{getGlobalBlockCount:t,getSettings:n}=e(pd);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:f}=(0,dn.Z)(pd);return(0,b.useEffect)((()=>{if(h)return!d&&s&&(f(),n({anchor:rK(l,s)})),oK(l,d),()=>oK(l,null)}),[d,s,l,h]),(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,{group:"block"},(0,b.createElement)(tK,{selectedLevel:c,onChange:e=>n({level:e})}),(0,b.createElement)(HD,{value:a,onChange:e=>{n({textAlign:e})}})),(0,b.createElement)(TF,(0,ta.Z)({identifier:"content",tagName:p,value:s,onChange:e=>{const t={content:e};!h||d&&e&&rK(l,s)!==d||(t.anchor=rK(l,e)),n(t)},onMerge:r,onSplit:(e,n)=>{let r;var o;return r=n||e?nr("core/heading",{...t,content:e}):nr(null!==(o=Gn())&&void 0!==o?o:"core/heading"),n&&(r.clientId=l),r},onReplace:o,onRemove:()=>o([]),"aria-label":(0,O.__)("Heading text"),placeholder:u||(0,O.__)("Heading"),textAlign:a},Pa.Z.isNative&&{deleteEnter:!0},m)))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:r,level:o}=t,i="h"+o,l=C()({[`has-text-align-${n}`]:n});return(0,b.createElement)(i,F_.save({className:l}),(0,b.createElement)(TF.Content,{value:r}))}},dK="core/heading",pK={name:dK,examples:null,deprecated:null,save:()=>null},mK={...sK,...uK,...pK,category:"design",supports:{...sK.supports,html:!1}};var hK=n(29199);const fK={className:!1},gK={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},vK=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:n,customBackgroundColor:r,customFontSize:o,...i}=e;return{...i,style:t}},{style:bK,...yK}=gK,_K=[{supports:fK,attributes:{...yK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,direction:i}=t,l=C()({"has-drop-cap":n!==((0,O.isRTL)()?"left":"right")&&"center"!==n&&o,[`has-text-align-${n}`]:n});return(0,b.createElement)("p",F_.save({className:l,dir:i}),(0,b.createElement)(TF.Content,{value:r}))}},{supports:fK,attributes:{...yK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:vK,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:u,direction:d}=t,p=MB("color",l),m=MB("background-color",i),h=hL(c),f=C()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[`has-text-align-${n}`]:n,[h]:h,[p]:p,[m]:m}),g={backgroundColor:m?void 0:a,color:p?void 0:s,fontSize:h?void 0:u};return(0,b.createElement)(TF.Content,{tagName:"p",style:g,className:f||void 0,value:r,dir:d})}},{supports:fK,attributes:{...yK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:vK,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:u,direction:d}=t,p=MB("color",l),m=MB("background-color",i),h=hL(c),f=C()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[h]:h,[p]:p,[m]:m}),g={backgroundColor:m?void 0:a,color:p?void 0:s,fontSize:h?void 0:u,textAlign:n};return(0,b.createElement)(TF.Content,{tagName:"p",style:g,className:f||void 0,value:r,dir:d})}},{supports:fK,attributes:{...yK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:vK,save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,customBackgroundColor:s,customTextColor:c,fontSize:u,customFontSize:d}=t,p=MB("color",a),m=MB("background-color",l),h=u&&`is-${u}-text`,f=C()({[`align${n}`]:n,"has-background":l||s,"has-drop-cap":i,[h]:h,[p]:p,[m]:m}),g={backgroundColor:m?void 0:s,color:p?void 0:c,fontSize:h?void 0:d,textAlign:r};return(0,b.createElement)(TF.Content,{tagName:"p",style:g,className:f||void 0,value:o})}},{supports:fK,attributes:{...yK,fontSize:{type:"number"}},save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,fontSize:s}=t,c=C()({[`align${n}`]:n,"has-background":l,"has-drop-cap":i}),u={backgroundColor:l,color:a,fontSize:s,textAlign:r};return(0,b.createElement)("p",{style:u,className:c||void 0},o)},migrate:e=>vK({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:fK,attributes:{...gK,content:{type:"string",source:"html",default:""}},save(e){let{attributes:t}=e;return(0,b.createElement)(Wo.Z,null,t.content)},migrate:e=>e}],kK=_K;var xK=n(9098);function wK(e){const{batch:t}=(0,Jf.Z)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:o,insertBlock:i}=(0,dn.Z)(pd),{getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s,getBlockName:c,getBlock:u,getNextBlockClientId:d}=(0,un.Z)(pd),p=(0,b.useRef)(e);return p.current=e,(0,__.Z)((e=>{function m(e){if(e.defaultPrevented)return;if(e.keyCode!==T_.ENTER)return;const{content:m,clientId:h}=p.current;if(m.length)return;const f=l(h);if(!Xn(c(f),"__experimentalOnEnter",!1))return;const g=s(f);e.preventDefault();const v=g.indexOf(h);if(v===g.length-1)return void n([h],f,l(f),a(f)+1);const b=u(f);t((()=>{o([f]);const e=a(f);r(f,b.innerBlocks.slice(0,v)),r(d(f),b.innerBlocks.slice(v+1)),i(nr("core/paragraph"),e+1,l(f),!0)}))}return e.addEventListener("keydown",m),()=>{e.removeEventListener("keydown",m)}}),[])}function CK(e){let{direction:t,setDirection:n}=e;return(0,O.isRTL)()&&(0,b.createElement)(sa,{icon:xK.Z,title:(0,O._x)("Left to right","editor button"),isActive:"ltr"===t,onClick:()=>{n("ltr"===t?void 0:"ltr")}})}function EK(e){return e===((0,O.isRTL)()?"left":"right")||"center"===e}const{name:SK}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},IK={from:[{type:"raw",priority:20,selector:"p",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;return{p:{children:t,attributes:n?[]:["style","id"]}}},transform(e){const t=Gi(SK,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),nr(SK,t)}}]},TK=IK,NK={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:BK}=NK,PK={icon:hK.Z,example:{attributes:{content:(0,O.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t}=e;return t&&0!==t.length?t:(0,O.__)("Empty")}},transforms:TK,deprecated:kK,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,mergeBlocks:n,onReplace:r,onRemove:o,setAttributes:i,clientId:l}=e;const{align:a,content:s,direction:c,dropCap:u,placeholder:d}=t,p=am("typography.dropCap"),m=F_({ref:wK({clientId:l,content:s}),className:C()({"has-drop-cap":!EK(a)&&u,[`has-text-align-${a}`]:a}),style:{direction:c}});let h;return h=EK(a)?(0,O.__)("Not available for aligned text."):u?(0,O.__)("Showing large initial letter."):(0,O.__)("Toggle to show a large initial letter."),(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,{group:"block"},(0,b.createElement)(HD,{value:a,onChange:e=>i({align:e,dropCap:!EK(e)&&u})}),(0,b.createElement)(CK,{direction:c,setDirection:e=>i({direction:e})})),p&&(0,b.createElement)(Gf,{group:"typography"},(0,b.createElement)(pT,{hasValue:()=>!!u,label:(0,O.__)("Drop cap"),onDeselect:()=>i({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:l},(0,b.createElement)(Bp.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Drop cap"),checked:!!u,onChange:()=>i({dropCap:!u}),help:h,disabled:!!EK(a)}))),(0,b.createElement)(TF,(0,ta.Z)({identifier:"content",tagName:"p"},m,{value:s,onChange:e=>i({content:e}),onSplit:(e,n)=>{let r;(n||e)&&(r={...t,content:e});const o=nr("core/paragraph",r);return n&&(o.clientId=l),o},onMerge:n,onReplace:r,onRemove:o,"aria-label":s?(0,O.__)("Paragraph block"):(0,O.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:d||(0,O.__)("Type / to choose a block"),"data-custom-placeholder":!!d||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))},save:function(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,direction:i}=t,l=C()({"has-drop-cap":n!==((0,O.isRTL)()?"left":"right")&&"center"!==n&&o,[`has-text-align-${n}`]:n});return(0,b.createElement)("p",F_.save({className:l,dir:i}),(0,b.createElement)(TF.Content,{value:r}))}},AK="core/paragraph",LK={name:AK,examples:null,deprecated:null,save:()=>null},RK={...NK,...PK,...LK,category:"design",supports:{...NK.supports,html:!1,anchor:!1}};var DK=n(57341);const MK={align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},OK={anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}}},FK=[{attributes:MK,supports:OK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:h}=t,f=(0,N.isEmpty)(a)?void 0:a,g=C()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u}),v=(0,b.createElement)("img",{src:n,alt:r,className:d?`wp-image-${d}`:null,width:c,height:u,title:h}),y=(0,b.createElement)(b.Fragment,null,l?(0,b.createElement)("a",{className:s,href:l,target:p,rel:f},v):v,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{tagName:"figcaption",value:o}));return(0,b.createElement)("figure",F_.save({className:g}),y)}},{attributes:{...MK,title:{type:"string",source:"attribute",selector:"img",attribute:"title"},sizeSlug:{type:"string"}},supports:OK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:h}=t,f=(0,N.isEmpty)(a)?void 0:a,g=C()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u}),v=(0,b.createElement)("img",{src:n,alt:r,className:d?`wp-image-${d}`:null,width:c,height:u,title:h}),y=(0,b.createElement)(b.Fragment,null,l?(0,b.createElement)("a",{className:s,href:l,target:p,rel:f},v):v,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{tagName:"figcaption",value:o}));return"left"===i||"right"===i||"center"===i?(0,b.createElement)("div",F_.save(),(0,b.createElement)("figure",{className:g},y)):(0,b.createElement)("figure",F_.save({className:g}),y)}},{attributes:MK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,u=C()({[`align${i}`]:i,"is-resized":a||s}),d=(0,b.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,b.createElement)("figure",{className:u},l?(0,b.createElement)("a",{href:l},d):d,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{tagName:"figcaption",value:o}))}},{attributes:MK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,u=(0,b.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,b.createElement)("figure",{className:i?`align${i}`:null},l?(0,b.createElement)("a",{href:l},u):u,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{tagName:"figcaption",value:o}))}},{attributes:MK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s}=t,c=a||s?{width:a,height:s}:{},u=(0,b.createElement)("img",(0,ta.Z)({src:n,alt:r},c));let d={};return a?d={width:a}:"left"!==i&&"right"!==i||(d={maxWidth:"50%"}),(0,b.createElement)("figure",{className:i?`align${i}`:null,style:d},l?(0,b.createElement)("a",{href:l},u):u,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{tagName:"figcaption",value:o}))}}],ZK=FK;var jK=n(98841);const zK=()=>{},HK={bottom:"bottom",corner:"corner"};const VK=(0,Vd.default)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),WK=(0,Vd.default)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),UK=(0,Vd.default)("div",{target:"e1wq7y4k1"})("background:",Ud.D.gray[900],";border-radius:2px;box-sizing:border-box;font-size:12px;color:",Ud.D.ui.textDark,";padding:4px 8px;position:relative;"),$K=(0,Vd.default)(HE.Z,{target:"e1wq7y4k0"})("&&&{color:",Ud.D.ui.textDark,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),GK=(0,b.forwardRef)((function(e,t){let{label:n,position:r=HK.corner,zIndex:o=1e3,...i}=e;const l=!!n,a=r===HK.bottom,s=r===HK.corner;if(!l)return null;let c={opacity:l?1:void 0,zIndex:o},u={};return a&&(c={...c,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},u={transform:"translate(0, 100%)"}),s&&(c={...c,position:"absolute",top:4,right:(0,O.isRTL)()?void 0:4,left:(0,O.isRTL)()?4:void 0}),(0,b.createElement)(WK,(0,ta.Z)({"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:t,style:c},i),(0,b.createElement)(UK,{className:"components-resizable-tooltip__tooltip",style:u},(0,b.createElement)($K,{as:"span"},n)))})),qK=GK,KK=()=>{},YK=(0,b.forwardRef)((function(e,t){let{axis:n,className:r,fadeTimeout:o=180,isVisible:i=!0,labelRef:l,onResize:a=KK,position:s=HK.bottom,showPx:c=!0,zIndex:u=1e3,...d}=e;const{label:p,resizeListener:m}=function(e){let{axis:t,fadeTimeout:n=180,onResize:r=zK,position:o=HK.bottom,showPx:i=!1}=e;const[l,a]=(0,Jd.Z)(),s=!!t,[c,u]=(0,b.useState)(!1),[d,p]=(0,b.useState)(!1),{width:m,height:h}=a,f=(0,b.useRef)(h),g=(0,b.useRef)(m),v=(0,b.useRef)(),y=(0,b.useCallback)((()=>{v.current&&window.clearTimeout(v.current),v.current=window.setTimeout((()=>{s||(u(!1),p(!1))}),n)}),[n,s]);(0,b.useEffect)((()=>{if(null===m&&null===h)return;const e=m!==g.current,t=h!==f.current;if(e||t){if(m&&!g.current&&h&&!f.current)return g.current=m,void(f.current=h);e&&(u(!0),g.current=m),t&&(p(!0),f.current=h),r({width:m,height:h}),y()}}),[m,h,r,y]);const _=function(e){let{axis:t,height:n,moveX:r=!1,moveY:o=!1,position:i=HK.bottom,showPx:l=!1,width:a}=e;if(!r&&!o)return;if(i===HK.corner)return`${a} x ${n}`;const s=l?" px":"";if(t){if("x"===t&&r)return`${a}${s}`;if("y"===t&&o)return`${n}${s}`}return r&&o?`${a} x ${n}`:r?`${a}${s}`:o?`${n}${s}`:void 0}({axis:t,height:h,moveX:c,moveY:d,position:o,showPx:i,width:m});return{label:_,resizeListener:l}}({axis:n,fadeTimeout:o,onResize:a,showPx:c,position:s});if(!i)return null;const h=C()("components-resize-tooltip",r);return(0,b.createElement)(VK,(0,ta.Z)({"aria-hidden":"true",className:h,ref:t},d),m,(0,b.createElement)(qK,{"aria-hidden":d["aria-hidden"],label:p,position:s,ref:l,zIndex:u}))})),XK=YK,QK="components-resizable-box__handle",JK="components-resizable-box__side-handle",eY="components-resizable-box__corner-handle",tY={top:C()(QK,JK,"components-resizable-box__handle-top"),right:C()(QK,JK,"components-resizable-box__handle-right"),bottom:C()(QK,JK,"components-resizable-box__handle-bottom"),left:C()(QK,JK,"components-resizable-box__handle-left"),topLeft:C()(QK,eY,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:C()(QK,eY,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:C()(QK,eY,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:C()(QK,eY,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},nY={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},rY={top:nY,right:nY,bottom:nY,left:nY,topLeft:nY,topRight:nY,bottomRight:nY,bottomLeft:nY},oY=(0,b.forwardRef)((function(e,t){let{className:n,children:r,showHandle:o=!0,__experimentalShowTooltip:i=!1,__experimentalTooltipProps:l={},...a}=e;return(0,b.createElement)(jK.Resizable,(0,ta.Z)({className:C()("components-resizable-box__container",o&&"has-show-handle",n),handleClasses:tY,handleStyles:rY,ref:t},a),r,i&&(0,b.createElement)(XK,l))})),iY=oY;var lY=n(89307),aY=n(33918),sY=n(67025),cY=n(34342);const uY=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],dY="wp-embed";var pY=n(41779),mY=n.n(pY);const{name:hY}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},type:{type:"string",__experimentalRole:"content"},providerNameSlug:{type:"string",__experimentalRole:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,__experimentalRole:"content"},previewable:{type:"boolean",default:!0,__experimentalRole:"content"}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},fY=e=>e&&e.includes('class="wp-embedded-content"'),gY=e=>{if(!e)return e;const t=uY.reduce(((e,t)=>{let{className:n}=t;return e[n]=!1,e}),{"wp-has-aspect-ratio":!1});return mY()(e,t)};Oi()((function(e,t,n,r){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return{};const i={};let{type:l="rich"}=e;const{html:a,provider_name:s}=e,c=(0,N.kebabCase)((s||t).toLowerCase());return fY(a)&&(l=dY),(a||"photo"===l)&&(i.type=l,i.providerNameSlug=c),i.className=function(e,t){if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])return gY(t);const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=n.body.querySelector("iframe");if(r&&r.height&&r.width){const e=(r.width/r.height).toFixed(2);for(let n=0;n<uY.length;n++){const r=uY[n];if(e>=r.ratio)return e-r.ratio>.1?gY(t):mY()(gY(t),r.className,"wp-has-aspect-ratio")}}return t}(a,n,r&&o),i}));const vY="none",bY="media",yY="attachment",_Y="custom",kY=["image"];function xY(e){var t,n;let{temporaryURL:r,attributes:o,setAttributes:i,isSelected:l,insertBlocksAfter:a,onReplace:s,onSelectImage:c,onSelectURL:u,onUploadError:d,containerRef:p,context:m,clientId:h,isContentLocked:f}=e;const{url:g="",alt:v,caption:y,align:_,id:k,href:x,rel:w,linkClass:C,linkDestination:E,title:S,width:I,height:T,linkTarget:B,sizeSlug:P}=o,A=(0,b.useRef)(),L=(0,tp.Z)(y),[R,D]=(0,b.useState)(!!y),{allowResize:M=!0}=m,{getBlock:F}=(0,un.Z)(pd),{image:Z,multiImageSelection:j}=(0,un.Z)((e=>{const{getMedia:t}=e(cn),{getMultiSelectedBlockClientIds:n,getBlockName:r}=e(pd),o=n();return{image:k&&l?t(k,{context:"view"}):null,multiImageSelection:o.length&&o.every((e=>"core/image"===r(e)))}}),[k,l,h]),{canInsertCover:z,imageEditing:H,imageSizes:V,maxWidth:W,mediaUpload:U}=(0,un.Z)((e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:r}=e(pd),o=t(h),i=n();return{imageEditing:i.imageEditing,imageSizes:i.imageSizes,maxWidth:i.maxWidth,mediaUpload:i.mediaUpload,canInsertCover:r("core/cover",o)}}),[h]),{replaceBlocks:$,toggleSelection:G}=(0,dn.Z)(pd),{createErrorNotice:q,createSuccessNotice:K}=(0,dn.Z)(aw.h),Y=(0,tg.Z)("medium"),X=["wide","full"].includes(_),[{loadedNaturalWidth:Q,loadedNaturalHeight:J},ee]=(0,b.useState)({}),[te,ne]=(0,b.useState)(!1),[re,oe]=(0,b.useState)(),ie=function(e,t){const[n,r]=(0,b.useState)();function o(){var t;r(null===(t=e.current)||void 0===t?void 0:t.clientWidth)}return(0,b.useEffect)(o,t),(0,b.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",o),()=>{t.removeEventListener("resize",o)}}),[]),n}(p,[_]),le=M&&!f&&!(X&&Y),ae=V.filter((e=>{var t,n,r;let{slug:o}=e;return null==Z||null===(t=Z.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(r=n[o])||void 0===r?void 0:r.source_url})).map((e=>{let{name:t,slug:n}=e;return{value:n,label:t}}));(0,b.useEffect)((()=>{CY(k,g)&&l&&!re&&window.fetch(g).then((e=>e.blob())).then((e=>oe(e))).catch((()=>{}))}),[k,g,l,re]),(0,b.useEffect)((()=>{y&&!L&&D(!0)}),[y,L]);const se=(0,b.useCallback)((e=>{e&&!y&&e.focus()}),[y]),{naturalWidth:ce,naturalHeight:ue}=(0,b.useMemo)((()=>{var e,t;return{naturalWidth:(null===(e=A.current)||void 0===e?void 0:e.naturalWidth)||Q||void 0,naturalHeight:(null===(t=A.current)||void 0===t?void 0:t.naturalHeight)||J||void 0}}),[Q,J,null===(t=A.current)||void 0===t?void 0:t.complete]);(0,b.useEffect)((()=>{l||(ne(!1),y||D(!1))}),[l,y]);const de=k&&ce&&ue&&H,pe=!j&&de&&!te,me=(0,b.createElement)(b.Fragment,null,(0,b.createElement)(Sd,{group:"block"},!f&&(0,b.createElement)(qh,{value:_,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};i({...t,align:e})}}),!f&&(0,b.createElement)(sa,{onClick:()=>{D(!R),R&&y&&i({caption:void 0})},icon:aY.Z,isPressed:R,label:R?(0,O.__)("Remove caption"):(0,O.__)("Add caption")}),!j&&!te&&(0,b.createElement)(ZF,{url:x||"",onChangeUrl:function(e){i(e)},linkDestination:E,mediaUrl:Z&&Z.source_url||g,mediaLink:Z&&Z.link,linkTarget:B,linkClass:C,rel:w}),pe&&(0,b.createElement)(sa,{onClick:()=>ne(!0),icon:sY.Z,label:(0,O.__)("Crop")}),re&&(0,b.createElement)(sa,{onClick:function(){U({filesList:[re],onFileChange(e){let[t]=e;c(t),Cn(t.url)||(oe(),K((0,O.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:kY,onError(e){q(e,{type:"snackbar"})}})},icon:NO.Z,label:(0,O.__)("Upload external image")}),!j&&z&&(0,b.createElement)(sa,{icon:cY.Z,label:(0,O.__)("Add text over image"),onClick:function(){$(h,pr(F(h),"core/cover"))}})),!j&&!te&&(0,b.createElement)(Sd,{group:"other"},(0,b.createElement)(LO,{mediaId:k,mediaURL:g,allowedTypes:kY,accept:"image/*",onSelect:c,onSelectURL:u,onError:d})),(0,b.createElement)(Gf,null,(0,b.createElement)(nf.Z,{title:(0,O.__)("Settings")},!j&&(0,b.createElement)(rq.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Alt text (alternative text)"),value:v,onChange:function(e){i({alt:e})},help:(0,b.createElement)(b.Fragment,null,(0,b.createElement)(tf.Z,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,O.__)("Describe the purpose of the image")),(0,O.__)("Leave empty if the image is purely decorative."))}),(0,b.createElement)(IM,{onChangeImage:function(e){var t,n,r;const o=null==Z||null===(t=Z.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.source_url;if(!o)return null;i({url:o,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>i(e),slug:P,width:I,height:T,imageSizeOptions:ae,isResizable:le,imageWidth:ce,imageHeight:ue}))),(0,b.createElement)(Gf,{group:"advanced"},(0,b.createElement)(ef.Z,{__nextHasNoMarginBottom:!0,label:(0,O.__)("Title attribute"),value:S||"",onChange:function(e){i({title:e})},help:(0,b.createElement)(b.Fragment,null,(0,O.__)("Describe the role of this image on the page."),(0,b.createElement)(tf.Z,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},(0,O.__)("(Note: many devices and browsers do not display this text.)")))}))),he=(0,lY.v)(g);let fe;fe=v||(he?(0,O.sprintf)((0,O.__)("This image has an empty alt attribute; its file name is %s"),he):(0,O.__)("This image has an empty alt attribute"));const ge=DD(o),ve=null===(n=o.className)||void 0===n?void 0:n.includes("is-style-rounded"),be=!!ge.className||!(0,N.isEmpty)(ge.style);let ye,_e,ke=(0,b.createElement)(b.Fragment,null,(0,b.createElement)("img",{src:r||g,alt:fe,onError:()=>function(){const e=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{preview:r,attributes:o={}}=e,{url:i,providerNameSlug:l,type:a,...s}=o;if(!i||!qn(hY))return;const c=(e=>{var t;return null===(t=er(hY))||void 0===t?void 0:t.find((t=>{let{patterns:n}=t;return function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((t=>e.match(t)))}(e,n)}))})(i),u="wordpress"===l||a===dY;if(!u&&c&&(c.attributes.providerNameSlug!==l||!l))return nr(hY,{url:i,...s,...c.attributes});const d=null===(t=er(hY))||void 0===t?void 0:t.find((e=>{let{name:t}=e;return"wordpress"===t}));return d&&r&&fY(r.html)&&!u?nr(hY,{url:i,...d.attributes,...n}):void 0}({attributes:{url:g}});void 0!==e&&s(e)}(),onLoad:e=>{var t,n;ee({loadedNaturalWidth:null===(t=e.target)||void 0===t?void 0:t.naturalWidth,loadedNaturalHeight:null===(n=e.target)||void 0===n?void 0:n.naturalHeight})},ref:A,className:ge.className,style:ge.style}),r&&(0,b.createElement)(cC.ZP,null));if(ie&&ce&&ue){const e=ce>ie;ye=e?ie:ce,_e=e?ie*(ue/ce):ue}if(de&&te)ke=(0,b.createElement)(CM,{id:k,url:g,width:I,height:T,clientWidth:ie,naturalHeight:ue,naturalWidth:ce,onSaveImage:e=>i(e),onFinishEditing:()=>{ne(!1)},borderProps:ve?void 0:ge});else if(le&&ye){const e=I||ye,t=T||_e,n=ce/ue,r=ce<ue?20:20*n,o=ue<ce?20:20/n,a=2.5*W;let s=!1,c=!1;"center"===_?(s=!0,c=!0):(0,O.isRTL)()?"left"===_?s=!0:c=!0:"right"===_?c=!0:s=!0,ke=(0,b.createElement)(iY,{size:{width:null!=I?I:"auto",height:T&&!be?T:"auto"},showHandle:l,minWidth:r,maxWidth:a,minHeight:o,maxHeight:a/n,lockAspectRatio:!0,enable:{top:!1,right:s,bottom:!0,left:c},onResizeStart:function(){G(!1)},onResizeStop:(n,r,o,l)=>{G(!0),i({width:parseInt(e+l.width,10),height:parseInt(t+l.height,10)})},resizeRatio:"center"===_?2:1},ke)}else ke=(0,b.createElement)("div",{style:{width:I,height:T}},ke);return(0,b.createElement)(b.Fragment,null,!r&&me,ke,R&&(!TF.isEmpty(y)||l)&&(0,b.createElement)(TF,{identifier:"caption",className:$Z("caption"),ref:se,tagName:"figcaption","aria-label":(0,O.__)("Image caption text"),placeholder:(0,O.__)("Add caption"),value:y,onChange:e=>i({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a(nr(Gn()))}))}const wY=e=>(0,b.createElement)(WD,{className:"block-editor-media-placeholder",withIllustration:!0,icon:DK.Z,label:(0,O.__)("Image"),instructions:(0,O.__)("Upload an image file, pick one from your media library, or add one with a URL.")},e),CY=(e,t)=>t&&!e&&!Cn(t);function EY(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:r}=n;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}const SY={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},IY={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:e=>{let{phrasingContentSchema:t}=e;return{figure:{require:["img"],children:{...SY,a:{attributes:["href","rel","target"],children:SY},figcaption:{children:t}}}}},transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,o=n?n[1]:void 0,i=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),l=i?Number(i[1]):void 0,a=e.querySelector("a"),s=a&&a.href?"custom":void 0,c=a&&a.href?a.href:void 0,u=a&&a.rel?a.rel:void 0,d=a&&a.className?a.className:void 0;return nr("core/image",Gi("core/image",e.outerHTML,{align:o,id:l,linkDestination:s,href:c,rel:u,linkClass:d,anchor:r}))}},{type:"files",isMatch(e){if(e.some((e=>0===e.type.indexOf("image/")))&&e.some((e=>0!==e.type.indexOf("image/")))){const{createErrorNotice:e}=(0,S.dispatch)(aw.h);e((0,O.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file",type:"snackbar"})}return e.every((e=>0===e.type.indexOf("image/")))},transform(e){const t=e.map((e=>nr("core/image",{url:xn(e)})));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,t){let{shortcode:n}=t;const{body:r}=document.implementation.createHTMLDocument("");r.innerHTML=n.content;let o=r.querySelector("img");for(;o&&o.parentNode&&o.parentNode!==r;)o=o.parentNode;return o&&o.parentNode.removeChild(o),r.innerHTML.trim()}},href:{shortcode:(e,t)=>{let{shortcode:n}=t;return EY(n.content,"href")}},rel:{shortcode:(e,t)=>{let{shortcode:n}=t;return EY(n.content,"rel")}},linkClass:{shortcode:(e,t)=>{let{shortcode:n}=t;return EY(n.content,"class")}},id:{type:"number",shortcode:e=>{let{named:{id:t}}=e;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:e=>{let{named:{align:t="alignnone"}}=e;return t.replace("align","")}}}}]},TY=IY,NY={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img, .components-placeholder",text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSelector:"img, .wp-block-image__crop-area",__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:BY}=NY,PY={icon:DK.Z,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,O.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":(0,O.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:TY,edit:function(e){let{attributes:t,setAttributes:n,isSelected:r,className:o,insertBlocksAfter:i,onReplace:l,context:a,clientId:s}=e;const{url:c="",alt:u,caption:d,align:p,id:m,width:h,height:f,sizeSlug:g}=t,[v,y]=(0,b.useState)(),_=(0,b.useRef)();(0,b.useEffect)((()=>{_.current=u}),[u]);const k=(0,b.useRef)();(0,b.useEffect)((()=>{k.current=d}),[d]);const x=(0,b.useRef)(),{imageDefaultSize:w,mediaUpload:E,isContentLocked:S}=(0,un.Z)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n}=e(pd),r=t();return{imageDefaultSize:r.imageDefaultSize,mediaUpload:r.mediaUpload,isContentLocked:!!n(s)}}),[]),{createErrorNotice:I}=(0,dn.Z)(aw.h);function T(e){I(e,{type:"snackbar"}),n({src:void 0,id:void 0,url:void 0}),y(void 0)}function B(e){var r,o,i,l,a,s;if(!e||!e.url)return void n({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(Cn(e.url))return void y(e.url);y();let u,d=((e,t)=>{var n,r,o,i,l;const a=Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["alt","id","link","caption"].includes(t)})));return a.url=(null==e||null===(n=e.sizes)||void 0===n||null===(r=n[t])||void 0===r?void 0:r.url)||(null==e||null===(o=e.media_details)||void 0===o||null===(i=o.sizes)||void 0===i||null===(l=i[t])||void 0===l?void 0:l.source_url)||e.url,a})(e,w);if(k.current&&!d.caption){const{caption:e,...t}=d;d=t}var p,h,f,g,v,b,_;u=e.id&&e.id===m?{url:c}:{width:void 0,height:void 0,sizeSlug:(p=e,h=w,"url"in(null!==(f=null==p||null===(g=p.sizes)||void 0===g?void 0:g[h])&&void 0!==f?f:{})||"source_url"in(null!==(v=null==p||null===(b=p.media_details)||void 0===b||null===(_=b.sizes)||void 0===_?void 0:_[h])&&void 0!==v?v:{})?w:"full")};let x,C=t.linkDestination;if(!C)switch((null===(r=window)||void 0===r||null===(o=r.wp)||void 0===o||null===(i=o.media)||void 0===i||null===(l=i.view)||void 0===l||null===(a=l.settings)||void 0===a||null===(s=a.defaultProps)||void 0===s?void 0:s.link)||vY){case"file":case bY:C=bY;break;case"post":case yY:C=yY;break;case _Y:C=_Y;break;case vY:C=vY}switch(C){case bY:x=e.url;break;case yY:x=e.link}d.href=x,n({...d,...u,linkDestination:C})}function P(e){e!==c&&n({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:w})}let A=((e,t)=>!e&&Cn(t))(m,c);(0,b.useEffect)((()=>{if(!A)return;const e=function(e){return kn[e]}(c);e&&E({filesList:[e],onFileChange:e=>{let[t]=e;B(t)},allowedTypes:kY,onError:e=>{A=!1,T(e)}})}),[]),(0,b.useEffect)((()=>{A?y(c):wn(v)}),[A,c]);const L=CY(m,c)?c:void 0,R=!!c&&(0,b.createElement)("img",{alt:(0,O.__)("Edit image"),title:(0,O.__)("Edit image"),className:"edit-image-preview",src:c}),D=DD(t),M=F_({ref:x,className:C()(o,{"is-transient":v,"is-resized":!!h||!!f,[`size-${g}`]:g,"has-custom-border":!!D.className||!(0,N.isEmpty)(D.style)})});return(0,b.createElement)("figure",M,(v||c)&&(0,b.createElement)(xY,{temporaryURL:v,attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:i,onReplace:l,onSelectImage:B,onSelectURL:P,onUploadError:T,containerRef:x,context:a,clientId:s,isContentLocked:S}),!c&&!S&&(0,b.createElement)(Sd,{group:"block"},(0,b.createElement)(qh,{value:p,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}})),(0,b.createElement)(HO,{icon:(0,b.createElement)(tk,{icon:DK.Z}),onSelect:B,onSelectURL:P,onError:T,placeholder:wY,accept:"image/*",allowedTypes:kY,value:{id:m,src:L},mediaPreview:R,disableMediaButtons:v||c}))},save:function(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:h}=t,f=(0,N.isEmpty)(a)?void 0:a,g=RD(t),v=C()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u,"has-custom-border":!!g.className||!(0,N.isEmpty)(g.style)}),y=C()(g.className,{[`wp-image-${d}`]:!!d}),_=(0,b.createElement)("img",{src:n,alt:r,className:y||void 0,style:g.style,width:c,height:u,title:h}),k=(0,b.createElement)(b.Fragment,null,l?(0,b.createElement)("a",{className:s,href:l,target:p,rel:f},_):_,!TF.isEmpty(o)&&(0,b.createElement)(TF.Content,{className:$Z("caption"),tagName:"figcaption",value:o}));return(0,b.createElement)("figure",F_.save({className:v}),k)},deprecated:ZK},AY="core/image",LY={name:AY,examples:null,deprecated:null,save:()=>null},RY={...NY,...PY,...LY,category:"design",supports:{...NY.supports,html:!1,anchor:!1}},DY=e=>{const t=NG(e);if(!t[e.type])return null;const n=uz(t[e.type].name,e);return Vn(n,t[e.type].settings),n},MY=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map((e=>e.message)),t=t.join(", ")),t},OY=(e,t)=>e.map((e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:OY(e.innerBlocks,t)}:n})),FY={async SAVE_FORM(){if((0,S.select)(nj).getIsFormSaving())return;if((0,S.dispatch)(nj).saveFormStarted(),(0,S.select)(nj).getFormErrors().length)return;const e=(0,S.select)(nj).getFormData(),t=(0,S.select)(nj).getFormBlocks(),n=(0,S.select)(nj).getAllAvailableCustomFields(),r=sj(rj,fa.colors,fa.gradients,n),o={...cj(e),body:r(t),editor_version:2};await KZ.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:o}).done((e=>{(0,S.dispatch)(nj).saveFormDone(e.data.id),lz.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})})).fail((e=>{(0,S.dispatch)(nj).saveFormFailed(MY(e))}))},async SAVE_CUSTOM_FIELD(e){(0,S.dispatch)(nj).saveCustomFieldStarted();const t=(0,S.select)(nj).getAllAvailableCustomFields().find((t=>t.id===e.customFieldId)),n={};(0,N.merge)(n,t,e.data),await KZ.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((n=>{(0,S.dispatch)(nj).saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()})).then((()=>{(0,S.dispatch)(nj).saveForm()})).fail((e=>{(0,S.dispatch)(nj).saveCustomFieldFailed(MY(e))}))},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,S.select)(nj).getIsCustomFieldCreating()||((0,S.dispatch)(nj).createCustomFieldStarted(e.data),(0,S.select)(nj).getIsCustomFieldCreating()&&await KZ.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((e=>{const n=e.data;KZ.x.trackEvent("Forms > Add new custom field",{"Field type":n.type});const r=nr(DY(n));(0,S.dispatch)(pd).replaceBlock(t,r),(0,S.dispatch)(nj).createCustomFieldDone(e.data)})).fail((e=>{(0,S.dispatch)(nj).createCustomFieldFailed(MY(e))})))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,S.dispatch)(nj).deleteCustomFieldStarted();const r=(0,S.select)(nj).getAllAvailableCustomFields().find((e=>e.id===t)),o=NG(r);await KZ.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then((()=>{KZ.x.trackEvent("Forms > Delete custom field",{"Field type":r.type}),(0,S.dispatch)(nj).deleteCustomFieldDone(t,n);const e=uz(o[r.type].name,r);qn(e)&&function(e){const t=(0,S.select)(Bo).getBlockType(e);if(t)return(0,S.dispatch)(Bo).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}(e),(0,S.dispatch)(pd).removeBlock(n)})).fail((e=>{(0,S.dispatch)(nj).deleteCustomFieldFailed(MY(e))}))},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,S.select)(nj).getFormBlocks(),n=OY(t,(t=>{const n={...t};return["mailpoet-form/last-name-input","mailpoet-form/first-name-input","mailpoet-form/email-input"].includes(t.name)||t.name.startsWith("mailpoet-form/custom-text")?{...n,attributes:{...n.attributes,styles:e.styles}}:n}));(0,S.dispatch)(pd).resetBlocks(n)},async TUTORIAL_DISMISS(){await KZ.x.Ajax.post({api_version:KZ.x.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=qj(t,"mailpoet-form/email-input"),r=qj(t,"mailpoet-form/submit-button");if(n&&r)return void(0,S.dispatch)(nj).changeFormBlocks(t);const o=(0,S.select)(nj).getFormBlocks(),i=[...t];if(!n){let e=qj(o,"mailpoet-form/email-input");e||(e=nr("mailpoet-form/email-input")),i.unshift(e)}if(!r){let e=qj(o,"mailpoet-form/submit-button");e||(e=nr("mailpoet-form/submit-button")),i.push(e)}(0,S.dispatch)(pd).resetBlocks(i)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:az.t,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,S.select)(nj).getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}},ZY={width:{unit:"percent",value:100}},jY={formDelay:15,formCookieExpiration:7},zY={styles:{width:{unit:"pixel",value:560}},...jY,animation:"slideup"},HY={styles:{width:{unit:"percent",value:100}},position:"top",...jY,animation:"slideup"},VY={width:{unit:"percent",value:100}},WY={styles:{width:{unit:"pixel",value:560}},position:"right",...jY,animation:"slideup"},UY={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"};function $Y(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,P,A,L,R,D,M,O,F,Z,j,z,H,V,W,U,$,G,q,K,Y,X,Q,J,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,he,fe,ge,ve,be,ye,_e,ke,xe,we,Ce,Ee,Se,Ie,Te,Ne,Be,Pe,Ae,Le,Re,De,Me,Oe,Fe,Ze,je,ze,He,Ve,We,Ue,$e,Ge,qe,Ke,Ye,Xe,Qe,Je,et,tt,nt,rt,ot,it,lt,at,st,ct,ut,dt,pt,mt,ht,ft,gt,vt,bt,yt,_t,kt,xt,wt,Ct,Et,St,It,Tt,Nt,Bt,Pt,At,Lt,Rt,Dt,Mt,Ot,Ft,Zt,jt,zt,Ht,Vt,Wt,Ut,$t,Gt,qt,Kt,Yt,Xt,Qt,Jt,en,tn,nn,rn,on,ln,an,sn,cn,un,dn,pn,mn,hn,fn,gn,vn,bn,yn,_n,kn,xn,wn,Cn,En,Sn,In,Tn,Nn,Bn,Pn,An,Ln,Rn,Dn,Mn,On,Fn,Zn,jn,zn,Hn,Vn;const Wn={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===(null===(t=e.settings.form_placement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled),exitIntentEnabled:"1"===(null===(r=e.settings.form_placement)||void 0===r||null===(o=r.popup)||void 0===o?void 0:o.exit_intent_enabled),delay:void 0!==(null===(i=e.settings.form_placement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay)?gG(null===(a=e.settings.form_placement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.delay):zY.formDelay,cookieExpiration:void 0!==(null===(c=e.settings.form_placement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.cookieExpiration)?gG(null===(d=e.settings.form_placement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.cookieExpiration):zY.formCookieExpiration,animation:void 0!==(null===(m=e.settings.form_placement)||void 0===m||null===(h=m.popup)||void 0===h?void 0:h.animation)?null===(f=e.settings.form_placement)||void 0===f||null===(g=f.popup)||void 0===g?void 0:g.animation:zY.animation,styles:{...zY.styles,...null===(v=e.settings.form_placement)||void 0===v||null===(b=v.popup)||void 0===b?void 0:b.styles},categories:(null===(y=e.settings.form_placement)||void 0===y||null===(_=y.popup)||void 0===_?void 0:_.categories)??[],tags:(null===(k=e.settings.form_placement)||void 0===k||null===(x=k.popup)||void 0===x?void 0:x.tags)??[],posts:{all:"1"===(null===(w=e.settings.form_placement)||void 0===w||null===(C=w.popup)||void 0===C||null===(E=C.posts)||void 0===E?void 0:E.all),selected:Array.isArray(null===(S=e.settings.form_placement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.posts)||void 0===T?void 0:T.selected)?null===(N=e.settings.form_placement)||void 0===N||null===(B=N.popup)||void 0===B||null===(P=B.posts)||void 0===P?void 0:P.selected:[]},pages:{all:"1"===(null===(A=e.settings.form_placement)||void 0===A||null===(L=A.popup)||void 0===L||null===(R=L.pages)||void 0===R?void 0:R.all),selected:Array.isArray(null===(D=e.settings.form_placement)||void 0===D||null===(M=D.popup)||void 0===M||null===(O=M.pages)||void 0===O?void 0:O.selected)?null===(F=e.settings.form_placement)||void 0===F||null===(Z=F.popup)||void 0===Z||null===(j=Z.pages)||void 0===j?void 0:j.selected:[]},homepage:"1"===(null===(z=e.settings.form_placement)||void 0===z||null===(H=z.popup)||void 0===H?void 0:H.homepage),tagArchives:{all:"1"===(null===(V=e.settings.form_placement)||void 0===V||null===(W=V.popup)||void 0===W||null===(U=W.tagArchives)||void 0===U?void 0:U.all),selected:Array.isArray(null===($=e.settings.form_placement)||void 0===$||null===(G=$.popup)||void 0===G||null===(q=G.tagArchives)||void 0===q?void 0:q.selected)?null===(K=e.settings.form_placement)||void 0===K||null===(Y=K.popup)||void 0===Y||null===(X=Y.tagArchives)||void 0===X?void 0:X.selected:[]},categoryArchives:{all:"1"===(null===(Q=e.settings.form_placement)||void 0===Q||null===(J=Q.popup)||void 0===J||null===(ee=J.categoryArchives)||void 0===ee?void 0:ee.all),selected:Array.isArray(null===(te=e.settings.form_placement)||void 0===te||null===(ne=te.popup)||void 0===ne||null===(re=ne.categoryArchives)||void 0===re?void 0:re.selected)?null===(oe=e.settings.form_placement)||void 0===oe||null===(ie=oe.popup)||void 0===ie||null===(le=ie.categoryArchives)||void 0===le?void 0:le.selected:[]}},fixedBar:{enabled:"1"===(null===(ae=e.settings.form_placement)||void 0===ae||null===(se=ae.fixed_bar)||void 0===se?void 0:se.enabled),delay:void 0!==(null===(ce=e.settings.form_placement)||void 0===ce||null===(ue=ce.fixed_bar)||void 0===ue?void 0:ue.delay)?gG(null===(de=e.settings.form_placement)||void 0===de||null===(pe=de.fixed_bar)||void 0===pe?void 0:pe.delay):HY.formDelay,cookieExpiration:void 0!==(null===(me=e.settings.form_placement)||void 0===me||null===(he=me.fixed_bar)||void 0===he?void 0:he.cookieExpiration)?gG(null===(fe=e.settings.form_placement)||void 0===fe||null===(ge=fe.fixed_bar)||void 0===ge?void 0:ge.cookieExpiration):HY.formCookieExpiration,animation:(null===(ve=e.settings.form_placement)||void 0===ve||null===(be=ve.fixed_bar)||void 0===be?void 0:be.animation)??HY.animation,styles:{...HY.styles,...null===(ye=e.settings.form_placement)||void 0===ye||null===(_e=ye.fixed_bar)||void 0===_e?void 0:_e.styles},position:(null===(ke=e.settings.form_placement)||void 0===ke||null===(xe=ke.fixed_bar)||void 0===xe?void 0:xe.position)??HY.position,categories:(null===(we=e.settings.form_placement)||void 0===we||null===(Ce=we.fixed_bar)||void 0===Ce?void 0:Ce.categories)??[],tags:(null===(Ee=e.settings.form_placement)||void 0===Ee||null===(Se=Ee.fixed_bar)||void 0===Se?void 0:Se.tags)??[],posts:{all:"1"===(null===(Ie=e.settings.form_placement)||void 0===Ie||null===(Te=Ie.fixed_bar)||void 0===Te||null===(Ne=Te.posts)||void 0===Ne?void 0:Ne.all),selected:Array.isArray(null===(Be=e.settings.form_placement)||void 0===Be||null===(Pe=Be.fixed_bar)||void 0===Pe||null===(Ae=Pe.posts)||void 0===Ae?void 0:Ae.selected)?null===(Le=e.settings.form_placement)||void 0===Le||null===(Re=Le.fixed_bar)||void 0===Re||null===(De=Re.posts)||void 0===De?void 0:De.selected:[]},pages:{all:"1"===(null===(Me=e.settings.form_placement)||void 0===Me||null===(Oe=Me.fixed_bar)||void 0===Oe||null===(Fe=Oe.pages)||void 0===Fe?void 0:Fe.all),selected:Array.isArray(null===(Ze=e.settings.form_placement)||void 0===Ze||null===(je=Ze.fixed_bar)||void 0===je||null===(ze=je.pages)||void 0===ze?void 0:ze.selected)?null===(He=e.settings.form_placement)||void 0===He||null===(Ve=He.fixed_bar)||void 0===Ve||null===(We=Ve.pages)||void 0===We?void 0:We.selected:[]},homepage:"1"===(null===(Ue=e.settings.form_placement)||void 0===Ue||null===($e=Ue.fixed_bar)||void 0===$e?void 0:$e.homepage),tagArchives:{all:"1"===(null===(Ge=e.settings.form_placement)||void 0===Ge||null===(qe=Ge.fixed_bar)||void 0===qe||null===(Ke=qe.tagArchives)||void 0===Ke?void 0:Ke.all),selected:Array.isArray(null===(Ye=e.settings.form_placement)||void 0===Ye||null===(Xe=Ye.fixed_bar)||void 0===Xe||null===(Qe=Xe.tagArchives)||void 0===Qe?void 0:Qe.selected)?null===(Je=e.settings.form_placement)||void 0===Je||null===(et=Je.fixed_bar)||void 0===et||null===(tt=et.tagArchives)||void 0===tt?void 0:tt.selected:[]},categoryArchives:{all:"1"===(null===(nt=e.settings.form_placement)||void 0===nt||null===(rt=nt.fixed_bar)||void 0===rt||null===(ot=rt.categoryArchives)||void 0===ot?void 0:ot.all),selected:Array.isArray(null===(it=e.settings.form_placement)||void 0===it||null===(lt=it.fixed_bar)||void 0===lt||null===(at=lt.categoryArchives)||void 0===at?void 0:at.selected)?null===(st=e.settings.form_placement)||void 0===st||null===(ct=st.fixed_bar)||void 0===ct||null===(ut=ct.categoryArchives)||void 0===ut?void 0:ut.selected:[]}},belowPosts:{enabled:"1"===(null===(dt=e.settings.form_placement)||void 0===dt||null===(pt=dt.below_posts)||void 0===pt?void 0:pt.enabled),styles:{...ZY,...null===(mt=e.settings.form_placement)||void 0===mt||null===(ht=mt.below_posts)||void 0===ht?void 0:ht.styles},categories:(null===(ft=e.settings.form_placement)||void 0===ft||null===(gt=ft.below_posts)||void 0===gt?void 0:gt.categories)??[],tags:(null===(vt=e.settings.form_placement)||void 0===vt||null===(bt=vt.below_posts)||void 0===bt?void 0:bt.tags)??[],posts:{all:"1"===(null===(yt=e.settings.form_placement)||void 0===yt||null===(_t=yt.below_posts)||void 0===_t||null===(kt=_t.posts)||void 0===kt?void 0:kt.all),selected:Array.isArray(null===(xt=e.settings.form_placement)||void 0===xt||null===(wt=xt.below_posts)||void 0===wt||null===(Ct=wt.posts)||void 0===Ct?void 0:Ct.selected)?null===(Et=e.settings.form_placement)||void 0===Et||null===(St=Et.below_posts)||void 0===St||null===(It=St.posts)||void 0===It?void 0:It.selected:[]},pages:{all:"1"===(null===(Tt=e.settings.form_placement)||void 0===Tt||null===(Nt=Tt.below_posts)||void 0===Nt||null===(Bt=Nt.pages)||void 0===Bt?void 0:Bt.all),selected:Array.isArray(null===(Pt=e.settings.form_placement)||void 0===Pt||null===(At=Pt.below_posts)||void 0===At||null===(Lt=At.pages)||void 0===Lt?void 0:Lt.selected)?null===(Rt=e.settings.form_placement)||void 0===Rt||null===(Dt=Rt.below_posts)||void 0===Dt||null===(Mt=Dt.pages)||void 0===Mt?void 0:Mt.selected:[]}},slideIn:{enabled:"1"===(null===(Ot=e.settings.form_placement)||void 0===Ot||null===(Ft=Ot.slide_in)||void 0===Ft?void 0:Ft.enabled),delay:void 0!==(null===(Zt=e.settings.form_placement)||void 0===Zt||null===(jt=Zt.slide_in)||void 0===jt?void 0:jt.delay)?gG(null===(zt=e.settings.form_placement)||void 0===zt||null===(Ht=zt.slide_in)||void 0===Ht?void 0:Ht.delay):WY.formDelay,cookieExpiration:void 0!==(null===(Vt=e.settings.form_placement)||void 0===Vt||null===(Wt=Vt.slide_in)||void 0===Wt?void 0:Wt.cookieExpiration)?gG(null===(Ut=e.settings.form_placement)||void 0===Ut||null===($t=Ut.slide_in)||void 0===$t?void 0:$t.cookieExpiration):WY.formCookieExpiration,position:(null===(Gt=e.settings.form_placement)||void 0===Gt||null===(qt=Gt.slide_in)||void 0===qt?void 0:qt.position)??WY.position,animation:(null===(Kt=e.settings.form_placement)||void 0===Kt||null===(Yt=Kt.slide_in)||void 0===Yt?void 0:Yt.animation)??WY.animation,styles:{...WY.styles,...null===(Xt=e.settings.form_placement)||void 0===Xt||null===(Qt=Xt.slide_in)||void 0===Qt?void 0:Qt.styles},categories:(null===(Jt=e.settings.form_placement)||void 0===Jt||null===(en=Jt.slide_in)||void 0===en?void 0:en.categories)??[],tags:(null===(tn=e.settings.form_placement)||void 0===tn||null===(nn=tn.slide_in)||void 0===nn?void 0:nn.tags)??[],posts:{all:"1"===(null===(rn=e.settings.form_placement)||void 0===rn||null===(on=rn.slide_in)||void 0===on||null===(ln=on.posts)||void 0===ln?void 0:ln.all),selected:Array.isArray(null===(an=e.settings.form_placement)||void 0===an||null===(sn=an.slide_in)||void 0===sn||null===(cn=sn.posts)||void 0===cn?void 0:cn.selected)?null===(un=e.settings.form_placement)||void 0===un||null===(dn=un.slide_in)||void 0===dn||null===(pn=dn.posts)||void 0===pn?void 0:pn.selected:[]},pages:{all:"1"===(null===(mn=e.settings.form_placement)||void 0===mn||null===(hn=mn.slide_in)||void 0===hn||null===(fn=hn.pages)||void 0===fn?void 0:fn.all),selected:Array.isArray(null===(gn=e.settings.form_placement)||void 0===gn||null===(vn=gn.slide_in)||void 0===vn||null===(bn=vn.pages)||void 0===bn?void 0:bn.selected)?null===(yn=e.settings.form_placement)||void 0===yn||null===(_n=yn.slide_in)||void 0===_n||null===(kn=_n.pages)||void 0===kn?void 0:kn.selected:[]},homepage:"1"===(null===(xn=e.settings.form_placement)||void 0===xn||null===(wn=xn.slide_in)||void 0===wn?void 0:wn.homepage),tagArchives:{all:"1"===(null===(Cn=e.settings.form_placement)||void 0===Cn||null===(En=Cn.slide_in)||void 0===En||null===(Sn=En.tagArchives)||void 0===Sn?void 0:Sn.all),selected:Array.isArray(null===(In=e.settings.form_placement)||void 0===In||null===(Tn=In.slide_in)||void 0===Tn||null===(Nn=Tn.tagArchives)||void 0===Nn?void 0:Nn.selected)?null===(Bn=e.settings.form_placement)||void 0===Bn||null===(Pn=Bn.slide_in)||void 0===Pn||null===(An=Pn.tagArchives)||void 0===An?void 0:An.selected:[]},categoryArchives:{all:"1"===(null===(Ln=e.settings.form_placement)||void 0===Ln||null===(Rn=Ln.slide_in)||void 0===Rn||null===(Dn=Rn.categoryArchives)||void 0===Dn?void 0:Dn.all),selected:Array.isArray(null===(Mn=e.settings.form_placement)||void 0===Mn||null===(On=Mn.slide_in)||void 0===On||null===(Fn=On.categoryArchives)||void 0===Fn?void 0:Fn.selected)?null===(Zn=e.settings.form_placement)||void 0===Zn||null===(jn=Zn.slide_in)||void 0===jn||null===(zn=jn.categoryArchives)||void 0===zn?void 0:zn.selected:[]}},others:{styles:{...VY,...null===(Hn=e.settings.form_placement)||void 0===Hn||null===(Vn=Hn.others)||void 0===Vn?void 0:Vn.styles}}},alignment:e.settings.alignment??UY.alignment,borderRadius:void 0!==e.settings.border_radius?gG(e.settings.border_radius):UY.borderRadius,borderSize:void 0!==e.settings.border_size?gG(e.settings.border_size):UY.borderSize,formPadding:void 0!==e.settings.form_padding?gG(e.settings.form_padding):UY.formPadding,inputPadding:void 0!==e.settings.input_padding?gG(e.settings.input_padding):UY.inputPadding,borderColor:e.settings.border_color,fontFamily:e.settings.font_family,fontSize:e.settings.fontSize,successValidationColor:e.settings.success_validation_color,errorValidationColor:e.settings.error_validation_color,backgroundImageUrl:e.settings.background_image_url,backgroundImageDisplay:e.settings.background_image_display,closeButton:e.settings.close_button??UY.closeButton}};return Wn.settings.formPlacement.belowPosts.styles.width.value=gG(Wn.settings.formPlacement.belowPosts.styles.width.value),Wn.settings.formPlacement.slideIn.styles.width.value=gG(Wn.settings.formPlacement.slideIn.styles.width.value),Wn.settings.formPlacement.fixedBar.styles.width.value=gG(Wn.settings.formPlacement.fixedBar.styles.width.value),Wn.settings.formPlacement.popup.styles.width.value=gG(Wn.settings.formPlacement.popup.styles.width.value),Wn.settings.formPlacement.others.styles.width.value=gG(Wn.settings.formPlacement.others.styles.width.value),delete Wn.settings.border_radius,delete Wn.settings.border_size,delete Wn.settings.border_color,delete Wn.settings.input_padding,delete Wn.settings.form_padding,delete Wn.settings.close_button,delete Wn.settings.font_family,delete Wn.settings.background_image_display,delete Wn.settings.background_image_url,Wn}function GY(e){const t=(0,un.Z)((e=>e(nj).hasEditorUndo()),[]),{historyUndo:n}=(0,dn.Z)(nj),{registerShortcut:r}=(0,dn.Z)("core/keyboard-shortcuts");return(0,Nk.bx)("mailpoet-form-editor/undo",(e=>{n(),e.preventDefault()})),(0,b.useEffect)((()=>{r({name:"mailpoet-form-editor/undo",category:"block",description:(0,O.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})}),[r]),(0,JZ.jsx)(ia.ZP,{...e,icon:tj.Z,label:(0,O.__)("Undo"),shortcut:T_.displayShortcut.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var qY=n(42128);function KY(e){const t=(0,un.Z)((e=>e(nj).hasEditorRedo()),[]),{historyRedo:n}=(0,dn.Z)(nj),{registerShortcut:r}=(0,dn.Z)("core/keyboard-shortcuts"),o=()=>{n()};return(0,Nk.bx)("mailpoet-form-editor/redo",(e=>{o(),e.preventDefault()})),(0,b.useEffect)((()=>{r({name:"mailpoet-form-editor/redo",category:"block",description:(0,O.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[r]),(0,JZ.jsx)(ia.ZP,{...e,icon:qY.Z,label:(0,O.__)("Redo"),shortcut:T_.displayShortcut.primaryShift("z"),"aria-disabled":!t,onClick:t?o:void 0,className:"editor-history__redo"})}function YY(e){let{isInserterOpened:t,setIsInserterOpened:n}=e;const r=(0,un.Z)((e=>e(nj).getSidebarOpened()),[]),o=(0,un.Z)((e=>e(nj).getIsFormSaving()),[]),i=(0,un.Z)((e=>e(nj).getIsPreviewShown()),[]),l=(0,un.Z)((e=>e(nj).isFullscreenEnabled()),[]),{toggleSidebar:a,saveForm:s,showPreview:c,toggleFullscreen:u}=(0,dn.Z)(nj);return(0,JZ.jsxs)("div",{className:"edit-post-header",children:[(0,JZ.jsxs)("div",{className:"edit-post-header__settings",children:[(0,JZ.jsx)(ia.ZP,{isSecondary:!0,onClick:c,isPressed:i,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,O.__)("Preview")}),(0,JZ.jsx)(ia.ZP,{isPrimary:!0,className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:o,onClick:s,children:o?`${(0,O.__)("Saving")}`:(0,O.__)("Save")}),(0,JZ.jsx)(ia.ZP,{icon:"admin-generic",label:KZ.x.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>a(!r),isPressed:r,className:"mailpoet-editor-header-button"}),(0,JZ.jsx)(ua.Z,{icon:_f.Z,label:(0,O.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,JZ.jsx)(Td.Z,{label:(0,O._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,JZ.jsx)(ej,{shortcut:"Ctrl+Shift+Alt+F",label:(0,O.__)("Fullscreen mode"),info:(0,O.__)("Work without distraction"),isActive:l,onToggle:()=>u(!l)})})})]}),(0,JZ.jsx)("div",{className:"edit-post-header__toolbar",children:(0,JZ.jsxs)("div",{className:"toolbar edit-post-header-toolbar edit-post-header-toolbar__left",children:[(0,JZ.jsx)(ia.ZP,{isSecondary:!0,href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:KZ.x.I18n.t("back")}),(0,JZ.jsx)(la.Z,{as:ia.ZP,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:t,onClick:()=>n(!t),icon:yf.Z,label:(0,O._x)("Add block","Generic label for block inserter button")}),(0,JZ.jsx)(GY,{"data-automation-id":"form_undo_button"}),(0,JZ.jsx)(KY,{"data-automation-id":"form_redo_button"})]})})]})}YY.propTypes={isInserterOpened:QZ().bool.isRequired,setIsInserterOpened:QZ().func.isRequired},YY.displayName="FormEditorHeader";var XY=n(98707),QY=n(19786);function JY(){const e=(0,un.Z)((e=>e(nj).getTutorialUrl()),[]),t=(0,un.Z)((e=>e(nj).getTutorialSeen()),[]),{tutorialDismissed:n}=(0,dn.Z)(nj),r=(0,b.useCallback)((()=>{n()}),[n]);return t?null:(0,JZ.jsx)(XY.u,{isDismissible:!0,onRequestClose:r,children:(0,JZ.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,JZ.jsx)(QY.X,{level:2,children:KZ.x.I18n.t("tutorialHeading")}),(0,JZ.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var eX=n(98711),tX=n(65311),nX=n.n(tX),rX=n(35614);n(1201);class oX extends b.Component{constructor(e){super(e),this.selectRef=(0,b.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&nX()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==this.props.item&&void 0!==e.item&&this.allowMultipleValues()&&rX.ZP.isArray(this.props.item[this.props.field.name])&&!rX.ZP.isEqual(this.props.item[this.props.field.name],e.item[this.props.field.name])&&nX()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}componentWillUnmount(){this.isSelect2Component()&&this.destroySelect2()}getFieldId=e=>{const t=e||this.props;return t.field.id||t.field.name};getSelectedValues=()=>{if(void 0!==this.props.field.selected)return this.props.field.selected(this.props.item);if(void 0!==this.props.item&&void 0!==this.props.field.name){if(!this.allowMultipleValues())return this.props.item[this.props.field.name];if(rX.ZP.isArray(this.props.item[this.props.field.name]))return this.props.item[this.props.field.name].map((e=>e.id))}return null};getItems=()=>{let e;return void 0!==window[`mailpoet_${this.props.field.endpoint}`]?e=window[`mailpoet_${this.props.field.endpoint}`]:void 0!==this.props.field.values&&(e=this.props.field.values),rX.ZP.isArray(e)&&void 0!==this.props.field.filter&&(e=e.filter(this.props.field.filter)),e};getLabel=e=>void 0!==this.props.field.getLabel?this.props.field.getLabel(e,this.props.item):e.name;getSearchLabel=e=>void 0!==this.props.field.getSearchLabel?this.props.field.getSearchLabel(e,this.props.item):null;getValue=e=>void 0!==this.props.field.getValue?this.props.field.getValue(e,this.props.item):e.id;setupSelect2=()=>{if(this.isSelect2Initialized())return;let e={disabled:this.props.disabled||!1,width:this.props.width||"",placeholder:{id:"",text:this.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}};this.props.dropDownParent&&(e.dropdownParent=nX()(this.props.dropDownParent));const t=this.props.field.remoteQuery||null;t&&(e=Object.assign(e,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:t.endpoint,method:t.method,data:Object.assign(t.data,{query:e.term})}},processResults:function(e){let t;return t=rX.ZP.has(e,"data")?e.data.map((e=>({id:e.id||e.value,text:e.name||e.text}))):[],{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==this.props.field.extendSelect2Options&&(e=Object.assign(e,this.props.field.extendSelect2Options));const n=nX()(`#${this.selectRef.current.id}`).select2(e);let r=!1;n.on("select2:unselecting",(()=>{r=!0})),n.on("select2:opening",(e=>{!0===r&&(r=!1,e.preventDefault())})),n.on("change",this.handleChange)};resetSelect2=()=>{this.destroySelect2(),this.setupSelect2()};destroySelect2=()=>{this.isSelect2Initialized()&&(nX()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())};cleanupAfterSelect2=()=>{nX()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),nX()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")};allowMultipleValues=()=>!0===this.props.field.multiple;isSelect2Initialized=()=>!0===nX()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible");isSelect2Component=()=>this.allowMultipleValues()||this.props.field.forceSelect2;handleChange=e=>{if(void 0===this.props.onValueChange)return;const t=nX()(`#${this.selectRef.current.id}`).children(":selected").map((function(){return{id:nX()(this).val(),text:nX()(this).text()}})),n=this.props.field.multiple?rX.ZP.pluck(t,"id"):rX.ZP.pluck(t,"id").toString(),r=this.transformChangedValue(n,t);this.props.onValueChange({target:{value:r,name:this.props.field.name,id:e.target.id}})};transformChangedValue=(e,t)=>"function"==typeof this.props.field.transformChangedValue?this.props.field.transformChangedValue.call(this,e,t):e;insertEmptyOption=()=>{if(!this.allowMultipleValues())return this.props.field.placeholder?(0,JZ.jsx)("option",{className:"default"}):void 0};render(){const e=this.getItems(this.props.field),t=this.getSelectedValues(),n=e.map((e=>{const t=this.getLabel(e),n=this.getSearchLabel(e),r=this.getValue(e);return(0,JZ.jsx)("option",{className:"default",value:r,title:n,children:t},`option-${e.id}`)}));return(0,JZ.jsxs)("select",{id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:t,...this.props.field.validation,children:[this.insertEmptyOption(),n]})}}oX.propTypes={onValueChange:QZ().func,field:QZ().shape({name:QZ().string.isRequired,values:QZ().oneOfType([QZ().object,QZ().array]),getLabel:QZ().func,resetSelect2OnUpdate:QZ().bool,selected:QZ().func,endpoint:QZ().string,filter:QZ().func,getSearchLabel:QZ().func,getValue:QZ().func,placeholder:QZ().string,remoteQuery:QZ().object,extendSelect2Options:QZ().object,multiple:QZ().bool,forceSelect2:QZ().bool,transformChangedValue:QZ().func,disabled:QZ().bool,validation:QZ().shape({"data-parsley-required":QZ().bool,"data-parsley-required-message":QZ().string,"data-parsley-type":QZ().string,"data-parsley-errors-container":QZ().string,maxLength:QZ().number})}).isRequired,item:QZ().object,disabled:QZ().bool,width:QZ().string,dropDownParent:QZ().string},oX.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0,dropDownParent:void 0},oX.displayName="FormEditorSelection";const iX=(0,qZ.withBoundary)(oX);function lX(){const[e,t]=(0,b.useState)(!1),n=(0,un.Z)((e=>e(nj).getFormName()),[]),r=C()({"is-selected":e}),{changeFormName:o}=(0,dn.Z)(nj);return(0,JZ.jsxs)("div",{className:r,children:[(0,JZ.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:KZ.x.I18n.t("addFormName")}),(0,JZ.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:KZ.x.I18n.t("addFormName"),"data-automation-id":"form_title_input",type:"text",onKeyPress:()=>t(!1),onBlur:()=>t(!1),onChange:e=>o(e.target.value),value:n})]})}function aX(e){let{onToggle:t,isOpened:n}=e;const r=(0,un.Z)((e=>e(nj).getFormSettings()),[]),o=(0,un.Z)((e=>e(nj).getAllAvailableSegments()),[]),i=(0,un.Z)((e=>e(nj).getAllAvailablePages()),[]),l=(0,un.Z)((e=>e(nj).getNotice("missing-lists")),[]),a=(0,un.Z)((e=>e(nj).isFormEnabled()),[]),{changeFormSettings:s,toggleForm:c}=(0,dn.Z)(nj),u=r.segments?o.filter((e=>r.segments.includes(e.id.toString()))):[],d=l&&!u.length;return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsxs)(nf.Z,{title:KZ.x.I18n.t("formSettings"),opened:n,onToggle:t,children:[(0,JZ.jsx)(lX,{}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayForm"),checked:a,onChange:c}),(0,JZ.jsxs)(Hd.ZP,{label:KZ.x.I18n.t("settingsListLabel"),className:C()({"mailpoet-form-missing-lists":d}),children:[d?(0,JZ.jsx)("span",{className:"mailpoet-form-lists-error",children:KZ.x.I18n.t("settingsPleaseSelectList")}):null,(0,JZ.jsx)(iX,{item:{segments:u},onValueChange:e=>{(0,N.isEqual)(r.segments,e.target.value)||s({...r,segments:e.target.value})},field:{id:"segments",name:"segments",values:o,multiple:!0,placeholder:KZ.x.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,JZ.jsx)(eX.Z,{className:"mailpoet-form-inline-radios__control",onChange:e=>{s({...r,on_success:e})},selected:r.on_success||"message",label:KZ.x.I18n.t("settingsAfterSubmit"),options:[{label:KZ.x.I18n.t("settingsShowMessage"),value:"message"},{label:KZ.x.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===r.on_success?(0,JZ.jsx)(jT.Z,{value:r.success_page,options:i.map((e=>({value:e.id.toString(),label:e.title}))),onChange:e=>{s({...r,success_page:e})}}):(0,JZ.jsx)(rq.Z,{value:r.success_message,onChange:e=>{s({...r,success_message:e})},rows:3})]})})}function sX(e){let{name:t,imageUrl:n,onImageUrlChange:r,imageDisplay:o,onImageDisplayChange:i}=e;return(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,JZ.jsx)(Hd.ZP.VisualLabel,{children:t}),(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,JZ.jsx)("input",{type:"text",value:n??"",onChange:e=>r(e.target.value)}),(0,JZ.jsx)(CC,{onSelect:e=>r(e.url),allowedTypes:["image"],render:e=>{let{open:t}=e;return(0,JZ.jsx)(ia.ZP,{isSecondary:!0,isSmall:!0,onClick:t,children:KZ.x.I18n.t("formSettingsStylesSelectImage")})}})]}),(0,JZ.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,JZ.jsx)(jT.Z,{value:o,options:[{label:KZ.x.I18n.t("imagePlacementScale"),value:"scale"},{label:KZ.x.I18n.t("imagePlacementFit"),value:"fit"},{label:KZ.x.I18n.t("imagePlacementTile"),value:"tile"}],onChange:i})})]})}aX.propTypes={onToggle:QZ().func.isRequired,isOpened:QZ().bool.isRequired},aX.displayName="FormEditorBasicSettingsPanel";const cX=(0,JZ.jsx)(Vp.Wj,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,JZ.jsx)(Vp.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,JZ.jsx)(Vp.G,{id:"icons/ic_settings",children:(0,JZ.jsx)(Vp.y$,{d:"M8.05,0 L8.05101528,2.11065231 C8.65254335,2.23933489 9.2139617,2.47621094 9.71391655,2.7999267 L11.2072853,1.30779041 L12.6922096,2.79271465 L11.199432,4.28509331 C11.5234762,4.78529701 11.7605802,5.34705952 11.8893477,5.94898472 L14,5.95 L14,8.05 L11.8895604,8.05002048 C11.7608414,8.65232154 11.5236547,9.21442744 11.199432,9.71490669 L12.6922096,11.2072853 L11.2072853,12.6922096 L9.71391655,11.2000733 C9.2139617,11.5237891 8.65254335,11.7606651 8.05101528,11.8893477 L8.05,14 L5.95,14 L5.94898472,11.8893477 C5.34705952,11.7605802 4.78529701,11.5234762 4.28509331,11.199432 L2.79271465,12.6922096 L1.30779041,11.2072853 L2.7999267,9.71391655 C2.4760325,9.21368611 2.23907376,8.65192438 2.11043961,8.05002048 L8.8817842e-16,8.05 L1.01676633e-15,5.95 L2.11065231,5.94898472 C2.23933489,5.34745665 2.47621094,4.7860383 2.7999267,4.28608345 L1.30779041,2.79271465 L2.79271465,1.30779041 L4.28509331,2.80056797 C4.78529701,2.47652376 5.34705952,2.23941984 5.94898472,2.11065231 L5.95,0 L8.05,0 Z M7,4 C5.34314575,4 4,5.34314575 4,7 C4,8.65685425 5.34314575,10 7,10 C8.65685425,10 10,8.65685425 10,7 C10,5.34314575 8.65685425,4 7,4 Z",id:"ic_settings"})})})}),uX=(0,JZ.jsx)(Vp.Wj,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,JZ.jsx)(Vp.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,JZ.jsx)(Vp.y$,{d:"M12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 Z M15.5939818,8.20494484 C15.1497095,7.86124495 14.5235958,7.95992422 14.1955177,8.42535116 L14.1955177,8.42535116 L11.2218999,12.6438652 L9.73479332,10.9561217 C9.36019283,10.530981 8.72753928,10.5044698 8.32172209,10.8969074 C7.91590488,11.289345 7.89059874,11.9521231 8.26519924,12.3772638 L8.26519924,12.3772638 L10.5728715,14.9962817 C10.9986562,15.4795122 11.7391892,15.4370557 12.1120948,14.9080343 L12.1120948,14.9080343 L15.8043703,9.66999857 C16.1324484,9.20457165 16.0382543,8.54864475 15.5939818,8.20494484 Z",id:"Combined-Shape",fill:"#ff5301",fillRule:"nonzero"})})});function dX(e){let{label:t,active:n,canBeActive:r,onClick:o,children:i,className:l,automationId:a,displaySettingsIcon:s}=e;const[c,u]=(0,b.useState)(!1);return(0,JZ.jsxs)("div",{"data-automation-id":a,className:C()(l,"selection-item",{"selection-item-active":n&&r}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:o,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),o())},role:"button",tabIndex:0,children:[(0,JZ.jsxs)("div",{className:"selection-item-body",children:[(0,JZ.jsxs)("div",{className:"selection-item-settings",children:[s?(0,JZ.jsx)("div",{className:C()("selection-item-icon",{"selection-item-icon-hover":c}),children:cX}):(0,JZ.jsx)("div",{}),c&&!n&&r&&(0,JZ.jsx)("div",{className:"selection-item-settings-oval"}),n&&r&&(0,JZ.jsx)("div",{className:"selection-item-check",children:uX})]}),i]}),c&&(0,JZ.jsx)("div",{className:"selection-item-overlay"})]},t)}function pX(e){let{label:t,active:n,onClick:r,iconUrl:o}=e;return(0,JZ.jsx)(dX,{label:t,onClick:r,active:n,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,JZ.jsx)("img",{src:o,alt:t.replace("_"," "),className:"close-button-selection-item-icon"})})}function mX(e){let{name:t,value:n,onChange:r}=e;const o=(0,un.Z)((e=>e(nj).getCloseIconsUrl()),[]);return(0,JZ.jsxs)("div",{children:[(0,JZ.jsx)(Hd.ZP.VisualLabel,{children:t}),(0,JZ.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,JZ.jsx)(pX,{label:"round_white",active:"round_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>r("round_white")}),(0,JZ.jsx)(pX,{label:"round_black",active:"round_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>r("round_black")}),(0,JZ.jsx)(pX,{label:"square_white",active:"square_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>r("square_white")}),(0,JZ.jsx)(pX,{label:"square_black",active:"square_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>r("square_black")}),(0,JZ.jsx)(pX,{label:"classic",active:"classic"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>r("classic")}),(0,JZ.jsx)(pX,{label:"classic_white",active:"classic_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>r("classic_white")})]})]})}function hX(e){let{onToggle:t,isOpened:n}=e;const{changeFormSettings:r}=(0,dn.Z)(nj),o=(0,un.Z)((e=>e(nj).getFormSettings()),[]),i=(0,b.useRef)(o);(0,b.useEffect)((()=>{i.current=o}),[o]);const l=(e,t)=>{const n={...i.current};n[e]=t??UY[e]??void 0,r(n),i.current=n};return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formSettingsStyles"),opened:n,onToggle:t,children:(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,JZ.jsx)(Mz,{title:KZ.x.I18n.t("formSettingsColor"),settings:[{label:KZ.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,gradientValue:o.gradient,onColorChange:(0,N.partial)(l,"backgroundColor"),onGradientChange:(0,N.partial)(l,"gradient")},{label:KZ.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,N.partial)(l,"fontColor")},{label:KZ.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,N.partial)(l,"borderColor")}]}),(0,JZ.jsx)(sX,{name:KZ.x.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:o.backgroundImageUrl,onImageUrlChange:(0,N.partial)(l,"backgroundImageUrl"),imageDisplay:o.backgroundImageDisplay,onImageDisplayChange:(0,N.partial)(l,"backgroundImageDisplay")}),(0,JZ.jsx)(DG,{value:o.fontSize,onChange:(0,N.partial)(l,"fontSize")}),(0,JZ.jsx)(OG,{name:KZ.x.I18n.t("formSettingsStylesFontFamily"),value:o.fontFamily,onChange:(0,N.partial)(l,"fontFamily")}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsInputPadding"),value:o.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,N.partial)(l,"inputPadding")}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderSize"),value:void 0!==o.borderSize?o.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,N.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsBorderRadius"),value:void 0!==o.borderRadius?o.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,N.partial)(l,"borderRadius")}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formSettingsAlignment"),onChange:(0,N.partial)(l,"alignment"),options:[{value:Zz.Left,label:KZ.x.I18n.t("formSettingsAlignmentLeft")},{value:Zz.Center,label:KZ.x.I18n.t("formSettingsAlignmentCenter")},{value:Zz.Right,label:KZ.x.I18n.t("formSettingsAlignmentRight")}],value:o.alignment}),(0,JZ.jsx)(fN,{label:KZ.x.I18n.t("formSettingsFormPadding"),value:o.formPadding,min:0,max:40,allowReset:!0,onChange:(0,N.partial)(l,"formPadding")}),(0,JZ.jsx)(Mz,{title:KZ.x.I18n.t("validationMessageColor"),settings:[{label:KZ.x.I18n.t("successValidationColorTitle"),colorValue:o.successValidationColor,onColorChange:(0,N.partial)(l,"successValidationColor")},{label:KZ.x.I18n.t("errorValidationColorTitle"),colorValue:o.errorValidationColor,onColorChange:(0,N.partial)(l,"errorValidationColor")}]}),(0,JZ.jsx)(mX,{name:KZ.x.I18n.t("closeButtonHeading"),value:o.closeButton,onChange:(0,N.partial)(l,"closeButton")})]})})})}dX.defaultProps={canBeActive:!0,displaySettingsIcon:!0,className:void 0,automationId:void 0};const fX=(0,JZ.jsxs)(Vp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,JZ.jsxs)("defs",{children:[(0,JZ.jsx)(Vp.UL,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,JZ.jsx)(Vp.UL,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,JZ.jsxs)(Vp.G,{fill:"none",fillRule:"evenodd",children:[(0,JZ.jsx)(Vp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,JZ.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,JZ.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,JZ.jsx)(Vp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function gX(e){let{label:t,icon:n,active:r,canBeActive:o,onClick:i}=e;return(0,JZ.jsxs)(dX,{label:t,onClick:i,active:r,canBeActive:o,className:"form-placement-option",automationId:`form-placement-option-${t}`,children:[(0,JZ.jsx)("div",{className:"form-placement-option-icon",children:n}),(0,JZ.jsx)("div",{className:"form-placement-option-label",children:(0,JZ.jsx)("p",{children:t})})]})}function vX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{showPlacementSettings:t}=(0,dn.Z)(nj);return(0,JZ.jsx)(gX,{active:e.formPlacement.belowPosts.enabled,label:KZ.x.I18n.t("placeFormBellowPages"),icon:fX,onClick:()=>{t("below_posts")},canBeActive:!0})}gX.defaultProps={canBeActive:!0};const bX=(0,JZ.jsxs)(Vp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,JZ.jsxs)("defs",{children:[(0,JZ.jsx)(Vp.UL,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,JZ.jsx)(Vp.y$,{d:"M49 34h46a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4H49a4 4 0 0 1-4-4V38a4 4 0 0 1 4-4z",id:"popup_icon_c"}),(0,JZ.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,JZ.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,JZ.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,JZ.jsx)("feColorMatrix",{values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0",in:"shadowBlurOuter1"})]})]}),(0,JZ.jsxs)(Vp.G,{fill:"none",fillRule:"evenodd",children:[(0,JZ.jsx)(Vp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,JZ.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,JZ.jsxs)(Vp.G,{fillRule:"nonzero",children:[(0,JZ.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,JZ.jsx)(Vp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function yX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{showPlacementSettings:t}=(0,dn.Z)(nj);return(0,JZ.jsx)(gX,{active:e.formPlacement.popup.enabled,label:KZ.x.I18n.t("placePopupFormOnPages"),icon:bX,onClick:()=>{t("popup")},canBeActive:!0})}const _X=(0,JZ.jsxs)(Vp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,JZ.jsx)("defs",{children:(0,JZ.jsx)(Vp.UL,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,JZ.jsxs)(Vp.G,{fill:"none",fillRule:"evenodd",children:[(0,JZ.jsx)(Vp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,JZ.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,JZ.jsx)(Vp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function kX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{showPlacementSettings:t}=(0,dn.Z)(nj);return(0,JZ.jsx)(gX,{active:e.formPlacement.fixedBar.enabled,label:KZ.x.I18n.t("placeFixedBarFormOnPages"),icon:_X,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const xX=(0,JZ.jsxs)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"76",height:"63",viewBox:"0 0 76 63",children:[(0,JZ.jsxs)("defs",{children:[(0,JZ.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,JZ.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,JZ.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,JZ.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,JZ.jsxs)("feMerge",{children:[(0,JZ.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,JZ.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,JZ.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,JZ.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,JZ.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,JZ.jsx)("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"})]}),(0,JZ.jsx)(Vp.UL,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,JZ.jsx)(Vp.y$,{id:"slide_in_prefix__d",d:"M.525 0h27.45c.29 0 .525.235.525.525v22.05c0 .29-.235.525-.525.525H.525c-.29 0-.525-.235-.525-.525V.525C0 .235.235 0 .525 0z"})]}),(0,JZ.jsxs)(Vp.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,JZ.jsx)(Vp.y$,{fill:"#FFF",fillRule:"nonzero",d:"M2.1 0h71.8c1.16 0 2.1.94 2.1 2.1v58.8c0 1.16-.94 2.1-2.1 2.1H2.1C.94 63 0 62.06 0 60.9V2.1C0 .94.94 0 2.1 0z"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,JZ.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,JZ.jsxs)(Vp.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,JZ.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,JZ.jsx)(Vp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,JZ.jsx)(Vp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,JZ.jsx)(Vp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function wX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{showPlacementSettings:t}=(0,dn.Z)(nj);return(0,JZ.jsx)(gX,{active:e.formPlacement.slideIn.enabled,label:KZ.x.I18n.t("placeSlideInFormOnPages"),icon:xX,onClick:()=>{t("slide_in")},canBeActive:!0})}const CX=(0,JZ.jsxs)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,JZ.jsxs)("defs",{children:[(0,JZ.jsx)(Vp.UL,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,JZ.jsx)(Vp.UL,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,JZ.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,JZ.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,JZ.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,JZ.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,JZ.jsxs)("feMerge",{children:[(0,JZ.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,JZ.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,JZ.jsxs)(Vp.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,JZ.jsx)(Vp.y$,{fill:"#FFF",fillRule:"nonzero",d:"M4 0h136c2.21 0 4 1.79 4 4v112c0 2.21-1.79 4-4 4H4c-2.21 0-4-1.79-4-4V4c0-2.21 1.79-4 4-4z"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,JZ.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,JZ.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,JZ.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,JZ.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,JZ.jsx)(Vp.UL,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,JZ.jsx)(Vp.UL,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,JZ.jsx)(Vp.UL,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function EX(){const{showPlacementSettings:e}=(0,dn.Z)(nj);return(0,JZ.jsx)(gX,{active:!1,label:KZ.x.I18n.t("formPlacementOtherLabel"),icon:CX,onClick:()=>{e("others")},canBeActive:!1})}function SX(e){let{onToggle:t,isOpened:n}=e;return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("formPlacement"),opened:n,onToggle:t,className:"form-sidebar-form-placement-panel",children:(0,JZ.jsxs)("div",{className:"form-placement-option-list",children:[(0,JZ.jsx)(vX,{}),(0,JZ.jsx)(kX,{}),(0,JZ.jsx)(yX,{}),(0,JZ.jsx)(wX,{}),(0,JZ.jsx)(EX,{})]})})})}SX.propTypes={onToggle:QZ().func.isRequired,isOpened:QZ().bool.isRequired};var IX=n(70907),TX=n.n(IX);function NX(e){let{options:t,value:n,onChange:r}=e;const o=(0,b.useRef)(null),i=(0,b.useRef)(null),l=(0,b.useCallback)((e=>{r(e.getValue())}),[r]);return(0,b.useEffect)((()=>(i.current=TX().fromTextArea(o.current,t),i.current.on("change",l),()=>{i.current&&i.current.toTextArea()})),[t,l]),(0,b.useEffect)((()=>{i.current.getValue()!==n&&(i.current.off("change",l),i.current.setValue(n),i.current.on("change",l))}),[n,l]),(0,JZ.jsx)("div",{children:(0,JZ.jsx)("textarea",{ref:o,name:"name",defaultValue:n,autoComplete:"off"})})}function BX(e){let{onToggle:t,isOpened:n}=e;const r=(0,un.Z)((e=>e(nj).getFormStyles()),[]),{changeFormStyles:o}=(0,dn.Z)(nj);return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:KZ.x.I18n.t("customCss"),opened:n,onToggle:t,children:(0,JZ.jsx)(NX,{value:r,onChange:o})})})}n(25002),NX.propTypes={value:QZ().string.isRequired,onChange:QZ().func.isRequired,options:QZ().shape({lineNumbers:QZ().bool,tabMode:QZ().string,matchBrackets:QZ().bool,theme:QZ().string,mode:QZ().string})},NX.defaultProps={options:{lineNumbers:!0,tabMode:"indent",matchBrackets:!0,theme:"neo",mode:"css"}},BX.propTypes={onToggle:QZ().func.isRequired,isOpened:QZ().bool.isRequired};var PX=n(7765);function AX(e){let{onToggle:t,isOpened:n}=e;const r=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:o}=(0,dn.Z)(nj),i=KZ.x.tags.map((e=>e.name));return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{title:"Tags",opened:n,onToggle:t,children:(0,JZ.jsx)(PX.T,{label:KZ.x.I18n.t("addNewTag"),onChange:e=>{(0,N.isEqual)(r.tags,e.value)||o({...r,tags:e.value})},suggestedValues:i,selectedValues:r.tags})})})}function LX(){const e=(0,dn.Z)(nj).toggleSidebarPanel,t=(0,un.Z)((e=>e(nj).getSidebarOpenedPanels()),[]);return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(aX,{isOpened:t.includes("basic-settings"),onToggle:(0,N.partial)(e,"basic-settings")})}),(0,JZ.jsx)(hX,{isOpened:t.includes("styles-settings"),onToggle:(0,N.partial)(e,"styles-settings")}),(0,JZ.jsx)(SX,{isOpened:t.includes("form-placement"),onToggle:(0,N.partial)(e,"form-placement")}),(0,JZ.jsx)(AX,{isOpened:t.includes("tags"),onToggle:(0,N.partial)(e,"tags")}),(0,JZ.jsx)(BX,{isOpened:t.includes("custom-css"),onToggle:(0,N.partial)(e,"custom-css")})]})}function RX(){return(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(RZ,{})})}function DX(e){let{children:t,closeSidebar:n}=e;return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[(0,JZ.jsx)("span",{className:"interface-complementary-area-header__small-title",children:KZ.x.I18n.t("formSettings")}),(0,JZ.jsx)(ia.ZP,{onClick:n,icon:"no-alt"})]}),(0,JZ.jsxs)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs",children:[t,(0,JZ.jsx)(ia.ZP,{onClick:n,icon:"no-alt"})]})]})}function MX(e){let{onClose:t}=e;const n=(0,un.Z)((e=>e(nj).getDefaultSidebarActiveTab()),[]),r=(0,un.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]),{switchDefaultSidebarTab:o}=(0,dn.Z)(nj);return(0,b.useEffect)((()=>{o(r?"block":"form")}),[r,o]),(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(DX,{closeSidebar:t,children:(0,JZ.jsxs)("ul",{children:[(0,JZ.jsx)("li",{children:(0,JZ.jsx)("button",{onClick:()=>{o("form")},className:C()("components-button edit-post-sidebar__panel-tab",{"is-active":"form"===n}),"data-automation-id":"mailpoet_form_settings_tab",type:"button",children:KZ.x.I18n.t("form")})}),(0,JZ.jsx)("li",{children:(0,JZ.jsx)("button",{onClick:()=>{o("block")},className:C()("components-button edit-post-sidebar__panel-tab",{"is-active":"block"===n}),"data-automation-id":"mailpoet_block_settings_tab",type:"button",children:(0,O.__)("Block")})})]})}),"form"===n?(0,JZ.jsx)(LX,{}):(0,JZ.jsx)(RX,{})]})}var OX=n(30211);function FX(e){let{label:t,minPercents:n=0,maxPercents:r=100,minPixels:o=10,maxPixels:i=1e3,value:l,defaultPercentValue:a=50,defaultPixelValue:s=200,onChange:c}=e;const[u,d]=(0,b.useState)(l??{unit:"pixel",value:void 0});return(0,b.useEffect)((()=>{d(l)}),[l]),(0,JZ.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,JZ.jsx)(Hd.ZP.VisualLabel,{children:t}),(0,JZ.jsx)(eX.Z,{className:"mailpoet-form-inline-radios__control",selected:u.unit||"pixel",options:[{label:"px",value:"pixel"},{label:"%",value:"percent"}],onChange:e=>{const t={value:"pixel"===e?s:a,unit:e};d(t),c(t)}}),(0,JZ.jsx)(fN,{value:u.value??("pixel"===u.unit?s:a),min:"pixel"===u.unit?o:n,max:"pixel"===u.unit?i:r,onChange:e=>{const t={unit:"pixel"===u.unit?"pixel":"percent",value:e};d(t),c(t)}})]})}FX.displayName="FormEditorSizeSettings";const ZX=(0,qZ.withBoundary)(FX);function jX(e){let{settingsPlacementKey:t}=e;const n=(0,un.Z)((e=>e(nj).getFormSettings()),[]),r=(0,un.Z)((e=>(0,OX.sortBy)("name",e(nj).getAllWPTags().concat(e(nj).getAllWooCommerceTags()))),[]),o=(0,un.Z)((e=>(0,OX.sortBy)("name",e(nj).getAllWPCategories().concat(e(nj).getAllWooCommerceCategories()))),[]),i=(0,un.Z)((e=>e(nj).getAllWPPages()),[]),l=(0,un.Z)((e=>(0,OX.sortBy)("name",e(nj).getAllWPPosts().concat(e(nj).getAllWooCommerceProducts()))),[]),a=(0,un.Z)((e=>e(nj).getIsPreviewShown()),[]),{changeFormSettings:s}=(0,dn.Z)(nj);let c="no-preview";a&&(c="preview");const u="belowPosts"!==t;return(0,JZ.jsxs)(JZ.Fragment,{children:[u&&(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("placeFormOnHomepage"),checked:n.formPlacement[t].homepage,onChange:e=>{(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.homepage`,e)])(n)}}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("placeFormOnAllPages"),checked:n.formPlacement[t].pages.all,onChange:e=>{(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.pages.all`,e),(0,OX.cond)([[()=>e,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.pages.selected`,[]),(0,OX.assocPath)(`formPlacement.${t}.categories`,[]),(0,OX.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,OX.identity]])])(n)}}),(0,JZ.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].pages.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].pages.selected;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.pages.selected`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.assocPath)(`formPlacement.${t}.pages.all`,!1)],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}pages`,name:"pages",values:i,multiple:!0,placeholder:KZ.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].pages.selected}})})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("placeFormOnAllPosts"),checked:n.formPlacement[t].posts.all,onChange:e=>{(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.posts.all`,e),(0,OX.cond)([[()=>e,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.posts.selected`,[]),(0,OX.assocPath)(`formPlacement.${t}.categories`,[]),(0,OX.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,OX.identity]])])(n)}}),(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].posts.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].posts.selected;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.posts.selected`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.assocPath)(`formPlacement.${t}.posts.all`,!1)],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}posts`,name:"posts",values:l,multiple:!0,placeholder:KZ.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].posts.selected}})}),(0,JZ.jsxs)("div",{children:[(0,JZ.jsx)("p",{className:"form-editor-sidebar-heading",children:KZ.x.I18n.t("displayOnCategories")}),(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].categories.join()}`},onValueChange:e=>{const r=n.formPlacement[t].categories;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.categories`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,OX.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}categories`,name:"categories",values:o,multiple:!0,placeholder:KZ.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].categories}})})]}),(0,JZ.jsxs)("div",{children:[(0,JZ.jsx)("p",{className:"form-editor-sidebar-heading",children:KZ.x.I18n.t("displayOnTags")}),(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].tags.join()}`},onValueChange:e=>{const r=n.formPlacement[t].tags;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.tags`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,OX.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}tags`,name:"tags",values:r,multiple:!0,placeholder:KZ.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].tags}})})]}),u&&(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayOnAllTagArchives"),checked:n.formPlacement[t].tagArchives.all,onChange:e=>{(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.tagArchives.all`,e),(0,OX.cond)([[()=>e,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.tagArchives.selected`,[])])],[()=>!e,OX.identity]])])(n)}}),(0,JZ.jsx)("div",{"data-automation-id":"form-placement-select-archive-tags",children:(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].tagArchives.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].tagArchives.selected;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.tagArchives.selected`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.assocPath)(`formPlacement.${t}.tagArchives.all`,!1)],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}tagArchives`,name:"tagArchives",values:r,multiple:!0,placeholder:KZ.x.I18n.t("selectSpecificArchiveTags"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].tagArchives.selected}})})}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("displayOnAllCategoryArchives"),checked:n.formPlacement[t].categoryArchives.all,onChange:e=>{(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.categoryArchives.all`,e),(0,OX.cond)([[()=>e,(0,OX.compose)([(0,OX.assocPath)(`formPlacement.${t}.categoryArchives.selected`,[])])],[()=>!e,OX.identity]])])(n)}}),(0,JZ.jsx)("div",{"data-automation-id":"form-placement-select-archive-categories",children:(0,JZ.jsx)("div",{className:"form-editor-placement-selection",children:(0,JZ.jsx)(iX,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].categoryArchives.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].categoryArchives.selected;(0,OX.isEqual)(r,e.target.value)||(0,OX.compose)([s,(0,OX.assocPath)(`formPlacement.${t}.categoryArchives.selected`,e.target.value),(0,OX.cond)([[()=>!!e.target.value.length,(0,OX.assocPath)(`formPlacement.${t}.categoryArchives.all`,!1)],[()=>!e.target.value.length,OX.identity]])])(n)},field:{id:`${c}categoryArchives`,name:"categoryArchives",values:o,multiple:!0,placeholder:KZ.x.I18n.t("selectSpecificArchiveCategories"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].categoryArchives.selected}})})})]})]})}jX.displayName="FormEditorPlacementSettings";const zX=(0,qZ.withBoundary)(jX);function HX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:t}=(0,dn.Z)(nj),n=e.formPlacement.belowPosts.enabled;return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:KZ.x.I18n.t("placeFormBellowPagesDescription")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("enable"),checked:n,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.belowPosts.enabled",OX.__,e)])}),n&&(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(ZX,{label:KZ.x.I18n.t("formSettingsWidth"),value:e.formPlacement.belowPosts.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,OX.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,JZ.jsx)(zX,{settingsPlacementKey:"belowPosts"})]})]})}function VX(e){let{settingsPlacementKey:t}=e;const n=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:r}=(0,dn.Z)(nj);return(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("animationHeader"),value:n.formPlacement[t].animation,options:[{label:KZ.x.I18n.t("animationNone"),value:"none"},{label:"Fade In",value:"fadein"},{label:"Slide Right",value:"slideright"},{label:"Slide Left",value:"slideleft"},{label:"Slide Up",value:"slideup"},{label:"Slide Down",value:"slidedown"},{label:"Zoom Out",value:"zoomout"},{label:"Zoom In",value:"zoomin"},{label:"Flip",value:"flip"}],onChange:(0,OX.compose)([r,(0,OX.assocPath)(`formPlacement.${t}.animation`,OX.__,n)])})}VX.displayName="FormEditorAnimationSettings";const WX=(0,qZ.withBoundary)(VX);function UX(e){let{settingsPlacementKey:t}=e;const n=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:r}=(0,dn.Z)(nj);return(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formPlacementCookieExpiration"),value:n.formPlacement[t].cookieExpiration,options:[{value:"0",label:KZ.x.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:KZ.x.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map((e=>({value:`${e}`,label:KZ.x.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())})))],onChange:(0,OX.compose)([r,(0,OX.assocPath)(`formPlacement.${t}.cookieExpiration`,OX.__,n)])})}UX.displayName="FormEditorCookieSettings";const $X=(0,qZ.withBoundary)(UX),GX=[0,2,5,10,15,30,45,60,120,180,240];function qX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:t}=(0,dn.Z)(nj),n=e.formPlacement.popup.enabled;return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:KZ.x.I18n.t("placePopupFormOnPagesDescription")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("enable"),checked:n,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.popup.enabled",OX.__,e)])}),n&&(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("hr",{}),(0,JZ.jsx)(ZX,{label:KZ.x.I18n.t("formSettingsWidth"),value:e.formPlacement.popup.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,OX.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,JZ.jsx)(zX,{settingsPlacementKey:"popup"}),(0,JZ.jsx)(WX,{settingsPlacementKey:"popup"}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.popup.delay",OX.__,e)]),options:GX.map((e=>({value:`${e}`,label:KZ.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,JZ.jsx)($X,{settingsPlacementKey:"popup"}),(0,JZ.jsxs)("div",{children:[(0,JZ.jsx)("p",{children:(0,JZ.jsx)("b",{children:KZ.x.I18n.t("exitIntentTitle")})}),(0,JZ.jsx)("p",{children:KZ.x.I18n.t("exitIntentDescription")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.popup.exitIntentEnabled",OX.__,e)])})]})]})]})}var KX=n(34352),YX=n.n(KX);function XX(){const[e,t]=(0,b.useState)(null),n=(0,un.Z)((e=>e(nj).getFormExports()),[]),r=(0,un.Z)((e=>e(nj).getFormSettings()),[]),o=(0,un.Z)((e=>e(nj).isFormSaved()),[]),{changeFormSettings:i}=(0,dn.Z)(nj),l=YX()(KZ.x.I18n.t("addFormWidgetHint"),/\[link](.*?)\[\/link]/g,(e=>(0,JZ.jsx)("a",{href:"widgets.php",target:"_blank",children:e},"addFormWidgetHintLink"))),a=YX()(KZ.x.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,(e=>(0,JZ.jsx)("code",{children:n.shortcode},e))),s=(0,N.curry)(((e,r)=>(r.preventDefault(),KZ.x.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe)))),c=YX()(KZ.x.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,(e=>"PHP"===e?(0,JZ.jsx)("a",{href:"#",onClick:s("php"),children:e},"exportPHP"):(0,JZ.jsx)("a",{href:"#",onClick:s("iframe"),children:e},"exportIframe")));return o?(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:l}),(0,JZ.jsx)("p",{children:a}),(0,JZ.jsx)("p",{children:c}),e?(0,JZ.jsx)(rq.Z,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,JZ.jsx)("hr",{}),(0,JZ.jsx)(ZX,{label:KZ.x.I18n.t("formSettingsWidth"),value:r.formPlacement.others.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:200,defaultPercentValue:100,onChange:e=>{i((0,OX.assocPath)("formPlacement.others.styles.width",e,r))}})]}):(0,JZ.jsx)("p",{children:KZ.x.I18n.t("saveFormFirst")})}XX.displayName="FormEditorOtherSettings";const QX=[0,2,5,10,15,30,45,60,120,180,240];function JX(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:t}=(0,dn.Z)(nj),n=e.formPlacement.fixedBar.enabled;return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:KZ.x.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("enable"),checked:n,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.fixedBar.enabled",OX.__,e)])}),n&&(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("hr",{}),(0,JZ.jsx)(eX.Z,{label:KZ.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:KZ.x.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:KZ.x.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.fixedBar.position",OX.__,e)])}),(0,JZ.jsx)(ZX,{label:KZ.x.I18n.t("formSettingsWidth"),value:e.formPlacement.fixedBar.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,OX.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,JZ.jsx)(zX,{settingsPlacementKey:"fixedBar"}),(0,JZ.jsx)(WX,{settingsPlacementKey:"fixedBar"}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.fixedBar.delay",OX.__,e)]),options:QX.map((e=>({value:`${e}`,label:KZ.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,JZ.jsx)($X,{settingsPlacementKey:"fixedBar"})]})]})}JX.displayName="FormEditorFixedBarSettings";const eQ=[0,2,5,10,15,30,45,60,120,180,240];function tQ(){const e=(0,un.Z)((e=>e(nj).getFormSettings()),[]),{changeFormSettings:t}=(0,dn.Z)(nj),n=e.formPlacement.slideIn.enabled;return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("p",{children:KZ.x.I18n.t("placeSlideInFormOnPagesDescription")}),(0,JZ.jsx)(Bp.Z,{label:KZ.x.I18n.t("enable"),checked:n,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.slideIn.enabled",OX.__,e)])}),n&&(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)("hr",{}),(0,JZ.jsx)(eX.Z,{label:KZ.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:KZ.x.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:KZ.x.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.slideIn.position",OX.__,e)])}),(0,JZ.jsx)(ZX,{label:KZ.x.I18n.t("formSettingsWidth"),value:e.formPlacement.slideIn.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,OX.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,JZ.jsx)(zX,{settingsPlacementKey:"slideIn"}),(0,JZ.jsx)(WX,{settingsPlacementKey:"slideIn"}),(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,OX.compose)([t,(0,OX.assocPath)("formPlacement.slideIn.delay",OX.__,e)]),options:eQ.map((e=>({value:`${e}`,label:KZ.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,JZ.jsx)($X,{settingsPlacementKey:"slideIn"})]})]})}function nQ(e){let{activePanel:t}=e;return(0,JZ.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===t&&(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(XX,{})}),"below_posts"===t&&(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(HX,{})}),"fixed_bar"===t&&(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(JX,{})}),"popup"===t&&(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(qX,{})}),"slide_in"===t&&(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(tQ,{})})]})}function rQ(e){let{onClose:t}=e;const n=(0,un.Z)((e=>e(nj).getPreviewSettings()),[]);return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(DX,{closeSidebar:t,children:(0,JZ.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===n.formType&&KZ.x.I18n.t("placeFormOthers"),"below_posts"===n.formType&&KZ.x.I18n.t("placeFormBellowPages"),"fixed_bar"===n.formType&&KZ.x.I18n.t("placeFixedBarFormOnPages"),"popup"===n.formType&&KZ.x.I18n.t("placePopupFormOnPages"),"slide_in"===n.formType&&KZ.x.I18n.t("placeSlideInFormOnPages")]})}),(0,JZ.jsx)(hz.Z,{children:(0,JZ.jsx)(nf.Z,{children:(0,JZ.jsx)(nQ,{activePanel:n.formType})})})]})}function oQ(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,dn.Z)(nj),n=(0,un.Z)((e=>e(nj).getActiveSidebar()),[]),r=(0,un.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]);return(0,b.useEffect)((()=>{r&&t("default")}),[r,t]),(0,JZ.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,JZ.jsx)(MX,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,JZ.jsx)(rQ,{onClose:()=>{t("default")}})]})}function iQ(e){let{setIsInserterOpened:t}=e;const n=(0,un.Z)((e=>e(nj).getInserterPanelInsertPoint()),[]);return(0,JZ.jsxs)("div",{className:"edit-post-editor__inserter-panel",children:[(0,JZ.jsx)("div",{className:"edit-post-editor__inserter-panel-header",children:(0,JZ.jsx)(ia.ZP,{icon:AF.Z,onClick:()=>t(!1)})}),(0,JZ.jsx)("div",{className:"edit-post-editor__inserter-panel-content",children:(0,JZ.jsx)(ZZ,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:n.rootClientId??void 0,__experimentalInsertionIndex:n.insertionIndex??void 0})})]})}oQ.displayName="FormEditorSidebar";var lQ=n(23725);function aQ(){const e=(0,un.Z)((e=>e(nj).getDismissibleNotices()),[]),t=(0,un.Z)((e=>e(nj).getNonDismissibleNotices()),[]),{removeNotice:n}=(0,dn.Z)(nj),r=(0,N.memoize)((e=>{setTimeout((()=>n(e)),5e3)}));return e.forEach((e=>r(e.id))),(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(lQ.Z,{notices:t,className:"components-editor-notices__pinned"}),(0,JZ.jsx)(lQ.Z,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}aQ.displayName="FormEditorNotices";var sQ=n(35572);const cQ=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,un.Z)((e=>e(nj).getFormStyles()),[]);try{sQ.parse(t)}catch(t){return y.createPortal(null,e)}const n=ix([{css:t}],".editor-styles-wrapper");return y.createPortal(n[0],e)};function uQ(){return(0,JZ.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"16px",height:"24px",viewBox:"0 0 16 24",version:"1.1",children:(0,JZ.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,JZ.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,JZ.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,JZ.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,JZ.jsx)("path",{d:"M16,3 C16,1.34314575 14.6568542,0 13,0 L3,0 C1.34314575,0 0,1.34314575 0,3 L0,21 C0,22.6568542 1.34314575,24 3,24 L13,24 C14.6568542,24 16,22.6568542 16,21 L16,3 Z M14,5.5 L14,17.5 C14,18.0522847 13.5522847,18.5 13,18.5 L3,18.5 C2.44771525,18.5 2,18.0522847 2,17.5 L2,5.5 C2,4.94771525 2.44771525,4.5 3,4.5 L13,4.5 C13.5522847,4.5 14,4.94771525 14,5.5 Z M7,21 C7,20.4477153 7.44771525,20 8,20 C8.55228475,20 9,20.4477153 9,21 C9,21.5522847 8.55228475,22 8,22 C7.44771525,22 7,21.5522847 7,21 Z",id:"Shape"})})})})})})}function dQ(){return(0,JZ.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:(0,JZ.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,JZ.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,JZ.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,JZ.jsx)("g",{children:(0,JZ.jsx)("path",{d:"M13.965,20.5 C14.1138804,20.5 14.2550143,20.5663566 14.35,20.681 L14.35,20.681 L16.449,23.213 C16.5561084,23.3657981 16.5692196,23.5655248 16.4830056,23.7310137 C16.3967915,23.8965027 16.2255996,24.0002137 16.039,24 L16.039,24 L7.96,24 C7.7734004,24.0002137 7.60220849,23.8965027 7.51599443,23.7310137 C7.42978036,23.5655248 7.44289164,23.3657981 7.55,23.213 L7.55,23.213 L9.65,20.681 C9.74498572,20.5663566 9.88611956,20.5 10.035,20.5 L10.035,20.5 Z M22.5,-4.08562073e-14 C23.3284271,-4.08562073e-14 24,0.671572875 24,1.5 L24,1.5 L24,17.5 C24,18.3284271 23.3284271,19 22.5,19 L22.5,19 L1.5,19 C0.671572875,19 0,18.3284271 0,17.5 L0,17.5 L0,1.5 C0,0.671572875 0.671572875,-4.08562073e-14 1.5,-4.08562073e-14 L1.5,-4.08562073e-14 Z M21.5,2 L2.5,2 C2.22385763,2 2,2.22385763 2,2.5 L2,2.5 L2,14.5 C2,14.7761424 2.22385763,15 2.5,15 L2.5,15 L21.5,15 C21.7761424,15 22,14.7761424 22,14.5 L22,14.5 L22,2.5 C22,2.22385763 21.7761424,2 21.5,2 L21.5,2 Z"})})})})})})}function pQ(e){let{children:t,onDisplayTypeChange:n,selectedDisplayType:r}=e;const[o,i]=(0,b.useState)(r),l=e=>{i(e),n(e)};return(0,JZ.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,JZ.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,JZ.jsx)("a",{className:C()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===o}),onClick:e=>{e.preventDefault(),l("desktop")},title:(0,O._x)("Desktop","Desktop browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_desktop",children:(0,JZ.jsx)(dQ,{})}),(0,JZ.jsx)("a",{className:C()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===o}),onClick:e=>{e.preventDefault(),l("mobile")},title:(0,O._x)("Mobile","Mobile browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_mobile",children:(0,JZ.jsx)(uQ,{})})]}),(0,JZ.jsx)("div",{className:C()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==o},{mailpoet_browser_preview_container_desktop:"desktop"===o}),children:(0,JZ.jsx)("div",{className:"mailpoet_browser_preview_border",children:t})}),"desktop"!==o&&(0,JZ.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:(0,O.__)("Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.","mailpoet")})]})}function mQ(){const e=(0,b.useRef)(null),[t,n]=(0,b.useState)(!1),{hidePreview:r,changePreviewSettings:o}=(0,dn.Z)(nj),i=(0,un.Z)((e=>e(nj).getIsPreviewShown()),[]),l=(0,un.Z)((e=>e(nj).getIsPreviewReady()),[]),a=(0,un.Z)((e=>e(nj).getPreviewSettings()),[]),s=(0,un.Z)((e=>e(nj).getFormSettings()),[]),c=(0,un.Z)((e=>e(nj).getFormData().id),[]),u=(0,un.Z)((e=>e(nj).getEditorUrl()),[]),d=(0,un.Z)((e=>e(nj).getPreviewPageUrl()),[]);(0,b.useEffect)((()=>{n(!1);const e=document.getElementById("beacon-container");i&&e&&(e.style.display="none")}),[i]),(0,b.useEffect)((()=>{if(!e.current||!t)return;const n={formType:a.formType,formSettings:s};e.current.contentWindow.postMessage(n,d)}),[s,e,a,t,d]);const p=(0,b.useCallback)((()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),r()}),[r]),m=(0,b.useCallback)((e=>{n(!1),o({...a,formType:e})}),[o,a]),h=(0,b.useCallback)((e=>{o({...a,displayType:e})}),[o,a]);if(!i)return null;const f={id:c,form_type:a.formType,editor_url:u};let g=`${d}&data=${btoa(JSON.stringify(f))}`;return["below_posts"].includes(a.formType)&&(g+=`#mailpoet_form_preview_${c}`),(0,JZ.jsxs)(XY.u,{onRequestClose:p,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",overlayClassName:"mailpoet_form_preview_modal_overlay",children:[!l&&(0,JZ.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,JZ.jsx)(cC.ZP,{})}),l&&(0,JZ.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,JZ.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,JZ.jsx)(jT.Z,{label:KZ.x.I18n.t("formPlacementLabel"),value:a.formType,onChange:m,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:KZ.x.I18n.t("placeFormOthers")},{value:"below_posts",label:KZ.x.I18n.t("placeFormBellowPages")},{value:"fixed_bar",label:KZ.x.I18n.t("placeFixedBarFormOnPages")},{value:"popup",label:KZ.x.I18n.t("placePopupFormOnPages")},{value:"slide_in",label:KZ.x.I18n.t("placeSlideInFormOnPages")}]}),(0,JZ.jsx)(nQ,{activePanel:a.formType})]}),(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsxs)(pQ,{onDisplayTypeChange:h,selectedDisplayType:a.displayType,children:[!t&&(0,JZ.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,JZ.jsx)(cC.ZP,{})}),(0,JZ.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:g,title:KZ.x.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===a.formType?"no":"yes"}),"others"===a.formType&&"desktop"===a.displayType&&(0,JZ.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:KZ.x.I18n.t("formPreviewOthersDisclaimer")})]})})]})]})}function hQ(e){let{children:t}=e;const{fontColor:n,backgroundColor:r,gradient:o,fontSize:i,borderRadius:l,borderSize:a,borderColor:s,alignment:c,formPadding:u,backgroundImageUrl:d,backgroundImageDisplay:p,fontFamily:m}=(0,un.Z)((e=>e(nj).getFormSettings()),[]),h=(0,un.Z)((e=>e(nj).getPreviewSettings()),[]),f=(0,un.Z)((e=>e(nj).getFormWidth(h.formType)),[h.formType]);let g,v,b,y;a&&s&&(g="solid"),l&&(v=Number(l)),u&&(b=Number(u)),c&&(y=c);const _=[],k={color:n,fontSize:`${i}${Number.isNaN(Number(`${i}`||NaN))?"":"px"}`,fontFamily:m,lineHeight:1.2,borderRadius:v,borderWidth:a,borderColor:s,borderStyle:g,textAlign:y,padding:b,width:"pixel"===f.unit?f.value:`${f.value}%`,margin:"0 auto",maxWidth:"100%"};if(["others","below_posts"].includes(h.formType)&&"percent"===f.unit&&(k.maxWidth=600),void 0!==d&&d){let e="center",t="no-repeat",n="cover";"fit"===p&&(n="auto",e="center top"),"tile"===p&&(t="repeat",n="auto"),_.push(`url(${d}) ${e}/${n} ${t}`)}if(o&&_.push(o),r&&_.push(r),_.length&&(k.background=_.join(", ")),"fixed_bar"===h.formType){const e={width:k.width,margin:"0 auto"};return k.width="max-content",k.minWidth="100%",k.maxWidth="auto",(0,JZ.jsx)("div",{className:"mailpoet-form-background",style:k,children:(0,JZ.jsx)("div",{style:e,children:t})})}return(0,JZ.jsx)("div",{className:"mailpoet-form-background",style:k,children:t})}function fQ(){const e=(0,un.Z)((e=>e(nj).isFullscreenEnabled()),[]);return(0,b.useEffect)((()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}),[e]),null}function gQ(){const e=(0,un.Z)((e=>e(nj).getSidebarOpened()),[]),t=(0,un.Z)((e=>e(nj).isInserterOpened()),[]),n=(0,un.Z)((e=>e(nj).getFormBlocks()),[]),r=(0,un.Z)((e=>e("core").canUser("create","media")),[]),o=(0,un.Z)((e=>e("core/block-editor").getSelectedBlock()),[]),i=C()("edit-post-layout interface-interface-skeleton",o?o.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:l,toggleInserter:a}=(0,dn.Z)(nj),s={mediaUpload:r?Sn:null,supportsLayout:!1,maxWidth:580,fontSizes:rj,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,enableCustomUnits:!0,__experimentalFetchLinkSuggestions:YZ,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:a,__experimentalFeatures:{color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:fa.colors},gradients:{default:fa.gradients}}}};return(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(FG,{}),(0,JZ.jsx)(Nk.vn,{children:(0,JZ.jsx)(pn.zt,{children:(0,JZ.jsxs)("div",{className:i,children:[(0,JZ.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,JZ.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(YY,{isInserterOpened:t,setIsInserterOpened:a})})}),(0,JZ.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,JZ.jsxs)(uk,{value:n,onInput:l,onChange:l,settings:s,useSubRegistry:!1,children:[t&&(0,JZ.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,JZ.jsx)(iQ,{setIsInserterOpened:a})}),(0,JZ.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(aQ,{})}),(0,JZ.jsx)(GZ.D,{storeName:"mailpoet-form-editor"}),(0,JZ.jsx)(bk,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,JZ.jsxs)(OZ,{children:[(0,JZ.jsx)(zZ,{}),(0,JZ.jsx)(zZ.Register,{}),(0,JZ.jsx)("div",{className:"mailpoet_form",children:(0,JZ.jsx)(Fk,{children:(0,JZ.jsx)(WZ,{children:(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(hQ,{children:(0,JZ.jsx)(eT,{})})})})})})]})})]}),e&&(0,JZ.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(oQ,{})})})]})}),(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(cQ,{})}),(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(fQ,{})})]}),(0,JZ.jsx)(mn.Z.Slot,{})]})})}),(0,JZ.jsx)(qZ.ErrorBoundary,{children:(0,JZ.jsx)(mQ,{})}),(0,JZ.jsx)(JY,{})]})}cQ.displayName="FormStyles",pQ.propTypes={children:QZ().node.isRequired,onDisplayTypeChange:QZ().func,selectedDisplayType:QZ().string},pQ.defaultProps={onDisplayTypeChange:()=>{},selectedDisplayType:"desktop"},pQ.displayName="FormEditorPreview",mQ.displayName="FormPreviewWrapper",hQ.propTypes={children:QZ().node.isRequired},hQ.displayName="FormStylingBackground",fQ.displayName="Fullscreen";const vQ=(0,B.Z)((0,ig.Z)(((e,t)=>{if(Xn(t.name,"multiple",!0))return{};const n=e(pd).getBlocks().find((e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,lg.Z)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(pd).selectBlock(n)}}))),bQ=(0,na.o)((e=>vQ((t=>{let{originalBlockClientId:n,selectFirst:r,...o}=t;if(!n)return(0,b.createElement)(e,o);const i=qn(o.name),l=function(e){const t=cr(ur("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));return t?qn(t.blocks[0]):null}(o.name);return[(0,b.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,b.createElement)(e,(0,ta.Z)({key:"block-edit"},o))),(0,b.createElement)(bg,{key:"multiple-use-warning",actions:[(0,b.createElement)(ia.ZP,{key:"find-original",variant:"secondary",onClick:r},(0,O.__)("Find original")),(0,b.createElement)(ia.ZP,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,O.__)("Remove")),l&&(0,b.createElement)(ia.ZP,{key:"transform",variant:"secondary",onClick:()=>o.onReplace(nr(l.name,o.attributes))},(0,O.__)("Transform into:")," ",l.title)]},(0,b.createElement)("strong",null,null==i?void 0:i.title,": "),(0,O.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,tr.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",bQ);var yQ=n(19451);const _Q="core/bold",kQ=(0,O.__)("Bold"),xQ={name:_Q,title:kQ,tagName:"strong",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,La.toggleFormat)(n,{type:_Q,title:kQ}))}return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"primary",character:"b",onUse:i}),(0,b.createElement)(BF,{name:"bold",icon:yQ.Z,title:kQ,onClick:function(){r((0,La.toggleFormat)(n,{type:_Q})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),(0,b.createElement)(PF,{inputType:"formatBold",onInput:i}))}};var wQ=n(75209);const CQ="core/code",EQ=(0,O.__)("Inline code"),SQ={name:CQ,title:EQ,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n[t-1])return e;if(t-2<0)return e;const r=n.lastIndexOf("`",t-2);if(-1===r)return e;const o=r,i=t-2;return o===i?e:(e=(0,La.remove)(e,o,o+1),e=(0,La.remove)(e,i,i+1),e=(0,La.applyFormat)(e,{type:CQ},o,i))},edit(e){let{value:t,onChange:n,onFocus:r,isActive:o}=e;function i(){n((0,La.toggleFormat)(t,{type:CQ,title:EQ})),r()}return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"access",character:"x",onUse:i}),(0,b.createElement)(BF,{icon:wQ.Z,title:EQ,onClick:i,isActive:o,role:"menuitemcheckbox"}))}},IQ=["image"],TQ="core/image",NQ=(0,O.__)("Inline image"),BQ={name:TQ,title:NQ,keywords:[(0,O.__)("photo"),(0,O.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(e){let{value:t,onChange:n,onFocus:r,isObjectActive:o,activeObjectAttributes:i,contentRef:l}=e;const[a,s]=(0,b.useState)(!1);function c(){s(!1)}return(0,b.createElement)(wC,null,(0,b.createElement)(BF,{icon:(0,b.createElement)(Vp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,b.createElement)(Vp.y$,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:NQ,onClick:function(){s(!0)},isActive:o}),a&&(0,b.createElement)(CC,{allowedTypes:IQ,onSelect:e=>{let{id:o,url:i,alt:l,width:a}=e;c(),n((0,La.insertObject)(t,{type:TQ,attributes:{className:`wp-image-${o}`,style:`width: ${Math.min(a,150)}px;`,url:i,alt:l}})),r()},onClose:c,render:e=>{let{open:t}=e;return t(),null}}),o&&(0,b.createElement)(PQ,{value:t,onChange:n,activeObjectAttributes:i,contentRef:l}))}};function PQ(e){let{value:t,onChange:n,activeObjectAttributes:r,contentRef:o}=e;const{style:i}=r,[l,a]=(0,b.useState)(null==i?void 0:i.replace(/\D/g,"")),s=(0,La.useAnchor)({editableContentElement:o.current,value:t,settings:BQ});return(0,b.createElement)(mn.Z,{placement:"bottom",focusOnMount:!1,anchor:s,className:"block-editor-format-toolbar__image-popover"},(0,b.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:e=>{const o=t.replacements.slice();o[t.start]={type:TQ,attributes:{...r,style:l?`width: ${l}px;`:""}},n({...t,replacements:o}),e.preventDefault()}},(0,b.createElement)(kf.Z,{alignment:"bottom",spacing:"0"},(0,b.createElement)(Mm.Z,{className:"block-editor-format-toolbar__image-container-value",label:(0,O.__)("Width"),value:l,min:1,onChange:e=>a(e)}),(0,b.createElement)(ia.ZP,{className:"block-editor-format-toolbar__image-container-button",icon:DO.Z,label:(0,O.__)("Apply"),type:"submit"}))))}var AQ=n(91452);const LQ="core/italic",RQ=(0,O.__)("Italic"),DQ={name:LQ,title:RQ,tagName:"em",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,La.toggleFormat)(n,{type:LQ,title:RQ}))}return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"primary",character:"i",onUse:i}),(0,b.createElement)(BF,{name:"italic",icon:AQ.Z,title:RQ,onClick:function(){r((0,La.toggleFormat)(n,{type:LQ})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),(0,b.createElement)(PF,{inputType:"formatItalic",onInput:i}))}};var MQ=n(70874),OQ=n(2746),FQ=n(37703),ZQ=n(67256),jQ=n(2355),zQ=n(72123),HQ=n(62036),VQ=n(28452),WQ=n(78072),UQ=n(17404);function $Q(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,aO.E)(t);if(!(0,OQ.M)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,FQ.C)(t);if(!(0,ZQ.x)(n))return!1;const r=(0,jQ.D)(t);if(r&&!(0,zQ.t)(r))return!1;const o=(0,HQ.W)(t);if(o&&!(0,VQ.A)(o))return!1;const i=(0,WQ.S)(t);if(i&&!(0,UQ.Z)(i))return!1}return!(t.startsWith("#")&&!(0,UQ.Z)(t))}function GQ(e,t){var n,r,o;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const a={start:null,end:null},{formats:s}=e;let c,u;if(null==s||!s.length)return a;const d=s.slice(),p=null===(n=d[i])||void 0===n?void 0:n.find((e=>{let{type:n}=e;return n===t.type})),m=null===(r=d[l])||void 0===r?void 0:r.find((e=>{let{type:n}=e;return n===t.type})),h=null===(o=d[l-1])||void 0===o?void 0:o.find((e=>{let{type:n}=e;return n===t.type}));if(p)c=p,u=i;else if(m)c=m,u=l;else{if(!h)return a;c=h,u=l-1}const f=d[u].indexOf(c),g=[d,u,c,f];return i=YQ(...g),l=XQ(...g),i=i<0?0:i,{start:i,end:l}}function qQ(e,t,n,r,o){let i=t;const l={forwards:1,backwards:-1}[o]||1,a=-1*l;for(;e[i]&&e[i][r]===n;)i+=l;return i+=a,i}const KQ=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e(...r,...n)}},YQ=KQ(qQ,"backwards"),XQ=KQ(qQ,"forwards"),QQ=new WeakMap;let JQ=-1;function eJ(e){return`link-control-instance-${e}`}const tJ=RM((function(e){let{isActive:t,activeAttributes:n,addingLink:r,value:o,onChange:i,speak:l,stopAddingLink:a,contentRef:s}=e;const c=function(e,t){let n=e.start,r=e.end;if(t){const t=GQ(e,{type:"core/link"});n=t.start,r=t.end+1}return(0,La.slice)(e,n,r)}(o,t).text,[u,d]=(0,b.useState)(),{createPageEntity:p,userCanCreatePages:m}=(0,un.Z)((e=>{const{getSettings:t}=e(pd),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),h={url:n.url,type:n.type,id:n.id,opensInNewTab:"_blank"===n.target,title:c,...u},f=(0,La.useAnchor)({editableContentElement:s.current,value:o,settings:oJ}),g=function(e){if(e)return QQ.has(e)?eJ(QQ.get(e)):(JQ+=1,QQ.set(e,JQ),eJ(JQ))}(f),v=(0,b.useRef)(!!r&&"firstElement");return(0,b.createElement)(mn.Z,{anchor:f,focusOnMount:v.current,onClose:a,placement:"bottom",shift:!0},(0,b.createElement)(SO,{key:g,value:h,onChange:function(e){e={...u,...e};const n=h.opensInNewTab!==e.opensInNewTab&&h.url===e.url,r=n&&void 0===e.url;if(d(r?e:void 0),r)return;const s=(0,sO.u)(e.url),p=function(e){let{url:t,type:n,id:r,opensInNewWindow:o}=e;const i={type:"core/link",attributes:{url:t}};return n&&(i.attributes.type=n),r&&(i.attributes.id=r),o&&(i.attributes.target="_blank",i.attributes.rel="noreferrer noopener"),i}({url:s,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewWindow:e.opensInNewTab}),m=e.title||s;if((0,La.isCollapsed)(o)&&!t){const e=(0,La.applyFormat)((0,La.create)({text:m}),p,0,m.length);i((0,La.insert)(o,e))}else{let e;if(m===c)e=(0,La.applyFormat)(o,p);else{e=(0,La.create)({text:m}),e=(0,La.applyFormat)(e,p,0,m.length);const t=GQ(o,{type:"core/link"}),[n,r]=(0,La.split)(o,t.start,t.start),i=(0,La.replace)(r,c,e);e=(0,La.concat)(n,i)}e.start=e.end,e.activeFormats=[],i(e)}n||a(),$Q(s)?l(t?(0,O.__)("Link edited."):(0,O.__)("Link inserted."),"assertive"):l((0,O.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,La.removeFormat)(o,"core/link");i(e),a(),l((0,O.__)("Link removed."),"assertive")},forceIsEditingLink:r,hasRichPreviews:!0,createSuggestion:p&&async function(e){const t=await p({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:m,createSuggestionButtonText:function(e){return(0,G_.Z)((0,O.sprintf)((0,O.__)("Create Page: <mark>%s</mark>"),e),{mark:(0,b.createElement)("mark",null)})},hasTextControl:!0}))})),nJ="core/link",rJ=(0,O.__)("Link"),oJ={name:nJ,title:rJ,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,t){let{html:n,plainText:r}=t;if((0,La.isCollapsed)(e))return e;const o=(n||r).replace(/<[^>]+>/g,"").trim();return(0,OM.P)(o)?(window.console.log("Created link:\n\n",o),(0,La.applyFormat)(e,{type:nJ,attributes:{url:(0,si.decodeEntities)(o)}})):e},edit:function(e){let{isActive:t,activeAttributes:n,value:r,onChange:o,onFocus:i,contentRef:l}=e;const[a,s]=(0,b.useState)(!1);function c(){const e=(0,La.getTextContent)((0,La.slice)(r));e&&(0,OM.P)(e)&&$Q(e)?o((0,La.applyFormat)(r,{type:nJ,attributes:{url:e}})):e&&(0,MQ.J)(e)?o((0,La.applyFormat)(r,{type:nJ,attributes:{url:`mailto:${e}`}})):s(!0)}function u(){o((0,La.removeFormat)(r,nJ)),(0,Xc.speak)((0,O.__)("Link removed."),"assertive")}return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"primary",character:"k",onUse:c}),(0,b.createElement)(NF,{type:"primaryShift",character:"k",onUse:u}),t&&(0,b.createElement)(BF,{name:"link",icon:hT.Z,title:(0,O.__)("Unlink"),onClick:u,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"k"}),!t&&(0,b.createElement)(BF,{name:"link",icon:mT.Z,title:rJ,onClick:c,isActive:t,shortcutType:"primary",shortcutCharacter:"k"}),(a||t)&&(0,b.createElement)(tJ,{addingLink:a,stopAddingLink:function(){s(!1),i()},isActive:t,activeAttributes:n,value:r,onChange:o,contentRef:l}))}},iJ="core/strikethrough",lJ=(0,O.__)("Strikethrough"),aJ={name:iJ,title:lJ,tagName:"s",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r((0,La.toggleFormat)(n,{type:iJ,title:lJ})),o()}return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"access",character:"d",onUse:i}),(0,b.createElement)(BF,{icon:VA.Z,title:lJ,onClick:i,isActive:t,role:"menuitemcheckbox"}))}},sJ="core/underline",cJ=(0,O.__)("Underline"),uJ={name:sJ,title:cJ,tagName:"span",className:null,attributes:{style:"style"},edit(e){let{value:t,onChange:n}=e;const r=()=>{n((0,La.toggleFormat)(t,{type:sJ,attributes:{style:"text-decoration: underline;"},title:cJ}))};return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(NF,{type:"primary",character:"u",onUse:r}),(0,b.createElement)(PF,{inputType:"formatUnderline",onInput:r}))}};var dJ=n(19811),pJ=n(26905);function mJ(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==bJ&&(e.backgroundColor=r)}return e}),{})}function hJ(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(" ").reduce(((t,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=RB(e,r);t.color=o.color}return t}),{})}function fJ(e,t,n){const r=(0,La.getActiveFormat)(e,t);return r?{...mJ(r.attributes.style),...hJ(r.attributes.class,n)}:{}}function gJ(e){let{name:t,property:n,value:r,onChange:o}=e;const i=(0,un.Z)((e=>{var t;const{getSettings:n}=e(pd);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),l=(0,b.useCallback)((e=>{o(function(e,t,n,r){const{color:o,backgroundColor:i}={...fJ(e,t,n),...r};if(!o&&!i)return(0,La.removeFormat)(e,t);const l=[],a=[],s={};if(i?l.push(["background-color",i].join(":")):l.push(["background-color",bJ].join(":")),o){const e=DB(n,o);e?a.push(MB("color",e.slug)):l.push(["color",o].join(":"))}return l.length&&(s.style=l.join(";")),a.length&&(s.class=a.join(" ")),(0,La.applyFormat)(e,{type:t,attributes:s})}(r,t,i,{[n]:e}))}),[i,o,n]),a=(0,b.useMemo)((()=>fJ(r,t,i)),[t,r,i]);return(0,b.createElement)(GD,{value:a[n],onChange:l})}function vJ(e){let{name:t,value:n,onChange:r,onClose:o,contentRef:i}=e;const l=function(e){const[t,n]=(0,b.useState)(e);return(0,b.useEffect)((()=>{e&&n(e)}),[e]),t}((0,La.useAnchor)({editableContentElement:i.current,value:n,settings:wJ}));return(0,b.createElement)(mn.Z,{onClose:o,className:"components-inline-color-popover",anchor:l},(0,b.createElement)(AC.Z,{tabs:[{name:"color",title:(0,O.__)("Text")},{name:"backgroundColor",title:(0,O.__)("Background")}]},(e=>(0,b.createElement)(gJ,{name:t,property:e.name,value:n,onChange:r}))))}const bJ="rgba(0, 0, 0, 0)",yJ="core/text-color",_J=(0,O.__)("Highlight"),kJ=[];function xJ(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===bJ&&e.parentElement?xJ(e.parentElement,t):o}const wJ={name:yJ,title:_J,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color",bJ].join(":");return t?[n,t].join(";"):n},edit:function(e){let{value:t,onChange:n,isActive:r,activeAttributes:o,contentRef:i}=e;const l=am("color.custom"),a=am("color.palette")||kJ,[s,c]=(0,b.useState)(!1),u=(0,b.useCallback)((()=>c(!0)),[c]),d=(0,b.useCallback)((()=>c(!1)),[c]),p=(0,b.useMemo)((()=>function(e,t){let{color:n,backgroundColor:r}=t;if(n||r)return{color:n||xJ(e,"color"),backgroundColor:r===bJ?xJ(e,"background-color"):r}}(i.current,fJ(t,yJ,a))),[t,a]),m=a.length||!l;return m||r?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(BF,{className:"format-library-text-color-button",isActive:r,icon:(0,b.createElement)(Gm.Z,{icon:Object.keys(o).length?dJ.Z:pJ.Z,style:p}),title:_J,onClick:m?u:()=>n((0,La.removeFormat)(t,yJ)),role:"menuitemcheckbox"}),s&&(0,b.createElement)(vJ,{name:yJ,onClose:d,activeAttributes:o,value:t,onChange:n,contentRef:i})):null}};var CJ=n(19942);const EJ="core/subscript",SJ=(0,O.__)("Subscript"),IJ={name:EJ,title:SJ,tagName:"sub",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,b.createElement)(BF,{icon:CJ.Z,title:SJ,onClick:function(){r((0,La.toggleFormat)(n,{type:EJ,title:SJ})),o()},isActive:t,role:"menuitemcheckbox"})}};var TJ=n(281);const NJ="core/superscript",BJ=(0,O.__)("Superscript"),PJ={name:NJ,title:BJ,tagName:"sup",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,b.createElement)(BF,{icon:TJ.Z,title:BJ,onClick:function(){r((0,La.toggleFormat)(n,{type:NJ,title:BJ})),o()},isActive:t,role:"menuitemcheckbox"})}};var AJ=n(35779);const LJ="core/keyboard",RJ=(0,O.__)("Keyboard input"),DJ={name:LJ,title:RJ,tagName:"kbd",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,b.createElement)(BF,{icon:AJ.Z,title:RJ,onClick:function(){r((0,La.toggleFormat)(n,{type:LJ,title:RJ})),o()},isActive:t,role:"menuitemcheckbox"})}};var MJ=n(53124);const OJ="core/unknown",FJ=(0,O.__)("Clear Unknown Formatting"),ZJ={name:OJ,title:FJ,tagName:"*",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;const i=(0,La.slice)(n).formats.some((e=>e.some((e=>e.type===OJ))));return t||i?(0,b.createElement)(BF,{name:"unknown",icon:MJ.Z,title:FJ,onClick:function(){r((0,La.removeFormat)(n,OJ)),o()},isActive:!0}):null}};[xQ,SQ,BQ,DQ,oJ,aJ,uJ,wJ,IJ,PJ,DJ,ZJ].forEach((e=>{let{name:t,...n}=e;return(0,La.registerFormatType)(t,n)}));const jJ="mailpoet-form/font-selection",zJ=["core/paragraph","core/heading"],HJ={name:jJ,title:"Font Selection",tagName:"span",className:"mailpoet-has-font",attributes:{style:"style",font:"data-font"},edit:function(e){let{value:t,onChange:n,activeAttributes:r}=e;const o=(0,un.Z)((e=>e("core/block-editor").getSelectedBlock()),[]);return zJ.includes(o.name)?(0,JZ.jsx)(Ed,{children:(0,JZ.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,JZ.jsx)(OG,{value:r.font,onChange:e=>{n((0,La.applyFormat)(t,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${e}`,font:e}}))},name:KZ.x.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var VJ=n(97184),WJ=n(56762),UJ=n(45235),$J=n(95662),GJ=n(33014),qJ=n(30533);const KJ="mailpoet-form-editor-templates";function YJ(){const e=[{name:"popup",label:(0,O._x)("Pop-up","This is a text on a widget that leads to settings for form placement - form type is pop-up, it will be displayed on page in a small modal window","mailpoet")},{name:"slide_in",label:(0,O._x)("Slide–in","This is a text on a widget that leads to settings for form placement - form type is slide in","mailpoet")},{name:"fixed_bar",label:(0,O._x)("Fixed bar","This is a text on a widget that leads to settings for form placement - form type is fixed bar","mailpoet")},{name:"below_posts",label:(0,O._x)("Below pages","This is a text on a widget that leads to settings for form placement","mailpoet")},{name:"others",label:(0,O._x)("Others (widget)","Placement of the form using theme widget","mailpoet")}],t=(0,un.Z)((e=>e(KJ).getSelectedCategory()),[]),n=(0,un.Z)((e=>e(KJ).getTemplates()),[]),r=(0,un.Z)((e=>e(KJ).getLoading()),[]),o=(0,un.Z)((e=>e(KJ).getSelectTemplateFailed()),[]),{selectTemplate:i,selectCategory:l}=(0,dn.Z)(KJ);return(0,JZ.jsxs)(JZ.Fragment,{children:[e.map((e=>n[e.name].map(((e,t)=>t<4&&(0,JZ.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))))),(0,JZ.jsx)(GJ.Q,{}),o&&(0,JZ.jsx)(qJ.q,{type:"error",scroll:!0,renderInPlace:!0,children:(0,JZ.jsx)("p",{children:(0,O.__)("Sorry, there was an error, please try again later.","mailpoet")})}),(0,JZ.jsxs)("div",{"data-automation-id":"template_selection_list",children:[(0,JZ.jsx)(WJ.A,{color:"#fff"}),(0,JZ.jsxs)("div",{className:"mailpoet-form-templates",children:[(0,JZ.jsxs)(Od.Z,{className:"mailpoet-form-template-selection-header",children:[(0,JZ.jsx)("h1",{className:"wp-heading-inline",children:(0,O.__)("Start with a template","mailpoet")}),(0,JZ.jsx)(ia.ZP,{"data-automation-id":"create_blank_form",variant:"secondary",onClick:()=>{i("initial_form","Blank template")},children:(0,O.__)("Or, start with a blank form","mailpoet")})]}),(0,JZ.jsx)(VJ.R,{categories:e,active:t,onSelect:l}),n[t].map((e=>(0,JZ.jsx)($J.G,{onSelect:()=>{i(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,JZ.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,JZ.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id))),(0,JZ.jsxs)("div",{className:"mailpoet-form-template-selection-footer",children:[(0,JZ.jsx)("p",{children:(0,O.__)("Can’t find a template that suits your needs?","mailpoet")}),(0,JZ.jsx)(ia.ZP,{variant:"link",onClick:()=>{i("initial_form","Blank template")},children:(0,O.__)("Start with a blank form","mailpoet")})]})]})]}),r&&(0,JZ.jsx)(UJ.g,{})]})}const XJ={getTemplates:e=>e.templates,getFormEditorUrl:e=>e.formEditorUrl,getSelectTemplateFailed:e=>e.selectTemplateFailed,getLoading:e=>e.loading,getSelectedCategory:e=>e.activeCategory},QJ=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"SELECT_TEMPLATE_ERROR":return(e=>({...e,selectTemplateFailed:!0,loading:!1}))(t);case"SELECT_TEMPLATE_START":return(e=>({...e,selectTemplateFailed:!1,loading:!0}))(t);case"SELECT_CATEGORY":return((e,t)=>({...e,activeCategory:t.category}))(t,n);default:return t}};function*JJ(e,t){yield{type:"SELECT_TEMPLATE_START"},yield{type:"TRACK_EVENT",name:"Forms > Template selected",data:{"Template id":e,"Template name":t},timeout:200};const n=(0,S.select)(KJ).getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function e0(e){return{type:"SELECT_CATEGORY",category:e}}var t0=n(92537);let n0;function r0(){return(0,JZ.jsx)(k.k.Provider,{value:(0,k.S)(window),children:(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(x.w,{}),(0,JZ.jsx)(YJ,{})]})})}!function(e){e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others"}(n0||(n0={}));const o0=document.querySelector("#mailpoet_form_edit_templates");function i0(){return(0,JZ.jsx)(k.k.Provider,{value:(0,k.S)(window),children:(0,JZ.jsxs)(JZ.Fragment,{children:[(0,JZ.jsx)(x.w,{}),(0,JZ.jsx)(gQ,{})]})})}o0&&((0,qZ.registerTranslations)(),(()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:n0.Popup},t={selectors:XJ,actions:g,controls:v,reducer:QJ(e),resolvers:{}},n=(0,E.Z)(KJ,t);(0,S.register)(n)})(),y.render((0,JZ.jsx)(b.StrictMode,{children:(0,JZ.jsx)(r0,{})}),o0)),window.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("#mailpoet_form_edit");e&&(_.Z.use(_.Z.createRootURLMiddleware(window.wpApiSettings.root)),_.Z.use(_.Z.createNonceMiddleware(window.wpApiSettings.nonce)),(0,tr.addFilter)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",(()=>_n)),(()=>{const e=window.mailpoet_custom_fields.map((e=>({...e,params:e.params||{}}))),t=xG(rj,fa.colors,fa.gradients,e),n={...window.mailpoet_form_data},r=t(n.body);delete n.body;const o={dateTypes:window.mailpoet_date_types,dateFormats:window.mailpoet_date_formats,months:window.mailpoet_month_names};n.settings.segments=n.settings.segments?n.settings.segments:[];let i,l=null;if(null!==n.id)try{l=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===l.formType&&(l.formType="below_posts")}catch(e){}try{i=JSON.parse(window.localStorage.getItem("mailpoet_form_view_options"))}catch(e){i=!1}const a={editorHistory:[],editorHistoryOffset:0,formBlocks:r,formData:$Y(n),dateSettingData:o,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:Kj(n,r),segments:window.mailpoet_form_segments,customFields:e,isFormSaving:!1,isCustomFieldSaving:!1,isCustomFieldCreating:!1,isPreviewShown:!1,isPreviewReady:!1,isCustomFieldDeleting:!1,inserterPanel:null,notices:[],hasUnsavedChanges:!1,sidebar:{activeSidebar:"default",activeTab:"form",openedPanels:["basic-settings"]},previewSettings:l,fullscreenStatus:i,editorUrl:window.location.href,formEditorUrl:window.mailpoet_form_edit_url,previewPageUrl:window.mailpoet_form_preview_page,closeIconsUrl:window.mailpoet_close_icons_url,customFonts:window.mailpoet_custom_fonts,allWpPosts:window.mailpoet_all_wp_posts,allWpPages:window.mailpoet_all_wp_pages,allWpCategories:window.mailpoet_all_wp_categories,allWpTags:window.mailpoet_all_wp_tags,allWooCommerceProducts:window.mailpoet_woocommerce_products,allWooCommerceCategories:window.mailpoet_woocommerce_categories,allWooCommerceTags:window.mailpoet_woocommerce_tags,tutorialSeen:"1"===window.mailpoet_tutorial_seen,tutorialUrl:window.mailpoet_tutorial_url,user:{isAdministrator:window.mailpoet_is_administrator}},s={reducer:tz(a),actions:f,selectors:rz,controls:FY,resolvers:{}},c=(0,E.Z)(nj,s);(0,S.register)(c)})(),(()=>{const e=(0,S.select)(nj).getAllAvailableCustomFields();sq.supports.inserter=(0,S.select)(nj).isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:KZ.x.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:KZ.x.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:KZ.x.I18n.t("customFieldsBlocksCategory")}),function(e){(0,S.dispatch)(Bo).setCategories(e)}(t),Vn("mailpoet-form/divider",PG),Vn("mailpoet-form/email-input",RG),Vn("mailpoet-form/submit-button",zG),Vn("mailpoet-form/first-name-input",WG),Vn("mailpoet-form/last-name-input",GG),Vn("mailpoet-form/segment-select",tq),Vn("mailpoet-form/html",sq),Vn("mailpoet-form/add-custom-field",mq),Vn(Bq,Aq),Vn(Zq,zq),Vn(AK,RK),Vn(dK,mK),Vn(AY,RY),Array.isArray(e)&&e.forEach(DY)})(),(0,La.registerFormatType)(jJ,HJ),window.mailpoet_translations.forEach((e=>{var t;const n=JSON.parse(e);n&&null!==(t=n.locale_data)&&void 0!==t&&t.messages&&(0,O.setLocaleData)(n.locale_data.messages)})),(0,qZ.registerTranslations)(),y.render((0,JZ.jsx)(b.StrictMode,{children:(0,JZ.jsx)(i0,{})}),e))}))},41779:(e,t)=>{var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)o(e,t[r])}e.prototype=Object.create(null);var n={}.hasOwnProperty,r=/\s+/;function o(e,o){if(o){var i=typeof o;"string"===i?function(e,t){for(var n=t.split(r),o=n.length,i=0;i<o;++i)e[n[i]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===i?function(e,t){if(t.toString===Object.prototype.toString)for(var r in t)n.call(t,r)&&(e[r]=!!t[r]);else e[t.toString()]=!0}(e,o):"number"===i&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=new e;t(i,r);var l=[];for(var a in i)i[a]&&l.push(a);return l.join(" ")}}();e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},70907:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),l=r||o||i,a=l&&(r?document.documentMode||6:+(i||o)[1]),s=!i&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),f=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),g=/Android/.test(e),v=f||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=f||/Mac/.test(t),y=/\bCrOS\b/.test(e),_=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(d=!1,s=!0);var x=b&&(c||d&&(null==k||k<12.11)),w=n||l&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,S=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function I(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return I(e).appendChild(t)}function N(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function B(e,t,n,r){var o=N(e,t,n,r);return o.setAttribute("role","presentation"),o}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function A(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function L(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function R(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(t)&&(t+=" "+n[r]);return t}E=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var D=function(e){e.select()};function M(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function O(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=r||0,l=o||0;;){var a=e.indexOf("\t",i);if(a<0||a>=t)return l+(t-i);l+=a-i,l+=n-l%n,i=a+1}}f?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(D=function(e){try{e.select()}catch(e){}});var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};function j(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var z=50,H={toString:function(){return"CodeMirror.Pass"}},V={scroll:!1},W={origin:"*mouse"},U={origin:"+move"};function $(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var l=i-r;if(i==e.length||o+l>=t)return r+Math.min(l,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var G=[""];function q(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function X(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(X.prototype=e,n=new X),t&&O(t,n),n}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function le(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:ae=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:ae=o)}return null!=r?r:ae}var ce=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,o=/[1n]/;function i(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,a){var s,c="ltr"==a?"L":"R";if(0==l.length||"ltr"==a&&!e.test(l))return!1;for(var u=l.length,d=[],p=0;p<u;++p)d.push((s=l.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(s):1424<=s&&s<=1524?"R":1536<=s&&s<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(s-1536):1774<=s&&s<=2220?"r":8192<=s&&s<=8203?"w":8204==s?"b":"L");for(var m=0,h=c;m<u;++m){var f=d[m];"m"==f?d[m]=h:h=f}for(var g=0,v=c;g<u;++g){var b=d[g];"1"==b&&"r"==v?d[g]="n":n.test(b)&&(v=b,"r"==b&&(d[g]="R"))}for(var y=1,_=d[0];y<u-1;++y){var k=d[y];"+"==k&&"1"==_&&"1"==d[y+1]?d[y]="1":","!=k||_!=d[y+1]||"1"!=_&&"n"!=_||(d[y]=_),_=k}for(var x=0;x<u;++x){var w=d[x];if(","==w)d[x]="N";else if("%"==w){var C=void 0;for(C=x+1;C<u&&"%"==d[C];++C);for(var E=x&&"!"==d[x-1]||C<u&&"1"==d[C]?"1":"N",S=x;S<C;++S)d[S]=E;x=C-1}}for(var I=0,T=c;I<u;++I){var N=d[I];"L"==T&&"1"==N?d[I]="L":n.test(N)&&(T=N)}for(var B=0;B<u;++B)if(t.test(d[B])){var P=void 0;for(P=B+1;P<u&&t.test(d[P]);++P);for(var A="L"==(B?d[B-1]:c),L=A==("L"==(P<u?d[P]:c))?A?"L":"R":c,R=B;R<P;++R)d[R]=L;B=P-1}for(var D,M=[],O=0;O<u;)if(r.test(d[O])){var F=O;for(++O;O<u&&r.test(d[O]);++O);M.push(new i(0,F,O))}else{var Z=O,j=M.length,z="rtl"==a?1:0;for(++O;O<u&&"L"!=d[O];++O);for(var H=Z;H<O;)if(o.test(d[H])){Z<H&&(M.splice(j,0,new i(1,Z,H)),j+=z);var V=H;for(++H;H<O&&o.test(d[H]);++H);M.splice(j,0,new i(2,V,H)),j+=z,Z=H}else++H;Z<O&&M.splice(j,0,new i(1,Z,O))}return"ltr"==a&&(1==M[0].level&&(D=l.match(/^\s+/))&&(M[0].from=D[0].length,M.unshift(new i(0,0,D[0].length))),1==K(M).level&&(D=l.match(/\s+$/))&&(K(M).to-=D[0].length,M.push(new i(0,u-D[0].length,u)))),"rtl"==a?M.reverse():M}}();function ue(e,t){var n=e.order;return null==n&&(n=e.order=ce(e.text,t)),n}var de=[],pe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||de}function he(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,o=r&&r[t];if(o){var i=j(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function fe(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function ge(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,n||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==j(n,t[r])&&n.push(t[r])}function be(e,t){return me(e,t).length>0}function ye(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){_e(e),ke(e)}function Ce(e){return e.target||e.srcElement}function Ee(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Se,Ie,Te=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Se){var t=N("span","​");T(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Se?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Be(e){if(null!=Ie)return Ie;var t=T(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return I(e),!(!n||n.left==n.right)&&(Ie=r.right-n.right<3)}var Pe,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),l=i.indexOf("\r");-1!=l?(n.push(i.slice(0,l)),t+=l+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Le=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Pe=N("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),De=null;var Me={},Oe={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Me[e]=t}function Ze(e){if("string"==typeof e&&Oe.hasOwnProperty(e))e=Oe[e];else if(e&&"string"==typeof e.name&&Oe.hasOwnProperty(e.name)){var t=Oe[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ze("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ze("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function je(e,t){t=Ze(t);var n=Me[t.name];if(!n)return je(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var o=ze[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var ze={};function He(e,t){O(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function Ve(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function We(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ue(e,t,n){return!e.startState||e.startState(t,n)}var $e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function qe(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,(function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o})),r}function Ke(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ye(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Xe(e){if(null==e.parent)return null;for(var t=e.parent,n=j(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function Qe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l].height;if(t<a)break;t-=a}return n+l}function Je(e,t){return t>=e.first&&t<e.first+e.size}function et(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,n){if(void 0===n&&(n=null),!(this instanceof tt))return new tt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function nt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==nt(e,t)}function ot(e){return tt(e.line,e.ch)}function it(e,t){return nt(e,t)<0?t:e}function lt(e,t){return nt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return tt(e.first,0);var n=e.first+e.size-1;return t.line>n?tt(n,Ge(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,Ge(e,t.line).text.length)}function ct(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}$e.prototype.eol=function(){return this.pos>=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$e.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},$e.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},$e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$e.prototype.backUp=function(e){this.pos-=e},$e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},$e.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},$e.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function pt(e,t,n,r){var o=[e.state.modeGen],i={};kt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var l=n.state,a=function(r){n.baseTokens=o;var a=e.state.overlays[r],s=1,c=0;n.state=!0,kt(e,t.text,a.mode,n,(function(e,t){for(var n=s;c<e;){var r=o[s];r>e&&o.splice(s,1,e,o[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(a.opaque)o.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function mt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ht(e,Xe(t)),o=t.text.length>e.options.maxHighlightLength&&Ve(e.doc.mode,r.state),i=pt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new dt(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=i.first)return i.first;var s=Ge(i,a-1),c=s.stateAfter;if(c&&(!n||a+(c instanceof ut?c.lookAhead:0)<=i.modeFrontier))return a;var u=F(s.text,null,e.options.tabSize);(null==o||r>u)&&(o=a-1,r=u)}return o}(e,t,n),l=i>r.first&&Ge(r,i-1).stateAfter,a=l?dt.fromSaved(r,l,i):new dt(r,Ue(r.mode),i);return r.iter(i,t,(function(n){ft(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function ft(e,t,n,r){var o=e.doc.mode,i=new $e(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&gt(o,n.state);!i.eol();)vt(o,i,n.state),i.start=i.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=We(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function vt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=We(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,n){return t instanceof ut?new dt(e,Ve(e.mode,t.state),n,t.lookAhead):new dt(e,Ve(e.mode,t),n)},dt.prototype.save=function(e){var t=!1!==e?Ve(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var o,i,l=e.doc,a=l.mode,s=Ge(l,(t=st(l,t)).line),c=ht(e,t.line,n),u=new $e(s.text,e.options.tabSize,c);for(r&&(i=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=vt(a,u,c.state),r&&i.push(new bt(u,o,Ve(l.mode,c.state)));return r?i:new bt(u,o,c.state)}function _t(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function kt(e,t,n,r,o,i,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,c=0,u=null,d=new $e(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];for(""==t&&_t(gt(n,r.state),i);!d.eol();){if(d.pos>e.options.maxHighlightLength?(a=!1,l&&ft(e,t,r,d.pos),d.pos=t.length,s=null):s=_t(vt(n,d,r.state,p),i),p){var m=p[0].name;m&&(s="m-"+(s?m+" "+s:m))}if(!a||u!=s){for(;c<d.start;)o(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);o(h,u),c=h}}var xt=!1,wt=!1;function Ct(e,t,n){this.marker=e,this.from=t,this.to=n}function Et(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function St(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function It(e,t){if(t.full)return null;var n=Je(e,t.from.line)&&Ge(e,t.from.line).markedSpans,r=Je(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,l=0==nt(t.from,t.to),a=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],l=i.marker;if(null==i.from||(l.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==l.type&&(!n||!i.marker.insertLeft)){var a=null==i.to||(l.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new Ct(l,i.from,a?null:i.to))}}return r}(n,o,l),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],l=i.marker;if(null==i.to||(l.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==l.type&&(!n||i.marker.insertLeft)){var a=null==i.from||(l.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new Ct(l,a?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,l),c=1==t.text.length,u=K(t.text).length+(c?o:0);if(a)for(var d=0;d<a.length;++d){var p=a[d];if(null==p.to){var m=Et(s,p.marker);m?c&&(p.to=null==m.to?null:m.to+u):p.to=o}}if(s)for(var h=0;h<s.length;++h){var f=s[h];null!=f.to&&(f.to+=u),null==f.from?Et(a,f.marker)||(f.from=u,c&&(a||(a=[])).push(f)):(f.from+=u,c&&(a||(a=[])).push(f))}a&&(a=Tt(a)),s&&s!=a&&(s=Tt(s));var g=[a];if(!c){var v,b=t.text.length-2;if(b>0&&a)for(var y=0;y<a.length;++y)null==a[y].to&&(v||(v=[])).push(new Ct(a[y].marker,null,null));for(var _=0;_<b;++_)g.push(v);g.push(s)}return g}function Tt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Bt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Pt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function Lt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=nt(r.from,o.from)||Pt(e)-Pt(t);return i?-i:nt(r.to,o.to)||At(e)-At(t)||t.id-e.id}function Rt(e,t){var n,r=wt&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!n||Lt(n,o.marker)<0)&&(n=o.marker);return n}function Dt(e){return Rt(e,!0)}function Mt(e){return Rt(e,!1)}function Ot(e,t){var n,r=wt&&e.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Lt(n,i.marker)<0)&&(n=i.marker)}return n}function Ft(e,t,n,r,o){var i=Ge(e,t),l=wt&&i.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var c=s.marker.find(0),u=nt(c.from,n)||Pt(s.marker)-Pt(o),d=nt(c.to,r)||At(s.marker)-At(o);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?nt(c.to,n)>=0:nt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?nt(c.from,r)<=0:nt(c.from,r)<0)))return!0}}}function Zt(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function jt(e,t){var n=Ge(e,t),r=Zt(n);return n==r?t:Xe(r)}function zt(e,t){if(t>e.lastLine())return t;var n,r=Ge(e,t);if(!Ht(e,r))return t;for(;n=Mt(r);)r=n.find(1,!0).line;return Xe(r)+1}function Ht(e,t){var n=wt&&t.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if((r=n[o]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Vt(e,t,r))return!0}}function Vt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Vt(e,r.line,Et(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Vt(e,t,o))return!0}function Wt(e){for(var t=0,n=(e=Zt(e)).parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=o.height}for(var i=n.parent;i;i=(n=i).parent)for(var l=0;l<i.children.length;++l){var a=i.children[l];if(a==n)break;t+=a.height}return t}function Ut(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Dt(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=Mt(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function $t(e){var t=e.display,n=e.doc;t.maxLine=Ge(n,n.first),t.maxLineLength=Ut(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Ut(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Gt=function(e,t,n){this.text=e,Bt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Nt(e)}Gt.prototype.lineNo=function(){return Xe(this)},ye(Gt);var Kt={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var n=B("span",null,null,s?"padding-right: .1px":null),r={pre:B("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,l=void 0;r.pos=0,r.addToken=en,Be(e.display.measure)&&(l=ue(i,e.doc.direction))&&(r.addToken=tn(r.addToken,l)),r.map=[],rn(i,r,mt(e,i,t!=e.display.externalMeasured&&Xe(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=R(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=R(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=R(r.pre.className,r.textClass||"")),r}function Jt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,o,i,s){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var m=0;;){d.lastIndex=m;var h=d.exec(t),f=h?h.index-m:t.length-m;if(f){var g=document.createTextNode(u.slice(m,m+f));l&&a<9?c.appendChild(N("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+f,g),e.col+=f,e.pos+=f}if(!h)break;m+=f+1;var v=void 0;if("\t"==h[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(N("span",q(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(N("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),l&&a<9?c.appendChild(N("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),l&&a<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||p||i||s){var _=n||"";r&&(_+=r),o&&(_+=o);var k=N("span",[c],_,i);if(s)for(var x in s)s.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,s[x]);return e.content.appendChild(k)}e.content.appendChild(c)}}function tn(e,t){return function(n,r,o,i,l,a,s){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(n,r,o,i,l,a,s);e(n,r.slice(0,d.to-c),o,i,null,a,s),i=null,r=r.slice(d.to-c),c=d.to}}}function nn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var l,a,s,c,u,d,p,m=o.length,h=0,f=1,g="",v=0;;){if(v==h){s=c=u=a="",p=null,d=null,v=1/0;for(var b=[],y=void 0,_=0;_<r.length;++_){var k=r[_],x=k.marker;if("bookmark"==x.type&&k.from==h&&x.widgetNode)b.push(x);else if(k.from<=h&&(null==k.to||k.to>h||x.collapsed&&k.to==h&&k.from==h)){if(null!=k.to&&k.to!=h&&v>k.to&&(v=k.to,c=""),x.className&&(s+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&k.from==h&&(u+=" "+x.startStyle),x.endStyle&&k.to==v&&(y||(y=[])).push(x.endStyle,k.to),x.title&&((p||(p={})).title=x.title),x.attributes)for(var w in x.attributes)(p||(p={}))[w]=x.attributes[w];x.collapsed&&(!d||Lt(d.marker,x)<0)&&(d=k)}else k.from>h&&v>k.from&&(v=k.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==v&&(c+=" "+y[C]);if(!d||d.from==h)for(var E=0;E<b.length;++E)nn(t,0,b[E]);if(d&&(d.from||0)==h){if(nn(t,(null==d.to?m+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=m)break;for(var S=Math.min(m,v);;){if(g){var I=h+g.length;if(!d){var T=I>S?g.slice(0,S-h):g;t.addToken(t,T,l?l+s:s,u,h+T.length==v?c:"",a,p)}if(I>=S){g=g.slice(S-h),h=S;break}h=I,u=""}g=o.slice(i,i=n[f++]),l=Xt(n[f++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,o.slice(i,i=n[N]),Xt(n[N+1],t.cm.options))}function on(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Mt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Xe(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ht(e,t)}function ln(e,t,n){for(var r,o=[],i=t;i<n;i=r){var l=new on(e.doc,Ge(e.doc,i),i);r=i+l.size,o.push(l)}return o}var an=null;var sn=null;function cn(e,t){var n=me(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(un,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},l=0;l<n.length;++l)i(l)}}function un(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?hn(e,t):"gutter"==i?gn(e,t,n,r):"class"==i?fn(e,t):"widget"==i&&vn(e,t,r)}t.changes=null}function pn(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&a<8&&(e.node.style.zIndex=2)),e.node}function mn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Qt(e,t)}function hn(e,t){var n=t.text.className,r=mn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,fn(e,t)):n&&(t.text.className=n)}function fn(e,t){(function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=pn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=pn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var l=pn(t),a=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(N("div",et(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=i.hasOwnProperty(c)&&i[c];u&&a.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=C("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&t.node.removeChild(o);yn(e,t,n)}function bn(e,t,n,r){var o=mn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),fn(e,t),gn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(_n(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)_n(e,t.rest[r],t,n,!1)}function _n(e,t,n,r,o){if(t.widgets)for(var i=pn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],c=N("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),kn(s,c,n,r),e.display.input.setUneditable(c),o&&s.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),cn(s,"redraw")}}function kn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function wn(e,t){for(var n=Ce(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Cn(e){return e.lineSpace.offsetTop}function En(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Sn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function In(e){return z-e.display.nativeBarWidth}function Tn(e){return e.display.scroller.clientWidth-In(e)-e.display.barWidth}function Nn(e){return e.display.scroller.clientHeight-In(e)-e.display.barHeight}function Bn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(Xe(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Pn(e,t,n,r){return Rn(e,Ln(e,t),n,r)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Ln(e,t){var n=Xe(t),r=An(e,n);r&&!r.text?r=null:r&&r.changes&&(dn(e,r,n,lr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Xe(t=Zt(t)),r=e.display.externalMeasured=new on(e.doc,t,n);r.lineN=n;var o=r.built=Qt(e,r);return r.text=o.pre,T(e.display.lineMeasure,o.pre),r}(e,t));var o=Bn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Rn(e,t,n,r,o){t.before&&(n=-1);var i,s=n+(r||"");return t.cache.hasOwnProperty(s)?i=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&Tn(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],c=l[a+1];Math.abs(s.bottom-c.bottom)>2&&i.push((s.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=On(t.map,n,r),s=i.node,c=i.start,u=i.end,d=i.collapse;if(3==s.nodeType){for(var p=0;p<4;p++){for(;c&&oe(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&oe(t.line.text.charAt(i.coverStart+u));)++u;if((o=l&&a<9&&0==c&&u==i.coverEnd-i.coverStart?s.parentNode.getBoundingClientRect():Fn(E(s,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,d="right"}l&&a<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=De)return De;var t=T(e,N("span","x")),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return De=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var m;c>0&&(d=r="right"),o=e.options.lineWrapping&&(m=s.getClientRects()).length>1?m["right"==r?m.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!c&&(!o||!o.left&&!o.right)){var h=s.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+ir(e.display),top:h.top,bottom:h.bottom}:Mn}for(var f=o.top-t.rect.top,g=o.bottom-t.rect.top,v=(f+g)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var _=y?b[y-1]:0,k=b[y],x={left:("right"==d?o.right:o.left)-t.rect.left,right:("left"==d?o.left:o.right)-t.rect.left,top:_,bottom:k};return o.left||o.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=f,x.rbottom=g),x}(e,t,n,r)).bogus||(t.cache[s]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Dn,Mn={left:0,right:0,top:0,bottom:0};function On(e,t,n){for(var r,o,i,l,a,s,c=0;c<e.length;c+=3)if(a=e[c],s=e[c+1],t<a?(o=0,i=1,l="left"):t<s?i=1+(o=t-a):(c==e.length-3||t==s&&e[c+3]>t)&&(o=(i=s-a)-1,t>=s&&(l="right")),null!=o){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&o==s-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],l="right";break}return{node:r,start:o,end:i,collapse:l,coverStart:a,coverEnd:s}}function Fn(e,t){var n=Mn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function Zn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function jn(e){e.display.externalMeasure=null,I(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Zn(e.display.view[t])}function zn(e){jn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Hn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Wn(e){var t=Zt(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=xn(t[r]));return n}function Un(e,t,n,r,o){if(!o){var i=Wn(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var l=Wt(t);if("local"==r?l+=Cn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:Vn());var s=a.left+("window"==r?0:Hn());n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function $n(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=Hn(),o-=Vn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:o-l.top}}function Gn(e,t,n,r,o){return r||(r=Ge(e.doc,t.line)),Un(e,r,Pn(e,r,t.ch,o),n)}function qn(e,t,n,r,o,i){function l(t,l){var a=Rn(e,o,t,l?"right":"left",i);return l?a.left=a.right:a.right=a.left,Un(e,r,a,n)}r=r||Ge(e.doc,t.line),o||(o=Ln(e,r));var a=ue(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!a)return l("before"==c?s-1:s,"before"==c);function u(e,t,n){return l(n?e-1:e,1==a[t].level!=n)}var d=se(a,s,c),p=ae,m=u(s,d,"before"==c);return null!=p&&(m.other=u(s,p,"before"!=c)),m}function Kn(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ge(e.doc,t.line),o=Wt(r)+Cn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Yn(e,t,n,r,o){var i=tt(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,-1,-1);var o=Qe(r,n),i=r.first+r.size-1;if(o>i)return Yn(r.first+r.size-1,Ge(r,i).text.length,null,1,1);t<0&&(t=0);for(var l=Ge(r,o);;){var a=tr(e,l,o,t,n),s=Ot(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var c=s.find(1);if(c.line==o)return c;l=Ge(r,o=c.line)}}function Qn(e,t,n,r){r-=Wn(t);var o=t.text.length,i=le((function(t){return Rn(e,n,t-1).bottom<=r}),o,0);return{begin:i,end:o=le((function(t){return Rn(e,n,t).top>r}),i,o)}}function Jn(e,t,n,r){return n||(n=Ln(e,t)),Qn(e,t,n,Un(e,t,Rn(e,n,r),"line").top)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,o){o-=Wt(t);var i=Ln(e,t),l=Wn(t),a=0,s=t.text.length,c=!0,u=ue(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?rr:nr)(e,t,n,i,u,r,o);a=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var p,m,h=null,f=null,g=le((function(t){var n=Rn(e,i,t);return n.top+=l,n.bottom+=l,!!er(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,f=n),!0)}),a,s),v=!1;if(f){var b=r-f.left<f.right-r,y=b==c;g=h+(y?0:1),m=y?"after":"before",p=b?f.left:f.right}else{c||g!=s&&g!=a||g++,m=0==g?"after":g==t.text.length?"before":Rn(e,i,g-(c?1:0)).bottom+l<=o==c?"after":"before";var _=qn(e,tt(n,g,m),"line",t,i);p=_.left,v=o<_.top?-1:o>=_.bottom?1:0}return Yn(n,g=ie(t.text,g,1),m,v,r-p)}function nr(e,t,n,r,o,i,l){var a=le((function(a){var s=o[a],c=1!=s.level;return er(qn(e,tt(n,c?s.to:s.from,c?"before":"after"),"line",t,r),i,l,!0)}),0,o.length-1),s=o[a];if(a>0){var c=1!=s.level,u=qn(e,tt(n,c?s.from:s.to,c?"after":"before"),"line",t,r);er(u,i,l,!0)&&u.top>l&&(s=o[a-1])}return s}function rr(e,t,n,r,o,i,l){var a=Qn(e,t,r,l),s=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<o.length;p++){var m=o[p];if(!(m.from>=c||m.to<=s)){var h=Rn(e,r,1!=m.level?Math.min(c,m.to)-1:Math.max(s,m.from)).right,f=h<i?i-h+1e9:h-i;(!u||d>f)&&(u=m,d=f)}}return u||(u=o[o.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(N("br"));Dn.appendChild(document.createTextNode("x"))}T(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),I(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function lr(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,l=0;i;i=i.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=i.offsetLeft+i.clientLeft+o,r[a]=i.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(o){if(Ht(e.doc,o))return 0;var i=0;if(o.widgets)for(var l=0;l<o.widgets.length;l++)o.widgets[l].height&&(i+=o.widgets[l].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function cr(e){var t=e.doc,n=sr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ye(e,t)}))}function ur(e,t,n,r){var o=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var i,l,a=o.lineSpace.getBoundingClientRect();try{i=t.clientX-a.left,l=t.clientY-a.top}catch(e){return null}var s,c=Xn(e,i,l);if(r&&c.xRel>0&&(s=Ge(e.doc,c.line).text).length==c.ch){var u=F(s,s.length,e.options.tabSize)-s.length;c=tt(c.line,Math.max(0,Math.round((i-Sn(e.display).left)/ir(e.display))-u))}return c}function dr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function pr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)wt&&jt(e.doc,t)<o.viewTo&&hr(e);else if(n<=o.viewFrom)wt&&zt(e.doc,n+r)>o.viewFrom?hr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)hr(e);else if(t<=o.viewFrom){var i=fr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):hr(e)}else if(n>=o.viewTo){var l=fr(e,t,t,-1);l?(o.view=o.view.slice(0,l.index),o.viewTo=l.lineN):hr(e)}else{var a=fr(e,t,t,-1),s=fr(e,n,n+r,1);a&&s?(o.view=o.view.slice(0,a.index).concat(ln(e,a.lineN,s.lineN)).concat(o.view.slice(s.index)),o.viewTo+=r):hr(e)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(o.externalMeasured=null))}function mr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[dr(e,t)];if(null!=i.node){var l=i.changes||(i.changes=[]);-1==j(l,n)&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fr(e,t,n,r){var o,i=dr(e,t),l=e.display.view;if(!wt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s<i;s++)a+=l[s].size;if(a!=t){if(r>0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;jt(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function gr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function br(e,t){void 0===t&&(t=!0);var n=e.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var c=s.empty();if(l){var u=l(e,s);u&&yr(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&yr(e,s.head,o);c||kr(e,s,i)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(N("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var i=Gn(e,t,"div",null,null),l=i.right-i.left;o.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function _r(e,t){return e.top-t.top||e.left-t.left}function kr(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),l=Sn(e.display),a=l.left,s=Math.max(r.sizerWidth,Tn(e)-r.sizer.offsetLeft)-l.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n                             height: "+(r-t)+"px"))}function d(t,n,r){var i,l,d=Ge(o,t),p=d.text.length;function m(n,r){return Gn(e,tt(t,n),"div",d,r)}function h(t,n,r){var o=Jn(e,d,null,t),i="ltr"==n==("after"==r)?"left":"right";return m("after"==r?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),i)[i]}var f=ue(d,o.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var l=e[i];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(f,n||0,null==r?p:r,(function(e,t,o,d){var g="ltr"==o,v=m(e,g?"left":"right"),b=m(t-1,g?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,k=0==d,x=!f||d==f.length-1;if(b.top-v.top<=3){var w=(c?_:y)&&x,C=(c?y:_)&&k?a:(g?v:b).left,E=w?s:(g?b:v).right;u(C,v.top,E-C,v.bottom)}else{var S,I,T,N;g?(S=c&&y&&k?a:v.left,I=c?s:h(e,o,"before"),T=c?a:h(t,o,"after"),N=c&&_&&x?s:b.right):(S=c?h(e,o,"before"):a,I=!c&&y&&k?s:v.right,T=!c&&_&&x?a:b.left,N=c?h(t,o,"after"):s),u(S,v.top,I-S,v.bottom),v.bottom<b.top&&u(a,v.bottom,null,b.top),u(T,b.top,N-T,b.bottom)}(!i||_r(v,i)<0)&&(i=v),_r(b,i)<0&&(i=b),(!l||_r(v,l)<0)&&(l=v),_r(b,l)<0&&(l=b)})),{start:i,end:l}}var p=t.from(),m=t.to();if(p.line==m.line)d(p.line,p.ch,m.ch);else{var h=Ge(o,p.line),f=Ge(o,m.line),g=Zt(h)==Zt(f),v=d(p.line,p.ch,g?h.text.length+1:null).end,b=d(m.line,g?0:null,m.ch).start;g&&(v.top<b.top-2?(u(v.right,v.top,null,v.bottom),u(a,b.top,b.left,b.bottom)):u(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&u(a,v.bottom,null,b.top)}n.appendChild(i)}function xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Sr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Er(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Sr(e))}),100)}function Er(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,L(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Ir(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,s=0;s<t.view.length;s++){var c=t.view[s],u=e.options.lineWrapping,d=void 0,p=0;if(!c.hidden){if(o+=c.line.height,l&&a<8){var m=c.node.offsetTop+c.node.offsetHeight;d=m-n,n=m}else{var h=c.node.getBoundingClientRect();d=h.bottom-h.top,!u&&c.text.firstChild&&(p=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var f=c.line.height-d;if((f>.005||f<-.005)&&(o<r&&(i-=f),Ye(c.line,d),Tr(c.line),c.rest))for(var g=0;g<c.rest.length;g++)Tr(c.rest[g]);if(p>e.display.sizerWidth){var v=Math.ceil(p/ir(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Tr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Nr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Cn(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=Qe(t,r),l=Qe(t,o);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<i?(i=a,l=Qe(t,Wt(Ge(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(i=Qe(t,Wt(Ge(t,s))-e.wrapper.clientHeight),l=s)}return{from:i,to:Math.max(l,i+1)}}function Br(e,t){var n=e.display,r=or(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Nn(e),l={};t.bottom-t.top>i&&(t.bottom=t.top+i);var a=e.doc.height+En(n),s=t.top<r,c=t.bottom>a-r;if(t.top<o)l.scrollTop=s?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?a:t.bottom)-i);u!=o&&(l.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,m=Tn(e)-n.gutters.offsetWidth,h=t.right-t.left>m;return h&&(t.right=t.left+m),t.left<10?l.scrollLeft=0:t.left<p?l.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>m+p-3&&(l.scrollLeft=t.right+(h?0:10)-m),l}function Pr(e,t){null!=t&&(Rr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ar(e){Rr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Lr(e,t,n){null==t&&null==n||Rr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Rr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Dr(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Dr(e,t,n,r){var o=Br(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Lr(e,o.scrollLeft,o.scrollTop)}function Mr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||co(e,{top:t}),Or(e,t,!0),n&&co(e),oo(e,100))}function Or(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,mo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Zr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+En(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+In(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var jr=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},jr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jr.prototype.zeroWidthHack=function(){var e=b&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},jr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var o=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},jr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var zr=function(){};function Hr(e,t){t||(t=Zr(e));var n=e.display.barWidth,r=e.display.barHeight;Vr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Ir(e),Vr(e,Zr(e)),n=e.display.barWidth,r=e.display.barHeight}function Vr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Wr={native:jr,null:zr};function Ur(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Fr(e,t):Mr(e,t)}),e),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)}var $r=0;function Gr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$r,markArrays:null},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Kr(t[n]);for(var r=0;r<t.length;r++)Yr(t[r]);for(var o=0;o<t.length;o++)Xr(t[o]);for(var i=0;i<t.length;i++)Qr(t[i]);for(var l=0;l<t.length;l++)Jr(t[l])}(e)}))}function Kr(e){var t=e.cm,n=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=In(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=In(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&$t(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new lo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){e.updatedDisplay=e.mustUpdate&&ao(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Ir(t),e.barMeasure=Zr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+In(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Qr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==A();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hr(t,e.barMeasure),e.updatedDisplay&&po(t,e.barMeasure),e.selectionChanged&&xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&wr(e.cm)}function Jr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&so(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Or(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=N("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n                         height: "+(t.bottom-t.top+In(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?tt(t.line,t.ch+1,"before"):t,t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var l=!1,a=qn(e,t),s=n&&n!=t?qn(e,n):a,c=Br(e,o={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Mr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(Fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(l=!0)),!l)break}return o}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||fe(o[l],"hide");if(i)for(var a=0;a<i.length;++a)i[a].lines.length&&fe(i[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function eo(e,t){if(e.curOp)return t();Gr(e);try{return t()}finally{qr(e)}}function to(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function no(e){return function(){if(this.curOp)return e.apply(this,arguments);Gr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function ro(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function oo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(io,e))}function io(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var l=i.styles,a=i.text.length>e.options.maxHighlightLength?Ve(t.mode,r.state):null,s=pt(e,i,r,!0);a&&(r.state=a),i.styles=s.styles;var c=i.styleClasses,u=s.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var d=!l||l.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<l.length;++p)d=l[p]!=i.styles[p];d&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ft(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return oo(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&eo(e,(function(){for(var t=0;t<o.length;t++)mr(e,o[t],"text")}))}}var lo=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Nr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Tn(e),this.force=n,this.dims=lr(e),this.events=[]};function ao(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(e))return!1;ho(e)&&(hr(e),t.dims=lr(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),wt&&(i=jt(e.doc,i),l=zt(e.doc,l));var a=i!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=ln(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=ln(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(dr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(ln(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,dr(e,n)))),r.viewTo=n})(e,i,l),n.viewOffset=Wt(Ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=gr(e);if(!a&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=A();if(!t||!P(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&P(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,l=i.firstChild;function a(t){var n=t.nextSibling;return s&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var p=c[d];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;l!=p.node;)l=a(l);var m=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&(j(p.changes,"gutter")>-1&&(m=!1),dn(e,p,u,n)),m&&(I(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),l=p.node.nextSibling}else{var h=bn(e,p,u,n);i.insertBefore(h,l)}u+=p.size}for(;l;)l=a(l)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=A()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),I(n.cursorDiv),I(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,oo(e,400)),n.updateLineNumbers=null,!0}function so(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))r&&(t.visible=Nr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+En(e.display)-Nn(e),n.top)}),t.visible=Nr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ao(e,t))break;Ir(e);var o=Zr(e);vr(e),Hr(e,o),po(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function co(e,t){var n=new lo(e,t);if(ao(e,n)){Ir(e),so(e,n);var r=Zr(e);vr(e),Hr(e,r),po(e,r),n.finish()}}function uo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",cn(e,"gutterChanged",e)}function po(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+In(e)+"px"}function mo(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=i),n[l].gutterBackground&&(n[l].gutterBackground.style.left=i));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function ho(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=et(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,l=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",uo(e.display),!0}return!1}function fo(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],l=null;if("string"!=typeof i&&(l=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function go(e){var t=e.gutters,n=e.gutterSpecs;I(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,l=o.style,a=t.appendChild(N("div",null,"CodeMirror-gutter "+i));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==i&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",uo(e)}function vo(e){go(e.display),pr(e),mo(e)}function bo(e,t,r,o){var i=this;this.input=r,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=B("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=B("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=B("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[c],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),i.wrapper.setAttribute("translate","no"),l&&a<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),s||n&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=fo(o.gutters,o.lineNumbers),go(i),r.init(i)}lo.prototype.signal=function(e,t){be(e,t)&&this.events.push(arguments)},lo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.apply(null,this.events[e])};var yo=0,_o=null;function ko(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xo(e){var t=ko(e);return t.x*=_o,t.y*=_o,t}function wo(e,t){var r=ko(t),o=r.x,i=r.y,l=_o;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,l=1);var a=e.display,c=a.scroller,u=c.scrollWidth>c.clientWidth,p=c.scrollHeight>c.clientHeight;if(o&&u||i&&p){if(i&&b&&s)e:for(var m=t.target,h=a.view;m!=c;m=m.parentNode)for(var f=0;f<h.length;f++)if(h[f].node==m){e.display.currentWheelTarget=m;break e}if(o&&!n&&!d&&null!=l)return i&&p&&Mr(e,Math.max(0,c.scrollTop+i*l)),Fr(e,Math.max(0,c.scrollLeft+o*l)),(!i||i&&p)&&_e(t),void(a.wheelStartX=null);if(i&&null!=l){var g=i*l,v=e.doc.scrollTop,y=v+a.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):y=Math.min(e.doc.height,y+g+50),co(e,{top:v,bottom:y})}yo<20&&0!==t.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=c.scrollLeft,a.wheelStartY=c.scrollTop,a.wheelDX=o,a.wheelDY=i,setTimeout((function(){if(null!=a.wheelStartX){var e=c.scrollLeft-a.wheelStartX,t=c.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(_o=(_o*yo+n)/(yo+1),++yo)}}),200)):(a.wheelDX+=o,a.wheelDY+=i))}}l?_o=-.53:n?_o=15:u?_o=-.7:p&&(_o=-1/3);var Co=function(e,t){this.ranges=e,this.primIndex=t};Co.prototype.primary=function(){return this.ranges[this.primIndex]},Co.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!rt(n.anchor,r.anchor)||!rt(n.head,r.head))return!1}return!0},Co.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Eo(ot(this.ranges[t].anchor),ot(this.ranges[t].head));return new Co(e,this.primIndex)},Co.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Co.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(nt(t,r.from())>=0&&nt(e,r.to())<=0)return n}return-1};var Eo=function(e,t){this.anchor=e,this.head=t};function So(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=j(t,o);for(var i=1;i<t.length;i++){var l=t[i],a=t[i-1],s=nt(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var c=lt(a.from(),l.from()),u=it(a.to(),l.to()),d=a.empty()?l.from()==l.head:a.from()==a.head;i<=n&&--n,t.splice(--i,2,new Eo(d?u:c,d?c:u))}}return new Co(t,n)}function Io(e,t){return new Co([new Eo(e,t||e)],0)}function To(e){return e.text?tt(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function No(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return To(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=To(t).ch-t.to.ch),tt(n,r)}function Bo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new Eo(No(o.anchor,t),No(o.head,t)))}return So(e.cm,n,e.sel.primIndex)}function Po(e,t,n){return e.line==t.line?tt(n.line,e.ch-t.ch+n.ch):tt(n.line+(e.line-t.line),e.ch)}function Ao(e){e.doc.mode=je(e.options,e.doc.modeOption),Lo(e)}function Lo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,oo(e,100),e.state.modeGen++,e.curOp&&pr(e)}function Ro(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Do(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){(function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Bt(e,n);var o=r?r(e):1;o!=e.height&&Ye(e,o)})(e,n,o,r),cn(e,"change",e,t)}function l(e,t){for(var n=[],i=e;i<t;++i)n.push(new Gt(c[i],o(i),r));return n}var a=t.from,s=t.to,c=t.text,u=Ge(e,a.line),d=Ge(e,s.line),p=K(c),m=o(c.length-1),h=s.line-a.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(Ro(e,t)){var f=l(0,c.length-1);i(d,d.text,m),h&&e.remove(a.line,h),f.length&&e.insert(a.line,f)}else if(u==d)if(1==c.length)i(u,u.text.slice(0,a.ch)+p+u.text.slice(s.ch),m);else{var g=l(1,c.length-1);g.push(new Gt(p+u.text.slice(s.ch),m,r)),i(u,u.text.slice(0,a.ch)+c[0],o(0)),e.insert(a.line+1,g)}else if(1==c.length)i(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(a.line+1,h);else{i(u,u.text.slice(0,a.ch)+c[0],o(0)),i(d,p+d.text.slice(s.ch),m);var v=l(1,c.length-1);h>1&&e.remove(a.line+1,h-1),e.insert(a.line+1,v)}cn(e,"change",e,t)}function Mo(e,t,n){!function e(r,o,i){if(r.linked)for(var l=0;l<r.linked.length;++l){var a=r.linked[l];if(a.doc!=o){var s=i&&a.sharedHist;n&&!s||(t(a.doc,s),e(a.doc,r,s))}}}(e,null,!0)}function Oo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,cr(e),Ao(e),Fo(e),e.options.direction=t.direction,e.options.lineWrapping||$t(e),e.options.mode=t.modeOption,pr(e)}function Fo(e){("rtl"==e.doc.direction?L:S)(e.display.lineDiv,"CodeMirror-rtl")}function Zo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function jo(e,t){var n={from:ot(t.from),to:To(t),text:qe(e,t.from,t.to)};return Uo(e,n,t.from.line,t.to.line+1),Mo(e,(function(e){return Uo(e,n,t.from.line,t.to.line+1)}),!0),n}function zo(e){for(;e.length&&K(e).ranges;)e.pop()}function Ho(e,t,n,r){var o=e.history;o.undone.length=0;var i,l,a=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(zo(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(o,o.lastOp==r)))l=K(i.changes),0==nt(t.from,t.to)&&0==nt(t.from,l.to)?l.to=To(t):i.changes.push(jo(e,t));else{var s=K(o.done);for(s&&s.ranges||Wo(e.sel,o.done),i={changes:[jo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,l||fe(e,"historyAdded")}function Vo(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,K(o.done),t))?o.done[o.done.length-1]=t:Wo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&zo(o.undone)}function Wo(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Uo(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function $o(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Go(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push($o(n[o]));return r}(e,t),r=It(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],l=r[o];if(i&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],c=0;c<i.length;++c)if(i[c].marker==s.marker)continue e;i.push(s)}else l&&(n[o]=l)}return n}function qo(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?Co.prototype.deepCopy.call(i):i);else{var l=i.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var c=l[s],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&j(t,Number(u[1]))>-1&&(K(a)[d]=c[d],delete c[d])}}}return r}function Ko(e,t,n,r){if(r){var o=e.anchor;if(n){var i=nt(t,o)<0;i!=nt(n,o)<0?(o=t,t=n):i!=nt(t,n)<0&&(t=n)}return new Eo(o,t)}return new Eo(n||t,t)}function Yo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ti(e,new Co([Ko(e.sel.primary(),t,n,o)],0),r)}function Xo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=Ko(e.sel.ranges[i],t[i],null,o);ti(e,So(e.cm,r,e.sel.primIndex),n)}function Qo(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,ti(e,So(e.cm,o,e.sel.primIndex),r)}function Jo(e,t,n,r){ti(e,Io(t,n),r)}function ei(e,t,n){var r=e.history.done,o=K(r);o&&o.ranges?(r[r.length-1]=t,ni(e,t,n)):ti(e,t,n)}function ti(e,t,n){ni(e,t,n),Vo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ni(e,t,n){(be(e,"beforeSelectionChange")||e.cm&&be(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Eo(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return fe(e,"beforeSelectionChange",e,r),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?So(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);ri(e,ii(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Ar(e.cm)}function ri(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),cn(e,"cursorActivity",e))}function oi(e){ri(e,ii(e,e.sel,null,!1))}function ii(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var l=t.ranges[i],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],s=ai(e,l.anchor,a&&a.anchor,n,r),c=ai(e,l.head,a&&a.head,n,r);(o||s!=l.anchor||c!=l.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new Eo(s,c))}return o?So(e.cm,o,t.primIndex):t}function li(e,t,n,r,o){var i=Ge(e,t.line);if(i.markedSpans)for(var l=0;l<i.markedSpans.length;++l){var a=i.markedSpans[l],s=a.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(o&&(fe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(i.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=si(e,d,-r,d&&d.line==t.line?i:null)),d&&d.line==t.line&&(p=nt(d,n))&&(r<0?p<0:p>0))return li(e,d,t,r,o)}var m=s.find(r<0?-1:1);return(r<0?c:u)&&(m=si(e,m,r,m.line==t.line?i:null)),m?li(e,m,t,r,o):null}}return t}function ai(e,t,n,r,o){var i=r||1;return li(e,t,n,i,o)||!o&&li(e,t,n,i,!0)||li(e,t,n,-i,o)||!o&&li(e,t,n,-i,!0)||(e.cantEdit=!0,tt(e.first,0))}function si(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,tt(t.line-1)):null:n>0&&t.ch==(r||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+n)}function ci(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),V)}function ui(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,o,i){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),fe(e,"beforeChange",e,r),e.cm&&fe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function di(e,t,n){if(e.cm){if(!e.cm.curOp)return to(e.cm,di)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"))||(t=ui(e,t,!0))){var r=xt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=j(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:t,to:n}],i=0;i<r.length;++i)for(var l=r[i],a=l.find(0),s=0;s<o.length;++s){var c=o[s];if(!(nt(c.to,a.from)<0||nt(c.from,a.to)>0)){var u=[s,1],d=nt(c.from,a.from),p=nt(c.to,a.to);(d<0||!l.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(p>0||!l.inclusiveRight&&!p)&&u.push({from:a.to,to:c.to}),o.splice.apply(o,u),s+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)pi(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else pi(e,t)}}function pi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Bo(e,t);Ho(e,t,n,e.cm?e.cm.curOp.id:NaN),fi(e,t,n,It(e,t));var r=[];Mo(e,(function(e,n){n||-1!=j(r,e.history)||(yi(e.history,t),r.push(e.history)),fi(e,t,null,It(e,t))}))}}function mi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,l=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,c=0;c<a.length&&(o=a[c],n?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=a.pop()).ranges){if(r)return void a.push(o);break}if(Wo(o,s),n&&!o.equals(e.sel))return void ti(e,o,{clearRedo:!1});l=o}var u=[];Wo(l,s),s.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var d=be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"),p=function(n){var r=o.changes[n];if(r.origin=t,d&&!ui(e,r,!1))return a.length=0,{};u.push(jo(e,r));var i=n?Bo(e,r):K(a);fi(e,r,i,Go(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:To(r)});var l=[];Mo(e,(function(e,t){t||-1!=j(l,e.history)||(yi(e.history,r),l.push(e.history)),fi(e,r,null,Go(e,r))}))},m=o.changes.length-1;m>=0;--m){var h=p(m);if(h)return h.v}}}}function hi(e,t){if(0!=t&&(e.first+=t,e.sel=new Co(Y(e.sel.ranges,(function(e){return new Eo(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)mr(e.cm,r,"gutter")}}function fi(e,t,n,r){if(e.cm&&!e.cm.curOp)return to(e.cm,fi)(e,t,n,r);if(t.to.line<e.first)hi(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);hi(e,o),t={from:tt(e.first,0),to:tt(t.to.line+o,t.to.ch),text:[K(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:tt(i,Ge(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Bo(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,l=t.to,a=!1,s=i.line;e.options.lineWrapping||(s=Xe(Zt(Ge(r,i.line))),r.iter(s,l.line+1,(function(e){if(e==o.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Do(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(s,i.line+t.text.length,(function(e){var t=Ut(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=Ge(e,r).stateAfter;if(o&&(!(o instanceof ut)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),oo(e,400);var c=t.text.length-(l.line-i.line)-1;t.full?pr(e):i.line!=l.line||1!=t.text.length||Ro(e.doc,t)?pr(e,i.line,l.line+1,c):mr(e,i.line,"text");var u=be(e,"changes"),d=be(e,"change");if(d||u){var p={from:i,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&cn(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,r):Do(e,t,r),ni(e,n,V),e.cantEdit&&ai(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}}function gi(e,t,n,r,o){var i;r||(r=n),nt(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),di(e,{from:n,to:r,text:t,origin:o})}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function bi(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],l=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var a=0;a<i.ranges.length;a++)vi(i.ranges[a].anchor,t,n,r),vi(i.ranges[a].head,t,n,r)}else{for(var s=0;s<i.changes.length;++s){var c=i.changes[s];if(n<c.from.line)c.from=tt(c.from.line+r,c.from.ch),c.to=tt(c.to.line+r,c.to.ch);else if(t<=c.to.line){l=!1;break}}l||(e.splice(0,o+1),o=0)}}}function yi(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;bi(e.done,n,r,o),bi(e.undone,n,r,o)}function _i(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=Ge(e,at(e,t)):o=Xe(t),null==o?null:(r(i,o)&&e.cm&&mr(e.cm,o,n),i)}function ki(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function xi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}Eo.prototype.from=function(){return lt(this.anchor,this.head)},Eo.prototype.to=function(){return it(this.anchor,this.head)},Eo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ki.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,qt(o),cn(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},xi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),l=r.height;if(r.removeInner(e,i),this.height-=l-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ki))){var a=[];this.collapse(a),this.children=[new ki(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,a=l;a<o.lines.length;){var s=new ki(o.lines.slice(a,a+=25));o.height-=s.height,this.children.splice(++r,0,s),s.parent=this}o.lines=o.lines.slice(0,l),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=j(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new xi(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<i){var l=Math.min(t,i-e);if(o.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=i}}};var wi=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Ci(e,t,n){Wt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pr(e,n)}wi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Xe(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=xn(this);Ye(n,Math.max(0,n.height-i)),e&&(eo(e,(function(){Ci(e,n,-i),mr(e,r,"widget")})),cn(e,"lineWidgetCleared",e,this,r))}},wi.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=xn(this)-t;o&&(Ht(this.doc,r)||Ye(r,r.height+o),n&&eo(n,(function(){n.curOp.forceUpdate=!0,Ci(n,r,o),cn(n,"lineWidgetChanged",n,e,Xe(r))})))},ye(wi);var Ei=0,Si=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ei};function Ii(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){(r=O(r)).shared=!1;var i=[Ii(e,t,n,r,o)],l=i[0],a=r.widgetNode;return Mo(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),i.push(Ii(e,st(e,t),st(e,n),r,o));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=K(i)})),new Ti(i,l)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return to(e.cm,Ii)(e,t,n,r,o);var i=new Si(e,o),l=nt(t,n);if(r&&O(r,i,!1),l>0||0==l&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=B("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ft(e,t.line,t,n,i)||t.line!=n.line&&Ft(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");wt=!0}i.addToHistory&&Ho(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&Zt(r)==c.display.maxLine&&(a=!0),i.collapsed&&s!=t.line&&Ye(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new Ct(i,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){Ht(e,t)&&Ye(t,0)})),i.clearOnEnter&&pe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Ei,i.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),i.collapsed)pr(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)mr(c,u,"text");i.atomic&&oi(c.doc),cn(c,"markerAdded",c,i)}return i}Si.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gr(e),be(this,"clear")){var n=this.find();n&&cn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var l=this.lines[i],a=Et(l.markedSpans,this);e&&!this.collapsed?mr(e,Xe(l),"text"):e&&(null!=a.to&&(o=Xe(l)),null!=a.from&&(r=Xe(l))),l.markedSpans=St(l.markedSpans,a),null==a.from&&this.collapsed&&!Ht(this.doc,l)&&e&&Ye(l,or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Zt(this.lines[s]),u=Ut(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&pr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&oi(e.doc)),e&&cn(e,"markerCleared",e,this,r,o),t&&qr(e),this.parent&&this.parent.clear()}},Si.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],l=Et(i.markedSpans,this);if(null!=l.from&&(n=tt(t?i:Xe(i),l.from),-1==e))return n;if(null!=l.to&&(r=tt(t?i:Xe(i),l.to),1==e))return r}return n&&{from:n,to:r}},Si.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&eo(r,(function(){var o=t.line,i=Xe(t.line),l=An(r,i);if(l&&(Zn(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ht(n.doc,o)&&null!=n.height){var a=n.height;n.height=null;var s=xn(n)-a;s&&Ye(o,o.height+s)}cn(r,"markerChanged",r,e)}))},Si.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=j(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Si.prototype.detachLine=function(e){if(this.lines.splice(j(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Si);var Ti=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ni(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),(function(e){return e.parent}))}function Bi(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Mo(n.primary.doc,(function(e){return r.push(e)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==j(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}Ti.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")}},Ti.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Ti);var Pi=0,Ai=function(e,t,n,r,o){if(!(this instanceof Ai))return new Ai(e,t,n,r,o);null==n&&(n=0),xi.call(this,[new ki([new Gt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=tt(n,0);this.sel=Io(i),this.history=new Zo(null),this.id=++Pi,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Do(this,{from:i,to:i,text:e}),ti(this,Io(i),V)};Ai.prototype=Q(xi.prototype,{constructor:Ai,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ro((function(e){var t=tt(this.first,0),n=this.first+this.size-1;di(this,{from:t,to:tt(n,Ge(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Lr(this.cm,0,0),ti(this,Io(t),V)})),replaceRange:function(e,t,n,r){gi(this,e,t=st(this,t),n=n?st(this,n):t,r)},getRange:function(e,t,n){var r=qe(this,st(this,e),st(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Je(this,e))return Ge(this,e)},getLineNumber:function(e){return Xe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),Zt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ro((function(e,t,n){Jo(this,st(this,"number"==typeof e?tt(e,t||0):e),null,n)})),setSelection:ro((function(e,t,n){Jo(this,st(this,e),st(this,t||e),n)})),extendSelection:ro((function(e,t,n){Yo(this,st(this,e),t&&st(this,t),n)})),extendSelections:ro((function(e,t){Xo(this,ct(this,e),t)})),extendSelectionsBy:ro((function(e,t){Xo(this,ct(this,Y(this.sel.ranges,e)),t)})),setSelections:ro((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new Eo(st(this,e[o].anchor),st(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ti(this,So(this.cm,r,t),n)}})),addSelection:ro((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Eo(st(this,e),st(this,t||e))),ti(this,So(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ro((function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var l=o.ranges[i];r[i]={from:l.from(),to:l.to(),text:this.splitLines(e[i]),origin:n}}for(var a=t&&"end"!=t&&function(e,t,n){for(var r=[],o=tt(e.first,0),i=o,l=0;l<t.length;l++){var a=t[l],s=Po(a.from,o,i),c=Po(To(a),o,i);if(o=a.to,i=c,"around"==n){var u=e.sel.ranges[l],d=nt(u.head,u.anchor)<0;r[l]=new Eo(d?c:s,d?s:c)}else r[l]=new Eo(s,s)}return new Co(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)di(this,r[s]);a?ei(this,a):this.cm&&Ar(this.cm)})),undo:ro((function(){mi(this,"undo")})),redo:ro((function(){mi(this,"redo")})),undoSelection:ro((function(){mi(this,"undo",!0)})),redoSelection:ro((function(){mi(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Zo(this.history),Mo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:qo(this.history.done),undone:qo(this.history.undone)}},setHistory:function(e){var t=this.history=new Zo(this.history);t.done=qo(e.done.slice(0),null,!0),t.undone=qo(e.undone.slice(0),null,!0)},setGutterMarker:ro((function(e,t,n){return _i(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ne(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ro((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&_i(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Je(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Xe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ro((function(e,t,n){return _i(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(C(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ro((function(e,t,n){return _i(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(C(n));if(!i)return!1;var l=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&l!=o.length?" ":"")+o.slice(l)||null}return!0}))})),addLineWidget:ro((function(e,t,n){return function(e,t,n,r){var o=new wi(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),_i(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!Ht(e,t)){var r=Wt(t)<e.scrollTop;Ye(t,t.height+xn(o)),r&&Pr(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&cn(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Xe(t)),o}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ii(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Ii(this,e=st(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ge(this,(e=st(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var l=i.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&o==e.line&&e.ch>=s.to||null==s.from&&o!=e.line||null!=s.from&&o==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n})),st(this,tt(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ai(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ai(Ke(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),l=e.clipPos(o.to);if(nt(i,l)){var a=Ii(e,i,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,Ni(this)),r},unlinkDoc:function(e){if(e instanceof Tl&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Bi(Ni(this));break}if(e.history==this.history){var n=[e.id];Mo(e,(function(e){return n.push(e.id)}),!0),e.history=new Zo(null),e.history.done=qo(this.history.done,n),e.history.undone=qo(this.history.undone,n)}},iterLinkedDocs:function(e){Mo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ro((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&eo(t=this.cm,(function(){Fo(t),pr(t)})))}))}),Ai.prototype.eachLine=Ai.prototype.iter;var Li=0;function Ri(e){var t=this;if(Di(t),!ge(t,e)&&!wn(t.display,e)){_e(e),l&&(Li=+new Date);var n=ur(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),a=0,s=function(){++a==o&&to(t,(function(){var e={from:n=st(t.doc,n),to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};di(t.doc,e),ei(t.doc,Io(st(t.doc,n),st(t.doc,To(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==j(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),s()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ni(t.doc,Io(n,n)),p)for(var m=0;m<p.length;++m)gi(t.doc,"",p[m].anchor,p[m].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Di(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Mi(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var o=t[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Oi=!1;function Fi(){var e;Oi||(pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Mi(Zi)}),100))})),pe(window,"blur",(function(){return Mi(Sr)})),Oi=!0)}function Zi(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ji={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},zi=0;zi<10;zi++)ji[zi+48]=ji[zi+96]=String(zi);for(var Hi=65;Hi<=90;Hi++)ji[Hi]=String.fromCharCode(Hi);for(var Vi=1;Vi<=12;Vi++)ji[Vi+111]=ji[Vi+63235]="F"+Vi;var Wi={};function Ui(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var l=0;l<i.length-1;l++){var a=i[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $i(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var o=Y(n.split(" "),Ui),i=0;i<o.length;i++){var l=void 0,a=void 0;i==o.length-1?(a=o.join(" "),l=r):(a=o.slice(0,i+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var c in t)e[c]=t[c];return e}function Gi(e,t,n,r){var o=(t=Xi(t)).call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Gi(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var l=Gi(e,t.fallthrough[i],n,r);if(l)return l}}}function qi(e){var t="string"==typeof e?e:ji[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ki(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Yi(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=ji[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ki(n,e,t))}function Xi(e){return"string"==typeof e?Wi[e]:e}function Qi(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&nt(i.from,K(r).to)<=0;){var l=r.pop();if(nt(l.from,i.from)<0){i.from=l.from;break}}r.push(i)}eo(e,(function(){for(var t=r.length-1;t>=0;t--)gi(e.doc,"",r[t].from,r[t].to,"+delete");Ar(e)}))}function Ji(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function el(e,t,n){var r=Ji(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function tl(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ue(n,t.doc.direction);if(i){var l,a=o<0?K(i):i[0],s=o<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Ln(t,n);l=o<0?n.text.length-1:0;var u=Rn(t,c,l).top;l=le((function(e){return Rn(t,c,e).top==u}),o<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Ji(n,l,1))}else l=o<0?a.to:a.from;return new tt(r,l,s)}}return new tt(r,o<0?n.text.length:0,o<0?"before":"after")}Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi.default=b?Wi.macDefault:Wi.pcDefault;var nl={selectAll:ci,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return Qi(e,(function(t){if(t.empty()){var n=Ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Qi(e,(function(t){return{from:tt(t.from().line,0),to:st(e.doc,tt(t.to().line+1,0))}}))},delLineLeft:function(e){return Qi(e,(function(e){return{from:tt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Qi(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Qi(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return rl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ol(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ge(e.doc,t),r=function(e){for(var t;t=Mt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Xe(r)),tl(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),U)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),U)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ol(e,t.head):r}),U)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),l=F(e.getLine(i.line),i.ch,r);t.push(q(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return eo(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=Ge(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new tt(o.line,o.ch-1)),o.ch>0)o=new tt(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),tt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var l=Ge(e.doc,o.line-1).text;l&&(o=new tt(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),tt(o.line-1,l.length-1),o,"+transpose"))}n.push(new Eo(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return eo(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ar(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function rl(e,t){var n=Ge(e.doc,t),r=Zt(n);return r!=n&&(t=Xe(r)),tl(!0,e,r,t,1)}function ol(e,t){var n=rl(e,t.line),r=Ge(e.doc,n.line),o=ue(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=i&&t.ch;return tt(n.line,l?0:i,n.sticky)}return n}function il(e,t,n){if("string"==typeof t&&!(t=nl[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=H}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var ll=new Z;function al(e,t,n,r){var o=e.state.keySeq;if(o){if(qi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ll.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),sl(e,o+" "+t,n,r))return!0}return sl(e,t,n,r)}function sl(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Gi(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Gi(t,e.options.extraKeys,n,e)||Gi(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&cn(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(_e(n),xr(e)),!!o}function cl(e,t){var n=Yi(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?al(e,"Shift-"+n,t,(function(t){return il(e,t,!0)}))||al(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return il(e,t)})):al(e,n,t,(function(t){return il(e,t)})))}var ul=null;function dl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=A(),ge(t,e)))){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=cl(t,e);d&&(ul=o?r:null,o||88!=r||Re||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!o&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n))}L(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}(t)}}function pl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function ml(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||wn(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ul)return ul=null,void _e(e);if(!d||e.which&&!(e.which<10)||!cl(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return al(e,"'"+n+"'",t,(function(t){return il(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var hl,fl,gl=function(e,t,n){this.time=e,this.pos=t,this.button=n};function vl(e){var t=this,n=t.display;if(!(ge(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,wn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!_l(t,e)){var r=ur(t,e),o=Ee(e),i=r?function(e,t){var n=+new Date;return fl&&fl.compare(n,e,t)?(hl=fl=null,"triple"):hl&&hl.compare(n,e,t)?(fl=new gl(n,e,t),hl=null,"double"):(hl=new gl(n,e,t),fl=null,"single")}(r,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),al(e,Ki(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=nl[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=H}finally{e.state.suppressEdits=!1}return r}))}(t,o,r,i,e)||(1==o?r?function(e,t,n,r){l?setTimeout(M(wr,e),0):e.curOp.focus=A();var o,i=function(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=y?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=b?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?n.altKey:n.ctrlKey)),o}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Te&&!e.isReadOnly()&&"single"==n&&(o=c.contains(t))>-1&&(nt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(nt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=to(e,(function(t){s&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Cr(e)),he(o.wrapper.ownerDocument,"mouseup",c),he(o.wrapper.ownerDocument,"mousemove",u),he(o.scroller,"dragstart",d),he(o.scroller,"drop",c),i||(_e(t),r.addNew||Yo(e.doc,n,null,null,r.extend),s&&!p||l&&9==a?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};s&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,pe(o.wrapper.ownerDocument,"mouseup",c),pe(o.wrapper.ownerDocument,"mousemove",u),pe(o.scroller,"dragstart",d),pe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,r,t,i):function(e,t,n,r){l&&Cr(e);var o=e.display,i=e.doc;_e(t);var a,s,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(s=i.sel.contains(n),a=s>-1?u[s]:new Eo(n,n)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Eo(n,n)),n=ur(e,t,!0,!0),s=-1;else{var d=bl(e,n,r.unit);a=r.extend?Ko(a,d.anchor,d.head,r.extend):d}r.addNew?-1==s?(s=u.length,ti(i,So(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(ti(i,So(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Qo(i,s,a,W):(s=0,ti(i,new Co([a],0),W),c=i.sel);var p=n;function m(t){if(0!=nt(p,t))if(p=t,"rectangle"==r.unit){for(var o=[],l=e.options.tabSize,u=F(Ge(i,n.line).text,n.ch,l),d=F(Ge(i,t.line).text,t.ch,l),m=Math.min(u,d),h=Math.max(u,d),f=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));f<=g;f++){var v=Ge(i,f).text,b=$(v,m,l);m==h?o.push(new Eo(tt(f,b),tt(f,b))):v.length>b&&o.push(new Eo(tt(f,b),tt(f,$(v,h,l))))}o.length||o.push(new Eo(n,n)),ti(i,So(e,c.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,_=a,k=bl(e,t,r.unit),x=_.anchor;nt(k.anchor,x)>0?(y=k.head,x=lt(_.from(),k.anchor)):(y=k.anchor,x=it(_.to(),k.head));var w=c.ranges.slice(0);w[s]=function(e,t){var n=t.anchor,r=t.head,o=Ge(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var i=ue(o);if(!i)return t;var l=se(i,n.ch,n.sticky),a=i[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,c=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(i,r.ch,r.sticky),d=u-l||(r.ch-n.ch)*(1==a.level?-1:1);s=u==c-1||u==c?d<0:d>0}var p=i[c+(s?-1:0)],m=s==(1==p.level),h=m?p.from:p.to,f=m?"after":"before";return n.ch==h&&n.sticky==f?t:new Eo(new tt(n.line,h,f),r)}(e,new Eo(st(i,x),y)),ti(i,So(e,w,s),W)}}var h=o.wrapper.getBoundingClientRect(),f=0;function g(t){var n=++f,l=ur(e,t,!0,"rectangle"==r.unit);if(l)if(0!=nt(l,p)){e.curOp.focus=A(),m(l);var a=Nr(o,i);(l.line>=a.to||l.line<a.from)&&setTimeout(to(e,(function(){f==n&&g(t)})),150)}else{var s=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;s&&setTimeout(to(e,(function(){f==n&&(o.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,f=1/0,t&&(_e(t),o.input.focus()),he(o.wrapper.ownerDocument,"mousemove",b),he(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var b=to(e,(function(e){0!==e.buttons&&Ee(e)?g(e):v(e)})),y=to(e,v);e.state.selectingText=y,pe(o.wrapper.ownerDocument,"mousemove",b),pe(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):Ce(e)==n.scroller&&_e(e):2==o?(r&&Yo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(w?t.display.input.onContextMenu(e):Cr(t)))}}function bl(e,t,n){if("char"==n)return new Eo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Eo(tt(t.line,0),st(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Eo(r.from,r.to)}function yl(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_e(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(i>a.bottom||!be(e,n))return xe(t);i-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=l.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=o)return fe(e,n,e,Qe(e.doc,i),e.display.gutterSpecs[s].className,t),xe(t)}}function _l(e,t){return yl(e,t,"gutterClick",!0)}function kl(e,t){wn(e.display,t)||function(e,t){return!!be(e,"gutterContextMenu")&&yl(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function xl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}gl.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var wl={toString:function(){return"CodeMirror.Init"}},Cl={},El={};function Sl(e,t,n){if(!t!=!(n&&n!=wl)){var r=e.display.dragFunctions,o=t?pe:he;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Il(e){e.options.lineWrapping?(L(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),$t(e)),cr(e),pr(e),zn(e),setTimeout((function(){return Hr(e)}),100)}function Tl(e,t){var n=this;if(!(this instanceof Tl))return new Tl(e,t);this.options=t=t?O(t):{},O(Cl,t,!1);var r=t.value;"string"==typeof r?r=new Ai(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Tl.inputStyles[t.inputStyle](this),i=this.display=new bo(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,xl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ur(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!v&&i.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;pe(t.scroller,"mousedown",to(e,vl)),pe(t.scroller,"dblclick",l&&a<11?to(e,(function(t){if(!ge(e,t)){var n=ur(e,t);if(n&&!_l(e,t)&&!wn(e.display,t)){_e(t);var r=e.findWordAt(n);Yo(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||_e(t)}),pe(t.scroller,"contextmenu",(function(t){return kl(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||kl(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function i(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}pe(t.scroller,"touchstart",(function(o){if(!ge(e,o)&&!i(o)&&!_l(e,o)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,l=e.coordsChar(t.activeTouch,"page");i=!r.prev||s(r,r.prev)?new Eo(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new Eo(tt(l.line,0),st(e.doc,tt(l.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),_e(n)}o()})),pe(t.scroller,"touchcancel",o),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Mr(e,t.scroller.scrollTop),Fr(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return wo(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return wo(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||we(t)},over:function(t){ge(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}(e,t),we(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Li<100))we(t);else if(!ge(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:to(e,Ri),leave:function(t){ge(e,t)||Di(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return pl.call(e,t)})),pe(c,"keydown",to(e,dl)),pe(c,"keypress",to(e,ml)),pe(c,"focus",(function(t){return Er(e,t)})),pe(c,"blur",(function(t){return Sr(e,t)}))}(this),Fi(),Gr(this),this.curOp.forceUpdate=!0,Oo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Er(n)}),20):Sr(this),El)El.hasOwnProperty(c)&&El[c](this,t[c],wl);ho(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Nl.length;++u)Nl[u](this);qr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Tl.defaults=Cl,Tl.optionHandlers=El;var Nl=[];function Bl(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=ht(e,t).state:n="prev");var l=e.options.tabSize,a=Ge(i,t),s=F(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((c=i.mode.indent(o,a.text.slice(u.length),a.text))==H||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?F(Ge(i,t-1).text,null,l):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/l);m;--m)p+=l,d+="\t";if(p<c&&(d+=q(c-p)),d!=u)return gi(i,d,tt(t,0),tt(t,u.length),"+input"),a.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var f=i.sel.ranges[h];if(f.head.line==t&&f.head.ch<u.length){var g=tt(t,u.length);Qo(i,h,new Eo(g,g));break}}}Tl.defineInitHook=function(e){return Nl.push(e)};var Pl=null;function Al(e){Pl=e}function Ll(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var l=+new Date-200,a="paste"==o||e.state.pasteIncoming>l,s=Ae(t),c=null;if(a&&r.ranges.length>1)if(Pl&&Pl.text.join("\n")==t){if(r.ranges.length%Pl.text.length==0){c=[];for(var u=0;u<Pl.text.length;u++)c.push(i.splitLines(Pl.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var m=r.ranges[p],h=m.from(),f=m.to();m.empty()&&(n&&n>0?h=tt(h.line,h.ch-n):e.state.overwrite&&!a?f=tt(f.line,Math.min(Ge(i,f.line).text.length,f.ch+K(s).length)):a&&Pl&&Pl.lineWise&&Pl.text.join("\n")==s.join("\n")&&(h=f=tt(h.line,0)));var g={from:h,to:f,text:c?c[p%c.length]:s,origin:o||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};di(e.doc,g),cn(e,"inputRead",e,g)}t&&!a&&Dl(e,t),Ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Rl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||eo(t,(function(){return Ll(t,n,0,null,"paste")})),!0}function Dl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),l=!1;if(i.electricChars){for(var a=0;a<i.electricChars.length;a++)if(t.indexOf(i.electricChars.charAt(a))>-1){l=Bl(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ge(e.doc,o.head.line).text.slice(0,o.head.ch))&&(l=Bl(e,o.head.line,"smart"));l&&cn(e,"electricInput",e,o.head.line)}}}function Ml(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:tt(o,0),head:tt(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Ol(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Fl(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Ol(e),t}function Zl(e,t,n,r,o){var i=t,l=n,a=Ge(e,t.line),s=o&&"rtl"==e.direction?-n:n;function c(i){var l,c;if("codepoint"==r){var u=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))l=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;l=new tt(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(d?2:1))),-n)}}else l=o?function(e,t,n,r){var o=ue(t,e.doc.direction);if(!o)return el(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=se(o,n.ch,n.sticky),l=o[i];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return el(t,n,r);var a,s=function(e,n){return Ji(t,e instanceof tt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(a=a||Ln(e,t),Jn(e,t,a,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var d=1==l.level==r<0,p=s(n,d?1:-1);if(null!=p&&(d?p<=l.to&&p<=u.end:p>=l.from&&p>=u.begin)){var m=d?"before":"after";return new tt(n.line,p,m)}}var h=function(e,t,r){for(var i=function(e,t){return t?new tt(n.line,s(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e<o.length;e+=t){var l=o[e],a=t>0==(1!=l.level),c=a?r.begin:s(r.end,-1);if(l.from<=c&&c<l.to)return i(c,a);if(c=a?l.from:s(l.to,-1),r.begin<=c&&c<r.end)return i(c,a)}},f=h(i+r,r,u);if(f)return f;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(f=h(r>0?0:o.length-1,r,c(g)))?null:f}(e.cm,a,t,n):el(a,t,n);if(null==l){if(i||((c=t.line+s)<e.first||c>=e.first+e.size||(t=new tt(c,t.ch,t.sticky),!(a=Ge(e,c)))))return!1;t=tl(o,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(n<0)||c(!m);m=!1){var h=a.text.charAt(t.ch)||"\n",f=te(h,p)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||m||f||(f="s"),u&&u!=f){n<0&&(n=1,c(),t.sticky="after");break}if(f&&(u=f),n>0&&!c(!m))break}var g=ai(e,t,i,l,!0);return rt(i,g)&&(g.hitSide=!0),g}function jl(e,t,n,r){var o,i,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*or(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=Xn(e,a,o)).outside;){if(n<0?o<=0:o>=l.height){i.hitSide=!0;break}o+=5*n}return i}var zl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Hl(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var r=Ge(e.doc,t.line),o=Bn(n,r,t.line),i=ue(r,e.doc.direction),l="left";i&&(l=se(i,t.ch)%2?"right":"left");var a=On(o.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Vl(e,t){return t&&(e.bad=!0),e}function Wl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Vl(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return Ul(i,t,n)}}function Ul(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!P(r,t))return Vl(tt(Xe(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?K(e.rest):e.line;return Vl(tt(Xe(i),i.text.length),o)}var l=3==t.nodeType?t:null,a=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?s.map:c[o],l=0;l<i.length;l+=3){var a=i[l+2];if(a==t||a==n){var u=Xe(o<0?e.line:e.rest[o]),d=i[l]+r;return(r<0||a!=t)&&(d=i[l+(r?1:0)]),tt(u,d)}}}var d=u(l,a,n);if(d)return Vl(d,o);for(var p=a.nextSibling,m=l?l.nodeValue.length-n:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return Vl(tt(d.line,d.ch-m),o);m+=p.textContent.length}for(var h=a.previousSibling,f=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1))return Vl(tt(d.line,d.ch+f),o);f+=h.textContent.length}}zl.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(i(e)&&!ge(r,e)){if(r.somethingSelected())Al({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ml(r);Al({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,V),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=Pl.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Fl(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Pl.text.join("\n");var c=A();D(s),setTimeout((function(){r.display.lineSpace.removeChild(a),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Ol(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pe(o,"paste",(function(e){!i(e)||ge(r,e)||Rl(e,r)||a<=11&&setTimeout(to(r,(function(){return t.updateFromDOM()})),20)})),pe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(o,"touchstart",(function(){return n.forceCompositionEnd()})),pe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(o,"copy",l),pe(o,"cut",l)},zl.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zl.prototype.prepareSelection=function(){var e=br(this.cm,!1);return e.focus=A()==this.div,e},zl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},zl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),o=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var l=Wl(t,e.anchorNode,e.anchorOffset),a=Wl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=nt(lt(l,a),o)||0!=nt(it(l,a),i)){var s=t.display.view,c=o.line>=t.display.viewFrom&&Hl(t,o)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Hl(t,i);if(!u){var d=s[s.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var m,h=e.rangeCount&&e.getRangeAt(0);try{m=E(c.node,c.offset,u.offset,u.node)}catch(e){}m&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},zl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},zl.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},zl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},zl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&A()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},zl.prototype.blur=function(){this.div.blur()},zl.prototype.getField=function(){return this.div},zl.prototype.supportsTouch=function(){return!0},zl.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):eo(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},zl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Wl(t,e.anchorNode,e.anchorOffset),r=Wl(t,e.focusNode,e.focusOffset);n&&r&&eo(t,(function(){ti(t.doc,Io(n,r),V),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},zl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),l=i.from(),a=i.to();if(0==l.ch&&l.line>r.firstLine()&&(l=tt(l.line-1,Ge(r.doc,l.line-1).length)),a.ch==Ge(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=tt(a.line+1,0)),l.line<o.viewFrom||a.line>o.viewTo-1)return!1;l.line==o.viewFrom||0==(e=dr(r,l.line))?(t=Xe(o.view[0].line),n=o.view[0].node):(t=Xe(o.view[e].line),n=o.view[e-1].node.nextSibling);var s,c,u=dr(r,a.line);if(u==o.view.length-1?(s=o.viewTo-1,c=o.lineDiv.lastChild):(s=Xe(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",l=!1,a=e.doc.lineSeparator(),s=!1;function c(){l&&(i+=a,s&&(i+=a),l=s=!1)}function u(e){e&&(c(),i+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var i,p=t.getAttribute("cm-marker");if(p){var m=e.findMarks(tt(r,0),tt(o+1,0),(g=+p,function(e){return e.id==g}));return void(m.length&&(i=m[0].find(0))&&u(qe(e.doc,i.from,i.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var f=0;f<t.childNodes.length;f++)d(t.childNodes[f]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),h&&(l=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return i}(r,n,c,t,s)),p=qe(r.doc,tt(t,0),tt(s,Ge(r.doc,s).text.length));d.length>1&&p.length>1;)if(K(d)==K(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var m=0,h=0,f=d[0],g=p[0],v=Math.min(f.length,g.length);m<v&&f.charCodeAt(m)==g.charCodeAt(m);)++m;for(var b=K(d),y=K(p),_=Math.min(b.length-(1==d.length?m:0),y.length-(1==p.length?m:0));h<_&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)++h;if(1==d.length&&1==p.length&&t==l.line)for(;m&&m>l.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)m--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(m).replace(/\u200b+$/,"");var k=tt(t,m),x=tt(s,p.length?K(p).length-h:0);return d.length>1||d[0]||nt(k,x)?(gi(r.doc,d,k,x,"+input"),!0):void 0},zl.prototype.ensurePolled=function(){this.forceCompositionEnd()},zl.prototype.reset=function(){this.forceCompositionEnd()},zl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},zl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||eo(this.cm,(function(){return pr(e.cm)}))},zl.prototype.setUneditable=function(e){e.contentEditable="false"},zl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||to(this.cm,Ll)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},zl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},zl.prototype.onContextMenu=function(){},zl.prototype.resetPosition=function(){},zl.prototype.needsContentAttribute=!0;var $l=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};$l.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ge(r,e)){if(r.somethingSelected())Al({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ml(r);Al({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,V):(n.prevInput="",o.value=t.text.join("\n"),D(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(o.style.width="0px"),pe(o,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(o,"paste",(function(e){ge(r,e)||Rl(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(o,"cut",i),pe(o,"copy",i),pe(e.scroller,"paste",(function(t){if(!wn(e,t)&&!ge(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),pe(e.lineSpace,"selectstart",(function(t){wn(e,t)||_e(t)})),pe(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},$l.prototype.createField=function(e){this.wrapper=Fl(),this.textarea=this.wrapper.firstChild},$l.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$l.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=br(e);if(e.options.moveInputWithCursor){var o=qn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+l.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+l.left-i.left))}return r},$l.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$l.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&D(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},$l.prototype.getField=function(){return this.textarea},$l.prototype.supportsTouch=function(){return!1},$l.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},$l.prototype.blur=function(){this.textarea.blur()},$l.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$l.prototype.receivedFocus=function(){this.slowPoll()},$l.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},$l.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},$l.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Le(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(r.length,o.length);s<c&&r.charCodeAt(s)==o.charCodeAt(s);)++s;return eo(t,(function(){Ll(t,o.slice(s),r.length-s,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},$l.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$l.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},$l.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=ur(n,e),c=r.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&to(n,ti)(n.doc,Io(i),V);var u,p=o.style.cssText,m=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&g(),w){we(e);var f=function(){he(window,"mouseup",f),setTimeout(v,20)};pe(window,"mouseup",f)}else setTimeout(v,50)}function g(){if(null!=o.selectionStart){var e=n.somethingSelected(),i="​"+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,o.style.cssText=p,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!l||l&&a<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?to(n,ci)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},$l.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},$l.prototype.setUneditable=function(){},$l.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=wl&&o(e,t,n)}:o)}e.defineOption=n,e.Init=wl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Ao(e)}),!0),n("indentUnit",2,Ao,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Lo(e),zn(e),pr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(tt(r,i))}r++}));for(var o=n.length-1;o>=0;o--)gi(e.doc,t,n[o],tt(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=wl&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xl(e),vo(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xi(t),o=n!=wl&&Xi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Il,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fo(t,e.options.lineNumbers),vo(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Hr(e)}),!0),n("scrollbarStyle","native",(function(e){Ur(e),Hr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fo(e.options.gutters,t),vo(e)}),!0),n("firstLineNumber",1,vo,!0),n("lineNumberFormatter",(function(e){return e}),vo,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Sr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Sl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Lo,!0),n("addModeClass",!1,Lo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Lo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Tl),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&to(this,t[e])(this,n,o),fe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:no((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");(function(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)})(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,pr(this)})),removeOverlay:no((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void pr(this)}})),indentLine:no((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Je(this.doc,e)&&Bl(this,e,t,n)})),indentSelection:no((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&(Bl(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Ar(this));else{var i=o.from(),l=o.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)Bl(this,s,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&Qo(this.doc,r,new Eo(i,c[r].to()),V)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=mt(this,Ge(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var l=r+o>>1;if((l?n[2*l-1]:0)>=i)o=l;else{if(!(n[2*l+1]<i)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var l=0;l<i[t].length;l++){var a=o[i[t][l]];a&&r.push(a)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var s=0;s<o._global.length;s++){var c=o._global[s];c.pred(i,this)&&-1==j(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ht(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?st(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Gn(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=$n(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=$n(this,{top:e,left:0},t||"page").top,Qe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=Ge(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Wt(r):0)},defaultTextHeight:function(){return or(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,l,a,s=this.display,c=(e=qn(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(s.wrapper.clientHeight,this.doc.height),p=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>p&&(u=p-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(i=this,l={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(a=Br(i,l)).scrollTop&&Mr(i,a.scrollTop),null!=a.scrollLeft&&Fr(i,a.scrollLeft))},triggerOnKeyDown:no(dl),triggerOnKeyPress:no(ml),triggerOnKeyUp:pl,triggerOnMouseDown:no(vl),execCommand:function(e){if(nl.hasOwnProperty(e))return nl[e].call(null,this)},triggerElectric:no((function(e){Dl(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=st(this.doc,e),l=0;l<t&&!(i=Zl(this.doc,i,o,n,r)).hitSide;++l);return i},moveH:no((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Zl(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),U)})),deleteH:no((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Qi(this,(function(n){var o=Zl(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var l=st(this.doc,e),a=0;a<t;++a){var s=qn(this,l,"div");if(null==i?i=s.left:s.left=i,(l=jl(this,s,o,n)).hitSide)break}return l},moveV:no((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(i)return e<0?l.from():l.to();var a=qn(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),o.push(a.left);var s=jl(n,a,e,t);return"page"==t&&l==r.sel.primary()&&Pr(n,Gn(n,s,"div").top-a.top),s}),U),o.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=o[l]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var i=t.charAt(n),l=te(i,o)?function(e){return te(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};n>0&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new Eo(tt(e.line,n),tt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?L(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:no((function(e,t){Lr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-In(this)-this.display.barHeight,width:e.scrollWidth-In(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:Tn(this)}},scrollIntoView:no((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:tt(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Rr(e),e.curOp.scrollToPos=t}(this,e):Dr(this,e.from,e.to,e.margin)})),setSize:no((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&jn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,fe(this,"refresh",this)})),operation:function(e){return eo(this,e)},startOperation:function(){return Gr(this)},endOperation:function(){return qr(this)},refresh:no((function(){var e=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,zn(this),Lr(this,this.doc.scrollLeft,this.doc.scrollTop),uo(this.display),(null==e||Math.abs(e-or(this.display))>.5||this.options.lineWrapping)&&cr(this),fe(this,"refresh",this)})),swapDoc:no((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Oo(this,e),zn(this),this.display.input.reset(),Lr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(Tl);var Gl="iter insert remove copy getEditor constructor".split(" ");for(var ql in Ai.prototype)Ai.prototype.hasOwnProperty(ql)&&j(Gl,ql)<0&&(Tl.prototype[ql]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ai.prototype[ql]));return ye(Ai),Tl.inputStyles={textarea:$l,contenteditable:zl},Tl.defineMode=function(e){Tl.defaults.mode||"null"==e||(Tl.defaults.mode=e),Fe.apply(this,arguments)},Tl.defineMIME=function(e,t){Oe[e]=t},Tl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Tl.defineMIME("text/plain","null"),Tl.defineExtension=function(e,t){Tl.prototype[e]=t},Tl.defineDocExtension=function(e,t){Ai.prototype[e]=t},Tl.fromTextArea=function(e,t){if((t=t?O(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var o;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var l=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=l}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var a=Tl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=he,e.on=pe,e.wheelEventPixels=xo,e.Doc=Ai,e.splitLines=Ae,e.countColumn=F,e.findColumn=$,e.isWordChar=ee,e.Pass=H,e.signal=fe,e.Line=Gt,e.changeEnd=To,e.scrollbarModel=Wr,e.Pos=tt,e.cmpPos=nt,e.modes=Me,e.mimeModes=Oe,e.resolveMode=Ze,e.getMode=je,e.modeExtensions=ze,e.extendMode=He,e.copyState=Ve,e.startState=Ue,e.innerMode=We,e.commands=nl,e.keyMap=Wi,e.keyName=Yi,e.isModifierKey=qi,e.lookupKey=Gi,e.normalizeKeyMap=$i,e.StringStream=$e,e.SharedTextMarker=Ti,e.TextMarker=Si,e.LineWidget=wi,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=we,e.addClass=L,e.contains=P,e.rmClass=S,e.keyNames=ji}(Tl),Tl.version="5.65.2",Tl}()},25002:(e,t,n)=>{!function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var o,i,l=t.indentUnit,a=n.tokenHooks,s=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},p=n.propertyKeywords||{},m=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},f=n.counterDescriptors||{},g=n.colorKeywords||{},v=n.valueKeywords||{},b=n.allowNested,y=n.lineComment,_=!0===n.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function x(e,t){return o=t,e}function w(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),x("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?x(null,"compare"):'"'==n||"'"==n?(t.tokenize=C(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==n?(e.match(/^\s*\w*/),x("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),x("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?x(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=E),x("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function C(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),x("string","string")}}function E(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),x(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function I(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:l),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,n){return A[n.context.type](e,t,n)}function B(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return N(e,t,n)}function P(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var A={top:function(e,t,n){if("{"==e)return I(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(_&&/@component/i.test(e))return I(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return I(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return I(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return I(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return I(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return I(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return p.hasOwnProperty(r)?(i="property","maybeprop"):m.hasOwnProperty(r)?(i=k?"string-2":"property","maybeprop"):b?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?A.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?I(n,t,"prop"):N(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&b)return I(n,t,"propBlock");if("}"==e||"{"==e)return B(e,t,n);if("("==e)return I(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)P(t);else if("interpolation"==e)return I(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?B(e,t,n):")"==e?T(n):"("==e?I(n,t,"parens"):"interpolation"==e?I(n,t,"interpolation"):("word"==e&&P(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):N(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&s.hasOwnProperty(t.current())?(i="tag",n.context.type):A.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return I(n,t,"atBlock_parens");if("}"==e||";"==e)return B(e,t,n);if("{"==e)return T(n)&&I(n,t,b?"block":"top");if("interpolation"==e)return I(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":p.hasOwnProperty(r)?"property":m.hasOwnProperty(r)?k?"string-2":"property":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?B(e,t,n):"{"==e?T(n)&&I(n,t,b?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?B(e,t,n,2):A.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?I(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):N(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?I(n,t,"top"):N(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?B(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?B(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||w)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=A[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-l)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],a=t(l),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),p=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],m=t(p),h=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),f=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),_=n.concat(o).concat(l).concat(s).concat(u).concat(p).concat(g).concat(b);function k(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:f,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:f,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(n(70907))},24481:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},35572:(e,t,n)=>{t.parse=n(73603),t.stringify=n(64335)},73603:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function n(e){return e?e.replace(/^\s+|\s+$/g,""):""}function r(e,t){var n=e&&"string"==typeof e.type,o=n?e:t;for(var i in e){var l=e[i];Array.isArray(l)?l.forEach((function(e){r(e,o)})):l&&"object"==typeof l&&r(l,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}e.exports=function(e,o){o=o||{};var i=1,l=1;function a(e){var t=e.match(/\n/g);t&&(i+=t.length);var n=e.lastIndexOf("\n");l=~n?e.length-n:l+e.length}function s(){var e={line:i,column:l};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:i,column:l},this.source=o.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(o.source+":"+i+":"+l+": "+t);if(n.reason=t,n.filename=o.source,n.line=i,n.column=l,n.source=e,!o.silent)throw n;u.push(n)}function p(){return f(/^{\s*/)}function m(){return f(/^}/)}function h(){var t,n,r,o=[];for(g(),v(o);e.length&&"}"!=e.charAt(0)&&(t=T()||(n=void 0,r=void 0,n=s(),(r=y())?(v(),n({type:"rule",selectors:r,declarations:k()})):d("selector missing")));)!1!==t&&(o.push(t),v(o));return o}function f(t){var n=t.exec(e);if(n){var r=n[0];return a(r),e=e.slice(r.length),n}}function g(){f(/^\s*/)}function v(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=s();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return d("End of comment missing");var r=e.slice(2,n-2);return l+=2,a(r),e=e.slice(n),l+=2,t({type:"comment",comment:r})}}function y(){var e=f(/^([^{]+)/);if(e)return n(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function _(){var e=s(),r=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=n(r[0]),!f(/^:\s*/))return d("property missing ':'");var o=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(t,""),value:o?n(o[0]).replace(t,""):""});return f(/^[;\s]*/),i}}function k(){var e,t=[];if(!p())return d("missing '{'");for(v(t);e=_();)!1!==e&&(t.push(e),v(t));return m()?t:d("missing '}'")}function x(){for(var e,t=[],n=s();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:k()})}var w,C=I("import"),E=I("charset"),S=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=s(),r=f(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function T(){if("@"==e[0])return function(){var e=s();if(t=f(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=f(/^([-\w]+)\s*/)))return d("@keyframes missing name");var r,o=t[1];if(!p())return d("@keyframes missing '{'");for(var i=v();r=x();)i.push(r),i=i.concat(v());return m()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):d("@keyframes missing '}'")}}()||function(){var e=s(),t=f(/^@media *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@media missing '{'");var o=v().concat(h());return m()?e({type:"media",media:r,rules:o}):d("@media missing '}'")}}()||function(){var e=s(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:n(t[1]),media:n(t[2])})}()||function(){var e=s(),t=f(/^@supports *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@supports missing '{'");var o=v().concat(h());return m()?e({type:"supports",supports:r,rules:o}):d("@supports missing '}'")}}()||C()||E()||S()||function(){var e=s(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=n(t[1]),o=n(t[2]);if(!p())return d("@document missing '{'");var i=v().concat(h());return m()?e({type:"document",document:o,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=s();if(f(/^@page */)){var t=y()||[];if(!p())return d("@page missing '{'");for(var n,r=v();n=_();)r.push(n),r=r.concat(v());return m()?e({type:"page",selectors:t,declarations:r}):d("@page missing '}'")}}()||function(){var e=s();if(f(/^@host\s*/)){if(!p())return d("@host missing '{'");var t=v().concat(h());return m()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=s();if(f(/^@font-face\s*/)){if(!p())return d("@font-face missing '{'");for(var t,n=v();t=_();)n.push(t),n=n.concat(v());return m()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}return r((w=h(),{type:"stylesheet",stylesheet:{source:o.source,rules:w,parsingErrors:u}}))}},68829:e=>{function t(e){this.options=e||{}}e.exports=t,t.prototype.emit=function(e){return e},t.prototype.visit=function(e){return this[e.type](e)},t.prototype.mapVisit=function(e,t){var n="";t=t||"";for(var r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n}},21352:(e,t,n)=>{var r=n(68829),o=n(89118);function i(e){r.call(this,e)}e.exports=i,o(i,r),i.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},i.prototype.comment=function(e){return this.emit("",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},i.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},i.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},i.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},i.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.prototype.rule=function(e){var t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},i.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")}},20478:(e,t,n)=>{var r=n(68829),o=n(89118);function i(e){e=e||{},r.call(this,e),this.indentation=e.indent}e.exports=i,o(i,r),i.prototype.compile=function(e){return this.stylesheet(e)},i.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},i.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("  {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},i.prototype.keyframe=function(e){var t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},i.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},i.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},i.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.prototype.rule=function(e){var t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},i.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},i.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||"  ")}},64335:(e,t,n)=>{var r=n(21352),o=n(20478);e.exports=function(e,t){var i=(t=t||{}).compress?new r(t):new o(t);if(t.sourcemap){n(51073)(i);var l=i.compile(e);return i.applySourceMaps(),{code:l,map:"generator"===t.sourcemap?i.map:i.map.toJSON()}}return i.compile(e)}},51073:(e,t,n)=>{var r=n(20065).SourceMapGenerator,o=n(20065).SourceMapConsumer,i=n(14471),l=n(37019),a=n(96344);e.exports=function(e){for(var n in e._comment=e.comment,e.map=new r,e.position={line:1,column:1},e.files={},t)e[n]=t[n]};const s=function(e){return"\\"===a.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e};t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var n=e.lastIndexOf("\n");this.position.column=~n?e.length-n:this.position.column+e.length},t.emit=function(e,t){if(t){var n=s(t.source||"source.css");this.map.addMapping({source:n,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:t.start.line,column:t.start.column-1}}),this.addFile(n,t)}return this.updatePosition(e),e},t.addFile=function(e,t){"string"==typeof t.content&&(Object.prototype.hasOwnProperty.call(this.files,e)||(this.files[e]=t.content))},t.applySourceMaps=function(){Object.keys(this.files).forEach((function(e){var t=this.files[e];if(this.map.setSourceContent(e,t),!1!==this.options.inputSourcemaps){var n=i.resolveSync(t,e,l.readFileSync);if(n){var r=new o(n.map),c=n.sourcesRelativeTo;this.map.applySourceMap(r,e,s(a.dirname(c)))}}}),this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}},20242:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp(t,"gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var l=Object.keys(t),a=0;a<l.length;a++){var s=l[a];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},22897:(e,t)=>{"use strict";function n(){}function r(e,t,n,r,o){for(var i=0,l=t.length,a=0,s=0;i<l;i++){var c=t[i];if(c.removed){if(c.value=e.join(r.slice(s,s+c.count)),s+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=u}}else{if(!c.added&&o){var d=n.slice(a,a+c.count);d=d.map((function(e,t){var n=r[s+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=c.count)}}var p=t[l-1];return l>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[l-2].value+=p.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var i=this;function l(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,c=1,u=a+s,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=a&&p+1>=s)return l([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*c;n<=c;n+=2){var o=void 0,u=d[n-1],p=d[n+1],m=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var h=u&&u.newPos+1<a,f=p&&0<=m&&m<s;if(h||f){if(!h||f&&u.newPos<p.newPos?(o={newPos:(g=p).newPos,components:g.components.slice(0)},i.pushComponent(o.components,void 0,!0)):((o=u).newPos++,i.pushComponent(o.components,!0,void 0)),m=i.extractCommon(o,t,e,n),o.newPos+1>=a&&m+1>=s)return l(r(i,o.components,t,e,i.useLongestToken));d[n]=o}else d[n]=void 0}var g;c++}if(o)!function e(){setTimeout((function(){if(c>u)return o();m()||e()}),0)}();else for(;c<=u;){var h=m();if(h)return h}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var o=t.length,i=n.length,l=e.newPos,a=l-r,s=0;l+1<o&&a+1<i&&this.equals(t[l+1],n[a+1]);)l++,a++,s++;return s&&e.components.push({count:s}),e.newPos=l,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},79646:(e,t,n)=>{"use strict";var r;t.Kx=function(e,t,n){return o.diff(e,t,n)};var o=new(((r=n(22897))&&r.__esModule?r:{default:r}).default)},85611:(e,t,n)=>{var r=n(24481);e.exports=function(e){var t=r(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=r(e,"line-height"),n=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var i=e.nodeName,l=document.createElement(i);l.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&l.setAttribute("rows","1");var a=r(e,"font-size");l.style.fontSize=a,l.style.padding="0px",l.style.border="0px";var s=document.body;s.appendChild(l),n=l.offsetHeight,s.removeChild(l)}return n}},91544:(e,t,n)=>{e.exports=n(42802)},23762:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},79775:e=>{var t,n,r,o,i,l,a,s,c,u,d,p,m,h,f,g=!1;function v(){if(!g){g=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),h=/FBAN\/\w+;/i.exec(e),f=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(e);l=y?parseFloat(y[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,r=v[3]?parseFloat(v[3]):NaN,(o=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),i=v&&v[1]?parseFloat(v[1]):NaN):i=NaN}else t=n=r=i=o=NaN;if(b){if(b[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;s=!!b[2],c=!!b[3]}else a=s=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||l>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||r},webkit:function(){return v()||o},safari:function(){return b.webkit()},chrome:function(){return v()||i},windows:function(){return v()||s},osx:function(){return v()||a},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||f},nativeApp:function(){return v()||h},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},87305:(e,t,n)=>{"use strict";var r,o=n(23762);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var l=document.createElement("div");l.setAttribute(n,"return;"),i="function"==typeof l[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},42802:(e,t,n)=>{"use strict";var r=n(79775),o=n(87305);function i(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},74870:function(e,t,n){var r;e=n.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var l,a=2147483647,s=36,c=26,u=38,d=700,p=/^xn--/,m=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=s-1,v=Math.floor,b=String.fromCharCode;function y(e){throw RangeError(f[e])}function _(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+_((e=e.replace(h,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function w(e){return _(e,(function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+b(e)})).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,n){var r=0;for(e=n?v(e/d):e>>1,e+=v(e/t);e>g*c>>1;r+=s)e=v(e/g);return v(r+(g+1)*e/(e+u))}function S(e){var t,n,r,o,i,l,u,d,p,m,h,f=[],g=e.length,b=0,_=128,k=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&y("not-basic"),f.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=b,l=1,u=s;o>=g&&y("invalid-input"),((d=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:s)>=s||d>v((a-b)/l))&&y("overflow"),b+=d*l,!(d<(p=u<=k?1:u>=k+c?c:u-k));u+=s)l>v(a/(m=s-p))&&y("overflow"),l*=m;k=E(b-i,t=f.length+1,0==i),v(b/t)>a-_&&y("overflow"),_+=v(b/t),b%=t,f.splice(b++,0,_)}return w(f)}function I(e){var t,n,r,o,i,l,u,d,p,m,h,f,g,_,k,w=[];for(f=(e=x(e)).length,t=128,n=0,i=72,l=0;l<f;++l)(h=e[l])<128&&w.push(b(h));for(r=o=w.length,o&&w.push("-");r<f;){for(u=a,l=0;l<f;++l)(h=e[l])>=t&&h<u&&(u=h);for(u-t>v((a-n)/(g=r+1))&&y("overflow"),n+=(u-t)*g,t=u,l=0;l<f;++l)if((h=e[l])<t&&++n>a&&y("overflow"),h==t){for(d=n,p=s;!(d<(m=p<=i?1:p>=i+c?c:p-i));p+=s)k=d-m,_=s-m,w.push(b(C(m+k%_,0))),d=v(k/_);w.push(b(C(d,0))),i=E(n,g,r==o),n=0,++r}++n,++t}return w.join("")}l={version:"1.3.2",ucs2:{decode:x,encode:w},decode:S,encode:I,toASCII:function(e){return k(e,(function(e){return m.test(e)?"xn--"+I(e):e}))},toUnicode:function(e){return k(e,(function(e){return p.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return l}.call(t,n,t,e))||(e.exports=r)}()},55240:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,o){n=n||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var l=/\+/g;e=e.split(n);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var c=0;c<s;++c){var u,d,p,m,h=e[c].replace(l,"%20"),f=h.indexOf(r);f>=0?(u=h.substr(0,f),d=h.substr(f+1)):(u=h,d=""),p=decodeURIComponent(u),m=decodeURIComponent(d),t(i,p)?Array.isArray(i[p])?i[p].push(m):i[p]=[i[p],m]:i[p]=m}return i}},3907:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,o){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(t(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(t(e))})).join(n):i+encodeURIComponent(t(e[o]))})).join(n):o?encodeURIComponent(t(o))+r+encodeURIComponent(t(e)):""}},54415:(e,t,n)=>{"use strict";t.decode=t.parse=n(55240),t.encode=t.stringify=n(3907)},82162:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};t.__esModule=!0;var a=n(70079),s=n(39519),c=n(17121),u=n(85611),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,r=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||r?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),r=(t.onChange,t.style),o=(t.innerRef,t.children),s=l(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",i({},s,{onChange:this.onChange,style:u?i({},r,{maxHeight:u}):r,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,i({},e,{innerRef:t}))}))},49710:(e,t,n)=>{"use strict";var r=n(82162);t.Z=r.TextareaAutosize},52965:function(e,t,n){var r;(function(){function o(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var i={},l={},a={},s=o(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=!0);return t}()};function d(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",r={valid:!0,error:""};i.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var l=n+" sub-extension "+o+": ",a=e[o];if("object"!=typeof a)return r.valid=!1,r.error=l+"must be an object, but "+typeof a+" given",r;if(!i.helper.isString(a.type))return r.valid=!1,r.error=l+'property "type" must be a string, but '+typeof a.type+" given",r;var s=a.type=a.type.toLowerCase();if("language"===s&&(s=a.type="lang"),"html"===s&&(s=a.type="output"),"lang"!==s&&"output"!==s&&"listener"!==s)return r.valid=!1,r.error=l+"type "+s+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',r;if("listener"===s){if(i.helper.isUndefined(a.listeners))return r.valid=!1,r.error=l+'. Extensions of type "listener" must have a property called "listeners"',r}else if(i.helper.isUndefined(a.filter)&&i.helper.isUndefined(a.regex))return r.valid=!1,r.error=l+s+' extensions must define either a "regex" property or a "filter" method',r;if(a.listeners){if("object"!=typeof a.listeners)return r.valid=!1,r.error=l+'"listeners" property must be an object but '+typeof a.listeners+" given",r;for(var c in a.listeners)if(a.listeners.hasOwnProperty(c)&&"function"!=typeof a.listeners[c])return r.valid=!1,r.error=l+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+c+" must be a function but "+typeof a.listeners[c]+" given",r}if(a.filter){if("function"!=typeof a.filter)return r.valid=!1,r.error=l+'"filter" must be a function, but '+typeof a.filter+" given",r}else if(a.regex){if(i.helper.isString(a.regex)&&(a.regex=new RegExp(a.regex,"g")),!(a.regex instanceof RegExp))return r.valid=!1,r.error=l+'"regex" property must either be a string or a RegExp object, but '+typeof a.regex+" given",r;if(i.helper.isUndefined(a.replace))return r.valid=!1,r.error=l+'"regex" extensions must implement a replace string or function',r}}return r}function p(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}i.helper={},i.extensions={},i.setOption=function(e,t){"use strict";return s[e]=t,this},i.getOption=function(e){"use strict";return s[e]},i.getOptions=function(){"use strict";return s},i.resetOptions=function(){"use strict";s=o(!0)},i.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");i.resetOptions();var t=u[e];for(var n in c=e,t)t.hasOwnProperty(n)&&(s[n]=t[n])},i.getFlavor=function(){"use strict";return c},i.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},i.getDefaultOptions=function(e){"use strict";return o(e)},i.subParser=function(e,t){"use strict";if(i.helper.isString(e)){if(void 0===t){if(l.hasOwnProperty(e))return l[e];throw Error("SubParser named "+e+" not registered!")}l[e]=t}},i.extension=function(e,t){"use strict";if(!i.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=i.helper.stdExtName(e),i.helper.isUndefined(t)){if(!a.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return a[e]}"function"==typeof t&&(t=t()),i.helper.isArray(t)||(t=[t]);var n=d(t,e);if(!n.valid)throw Error(n.error);a[e]=t},i.getAllExtensions=function(){"use strict";return a},i.removeExtension=function(e){"use strict";delete a[e]},i.resetExtensions=function(){"use strict";a={}},i.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},i.hasOwnProperty("helper")||(i.helper={}),i.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},i.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},i.helper.isArray=function(e){"use strict";return Array.isArray(e)},i.helper.isUndefined=function(e){"use strict";return void 0===e},i.helper.forEach=function(e,t){"use strict";if(i.helper.isUndefined(e))throw new Error("obj param is required");if(i.helper.isUndefined(t))throw new Error("callback param is required");if(!i.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(i.helper.isArray(e))for(var n=0;n<e.length;n++)t(e[n],n,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var r in e)e.hasOwnProperty(r)&&t(e[r],r,e)}},i.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},i.helper.escapeCharactersCallback=p,i.helper.escapeCharacters=function(e,t,n){"use strict";var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var o=new RegExp(r,"g");return e.replace(o,p)},i.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};var m=function(e,t,n,r){"use strict";var o,i,l,a,s,c=r||"",u=c.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),p=new RegExp(t,c.replace(/g/g,"")),m=[];do{for(o=0;l=d.exec(e);)if(p.test(l[0]))o++||(a=(i=d.lastIndex)-l[0].length);else if(o&&!--o){s=l.index+l[0].length;var h={left:{start:a,end:i},match:{start:i,end:l.index},right:{start:l.index,end:s},wholeMatch:{start:a,end:s}};if(m.push(h),!u)return m}}while(o&&(d.lastIndex=i));return m};i.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=m(e,t,n,r),i=[],l=0;l<o.length;++l)i.push([e.slice(o[l].wholeMatch.start,o[l].wholeMatch.end),e.slice(o[l].match.start,o[l].match.end),e.slice(o[l].left.start,o[l].left.end),e.slice(o[l].right.start,o[l].right.end)]);return i},i.helper.replaceRecursiveRegExp=function(e,t,n,r,o){"use strict";if(!i.helper.isFunction(t)){var l=t;t=function(){return l}}var a=m(e,n,r,o),s=e,c=a.length;if(c>0){var u=[];0!==a[0].wholeMatch.start&&u.push(e.slice(0,a[0].wholeMatch.start));for(var d=0;d<c;++d)u.push(t(e.slice(a[d].wholeMatch.start,a[d].wholeMatch.end),e.slice(a[d].match.start,a[d].match.end),e.slice(a[d].left.start,a[d].left.end),e.slice(a[d].right.start,a[d].right.end))),d<c-1&&u.push(e.slice(a[d].wholeMatch.end,a[d+1].wholeMatch.start));a[c-1].wholeMatch.end<e.length&&u.push(e.slice(a[c-1].wholeMatch.end)),s=u.join("")}return s},i.helper.regexIndexOf=function(e,t,n){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==0)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var r=e.substring(n||0).search(t);return r>=0?r+(n||0):r},i.helper.splitAtIndex=function(e,t){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},i.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e}))},i.helper.padEnd=function(e,t,n){"use strict";return t>>=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),i.helper.regexes={asteriskDashAndColon:/([*_:~])/g},i.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️&zwj;♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴&zwj;♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱&zwj;♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇&zwj;♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷&zwj;♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨&zwj;❤️&zwj;👨",couple_with_heart_woman_woman:"👩&zwj;❤️&zwj;👩",couplekiss_man_man:"👨&zwj;❤️&zwj;💋&zwj;👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩&zwj;❤️&zwj;💋&zwj;👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯&zwj;♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁&zwj;🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨&zwj;👦",family_man_boy_boy:"👨&zwj;👦&zwj;👦",family_man_girl:"👨&zwj;👧",family_man_girl_boy:"👨&zwj;👧&zwj;👦",family_man_girl_girl:"👨&zwj;👧&zwj;👧",family_man_man_boy:"👨&zwj;👨&zwj;👦",family_man_man_boy_boy:"👨&zwj;👨&zwj;👦&zwj;👦",family_man_man_girl:"👨&zwj;👨&zwj;👧",family_man_man_girl_boy:"👨&zwj;👨&zwj;👧&zwj;👦",family_man_man_girl_girl:"👨&zwj;👨&zwj;👧&zwj;👧",family_man_woman_boy_boy:"👨&zwj;👩&zwj;👦&zwj;👦",family_man_woman_girl:"👨&zwj;👩&zwj;👧",family_man_woman_girl_boy:"👨&zwj;👩&zwj;👧&zwj;👦",family_man_woman_girl_girl:"👨&zwj;👩&zwj;👧&zwj;👧",family_woman_boy:"👩&zwj;👦",family_woman_boy_boy:"👩&zwj;👦&zwj;👦",family_woman_girl:"👩&zwj;👧",family_woman_girl_boy:"👩&zwj;👧&zwj;👦",family_woman_girl_girl:"👩&zwj;👧&zwj;👧",family_woman_woman_boy:"👩&zwj;👩&zwj;👦",family_woman_woman_boy_boy:"👩&zwj;👩&zwj;👦&zwj;👦",family_woman_woman_girl:"👩&zwj;👩&zwj;👧",family_woman_woman_girl_boy:"👩&zwj;👩&zwj;👧&zwj;👦",family_woman_woman_girl_girl:"👩&zwj;👩&zwj;👧&zwj;👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️&zwj;♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍&zwj;♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️&zwj;♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂&zwj;♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇&zwj;♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨&zwj;🎨",man_astronaut:"👨&zwj;🚀",man_cartwheeling:"🤸&zwj;♂️",man_cook:"👨&zwj;🍳",man_dancing:"🕺",man_facepalming:"🤦&zwj;♂️",man_factory_worker:"👨&zwj;🏭",man_farmer:"👨&zwj;🌾",man_firefighter:"👨&zwj;🚒",man_health_worker:"👨&zwj;⚕️",man_in_tuxedo:"🤵",man_judge:"👨&zwj;⚖️",man_juggling:"🤹&zwj;♂️",man_mechanic:"👨&zwj;🔧",man_office_worker:"👨&zwj;💼",man_pilot:"👨&zwj;✈️",man_playing_handball:"🤾&zwj;♂️",man_playing_water_polo:"🤽&zwj;♂️",man_scientist:"👨&zwj;🔬",man_shrugging:"🤷&zwj;♂️",man_singer:"👨&zwj;🎤",man_student:"👨&zwj;🎓",man_teacher:"👨&zwj;🏫",man_technologist:"👨&zwj;💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆&zwj;♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼&zwj;♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵&zwj;♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅&zwj;♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆&zwj;♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮&zwj;♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎&zwj;♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️&zwj;🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋&zwj;♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣&zwj;♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃&zwj;♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄&zwj;♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊&zwj;♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁&zwj;♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶&zwj;♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️&zwj;♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩&zwj;🎨",woman_astronaut:"👩&zwj;🚀",woman_cartwheeling:"🤸&zwj;♀️",woman_cook:"👩&zwj;🍳",woman_facepalming:"🤦&zwj;♀️",woman_factory_worker:"👩&zwj;🏭",woman_farmer:"👩&zwj;🌾",woman_firefighter:"👩&zwj;🚒",woman_health_worker:"👩&zwj;⚕️",woman_judge:"👩&zwj;⚖️",woman_juggling:"🤹&zwj;♀️",woman_mechanic:"👩&zwj;🔧",woman_office_worker:"👩&zwj;💼",woman_pilot:"👩&zwj;✈️",woman_playing_handball:"🤾&zwj;♀️",woman_playing_water_polo:"🤽&zwj;♀️",woman_scientist:"👩&zwj;🔬",woman_shrugging:"🤷&zwj;♀️",woman_singer:"👩&zwj;🎤",woman_student:"👩&zwj;🎓",woman_teacher:"👩&zwj;🏫",woman_technologist:"👩&zwj;💻",woman_with_turban:"👳&zwj;♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼&zwj;♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},i.Converter=function(e){"use strict";var t={},n=[],r=[],o={},l=c,p={parsed:{},raw:"",format:""};function m(e,t){if(t=t||null,i.helper.isString(e)){if(t=e=i.helper.stdExtName(e),i.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new i.Converter)),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var l=0;l<e.length;++l)switch(e[l].type){case"lang":n.push(e[l]);break;case"output":r.push(e[l]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(i.extensions[e],e);if(i.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var l=0;l<e.length;++l){switch(e[l].type){case"lang":n.push(e[l]);break;case"output":r.push(e[l])}if(e[l].hasOwnProperty("listeners"))for(var s in e[l].listeners)e[l].listeners.hasOwnProperty(s)&&h(s,e[l].listeners[s])}}function h(e,t){if(!i.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");o.hasOwnProperty(e)||(o[e]=[]),o[e].push(t)}!function(){for(var n in e=e||{},s)s.hasOwnProperty(n)&&(t[n]=s[n]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.extensions&&i.helper.forEach(t.extensions,m)}(),this._dispatch=function(e,t,n,r){if(o.hasOwnProperty(e))for(var i=0;i<o[e].length;++i){var l=o[e][i](e,t,this,n,r);l&&void 0!==l&&(t=l)}return t},this.listen=function(e,t){return h(e,t),this},this.makeHtml=function(e){if(!e)return e;var o={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:n,outputModifiers:r,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g,"&nbsp;"),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=i.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),i.helper.forEach(n,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),e=i.subParser("metadata")(e,t,o),e=i.subParser("hashPreCodeTags")(e,t,o),e=i.subParser("githubCodeBlocks")(e,t,o),e=i.subParser("hashHTMLBlocks")(e,t,o),e=i.subParser("hashCodeTags")(e,t,o),e=i.subParser("stripLinkDefinitions")(e,t,o),e=i.subParser("blockGamut")(e,t,o),e=i.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=i.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=i.subParser("completeHTMLDocument")(e,t,o),i.helper.forEach(r,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),p=o.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var n=t.createElement("div");n.innerHTML=e;var r={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],r=0;r<t.length;++r)if(1===t[r].childElementCount&&"code"===t[r].firstChild.tagName.toLowerCase()){var o=t[r].firstChild.innerHTML.trim(),l=t[r].firstChild.getAttribute("data-language")||"";if(""===l)for(var a=t[r].firstChild.className.split(" "),s=0;s<a.length;++s){var c=a[s].match(/^language-(.+)$/);if(null!==c){l=c[1];break}}o=i.helper.unescapeHTMLEntities(o),n.push(o),t[r].outerHTML='<precode language="'+l+'" precodenum="'+r.toString()+'"></precode>'}else n.push(t[r].innerHTML),t[r].innerHTML="",t[r].setAttribute("prenum",r.toString());return n}(n)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(n);for(var o=n.childNodes,l="",a=0;a<o.length;a++)l+=i.subParser("makeMarkdown.node")(o[a],r);return l},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){m(e,t=t||null)},this.useExtension=function(e){m(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in l=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return l},this.removeExtension=function(e){i.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],l=0;l<n.length;++l)n[l]===o&&n[l].splice(l,1);for(;0<r.length;++l)r[0]===o&&r[0].splice(l,1)}},this.getAllExtensions=function(){return{language:n,output:r}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},i.subParser("anchors",(function(e,t,n){"use strict";var r=function(e,r,o,l,a,s,c){if(i.helper.isUndefined(c)&&(c=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)l="";else if(!l){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),l="#"+o,i.helper.isUndefined(n.gUrls[o]))return e;l=n.gUrls[o],i.helper.isUndefined(n.gTitles[o])||(c=n.gTitles[o])}var u='<a href="'+(l=l.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,"&quot;")).replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(l)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+">"+r+"</a>"};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,n,r,o,l){if("\\"===r)return n+o;if(!i.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var a=t.ghMentionsLink.replace(/\{u}/g,l),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'<a href="'+a+'"'+s+">"+o+"</a>"}))),n.converter._dispatch("anchors.after",e,t,n)}));var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,v=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,b=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,n,r,o,l,a,s){var c=r=r.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback),u="",d="",p=n||"",m=s||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(u=a),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+r+'"'+d+">"+c+"</a>"+u+m}},_=function(e,t){"use strict";return function(n,r,o){var l="mailto:";return r=r||"",o=i.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(l=i.helper.encodeEmailAddress(l+o),o=i.helper.encodeEmailAddress(o)):l+=o,r+'<a href="'+l+'">'+o+"</a>"}};i.subParser("autoLinks",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(g,y(t))).replace(b,_(t,n)),n.converter._dispatch("autoLinks.after",e,t,n)})),i.subParser("simplifiedAutoLinks",(function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(f,y(t)):e.replace(h,y(t))).replace(v,_(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e})),i.subParser("blockGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=i.subParser("blockQuotes")(e,t,n),e=i.subParser("headers")(e,t,n),e=i.subParser("horizontalRule")(e,t,n),e=i.subParser("lists")(e,t,n),e=i.subParser("codeBlocks")(e,t,n),e=i.subParser("tables")(e,t,n),e=i.subParser("hashHTMLBlocks")(e,t,n),e=i.subParser("paragraphs")(e,t,n),n.converter._dispatch("blockGamut.after",e,t,n)})),i.subParser("blockQuotes",(function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var r=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(r=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(r,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=i.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=i.subParser("blockGamut")(e,t,n)).replace(/(^|\n)/g,"$1  ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var n=t;return(n=n.replace(/^  /gm,"¨0")).replace(/¨0/g,"")})),i.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,n)})),n.converter._dispatch("blockQuotes.after",e,t,n)})),i.subParser("codeBlocks",(function(e,t,n){"use strict";return e=n.converter._dispatch("codeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,r,o){var l=r,a=o,s="\n";return l=i.subParser("outdent")(l,t,n),l=i.subParser("encodeCode")(l,t,n),l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(s=""),l="<pre><code>"+l+s+"</code></pre>",i.subParser("hashBlock")(l,t,n)+a}))).replace(/¨0/,""),n.converter._dispatch("codeBlocks.after",e,t,n)})),i.subParser("codeSpans",(function(e,t,n){"use strict";return void 0===(e=n.converter._dispatch("codeSpans.before",e,t,n))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,r,o,l){var a=l;return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+"<code>"+(a=i.subParser("encodeCode")(a,t,n))+"</code>",i.subParser("hashHTMLSpans")(a,t,n)})),n.converter._dispatch("codeSpans.after",e,t,n)})),i.subParser("completeHTMLDocument",(function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="<!DOCTYPE HTML>\n",i="",l='<meta charset="utf-8">\n',a="",s="";for(var c in void 0!==n.metadata.parsed.doctype&&(o="<!DOCTYPE "+n.metadata.parsed.doctype+">\n","html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(l='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":i="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":l="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":a=' lang="'+n.metadata.parsed[c]+'"',s+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n';break;default:s+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n'}return e=o+"<html"+a+">\n<head>\n"+i+l+s+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",n.converter._dispatch("completeHTMLDocument.after",e,t,n)})),i.subParser("detab",(function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g,"    ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var n=t,r=4-n.length%4,o=0;o<r;o++)n+=" ";return n}))).replace(/¨A/g,"    ")).replace(/¨B/g,""),n.converter._dispatch("detab.after",e,t,n)})),i.subParser("ellipsis",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),n.converter._dispatch("ellipsis.after",e,t,n)})),i.subParser("emoji",(function(e,t,n){"use strict";return t.emoji?(e=(e=n.converter._dispatch("emoji.before",e,t,n)).replace(/:([\S]+?):/g,(function(e,t){return i.helper.emojis.hasOwnProperty(t)?i.helper.emojis[t]:e})),n.converter._dispatch("emoji.after",e,t,n)):e})),i.subParser("encodeAmpsAndAngles",(function(e,t,n){"use strict";return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;")).replace(/<(?![a-z\/?$!])/gi,"&lt;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)})),i.subParser("encodeBackslashEscapes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,i.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)})),i.subParser("encodeCode",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("encodeCode.before",e,t,n)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeCode.after",e,t,n)})),i.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)})),n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)})),i.subParser("githubCodeBlocks",(function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,r,o,l){var a=t.omitExtraWLInCodeBlocks?"":"\n";return l=i.subParser("encodeCode")(l,t,n),l="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+a+"</code></pre>",l=i.subParser("hashBlock")(l,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:l})-1)+"G\n\n"}))).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e})),i.subParser("hashBlock",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",n.converter._dispatch("hashBlock.after",e,t,n)})),i.subParser("hashCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,l){var a=o+i.subParser("encodeCode")(r,t,n)+l;return"¨C"+(n.gHtmlSpans.push(a)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),n.converter._dispatch("hashCodeTags.after",e,t,n)})),i.subParser("hashElement",(function(e,t,n){"use strict";return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),"\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}})),i.subParser("hashHTMLBlocks",(function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var r=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,r,o){var i=e;return-1!==r.search(/\bmarkdown\b/)&&(i=r+n.converter.makeHtml(t)+o),"\n\n¨K"+(n.gHtmlBlocks.push(i)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"&lt;"+t+"&gt;"})));for(var l=0;l<r.length;++l)for(var a,s=new RegExp("^ {0,3}(<"+r[l]+"\\b[^>]*>)","im"),c="<"+r[l]+"\\b[^>]*>",u="</"+r[l]+">";-1!==(a=i.helper.regexIndexOf(e,s));){var d=i.helper.splitAtIndex(e,a),p=i.helper.replaceRecursiveRegExp(d[1],o,c,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),e=(e=i.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),n.converter._dispatch("hashHTMLBlocks.after",e,t,n)})),i.subParser("hashHTMLSpans",(function(e,t,n){"use strict";function r(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,(function(e){return r(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<[^>]+?>/gi,(function(e){return r(e)})),n.converter._dispatch("hashHTMLSpans.after",e,t,n)})),i.subParser("unhashHTMLSpans",(function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var o=n.gHtmlSpans[r],i=0;/¨C(\d+)C/.test(o);){var l=RegExp.$1;if(o=o.replace("¨C"+l+"C",n.gHtmlSpans[l]),10===i){console.error("maximum nesting of 10 spans reached!!!");break}++i}e=e.replace("¨C"+r+"C",o)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)})),i.subParser("hashPreCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashPreCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,l){var a=o+i.subParser("encodeCode")(r,t,n)+l;return"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),n.converter._dispatch("hashPreCodeTags.after",e,t,n)})),i.subParser("headers",(function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var r=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,l=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c="<h"+r+a+">"+l+"</h"+r+">";return i.subParser("hashBlock")(c,t,n)}))).replace(l,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c=r+1,u="<h"+c+a+">"+l+"</h"+c+">";return i.subParser("hashBlock")(u,t,n)}));var a=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var r,o;if(t.customizedHeaderId){var l=e.match(/\{([^{]+?)}\s*$/);l&&l[1]&&(e=l[1])}return r=e,o=i.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(r=o+r),r=t.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&amp;/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():r.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(r=o+r),n.hashLinkCounts[r]?r=r+"-"+n.hashLinkCounts[r]++:n.hashLinkCounts[r]=1,r}return e=e.replace(a,(function(e,o,l){var a=l;t.customizedHeaderId&&(a=l.replace(/\s?\{([^{]+?)}\s*$/,""));var c=i.subParser("spanGamut")(a,t,n),u=t.noHeaderId?"":' id="'+s(l)+'"',d=r-1+o.length,p="<h"+d+u+">"+c+"</h"+d+">";return i.subParser("hashBlock")(p,t,n)})),n.converter._dispatch("headers.after",e,t,n)})),i.subParser("horizontalRule",(function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var r=i.subParser("hashBlock")("<hr />",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,r),n.converter._dispatch("horizontalRule.after",e,t,n)})),i.subParser("images",(function(e,t,n){"use strict";function r(e,t,r,o,l,a,s,c){var u=n.gUrls,d=n.gTitles,p=n.gDimensions;if(r=r.toLowerCase(),c||(c=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==r&&null!==r||(r=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,i.helper.isUndefined(u[r]))return e;o=u[r],i.helper.isUndefined(d[r])||(c=d[r]),i.helper.isUndefined(p[r])||(l=p[r].width,a=p[r].height)}t=t.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback);var m='<img src="'+(o=o.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&i.helper.isString(c)&&(m+=' title="'+(c=c.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),l&&a&&(m+=' width="'+(l="*"===l?"auto":l)+'"',m+=' height="'+(a="*"===a?"auto":a)+'"'),m+" />"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,n,o,i,l,a,s){return r(e,t,n,o=o.replace(/\s/g,""),i,l,0,s)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,r)).replace(/!\[([^\[\]]+)]()()()()()/g,r),n.converter._dispatch("images.after",e,t,n)})),i.subParser("italicsAndBold",(function(e,t,n){"use strict";function r(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return r(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return r(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return r(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),n.converter._dispatch("italicsAndBold.after",e,t,n)})),i.subParser("lists",(function(e,t,n){"use strict";function r(e,r){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,l=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,r,o,a,s,c,u){u=u&&""!==u.trim();var d=i.subParser("outdent")(s,t,n),p="";return c&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+">"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),r||d.search(/\n{2,}/)>-1?(d=i.subParser("githubCodeBlocks")(d,t,n),d=i.subParser("blockGamut")(d,t,n)):(d=(d=i.subParser("lists")(d,t,n)).replace(/\n$/,""),d=(d=i.subParser("hashHTMLBlocks")(d,t,n)).replace(/\n\n+/g,"\n\n"),d=l?i.subParser("paragraphs")(d,t,n):i.subParser("spanGamut")(d,t,n)),"<li"+p+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),n.gListLevel--,r&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function l(e,n,i){var l=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,a=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?l:a,c="";if(-1!==e.search(s))!function t(u){var d=u.search(s),p=o(e,n);-1!==d?(c+="\n\n<"+n+p+">\n"+r(u.slice(0,d),!!i)+"</"+n+">\n",s="ul"==(n="ul"===n?"ol":"ul")?l:a,t(u.slice(d))):c+="\n\n<"+n+p+">\n"+r(u,!!i)+"</"+n+">\n"}(e);else{var u=o(e,n);c="\n\n<"+n+u+">\n"+r(e,!!i)+"</"+n+">\n"}return c}return e=n.converter._dispatch("lists.before",e,t,n),e+="¨0",e=(e=n.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n){return l(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n,r){return l(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),n.converter._dispatch("lists.after",e,t,n)})),i.subParser("metadata",(function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,r){return n.metadata.parsed[t]=r,""}))}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,n){return r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"}))).replace(/¨M/g,""),n.converter._dispatch("metadata.after",e,t,n)})),i.subParser("outdent",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),n.converter._dispatch("outdent.after",e,t,n)})),i.subParser("paragraphs",(function(e,t,n){"use strict";for(var r=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],l=r.length,a=0;a<l;a++){var s=r[a];s.search(/¨(K|G)(\d+)\1/g)>=0?o.push(s):s.search(/\S/)>=0&&(s=(s=i.subParser("spanGamut")(s,t,n)).replace(/^([ \t]*)/g,"<p>"),s+="</p>",o.push(s))}for(l=o.length,a=0;a<l;a++){for(var c="",u=o[a],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,m=RegExp.$2;c=(c="K"===p?n.gHtmlBlocks[m]:d?i.subParser("encodeCode")(n.ghCodeBlocks[m].text,t,n):n.ghCodeBlocks[m].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,c),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}o[a]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)})),i.subParser("runExtension",(function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),i.subParser("spanGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=i.subParser("codeSpans")(e,t,n),e=i.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=i.subParser("encodeBackslashEscapes")(e,t,n),e=i.subParser("images")(e,t,n),e=i.subParser("anchors")(e,t,n),e=i.subParser("autoLinks")(e,t,n),e=i.subParser("simplifiedAutoLinks")(e,t,n),e=i.subParser("emoji")(e,t,n),e=i.subParser("underline")(e,t,n),e=i.subParser("italicsAndBold")(e,t,n),e=i.subParser("strikethrough")(e,t,n),e=i.subParser("ellipsis")(e,t,n),e=i.subParser("hashHTMLSpans")(e,t,n),e=i.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/  +\n/g,"<br />\n"),n.converter._dispatch("spanGamut.after",e,t,n)})),i.subParser("strikethrough",(function(e,t,n){"use strict";return t.strikethrough&&(e=(e=n.converter._dispatch("strikethrough.before",e,t,n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,r){return function(e){return t.simplifiedAutoLink&&(e=i.subParser("simplifiedAutoLinks")(e,t,n)),"<del>"+e+"</del>"}(r)})),e=n.converter._dispatch("strikethrough.after",e,t,n)),e})),i.subParser("stripLinkDefinitions",(function(e,t,n){"use strict";var r=function(e,r,o,l,a,s,c){return r=r.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?n.gUrls[r]=o.replace(/\s/g,""):n.gUrls[r]=i.subParser("encodeAmpsAndAngles")(o,t,n),s?s+c:(c&&(n.gTitles[r]=c.replace(/"|'/g,"&quot;")),t.parseImgDimensions&&l&&a&&(n.gDimensions[r]={width:l,height:a}),"")};return(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,r)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,r)).replace(/¨0/,"")})),i.subParser("tables",(function(e,t,n){"use strict";if(!t.tables)return e;function r(e,r){return"<td"+r+">"+i.subParser("spanGamut")(e,t,n)+"</td>\n"}function o(e){var o,l=e.split("\n");for(o=0;o<l.length;++o)/^ {0,3}\|/.test(l[o])&&(l[o]=l[o].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(l[o])&&(l[o]=l[o].replace(/\|[ \t]*$/,"")),l[o]=i.subParser("codeSpans")(l[o],t,n);var a,s,c,u,d=l[0].split("|").map((function(e){return e.trim()})),p=l[1].split("|").map((function(e){return e.trim()})),m=[],h=[],f=[],g=[];for(l.shift(),l.shift(),o=0;o<l.length;++o)""!==l[o].trim()&&m.push(l[o].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(o=0;o<p.length;++o)f.push((a=p[o],/^:[ \t]*--*$/.test(a)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(a)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(a)?' style="text-align:center;"':""));for(o=0;o<d.length;++o)i.helper.isUndefined(f[o])&&(f[o]=""),h.push((s=d[o],c=f[o],u=void 0,u="",s=s.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+s.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+c+">"+(s=i.subParser("spanGamut")(s,t,n))+"</th>\n"));for(o=0;o<m.length;++o){for(var v=[],b=0;b<h.length;++b)i.helper.isUndefined(m[o][b]),v.push(r(m[o][b],f[b]));g.push(v)}return function(e,t){for(var n="<table>\n<thead>\n<tr>\n",r=e.length,o=0;o<r;++o)n+=e[o];for(n+="</tr>\n</thead>\n<tbody>\n",o=0;o<t.length;++o){n+="<tr>\n";for(var i=0;i<r;++i)n+=t[o][i];n+="</tr>\n"}return n+"</tbody>\n</table>\n"}(h,g)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,i.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),n.converter._dispatch("tables.after",e,t,n)})),i.subParser("underline",(function(e,t,n){"use strict";return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/(_)/g,i.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e})),i.subParser("unescapeSpecialChars",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,(function(e,t){var n=parseInt(t);return String.fromCharCode(n)})),n.converter._dispatch("unescapeSpecialChars.after",e,t,n)})),i.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,l=0;l<o;++l){var a=i.subParser("makeMarkdown.node")(r[l],t);""!==a&&(n+=a)}return"> "+(n=n.trim()).split("\n").join("\n> ")})),i.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"})),i.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),i.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);n+="*"}return n})),i.subParser("makeMarkdown.header",(function(e,t,n){"use strict";var r=new Array(n+1).join("#"),o="";if(e.hasChildNodes()){o=r+" ";for(var l=e.childNodes,a=l.length,s=0;s<a;++s)o+=i.subParser("makeMarkdown.node")(l[s],t)}return o})),i.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),i.subParser("makeMarkdown.image",(function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="!["+e.getAttribute("alt")+"](",t+="<"+e.getAttribute("src")+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),i.subParser("makeMarkdown.links",(function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,o=r.length;n="[";for(var l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);n+="](",n+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n})),i.subParser("makeMarkdown.list",(function(e,t,n){"use strict";var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,l=o.length,a=e.getAttribute("start")||1,s=0;s<l;++s)void 0!==o[s].tagName&&"li"===o[s].tagName.toLowerCase()&&(r+=("ol"===n?a.toString()+". ":"- ")+i.subParser("makeMarkdown.listItem")(o[s],t),++a);return(r+="\n\x3c!-- --\x3e\n").trim()})),i.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var n="",r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);return/\n$/.test(n)?n=n.split("\n").join("\n    ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):n+="\n",n})),i.subParser("makeMarkdown.node",(function(e,t,n){"use strict";n=n||!1;var r="";if(3===e.nodeType)return i.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":n||(r=i.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":n||(r=i.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":n||(r=i.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":n||(r=i.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":n||(r=i.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":n||(r=i.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":n||(r=i.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":n||(r=i.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":n||(r=i.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":n||(r=i.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":n||(r=i.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":n||(r=i.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":n||(r=i.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":n||(r=i.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":r=i.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":r=i.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":r=i.subParser("makeMarkdown.strong")(e,t);break;case"del":r=i.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":r=i.subParser("makeMarkdown.links")(e,t);break;case"img":r=i.subParser("makeMarkdown.image")(e,t);break;default:r=e.outerHTML+"\n\n"}return r})),i.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);return n.trim()})),i.subParser("makeMarkdown.pre",(function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),i.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);n+="~~"}return n})),i.subParser("makeMarkdown.strong",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="**";for(var r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t);n+="**"}return n})),i.subParser("makeMarkdown.table",(function(e,t){"use strict";var n,r,o="",l=[[],[]],a=e.querySelectorAll("thead>tr>th"),s=e.querySelectorAll("tbody>tr");for(n=0;n<a.length;++n){var c=i.subParser("makeMarkdown.tableCell")(a[n],t),u="---";if(a[n].hasAttribute("style"))switch(a[n].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}l[0][n]=c.trim(),l[1][n]=u}for(n=0;n<s.length;++n){var d=l.push([])-1,p=s[n].getElementsByTagName("td");for(r=0;r<a.length;++r){var m=" ";void 0!==p[r]&&(m=i.subParser("makeMarkdown.tableCell")(p[r],t)),l[d].push(m)}}var h=3;for(n=0;n<l.length;++n)for(r=0;r<l[n].length;++r){var f=l[n][r].length;f>h&&(h=f)}for(n=0;n<l.length;++n){for(r=0;r<l[n].length;++r)1===n?":"===l[n][r].slice(-1)?l[n][r]=i.helper.padEnd(l[n][r].slice(-1),h-1,"-")+":":l[n][r]=i.helper.padEnd(l[n][r],h,"-"):l[n][r]=i.helper.padEnd(l[n][r],h);o+="| "+l[n].join(" | ")+" |\n"}return o.trim()})),i.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var n="";if(!e.hasChildNodes())return"";for(var r=e.childNodes,o=r.length,l=0;l<o;++l)n+=i.subParser("makeMarkdown.node")(r[l],t,!0);return n.trim()})),i.subParser("makeMarkdown.txt",(function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),(t=(t=(t=(t=(t=(t=(t=(t=i.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")})),void 0===(r=function(){"use strict";return i}.call(t,n,t,e))||(e.exports=r)}).call(this)},14471:(e,t,n)=>{var r=n(89504),o=n(3040),i=n(439),l=n(20242);function a(){return Array.prototype.reduce.call(arguments,(function(e,t){return o.resolve(e,t)}))}function s(e){return"\\"===i.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return l(e.replace(/\+/g,"%2B"))}function u(e,t,n){setImmediate((function(){e(t,n)}))}function d(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function p(e,t,n){var r=c(t);try{return String(e(r))}catch(e){throw e.sourceMapData=n,e}}var m=/[#@] sourceMappingURL=([^\s'"]*)/,h=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+m.source+")\\s*\\*/|//(?:"+m.source+"))\\s*");function f(e,t,n,r){var o;try{o=_(e,t)}catch(e){return u(r,e)}if(!o||o.map)return u(r,null,o);n(c(o.url),(function(e,t){if(e)return e.sourceMapData=o,r(e);o.map=String(t);try{o.map=d(o.map,o)}catch(e){return r(e)}r(null,o)}))}function g(e,t,n){var r=_(e,t);return!r||r.map||(r.map=p(n,r.url,r),r.map=d(r.map,r)),r}var v=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,b=/^(?:application|text)\/json$/,y="utf-8";function _(e,t){t=s(t);var n=function(e){var t=e.match(h);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var o=n.match(v);if(o){var i=o[1]||"text/plain",l=o[2]||"",c=o[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!b.test(i)){var p=new Error("Unuseful data uri mime type: "+i);throw p.sourceMapData=u,p}try{u.map=d(";base64"===l?function(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return r(e);var t=function(e){for(var t=r(e),n=t.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=t.charCodeAt(i);return o}(e);return new TextDecoder(y,{fatal:!0}).decode(t)}(c):decodeURIComponent(c),u)}catch(p){throw p.sourceMapData=u,p}return u}var m=a(t,n);return{sourceMappingURL:n,url:m,sourcesRelativeTo:m,map:null}}function k(e,t,n,r,o){"function"==typeof r&&(o=r,r={});var i=e.sources?e.sources.length:0,l={sourcesResolved:[],sourcesContent:[]};if(0!==i){var a=function(){0==--i&&o(null,l)};C(e,t,r,(function(e,t,r){if(l.sourcesResolved[r]=e,"string"==typeof t)l.sourcesContent[r]=t,u(a,null);else{var o=c(e);n(o,(function(e,t){l.sourcesContent[r]=e||String(t),a()}))}}))}else u(o,null,l)}function x(e,t,n,r){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(C(e,t,r,(function(e,t,r){if(o.sourcesResolved[r]=e,null!==n)if("string"==typeof t)o.sourcesContent[r]=t;else{var i=c(e);try{o.sourcesContent[r]=String(n(i))}catch(e){o.sourcesContent[r]=e}}})),o):o}var w=/\/?$/;function C(e,t,n,r){var o;n=n||{},t=s(t);for(var i=0,l=e.sources.length;i<l;i++)o=null,"string"==typeof n.sourceRoot?o=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(o=e.sourceRoot),r(null===o||""===o?a(t,e.sources[i]):a(t,o.replace(w,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}e.exports={resolveSourceMap:f,resolveSourceMapSync:g,resolveSources:k,resolveSourcesSync:x,resolve:function(e,t,n,r,o){if("function"==typeof r&&(o=r,r={}),null===e){var i={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},l=c(t);n(l,(function(e,t){if(e)return e.sourceMapData=i,o(e);i.map=String(t);try{i.map=d(i.map,i)}catch(e){return o(e)}a(i)}))}else f(e,t,n,(function(e,t){return e?o(e):t?void a(t):o(null,null)}));function a(e){k(e.map,e.sourcesRelativeTo,n,r,(function(t,n){if(t)return o(t);e.sourcesResolved=n.sourcesResolved,e.sourcesContent=n.sourcesContent,o(null,e)}))}},resolveSync:function(e,t,n,r){var o;if(null===e)(o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=p(n,t,o),o.map=d(o.map,o);else if(!(o=g(e,t,n)))return null;var i=x(o.map,o.sourcesRelativeTo,n,r);return o.sourcesResolved=i.sourcesResolved,o.sourcesContent=i.sourcesContent,o},parseMapToJSON:d}},7402:(e,t,n)=>{var r=n(23114),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function l(){this._array=[],this._set=i?new Map:Object.create(null)}l.fromArray=function(e,t){for(var n=new l,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},l.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},l.prototype.add=function(e,t){var n=i?e:r.toSetString(e),l=i?this.has(e):o.call(this._set,n),a=this._array.length;l&&!t||this._array.push(e),l||(i?this._set.set(e,a):this._set[n]=a)},l.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},l.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},l.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},l.prototype.toArray=function(){return this._array.slice()},t.I=l},93719:(e,t,n)=>{var r=n(8407);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,l,a,s=e.length,c=0,u=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<u,u+=5}while(o);n.value=(a=(l=c)>>1,1==(1&l)?-a:a),n.rest=t}},8407:(e,t)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},54397:(e,t)=>{function n(e,r,o,i,l,a){var s=Math.floor((r-e)/2)+e,c=l(o,i[s],!0);return 0===c?s:c>0?r-s>1?n(s,r,o,i,l,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:s:s-e>1?n(e,s,o,i,l,a):a==t.LEAST_UPPER_BOUND?s:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var l=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&0===o(r[l],r[l-1],!0);)--l;return l}},3307:(e,t,n)=>{var r=n(23114);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,l,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,l=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=l||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},90384:(e,t)=>{function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o<i){var l=o-1;n(e,(u=o,d=i,Math.round(u+Math.random()*(d-u))),i);for(var a=e[i],s=o;s<i;s++)t(e[s],a)<=0&&n(e,l+=1,s);n(e,l+1,s);var c=l+1;r(e,t,o,c-1),r(e,t,c+1,i)}var u,d}t.U=function(e,t){r(e,t,0,e.length-1)}},22799:(e,t,n)=>{var r=n(23114),o=n(54397),i=n(7402).I,l=n(93719),a=n(90384).U;function s(e,t){var n=e;return"string"==typeof e&&(n=r.parseSourceMapInput(e)),null!=n.sections?new d(n,t):new c(n,t)}function c(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),l=r.getArg(n,"sources"),a=r.getArg(n,"names",[]),s=r.getArg(n,"sourceRoot",null),c=r.getArg(n,"sourcesContent",null),u=r.getArg(n,"mappings"),d=r.getArg(n,"file",null);if(o!=this._version)throw new Error("Unsupported version: "+o);s&&(s=r.normalize(s)),l=l.map(String).map(r.normalize).map((function(e){return s&&r.isAbsolute(s)&&r.isAbsolute(e)?r.relative(s,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(l,!0),this._absoluteSources=this._sources.toArray().map((function(e){return r.computeSourceURL(s,e,t)})),this.sourceRoot=s,this.sourcesContent=c,this._mappings=u,this._sourceMapURL=t,this.file=d}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),l=r.getArg(n,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=l.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=r.getArg(e,"offset"),o=r.getArg(n,"line"),i=r.getArg(n,"column");if(o<a.line||o===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new s(r.getArg(e,"map"),t)}}))}s.fromSourceMap=function(e,t){return c.fromSourceMap(e,t)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},s.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(e,t,n){var o,i=t||null;switch(n||s.GENERATED_ORDER){case s.GENERATED_ORDER:o=this._generatedMappings;break;case s.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=r.computeSourceURL(l,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,i)},s.prototype.allGeneratedPositionsFor=function(e){var t=r.getArg(e,"line"),n={source:r.getArg(e,"source"),originalLine:t,originalColumn:r.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],l=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(l>=0){var a=this._originalMappings[l];if(void 0===e.column)for(var s=a.originalLine;a&&a.originalLine===s;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l]}return i},t.SourceMapConsumer=s,c.prototype=Object.create(s.prototype),c.prototype.consumer=s,c.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},c.fromSourceMap=function(e,t){var n=Object.create(c.prototype),o=n._names=i.fromArray(e._names.toArray(),!0),l=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map((function(e){return r.computeSourceURL(n.sourceRoot,e,t)}));for(var s=e._mappings.toArray().slice(),d=n.__generatedMappings=[],p=n.__originalMappings=[],m=0,h=s.length;m<h;m++){var f=s[m],g=new u;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=o.indexOf(f.name)),p.push(g)),d.push(g)}return a(n.__originalMappings,r.compareByOriginalPositions),n},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),c.prototype._parseMappings=function(e,t){for(var n,o,i,s,c,d=1,p=0,m=0,h=0,f=0,g=0,v=e.length,b=0,y={},_={},k=[],x=[];b<v;)if(";"===e.charAt(b))d++,b++,p=0;else if(","===e.charAt(b))b++;else{for((n=new u).generatedLine=d,s=b;s<v&&!this._charIsMappingSeparator(e,s);s++);if(i=y[o=e.slice(b,s)])b+=o.length;else{for(i=[];b<s;)l.decode(e,b,_),c=_.value,b=_.rest,i.push(c);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");y[o]=i}n.generatedColumn=p+i[0],p=n.generatedColumn,i.length>1&&(n.source=f+i[1],f+=i[1],n.originalLine=m+i[2],m=n.originalLine,n.originalLine+=1,n.originalColumn=h+i[3],h=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),x.push(n),"number"==typeof n.originalLine&&k.push(n)}a(x,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=x,a(k,r.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(e,t,n,r,i,l){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,l)},c.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositionsDeflated,r.getArg(e,"bias",s.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=r.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var l=r.getArg(o,"name",null);return null!==l&&(l=this._names.at(l)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:l}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){var l=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(l))return this.sourcesContent[this._sources.indexOf(l)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",s.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(s.prototype),d.prototype.constructor=s,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),d.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=o.search(t,this._sections,(function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},d.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},d.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(r.getArg(e,"source"))){var o=n.consumer.generatedPositionFor(e);if(o)return{line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,l=0;l<i.length;l++){var s=i[l],c=o.consumer._sources.at(s.source);c=r.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;s.name&&(u=o.consumer._names.at(s.name),this._names.add(u),u=this._names.indexOf(u));var d={source:c,generatedLine:s.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(o.generatedOffset.generatedLine===s.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}a(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),a(this.__originalMappings,r.compareByOriginalPositions)}},67819:(e,t,n)=>{var r=n(93719),o=n(23114),i=n(7402).I,l=n(3307).H;function a(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new l,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var l=e.sourceContentFor(r);null!=l&&n.setSourceContent(r,l)})),n},a.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var l=this._sourceRoot;null!=l&&(r=o.relative(l,r));var a=new i,s=new i;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=l&&(t.source=o.relative(l,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||a.has(c)||a.add(c);var u=t.name;null==u||s.has(u)||s.add(u)}),this),this._sources=a,this._names=s,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=l&&(t=o.relative(l,t)),this.setSourceContent(t,r))}),this)},a.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,l=0,a=1,s=0,c=0,u=0,d=0,p="",m=this._mappings.toArray(),h=0,f=m.length;h<f;h++){if(e="",(t=m[h]).generatedLine!==a)for(l=0;t.generatedLine!==a;)e+=";",a++;else if(h>0){if(!o.compareByGeneratedPositionsInflated(t,m[h-1]))continue;e+=","}e+=r.encode(t.generatedColumn-l),l=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},a.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},25421:(e,t,n)=>{var r=n(67819).SourceMapGenerator,o=n(23114),i=/(\r?\n)/,l="$$$isSourceNode$$$";function a(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[l]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,l=e.split(i),s=0,c=function(){return e()+(e()||"");function e(){return s<l.length?l[s++]:void 0}},u=1,d=0,p=null;return t.eachMapping((function(e){if(null!==p){if(!(u<e.generatedLine)){var t=(n=l[s]||"").substr(0,e.generatedColumn-d);return l[s]=n.substr(e.generatedColumn-d),d=e.generatedColumn,m(p,t),void(p=e)}m(p,c()),u++,d=0}for(;u<e.generatedLine;)r.add(c()),u++;if(d<e.generatedColumn){var n=l[s]||"";r.add(n.substr(0,e.generatedColumn)),l[s]=n.substr(e.generatedColumn),d=e.generatedColumn}p=e}),this),s<l.length&&(p&&m(p,c()),r.add(l.splice(s).join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=n&&(e=o.join(n,e)),r.setSourceContent(e,i))})),r;function m(e,t){if(null===e||void 0===e.source)r.add(t);else{var i=n?o.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,i,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[l]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[l]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][l]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},a.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,l=null,a=null,s=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&l===r.line&&a===r.column&&s===r.name||n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,l=r.line,a=r.column,s=r.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,u=e.length;c<u;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===u?(i=null,o=!1):o&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}}},23114:(e,t)=>{t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function l(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var l,a=t.isAbsolute(n),s=n.split(/\/+/),c=0,u=s.length-1;u>=0;u--)"."===(l=s[u])?s.splice(u,1):".."===l?c++:c>0&&(""===l?(s.splice(u+1,c),c=0):(s.splice(u,2),c--));return""===(n=s.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:l(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}t.urlParse=o,t.urlGenerate=i,t.normalize=l,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=s?c:function(e){return u(e)?"$"+e:e},t.fromSetString=s?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=d(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var s=r.path.lastIndexOf("/");s>=0&&(r.path=r.path.substring(0,s+1))}t=a(i(r),t)}return l(t)}},20065:(e,t,n)=>{t.SourceMapGenerator=n(67819).SourceMapGenerator,t.SourceMapConsumer=n(22799).SourceMapConsumer,n(25421)},28771:e=>{"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)}var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},i=Object.prototype.hasOwnProperty||function(e,t){return t in e};function l(e){if("object"==typeof e&&null!==e){var i;if(n(e))i=[];else if("[object Date]"===t(e))i=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))i=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))i={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))i=Object(e);else if(Object.create&&Object.getPrototypeOf)i=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)i={};else{var l=e.constructor&&e.constructor.prototype||e.__proto__||{},a=function(){};a.prototype=l,i=new a}return r(o(e),(function(t){i[t]=e[t]})),i}return e}function a(e,t,a){var s=[],c=[],u=!0;return function e(d){var p=a?l(d):d,m={},h=!0,f={node:p,node_:d,path:[].concat(s),parent:c[c.length-1],parents:c,key:s[s.length-1],isRoot:0===s.length,level:s.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(h=!1)},delete:function(e){delete f.parent.node[f.key],e&&(h=!1)},remove:function(e){n(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(h=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){h=!1}};if(!u)return f;function g(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=o(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<c.length;e++)if(c[e].node_===d){f.circular=c[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}g();var v=t.call(f,f.node);return void 0!==v&&f.update&&f.update(v),m.before&&m.before.call(f,f.node),h?("object"!=typeof f.node||null===f.node||f.circular||(c.push(f),g(),r(f.keys,(function(t,n){s.push(t),m.pre&&m.pre.call(f,f.node[t],t);var r=e(f.node[t]);a&&i.call(f.node,t)&&(f.node[t]=r.node),r.isLast=n===f.keys.length-1,r.isFirst=0===n,m.post&&m.post.call(f,r),s.pop()})),c.pop()),m.after&&m.after.call(f,f.node),f):f}(e).node}function s(e){this.value=e}function c(e){return new s(e)}s.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!i.call(t,r))return;t=t[r]}return t},s.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!i.call(t,r))return!1;t=t[r]}return!0},s.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];i.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},s.prototype.map=function(e){return a(this.value,e,!0)},s.prototype.forEach=function(e){return this.value=a(this.value,e,!1),this.value},s.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(r=e.call(this,r,t))})),r},s.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},s.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},s.prototype.clone=function(){var e=[],t=[];return function n(i){for(var a=0;a<e.length;a++)if(e[a]===i)return t[a];if("object"==typeof i&&null!==i){var s=l(i);return e.push(i),t.push(s),r(o(i),(function(e){s[e]=n(i[e])})),e.pop(),t.pop(),s}return i}(this.value)},r(o(s.prototype),(function(e){c[e]=function(t){var n=[].slice.call(arguments,1),r=new s(t);return r[e].apply(r,n)}})),e.exports=c},3040:(e,t,n)=>{"use strict";var r=n(74870),o=n(54783);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=y(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var l=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),d=["%","/","?",";","#"].concat(u),p=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(54415);function y(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var y=e=c.join(a);if(y=y.trim(),!n&&1===e.split("#").length){var _=s.exec(y);if(_)return this.path=y,this.href=y,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var k=l.exec(y);if(k){var x=(k=k[0]).toLowerCase();this.protocol=x,y=y.substr(k.length)}if(n||k||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===y.substr(0,2);!w||k&&g[k]||(y=y.substr(2),this.slashes=!0)}if(!g[k]&&(w||k&&!v[k])){for(var C,E,S=-1,I=0;I<p.length;I++)-1!==(T=y.indexOf(p[I]))&&(-1===S||T<S)&&(S=T);for(-1!==(E=-1===S?y.lastIndexOf("@"):y.lastIndexOf("@",S))&&(C=y.slice(0,E),y=y.slice(E+1),this.auth=decodeURIComponent(C)),S=-1,I=0;I<d.length;I++){var T;-1!==(T=y.indexOf(d[I]))&&(-1===S||T<S)&&(S=T)}-1===S&&(S=y.length),this.host=y.slice(0,S),y=y.slice(S),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var B=this.hostname.split(/\./),P=(I=0,B.length);I<P;I++){var A=B[I];if(A&&!A.match(m)){for(var L="",R=0,D=A.length;R<D;R++)A.charCodeAt(R)>127?L+="x":L+=A[R];if(!L.match(m)){var M=B.slice(0,I),O=B.slice(I+1),F=A.match(h);F&&(M.push(F[1]),O.unshift(F[2])),O.length&&(y="/"+O.join(".")+y),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var Z=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+Z,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!f[x])for(I=0,P=u.length;I<P;I++){var z=u[I];if(-1!==y.indexOf(z)){var H=encodeURIComponent(z);H===z&&(H=escape(z)),y=y.split(z).join(H)}}var V=y.indexOf("#");-1!==V&&(this.hash=y.substr(V),y=y.slice(0,V));var W=y.indexOf("?");if(-1!==W?(this.search=y.substr(W),this.query=y.substr(W+1),t&&(this.query=b.parse(this.query)),y=y.slice(0,W)):t&&(this.search="",this.query={}),y&&(this.pathname=y),v[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Z=this.pathname||"";var U=this.search||"";this.path=Z+U}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,l="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(l=b.stringify(this.query));var a=this.search||l&&"?"+l||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),l=0;l<r.length;l++){var a=r[l];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),c=0;c<s.length;c++){var u=s[c];"protocol"!==u&&(n[u]=e[u])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var m=d[p];n[m]=e[m]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var f=n.pathname||"",b=n.search||"";n.path=f+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),k=_||y||n.host&&e.pathname,x=k,w=n.pathname&&n.pathname.split("/")||[],C=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(C&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),k=k&&(""===h[0]||""===w[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=h;else if(h.length)w||(w=[]),w.pop(),w=w.concat(h),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search))return C&&(n.hostname=n.host=w.shift(),(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,I=0,T=w.length;T>=0;T--)"."===(E=w[T])?w.splice(T,1):".."===E?(w.splice(T,1),I++):I&&(w.splice(T,1),I--);if(!k&&!x)for(;I--;I)w.unshift("..");!k||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var N,B=""===w[0]||w[0]&&"/"===w[0].charAt(0);return C&&(n.hostname=n.host=B?"":w.length?w.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),(k=k||n.host&&w.length)&&!B&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},54783:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},65311:e=>{"use strict";e.exports=jQuery},37019:()=>{},96344:()=>{},439:()=>{}},e=>{e.O(0,[351],(()=>(93574,e(e.s=93574)))),e.O()}]);

Youez - 2016 - github.com/yon3zu
LinuXploit