"use strict";(globalThis.webpackChunkextendify=globalThis.webpackChunkextendify||[]).push([[701],{4701:(e,t,n)=>{var o=n(9196);const a=window.wp.domReady;var r=n.n(a),i=n(9307),l=n(3689),s=n(5736),c=n(6409),d=n(3773),m=n(1984),u=n(4310),p=n(9526),f=n(7231),h=n(5024),g=n(6993),y=n(3967),x=n.n(y),b=n(6989),w=n.n(b),v=n(7403),E=n(270),_=n(782),L=n(7713),T=n(424),C=n(4981);const k=({text:e,reset:t})=>(0,o.createElement)("div",{className:"rounded-lg border border-solid border-red-500 bg-red-100 p-5"},(0,o.createElement)("p",{className:"m-0 mb-4 text-sm text-gray-800"},e),t&&(0,o.createElement)("p",{className:"m-0"},(0,o.createElement)("button",{type:"button",className:"cursor-pointer border-none bg-transparent p-0 underline",onClick:t},(0,s.__)("Please try again.","extendify-local")))),S=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("g",{clipPath:"url(#clip0_2114_35675)"},(0,o.createElement)("path",{d:"M11.2266 6.0469V4.93948C11.0919 4.889 10.9613 4.82828 10.8359 4.75784C10.345 4.46641 9.97524 4.00815 9.79416 3.46671C9.61308 2.92526 9.63277 2.33675 9.84962 1.80862C9.97012 1.5206 10.1452 1.25862 10.3652 1.03713C10.5846 0.817735 10.8447 0.643251 11.1309 0.523459C11.4193 0.403518 11.7287 0.342425 12.041 0.343772C12.5103 0.343706 12.9689 0.48286 13.359 0.74362C13.7491 1.00438 14.0531 1.37502 14.2324 1.80862C14.4719 2.38837 14.4719 3.03941 14.2324 3.61917C14.1131 3.90723 13.9378 4.16878 13.7168 4.3887L13.7051 4.40042C13.566 4.53722 13.4113 4.65718 13.2442 4.75784C13.1202 4.83102 12.9894 4.89186 12.8535 4.93948V6.0469H18.416C19.2143 6.04948 19.9792 6.36788 20.5435 6.93255C21.1078 7.49722 21.4257 8.26227 21.4278 9.06058V9.50784H22.459C22.8681 9.50939 23.2599 9.67272 23.549 9.96217C23.8381 10.2516 24.0009 10.6437 24.002 11.0528V14.6407C24.0009 15.0497 23.8381 15.4418 23.549 15.7313C23.2599 16.0207 22.8681 16.184 22.459 16.1856H21.4336V16.5899C21.431 17.389 21.1122 18.1547 20.5467 18.7194C19.9812 19.2841 19.2152 19.602 18.416 19.6036H10.7852L6.21094 23.5313C6.16052 23.5746 6.10202 23.6075 6.03882 23.6281C5.97562 23.6487 5.90897 23.6566 5.84271 23.6514C5.77644 23.6461 5.71188 23.6278 5.65273 23.5974C5.59357 23.5671 5.54101 23.5254 5.49805 23.4747C5.41215 23.3745 5.36809 23.2451 5.37501 23.1133L5.61915 19.5977H5.57813C4.78086 19.5956 4.01681 19.2781 3.45287 18.7146C2.88893 18.151 2.57094 17.3871 2.56836 16.5899V16.1856H1.54297C1.13355 16.1846 0.74119 16.0215 0.451684 15.7319C0.162178 15.4424 -0.00092183 15.0501 -0.00195312 14.6407L-0.00195312 11.0528C-0.000924304 10.6437 0.161907 10.2516 0.450991 9.96217C0.740076 9.67272 1.13193 9.50939 1.54102 9.50784H2.56836V9.05862C2.56991 8.26068 2.88744 7.49583 3.45149 6.93141C4.01554 6.367 4.78019 6.04897 5.57813 6.0469H11.2266ZM16.1582 9.58597C16.5198 9.58597 16.8732 9.69319 17.1739 9.89406C17.4745 10.0949 17.7088 10.3805 17.8472 10.7145C17.9856 11.0485 18.0218 11.4161 17.9512 11.7707C17.8807 12.1254 17.7066 12.4511 17.4509 12.7068C17.1952 12.9624 16.8695 13.1366 16.5149 13.2071C16.1602 13.2776 15.7927 13.2414 15.4586 13.1031C15.1246 12.9647 14.8391 12.7304 14.6382 12.4297C14.4373 12.1291 14.3301 11.7757 14.3301 11.4141C14.3301 10.9292 14.5227 10.4643 14.8655 10.1214C15.2084 9.77857 15.6734 9.58597 16.1582 9.58597ZM7.8418 9.58597C8.20337 9.58597 8.55682 9.69319 8.85746 9.89406C9.15809 10.0949 9.39241 10.3805 9.53077 10.7145C9.66914 11.0485 9.70534 11.4161 9.6348 11.7707C9.56427 12.1254 9.39015 12.4511 9.13448 12.7068C8.87882 12.9624 8.55308 13.1366 8.19845 13.2071C7.84383 13.2776 7.47626 13.2414 7.14221 13.1031C6.80816 12.9647 6.52265 12.7304 6.32177 12.4297C6.1209 12.1291 6.01368 11.7757 6.01368 11.4141C6.01368 10.9292 6.20628 10.4643 6.54912 10.1214C6.89196 9.77857 7.35695 9.58597 7.8418 9.58597ZM9.0879 15.711C9.06032 15.6892 9.03541 15.6643 9.01368 15.6368C8.95038 15.5625 8.91453 15.4687 8.91212 15.3711C8.91035 15.2731 8.94204 15.1773 9.00196 15.0996C9.02434 15.0714 9.0499 15.0459 9.07813 15.0235C9.18557 14.9388 9.31767 14.8915 9.45442 14.8887C9.59117 14.8859 9.72511 14.9277 9.83595 15.0078C10.1697 15.2712 10.5402 15.4844 10.9356 15.6407C11.2762 15.7724 11.6387 15.8387 12.0039 15.836C12.3737 15.8281 12.7393 15.7554 13.084 15.6211C13.4841 15.4612 13.8616 15.2498 14.207 14.9922C14.3204 14.9149 14.4558 14.8766 14.5928 14.8829C14.7298 14.8893 14.8611 14.94 14.9668 15.0274C14.9933 15.0518 15.0175 15.0786 15.0391 15.1075C15.0965 15.1867 15.1254 15.2831 15.1211 15.3809C15.1128 15.4787 15.073 15.5712 15.0078 15.6446C14.9831 15.6727 14.9548 15.6977 14.9238 15.7188C14.4846 16.0434 14.0029 16.3063 13.4922 16.5C13.0218 16.6774 12.5242 16.7719 12.0215 16.7793C11.5182 16.7864 11.0179 16.7016 10.5449 16.5293C10.0237 16.3343 9.53556 16.0603 9.09766 15.7168L9.0879 15.711ZM18.4141 7.06253H5.57813C5.04903 7.06459 4.54222 7.27582 4.16826 7.65014C3.79431 8.02445 3.58358 8.53147 3.58203 9.06058V16.5899C3.58358 17.119 3.79431 17.626 4.16826 18.0003C4.54222 18.3746 5.04903 18.5859 5.57813 18.5879H6.19727C6.33117 18.5979 6.45571 18.6604 6.54384 18.7617C6.63197 18.863 6.67658 18.995 6.66797 19.1289L6.47266 21.9766L10.2422 18.7325C10.2891 18.6856 10.3448 18.6485 10.4062 18.6233C10.4676 18.5982 10.5333 18.5855 10.5996 18.586H18.4121C18.9412 18.5839 19.448 18.3727 19.822 17.9984C20.1959 17.6241 20.4067 17.117 20.4082 16.5879V9.05862C20.4072 8.52988 20.1968 8.02306 19.8231 7.649C19.4494 7.27494 18.9428 7.06408 18.4141 7.06253Z"})),(0,o.createElement)("defs",null,(0,o.createElement)("clipPath",{id:"clip0_2114_35675"},(0,o.createElement)("rect",{width:"24",height:"23.3106",transform:"translate(0 0.34375)"})))),N=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M3.51 6.03L11.02 9.25L3.5 8.25L3.51 6.03ZM11.01 14.75L3.5 17.97V15.75L11.01 14.75ZM1.51 3L1.5 10L16.5 12L1.5 14L1.51 21L22.5 12L1.51 3Z"})),R=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M14.1818 5H7.63636C7.03273 5 6.51636 5.36364 6.29818 5.88727L4.10182 11.0145C4.03636 11.1818 4 11.3564 4 11.5455V13C4 13.8 4.65455 14.4545 5.45455 14.4545H10.0436L9.35273 17.7782L9.33091 18.0109C9.33091 18.3091 9.45455 18.5855 9.65091 18.7818L10.4218 19.5455L15.2145 14.7527C15.4764 14.4909 15.6364 14.1273 15.6364 13.7273V6.45455C15.6364 5.65455 14.9818 5 14.1818 5ZM14.1818 13.7273L11.0255 16.8836L12 13H5.45455V11.5455L7.63636 6.45455H14.1818V13.7273ZM17.0909 5H20V13.7273H17.0909V5Z"})),A=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M9.81818 19.5455H16.3636C16.9673 19.5455 17.4836 19.1818 17.7018 18.6582L19.8982 13.5309C19.9636 13.3636 20 13.1891 20 13V11.5455C20 10.7455 19.3455 10.0909 18.5455 10.0909H13.9564L14.6473 6.76727L14.6691 6.53455C14.6691 6.23636 14.5455 5.96 14.3491 5.76364L13.5782 5L8.78545 9.79273C8.52364 10.0545 8.36364 10.4182 8.36364 10.8182V18.0909C8.36364 18.8909 9.01818 19.5455 9.81818 19.5455ZM9.81818 10.8182L12.9745 7.66182L12 11.5455H18.5455V13L16.3636 18.0909H9.81818V10.8182ZM4 10.8182H6.90909V19.5455H4V10.8182Z"})),P=(0,o.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z"}));(0,o.createElement)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)("path",{d:"M15.5 4V11H5.67L4.5 12.17V4H15.5ZM16.5 2H3.5C2.95 2 2.5 2.45 2.5 3V17L6.5 13H16.5C17.05 13 17.5 12.55 17.5 12V3C17.5 2.45 17.05 2 16.5 2ZM21.5 6H19.5V15H6.5V17C6.5 17.55 6.95 18 7.5 18H18.5L22.5 22V7C22.5 6.45 22.05 6 21.5 6Z"}));var q=n(2200);const H=["siteId","partnerId","wpVersion","wpLanguage","devbuild","isBlockTheme","userId","siteProfile"],{showAIConsent:Z,userGaveConsent:I}=T.y.getState(),D={...Object.fromEntries(Object.entries(window.extSharedData).filter((([e])=>H.includes(e)))),showAIConsent:Z,userGaveConsent:I},M=({answerId:e})=>{const[t,n]=(0,i.useState)(void 0);return(0,i.useEffect)((()=>{e&&void 0!==t&&(({answerId:e,rating:t})=>{fetch(`${q.Yy}/api/chat/rate-answer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({answerId:e,rating:t})})})({answerId:e,rating:t})}),[t,e]),(0,o.createElement)("div",{className:"mt-1 flex items-center justify-end gap-0.5 text-right"},(0,o.createElement)("button",{type:"button","aria-pressed":1===t,"aria-live":"polite",onClick:()=>n((e=>1===e?0:1)),"aria-label":1===t?(0,s.__)("Remove rating","extendify-local"):(0,s.__)("Rate that this answer was helpful","extendify-local"),className:x()("m-0 h-5 w-5 cursor-pointer border-0 bg-transparent p-0 hover:text-design-main",{"text-design-main":1===t,"text-gray-500":1!==t})},(0,o.createElement)(m.Z,{className:"fill-current",icon:A})),(0,o.createElement)("button",{type:"button","aria-pressed":-1===t,"aria-live":"polite",onClick:()=>n((e=>-1===e?0:-1)),"aria-label":-1===t?(0,s.__)("Remove rating","extendify-local"):(0,s.__)("Rate that this answer was not helpful","extendify-local"),className:x()("m-0 h-5 w-5 cursor-pointer border-0 bg-transparent p-0 hover:text-design-main",{"text-design-main":-1===t,"text-gray-500":-1!==t})},(0,o.createElement)(m.Z,{className:"fill-current",icon:R})))},F={experienceLevel:"beginner",currentQuestion:void 0},O=(0,E.Ue)((0,_.tJ)((0,_.mW)(((e,t)=>({history:[],...F,setCurrentQuestion:t=>e({currentQuestion:t}),setExperienceLevel:t=>e({experienceLevel:t}),addHistory:t=>e((e=>({history:[t,...e.history.filter((({answerId:e})=>e!==t.answerId)).slice(0,9)]}))),hasHistory:()=>t().history.length>0,clearHistory:()=>e({history:[]}),deleteFromHistory:t=>e((e=>({history:e.history.filter((({answerId:e})=>e!==t.answerId))}))),historyCount:()=>t().history.length,reset:()=>e({...F})})),{name:"Extendify Chat History"}),{name:"extendify-chat-history",storage:(0,_.FL)((()=>localStorage))})),V=({question:e,answer:t,reset:n,error:a,answerId:r})=>{var l;const c=(0,i.useRef)(null),{addHistory:d,setCurrentQuestion:u}=O(),p=(0,C.pasteHandler)({plainText:null!==(l=t?.replace(/[\r\n]+/g,"
"))&&void 0!==l?l:""}),f=Array.isArray(p)?(0,C.serialize)(p):p;return(0,i.useEffect)((()=>{if(!r)return;const t={answerId:r,htmlAnswer:f,question:e,time:Date.now()};d(t),u(t)}),[r,f,d,e,u]),a?(0,o.createElement)("div",{className:"overflow-y-auto p-6 pb-10",ref:c},(0,o.createElement)("div",{className:"relative mb-8 ml-4 flex justify-end"},(0,o.createElement)(k,{text:(0,s.__)("Oops! We were unable to send your question.","extendify-local"),reset:n}))):(0,o.createElement)("div",{className:"flex h-full flex-col"},(0,o.createElement)("div",{className:"flex-grow overflow-y-auto p-6 pb-10",ref:c},(0,o.createElement)("div",{className:"relative mb-8 ml-4 flex justify-end"},(0,o.createElement)("div",{className:"m-0 rounded-lg bg-gray-800 p-5 text-sm text-design-text"},e)),(0,o.createElement)("div",{className:"relative"},(0,o.createElement)("div",{className:"absolute z-10 -ml-2 -mt-4 flex items-center rounded-full bg-design-main p-2"},(0,o.createElement)(m.Z,{icon:S,className:"h-4 w-4 fill-current text-design-text"})),(0,o.createElement)("div",{className:x()("m-0 inline-block rounded-lg bg-gray-100 p-5 text-sm text-gray-800",{"animate-pulse bg-gray-300":"..."===t,"bg-gray-100":"..."!==t}),dangerouslySetInnerHTML:{__html:f}}),r&&(0,o.createElement)(M,{answerId:r}))),(0,o.createElement)("div",{className:"ask-another-question relative flex justify-center p-4"},(0,o.createElement)("button",{type:"button",onClick:n,className:"flex cursor-pointer items-center gap-2 rounded-sm border-none bg-design-main px-4 py-2 text-sm text-design-text rtl:flex-row-reverse"},(0,s.__)("Ask Another Question","extendify-local"),(0,o.createElement)(m.Z,{icon:N,className:"h-6 fill-current text-design-text rtl:rotate-180"}))))};var B=n(5202);const z=({setShowHistory:e})=>{const{history:t,setCurrentQuestion:n,deleteFromHistory:a}=O();return(0,i.useEffect)((()=>{t.length>0||setTimeout((()=>e(!1)),750)}),[t,e]),(0,o.createElement)("div",{className:"relative h-full"},(0,o.createElement)("div",{className:"flex items-center justify-between bg-gray-100 p-4 px-6 text-gray-900"},(0,o.createElement)("h1",{className:"m-0 p-0 text-sm font-medium"},(0,s.__)("Chat History","extendify-local")),(0,o.createElement)("button",{type:"button",onClick:()=>e(!1),className:"m-0 cursor-pointer border-0 bg-transparent fill-current p-0 text-design-text"},(0,o.createElement)(m.Z,{icon:B.Z,size:16}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Close history","extendify-local")))),(0,o.createElement)("ul",{className:"m-0 mt-3 h-full overflow-y-auto p-0"},[...t].sort(((e,t)=>e.time-t.time)).map((e=>(0,o.createElement)("li",{key:e.answerId,className:"group flex gap-1 px-2 pr-4 rtl:flex-row-reverse"},(0,o.createElement)("button",{type:"button",onClick:()=>a(e),className:"m-0 cursor-pointer border-0 bg-transparent p-0 opacity-0 group-hover:opacity-100"},(0,o.createElement)(m.Z,{icon:B.Z,size:12}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Remove from history","extendify-local"))),(0,o.createElement)("button",{type:"button",className:"m-0 flex w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100",onClick:()=>n(e)},(0,o.createElement)("div",null,(0,o.createElement)("span",{className:"overflow-hidden truncate text-ellipsis"},e.question.substring(0,100))),(0,o.createElement)("span",null,(0,o.createElement)(m.Z,{className:"fill-current text-gray-900 rtl:rotate-180",icon:P}))))))))};var j=n(5609),W=n(3279),$=n(8184);const U=({setShowHistory:e})=>{const t={beginner:(0,s.__)("Beginner","extendify-local"),intermediate:(0,s.__)("Intermediate","extendify-local"),advanced:(0,s.__)("Advanced","extendify-local")},{historyCount:n,hasHistory:a,experienceLevel:r,setExperienceLevel:i}=O();return(0,o.createElement)("nav",{className:"absolute right-0 z-10 mx-4 mt-3 flex items-center justify-between gap-2"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)(j.Dropdown,{className:"flex",contentClassName:"origin-top-right rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none",popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,o.createElement)("span",null,(0,o.createElement)(j.Icon,{icon:W.Z,onClick:e,size:28,className:"cursor-pointer rounded fill-current p-1 text-design-text hover:bg-white/10"}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Toggle menu","extendify-local"))),renderContent:({onClose:l})=>(0,o.createElement)(j.MenuGroup,{label:(0,s.__)("WordPress Comfort Level","extendify-local")},Object.entries(t).map((([e,t])=>(0,o.createElement)(j.MenuItem,{key:e,isSelected:r===e,onClick:()=>{i(e),l()},icon:r===e?$.Z:null},t))),(0,o.createElement)("hr",null),(0,o.createElement)(j.MenuItem,{disabled:!a(),onClick:()=>{e(!0),l()}},(0,s.sprintf)((0,s.__)("Chat History (%d)","extendify-local"),n)))})))},Q=({value:e,className:t,onChange:n,onKeyDown:a,disabled:r,placeholder:s,maxRows:c=6})=>{const m=(0,i.useRef)(null),[u,p]=(0,i.useState)("auto"),[f,h]=(0,i.useState)("auto");return(0,i.useLayoutEffect)((()=>{if(!m.current)return;const e=window.getComputedStyle(m.current),t=parseFloat(e.lineHeight||"20px");h(t)}),[]),(0,i.useLayoutEffect)((()=>{const t=document.createElement("textarea");t.value=e||s,t.rows=1;const n=window.getComputedStyle(m.current);["paddingTop","paddingBottom","paddingLeft","paddingRight","width","fontFamily","fontSize","borderWidth"].forEach((e=>t.style[e]=n[e])),Object.assign(t.style,{position:"absolute",left:"-9999px"}),document.body.appendChild(t),p(t.scrollHeight<52?52:t.scrollHeight),document.body.removeChild(t)}),[e,s]),(0,i.useEffect)((()=>{const e=m.current;if(!e)return;if(document.activeElement===e)return;const t=e.value.length;e.focus(),e.setSelectionRange(t,t)}),[e]),(0,o.createElement)(l.M,null,(0,o.createElement)(d.E.div,{key:"input",animate:{height:`${u}px`},transition:{duration:.2},style:{overflow:"hidden",maxHeight:f?f*c+16+"px":"none"}},(0,o.createElement)("label",{htmlFor:"draft-ai-textarea",className:"sr-only"},s),(0,o.createElement)("textarea",{ref:m,id:"draft-ai-textarea",disabled:r,className:t,value:e,rows:1,onChange:n,onKeyDown:a,placeholder:s,style:{overflowY:u{const[t,n]=(0,i.useState)(""),a=(0,i.useRef)(null);return(0,o.createElement)("form",{onSubmit:e,ref:a,className:"rtl:w-full"},(0,o.createElement)("p",{className:"m-0 mb-1 text-lg font-medium opacity-80"},(0,s.__)("Hi there!","extendify-local")),(0,o.createElement)("p",{className:"m-0 mb-6 text-2xl font-medium"},(0,s.__)("Ask me any questions about WordPress.","extendify-local")),(0,o.createElement)("div",{className:"relative rounded border border-gray-300 bg-white shadow"},(0,o.createElement)(Q,{value:t,className:"rtl:pl-auto h-full w-full flex-1 resize-none py-4 pl-3 pr-10 placeholder-gray-600 rtl:py-2.5 rtl:pr-2",placeholder:(0,s.__)("Ask your WordPress question…","extendify-local"),onChange:e=>{n(e.target.value)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||a?.current?.requestSubmit()}}),(0,o.createElement)("button",{type:"submit",className:"absolute bottom-3.5 right-2.5 flex h-6 cursor-pointer items-center border-none bg-transparent fill-current text-gray-700 hover:text-gray-900 rtl:bottom-2 rtl:left-2.5 rtl:right-auto",disabled:!t},(0,o.createElement)(m.Z,{icon:N,className:"h-4 w-4"}))))};var G=n(6755);const J=({height:e})=>window.extHelpCenterData?.supportUrl?(0,o.createElement)("div",{className:"px-6 py-8"},(0,o.createElement)("a",{href:window.extHelpCenterData.supportUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-4 rounded border border-solid border-gray-300 px-4 py-3 text-sm text-gray-800 no-underline"},(0,o.createElement)("span",null,(0,s.__)("For other questions, visit our support page.","extendify-local")),(0,o.createElement)(m.Z,{icon:G.Z,className:"w-8 fill-current"}))):(0,o.createElement)("div",{className:`bg-design-main ${e}`}),Y=({onOpen:e})=>(0,o.createElement)("section",{className:""},(0,o.createElement)("button",{"data-test":"help-center-dashboard-ai-chat-button",type:"button",onClick:e,className:"m-0 flex w-full cursor-pointer justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100 rtl:text-right"},(0,o.createElement)(m.Z,{icon:L.Z,className:"rounded-full border-0 bg-design-main fill-design-text p-2",size:48}),(0,o.createElement)("div",{className:"grow pl-1"},(0,o.createElement)("h1",{className:"m-0 p-0 text-lg font-medium"},(0,s.__)("Ask AI","extendify-local")),(0,o.createElement)("p",{className:"m-0 p-0 text-xs text-gray-800"},(0,s.__)("Got questions? Ask our AI chatbot","extendify-local"))),(0,o.createElement)("div",{className:"flex h-12 grow-0 items-center justify-end"},(0,o.createElement)(m.Z,{icon:(0,s.isRTL)()?u.Z:h.Z,size:24,className:"fill-current text-gray-700"})))),X=()=>{const{consentTermsHTML:e,setUserGaveConsent:t}=(0,T.y)();return(0,o.createElement)("div",{"data-test":"help-center-ai-chat-consent-prompt",className:"absolute inset-0 flex items-center justify-center bg-black/75 p-6"},(0,o.createElement)("div",{className:"rounded bg-white p-4"},(0,o.createElement)("h2",{className:"mb-2 mt-0 text-lg"},(0,s.__)("Terms of Use","extendify-local")),(0,o.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:e}}),(0,o.createElement)("button",{"data-test":"help-center-ai-chat-consent-accept-button",className:"mt-4 w-full cursor-pointer rounded border-0 bg-design-main px-4 py-2 text-center text-white",type:"button",onClick:()=>t(!0)},(0,s.__)("Accept","extendify-local"))))},ee=[{slug:"ai-chat",title:(0,s.__)("AI Chatbot","extendify-local"),component:()=>{const[e,t]=(0,i.useState)(void 0),[n,a]=(0,i.useState)(void 0),[r,s]=(0,i.useState)(void 0),[c,m]=(0,i.useState)(!1),[u,p]=(0,i.useState)(!1),{experienceLevel:f,currentQuestion:h,setCurrentQuestion:g}=O(),y=(0,T.y)((e=>e.shouldShowAIConsent("help-center")));return(0,i.useLayoutEffect)((()=>{t(h?.question),a(h?.htmlAnswer),p(!1)}),[h]),y?(0,o.createElement)(X,null):e?(0,o.createElement)(V,{question:e,answer:n,answerId:r,reset:()=>{t(void 0),a(void 0),s(void 0),m(!1),p(!1),g(void 0)},error:c}):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{className:"flex h-full flex-col"},(0,o.createElement)(U,{setShowHistory:p,showHistory:u}),(0,o.createElement)("div",{className:"flex flex-grow items-center bg-design-main p-6 text-design-text"},(0,o.createElement)(K,{onSubmit:async e=>{var n;e.preventDefault();const o=null!==(n=e.target?.[0]?.value)&&void 0!==n?n:"";if(!o)return;a("..."),t(o);const r=await(({question:e,experienceLevel:t})=>fetch(`${q.Yy}/api/chat/ask-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:e,experienceLevel:t,...D})}))({question:o,experienceLevel:f});if(r.ok)try{const e=r.body.getReader(),t=new TextDecoder;for(;;){const{value:n,done:o}=await e.read();if(o)break;const r=t.decode(n);a((e=>"..."===e?r:(e+r).replace(/\{"id":"[a-zA-Z0-9]+"\}/g,"")))}s(r.headers.get("x-extendify-chat-id")||void 0)}catch(e){console.error(e)}else m(!0)}})),(0,o.createElement)(J,{height:"h-11"})),(0,o.createElement)(l.M,null,u&&(0,o.createElement)(d.E.section,{initial:{x:50},animate:{x:0},exit:{x:0},transition:{duration:.2},style:{"--ext-design-text":"#000000"},className:"absolute bottom-0 left-0 right-0 top-0 z-20 ml-4 mt-4 flex h-full flex-col overflow-hidden rounded-tl-lg bg-white shadow-2xl"},(0,o.createElement)(z,{setShowHistory:p}))))}}];var te=n(7311),ne=n(9870);const oe=e=>{const t=window.extSharedData.wpLanguage||null,n=new URLSearchParams({lang:t});return fetch(`${q.nX}/api/posts/${e}?${n.toString()}`).then((e=>{if(404===e.status)throw new Error("Not found");if(!e.ok)throw new Error(e.statusText);return e.json()}))};var ae;const re={articles:[],recentArticles:[],viewedArticles:[],searchTerm:"",...null!==(ae=(0,v.a)(window.extHelpCenterData.userData.supportArticlesData)?.state)&&void 0!==ae?ae:{}},ie=(0,E.Ue)((0,_.tJ)((0,_.mW)(((e,t)=>({...re,pushArticle:n=>{const{slug:o,title:a}=n,r=t(),i=(new Date).toISOString(),l=i,s=r.viewedArticles.find((e=>e.slug===o)),c=[...r.viewedArticles.filter((e=>e.slug!==o)),s?{...s,count:s.count+1,lastViewedAt:i}:{slug:o,title:a,firstViewedAt:l,lastViewedAt:i,count:1}];w()({path:"/extendify/v1/help-center/support-articles-data",method:"POST",data:{state:{viewedArticles:c}}}),e({articles:[n,...r.articles],recentArticles:[n,...r.recentArticles.slice(0,9)],viewedArticles:c})},popArticle:()=>e((e=>({articles:e.articles.slice(1)}))),clearArticles:()=>e({articles:[]}),reset:()=>e({articles:[],searchTerm:""}),updateTitle:(t,n)=>e((e=>({articles:e.articles.map((e=>(e.slug===t&&(e.title=n),e)))}))),clearSearchTerm:()=>e({searchTerm:""}),setSearchTerm:t=>e({searchTerm:t})})),{name:"Extendify Help Center Knowledge Base"}),{name:"extendify-help-center-knowledge-base",storage:(0,_.FL)((()=>sessionStorage))})),le=()=>{const{articles:e,pushArticle:t,popArticle:n,updateTitle:a}=ie(),[r,l]=(0,i.useState)(),[c,d]=(0,i.useState)(!1),m=(0,i.useRef)(),u=e?.[0]?.slug,{data:p,error:f,loading:h}=(e=>{const{data:t,error:n}=(0,ne.Z)(e,oe);return{data:t,error:n,loading:!t&&!n}})(u),g=p?.title;return(0,i.useEffect)((()=>{if(!f)return l(!1);r||(l(!0),n(),window.open(`https://wordpress.org/documentation/article/${u}`,"_blank"))}),[f,u,r,n]),(0,i.useEffect)((()=>{u&&g&&a(u,g)}),[g,a,u]),(0,i.useEffect)((()=>{if(!m.current)return;const e=m.current?.querySelectorAll("a"),n=m.current?.querySelectorAll("figure"),o=m.current?.querySelectorAll("img");n.forEach((e=>{e.classList.add("mx-auto"),e.classList.add("my-4"),e.classList.add("block"),e.classList.add("w-full"),e.classList.remove("wp-block-image")})),o.forEach((e=>{e.classList.add("object-contain"),e.classList.add("max-w-[400px]"),e.classList.add("max-h-[250px]")}));const a=async e=>{var n;if(e.preventDefault(),e.ctrlKey||e.metaKey)return e.stopPropagation(),window.open(e.target.href,"_blank");const o=null!==(n=e.target?.href)&&void 0!==n?n:e.target?.closest("a")?.href,{pathname:a}=new URL(o),r=a.split("/").filter(Boolean)?.at(-1);d(!0);const i=await(l=a,w()({path:`/extendify/v1/help-center/get-redirect?path=${l}`}));var l;if(d(!1),!i)return a.startsWith("/documentation/article/")?t({slug:r,title:void 0}):window.open(`https://wordpress.org${a}`,"_blank");t({slug:i.split("/").filter(Boolean)?.at(-1)})},r=e=>{e.preventDefault(),window.open(e.target.href,"_blank")},i=e=>e.preventDefault();return e.forEach((e=>{const{hash:t,host:n,pathname:o}=new URL(e.href);if(t&&n===window.location.host||o.startsWith("/support/category"))return e.addEventListener("click",i),e.setAttribute("aria-disabled","true"),void e.classList.add("link-disabled");if(o.match(/\.(jpg|jpeg|png|gif|pdf|doc|docx|xls|xlsx|ppt|pptx)$/))return void e.addEventListener("click",i);if(o.startsWith("/documentation/article")||o.startsWith("/support/article"))return void e.addEventListener("click",a);e.addEventListener("click",r);const l=document.createElement("span");l.innerHTML='',e.appendChild(l)})),()=>{e.forEach((e=>{e?.removeEventListener("click",a),e?.removeEventListener("click",r),e?.removeEventListener("click",i)}))}}),[p,t]),h||c?(0,o.createElement)("div",{className:"p-8 text-center text-base"},(0,o.createElement)(j.Spinner,null)):f?(0,o.createElement)("div",{className:"p-8 text-center text-base"},(0,s.__)("There was an error loading this article","extendify-local")):(0,o.createElement)("article",{ref:m,className:"extendify-documentation w-full","data-test":"kb-article-content"},(0,o.createElement)("h1",{className:"m-0 text-3xl"},g),p?.content&&(0,te.ZP)(p?.content))};var se=n(1819),ce=n(802);const de=({articles:e})=>{const{pushArticle:t}=ie(),{navigateTo:n}=We();return(0,o.createElement)("ul",{className:"m-0 flex flex-col gap-1 py-2","data-test":"help-center-kb-articles-list"},e.map((({slug:e,title:a})=>(0,o.createElement)("li",{key:e,className:"m-0 py-1 pl-2 pr-3"},(0,o.createElement)("button",{type:"button",className:"flex cursor-pointer gap-2 bg-transparent text-sm text-gray-800 hover:underline hover:underline-offset-4",onClick:()=>{t({slug:e,title:a}),n("knowledge-base-article")}},(0,o.createElement)(m.Z,{size:20,icon:(0,s.isRTL)()?se.Z:ce.Z,className:"rotate-180 transform fill-gray-700"}),a)))))};var me=n(2395);const ue=({onChange:e})=>{const{searchTerm:t,clearSearchTerm:n,reset:a}=ie(),r=(0,i.useRef)(!1),l=(0,i.useRef)();return(0,o.createElement)("form",{method:"get",onSubmit:e=>e.preventDefault(),className:"relative h-10 w-full"},(0,o.createElement)("label",{htmlFor:"ext-help-center-search",className:"sr-only"},(0,s.__)("Search for articles","extendify-local")),(0,o.createElement)("input",{ref:l,name:"ext-kb-search",autoFocus:!0,autoCapitalize:"off",id:"ext-help-center-search",type:"text",value:null!=t?t:"",onChange:t=>e(t.target.value),onFocus:()=>{r.current||(r.current=!0,fetch(`${q.nX}/api/posts?boot=true`,{method:"POST"}))},placeholder:(0,s.__)("What do you need help with?","extendify-local"),className:"input border-text-800 h-10 w-full border px-3 text-sm placeholder-gray-600"}),(0,o.createElement)("div",{className:"absolute inset-y-5 right-2 flex items-center justify-center text-gray-400 rtl:left-2 rtl:right-auto"},(0,o.createElement)(m.Z,{icon:t?f.Z:me.Z,className:x()("fill-current",{"cursor-pointer":t}),onClick:()=>{a(),n(),l.current?.focus()},size:24})))},pe=async e=>{if(e.length<3)return null;const t=new URLSearchParams({lang:window.extSharedData.wpLanguage||null,search:e});return await fetch(`${q.nX}/api/posts?${t.toString()}`,{method:"POST"}).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()}))},fe=["wordpress-block-editor","blocks-list","adding-a-new-block","block-pattern","block-pattern-directory"],he=(0,v.a)(window.extSharedData.resourceData)?.supportArticles?.filter((e=>fe.includes(e.slug))),ge=({onOpen:e})=>{const{setSearchTerm:t}=ie();return(0,o.createElement)("section",{className:"rounded-md border","data-test":"help-center-kb-section"},(0,o.createElement)("div",{className:"border-b border-gray-150 bg-gray-100 p-2.5 pb-4"},(0,o.createElement)("h1",{className:"m-0 mb-3 p-0 text-lg font-medium"},(0,s.__)("Knowledge Base","extendify-local")),(0,o.createElement)(ue,{onChange:n=>{t(n),e()}})),(0,o.createElement)(de,{articles:he.slice(0,5)}))},ye=[{slug:"knowledge-base",title:(0,s.__)("Knowledge Base","extendify-local"),component:()=>{var e;const{setSearchTerm:t,searchTerm:n}=ie(),{data:a,loading:r}=(e=>{const{data:t,error:n}=(0,ne.Z)(e||null,pe);return{data:t,error:n,loading:!t&&!n}})(n);return(0,o.createElement)("section",{className:"p-4"},(0,o.createElement)("div",{className:""},(0,o.createElement)("div",{className:"mb-4"},(0,o.createElement)("h2",{className:"m-0 mb-2 text-sm"},n&&r?(0,s.__)("Searching...","extendify-local"):a?.length>0?(0,s.__)("Search results","extendify-local"):(0,s.__)("Search the knowledge base","extendify-local")),(0,o.createElement)(ue,{onChange:t})),r&&n?(0,o.createElement)("div",{className:"p-8 text-center text-base"},(0,o.createElement)(j.Spinner,null)):(0,o.createElement)(de,{articles:null!==(e=a?.slice(0,10))&&void 0!==e?e:[]})))}},{slug:"knowledge-base-article",title:(0,s.__)("Knowledge Base","extendify-local"),component:()=>(0,o.createElement)("section",{className:"p-4"},(0,o.createElement)("div",{className:""},(0,o.createElement)("div",{className:""},(0,o.createElement)(le,null))))}],xe=(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)("path",{d:"M18.72,8.267L20,8.267L20,17.653C20,18.949 18.95,20 17.654,20L6.56,20L6.56,18.72L17.654,18.72C18.243,18.72 18.72,18.242 18.72,17.653L18.72,8.267Z"}),(0,o.createElement)("path",{d:"M16.8,5.387L16.8,15.413C16.8,16.179 16.179,16.8 15.413,16.8L5.387,16.8C4.621,16.8 4,16.179 4,15.413L4,5.387C4,4.621 4.621,4 5.387,4L15.413,4C16.179,4 16.8,4.621 16.8,5.387ZM15.52,5.387C15.52,5.328 15.472,5.28 15.413,5.28L5.387,5.28C5.328,5.28 5.28,5.328 5.28,5.387L5.28,15.413C5.28,15.472 5.328,15.52 5.387,15.52L15.413,15.52C15.472,15.52 15.52,15.472 15.52,15.413L15.52,5.387Z"}),(0,o.createElement)("path",{d:"M9.573,13.839L8.667,12.934L10.775,10.827L8.667,8.719L9.573,7.814L12.585,10.827L9.573,13.839Z"})),be=(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,o.createElement)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM8 14.5V5.5L14 10L8 14.5Z",fill:"currentColor"})),we=(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,o.createElement)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 16.5C6.69 16.5 4 13.81 4 10.5H6C6 12.71 7.79 14.5 10 14.5C12.21 14.5 14 12.71 14 10.5C14 8.26 12.15 6.41 9.84 6.51L11.41 8.08L10 9.5L6 5.5L10 1.5L11.41 2.91L9.81 4.51C13.28 4.4 16 7.18 16 10.5C16 13.81 13.31 16.5 10 16.5Z"})),ve=(0,E.Ue)((0,_.tJ)((0,_.mW)((e=>({visibility:"minimized",queuedTour:null,queueTourForRedirect:t=>e({queuedTour:t}),clearQueuedTour:()=>e({queuedTour:null}),setVisibility:t=>{if(!["open","minimized","closed"].includes(t))throw new Error("Invalid visibility state");e({visibility:t})}})),{name:"Extendify Help Center Globals Sync"}),{name:"extendify-help-center-globals-sync"}));var Ee;const _e={currentTour:null,currentStep:void 0,preparingStep:void 0,progress:[],...null!==(Ee=(0,v.a)(window.extHelpCenterData.userData.tourData)?.state)&&void 0!==Ee?Ee:{}},Le="/extendify/v1/help-center/tour-data",Te={getItem:async()=>await w()({path:Le}),setItem:async(e,t)=>await w()({path:Le,method:"POST",data:{state:t}})},Ce=(0,E.Ue)((0,_.tJ)((0,_.mW)(((e,t)=>({..._e,startTour:async n=>{const{trackTourProgress:o,updateProgress:a,getStepData:r,onTourPage:i}=t();i(n?.settings?.startFrom)&&(await(n?.onStart?.(n)),n.steps=n.steps?.filter((e=>e?.showOnlyIf?.()||void 0===e?.showOnlyIf?.()))||[],await(r(0,n)?.events?.beforeAttach?.(n))),e({currentTour:n,currentStep:0,preparingStep:void 0});const l=o(n.id);a(l.id,{openedCount:Number(l.openedCount)+1,lastAction:"started"})},onTourPage:(e=null)=>{const n=window.location.href;if(e?.includes(n))return!0;const{currentTour:o}=t();return o?.settings?.startFrom?.includes(n)},completeCurrentTour:async()=>{const{currentTour:n,wasCompleted:o,findTourProgress:a,updateProgress:r}=t(),i=a(n?.id);i?.id&&(o(i.id)||r(i.id,{completedAt:(new Date).toISOString(),lastAction:"completed"}),r(i.id,{completedCount:Number(i.completedCount)+1,lastAction:"completed"}),await(n?.onDetach?.()),await(n?.onFinish?.()),e({currentTour:null,currentStep:void 0}),"site-assistant-tour"===i?.id&&window.dispatchEvent(new CustomEvent("extendify-assist:is-tour-finished",{detail:{isFinished:!0}})))},closeCurrentTour:async n=>{const{currentTour:o,findTourProgress:a,updateProgress:r}=t(),i=a(o?.id);if(!i?.id)return;const l={};return["redirected"].includes(n)?r(i?.id,{lastAction:n}):["closed-by-caught-error"].includes(n)?r(i?.id,{lastAction:n,errored:!0}):("closed-manually"===n&&(l.closedManuallyCount=Number(i.closedManuallyCount)+1),await(o?.onDetach?.()),await(o?.onFinish?.()),r(i?.id,{lastAction:n,...l}),void e({currentTour:null,currentStep:void 0,preparingStep:void 0}))},findTourProgress:e=>t().progress.find((t=>t.id===e)),wasCompleted:e=>t().findTourProgress(e)?.completedAt,wasOpened:e=>{var n;return Number(null!==(n=t().findTourProgress(e)?.openedCount)&&void 0!==n?n:0)>0},isSeen:e=>t().findTourProgress(e)?.firstSeenAt,trackTourProgress:n=>{const{findTourProgress:o}=t();return o(n)||e((e=>({progress:[...e.progress,{id:n,firstSeenAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),completedAt:null,lastAction:"init",currentStep:0,openedCount:0,closedManuallyCount:0,completedCount:0,errored:!1}]}))),o(n)},updateProgress:(t,n)=>{var o;const a=null!==(o=n?.lastAction)&&void 0!==o?o:"unknown";e((e=>({progress:e.progress.map((e=>e.id===t?{...e,...n,lastAction:a,updatedAt:(new Date).toISOString()}:e))})))},getStepData:(e,n=t().currentTour)=>{var o;return null!==(o=n?.steps?.[e])&&void 0!==o?o:{}},hasNextStep:()=>!!t().currentTour&&Number(t().currentStep){const{currentTour:e,goToStep:n,updateProgress:o,currentStep:a}=t(),r=Number(a)+1;await n(r),o(e.id,{currentStep:r,lastAction:"next"})},hasPreviousStep:()=>!!t().currentTour&&Number(t().currentStep)>0,prevStep:async()=>{const{currentTour:e,goToStep:n,updateProgress:o,currentStep:a}=t(),r=a-1;await n(r),o(e.id,{currentStep:r,lastAction:"prev"})},goToStep:async n=>{const{currentTour:o,updateProgress:a,closeCurrentTour:r,getStepData:i}=t(),l=o;if(n<0||n>l.steps.length-1)return void r("closed-by-caught-error");a(l.id,{currentStep:n,lastAction:`go-to-step-${n}`});const s=i(n)?.events;s?.beforeAttach&&(e((()=>({preparingStep:n}))),await Promise.allSettled([s.beforeAttach?.(l),new Promise((e=>setTimeout(e,300)))]),e((()=>({preparingStep:void 0})))),e((()=>({currentStep:n})))}})),{name:"Extendify Tour Progress"}),{name:"extendify-help-center-tour-progress",storage:(0,_.FL)((()=>Te)),skipHydration:!0,partialize:e=>{const{currentTour:t,currentStep:n,preparingStep:o,...a}=e;return a}})),ke=e=>new Promise((t=>{const n=setInterval((()=>{document.querySelector(e)&&(clearInterval(n),t())}),50)})),Se=e=>new Promise((t=>{const n=setInterval((()=>{document.querySelector(e)||(clearInterval(n),t())}),50)})),Ne={id:"library-tour",title:(0,s.__)("Design Library","extendify-local"),settings:{allowOverflow:!0,hideDotsNav:!0,startFrom:[window.extSharedData.adminUrl+"post-new.php?post_type=page&ext-close",window.extSharedData.adminUrl+"post-new.php?post_type=page"]},onStart:async()=>{await ke("#extendify-library-btn"),document.querySelector(`[aria-label="${(0,s.__)("Settings")}"].is-pressed`)?.click()},steps:[{title:(0,s.__)("Open the Pattern Library","extendify-local"),text:(0,s.__)("The Extendify pattern library can be opened by clicking the button to the left.","extendify-local"),attachTo:{element:'#extendify-library-btn [role="button"]',offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{beforeAttach:()=>{}}},{title:(0,s.__)("Filter Patterns","extendify-local"),text:(0,s.__)("Click on any pattern category to refine the selection.","extendify-local"),attachTo:{element:"#extendify-library-category-control",position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},options:{allowPointerEvents:!0},events:{beforeAttach:async()=>(dispatchEvent(new CustomEvent("extendify::open-library")),await ke("#extendify-library-category-control"))}},{title:(0,s.__)("Select a Pattern","extendify-local"),text:(0,s.__)("Simply select any pattern you wish to insert into a page by clicking on it.","extendify-local"),attachTo:{element:"#extendify-library-patterns-list",position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{beforeAttach:async()=>{await ke("#extendify-library-patterns-list")}}},{title:(0,s.__)("View the Inserted Pattern","extendify-local"),text:(0,s.__)("The selected pattern has been inserted into the page.","extendify-local"),attachTo:{element:".wp-block-group:last-child",frame:'iframe[name="editor-canvas"]',offset:{marginTop:15,marginLeft:0},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top left":"top right"},events:{beforeAttach:async()=>(document.querySelector("#extendify-library-patterns-list .library-pattern")?.click(),await Se("#extendify-library-patterns-list"))},options:{hideBackButton:!0}}]},Re=()=>!!document.querySelector('iframe[name="editor-canvas"]'),Ae=e=>{var t;return null!==(t=13!==e.keyCode)&&void 0!==t?t:e.preventDefault()},Pe=(e="")=>`.edit-post-header-toolbar__inserter-toggle${e}, .editor-document-tools__inserter-toggle${e}`,qe={id:"page-editor-tour",title:(0,s.__)("Page editor","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"post-new.php?post_type=page&ext-close",window.extSharedData.adminUrl+"post-new.php?post_type=page"]},steps:[{title:(0,s.__)("Add a Block","extendify-local"),text:(0,s.__)("Click the plus to open the block inserter.","extendify-local"),attachTo:{element:Pe(),offset:{marginTop:15,marginLeft:0},position:{x:(0,s.isRTL)()?"right":"left",y:"bottom"},hook:(0,s.isRTL)()?"top right":"top left"},events:{beforeAttach:async()=>await ke(Pe())}},{title:(0,s.__)("Block Inserter","extendify-local"),text:(0,s.__)("Add a block by clicking or dragging it onto the page.","extendify-local"),attachTo:{element:".block-editor-inserter__menu",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{beforeAttach:async()=>(document.querySelector(Pe(":not(.is-pressed)"))?.click(),await ke(".block-editor-tabbed-sidebar")),onAttach:()=>{const e=document.querySelector(Pe());He.observe(e,{attributes:!0}),window.addEventListener("keydown",Ae)},onDetach:async()=>{He.disconnect(),window.removeEventListener("keydown",Ae),document.querySelector(Pe(".is-pressed"))?.click(),await Se(".block-editor-inserter__block-list"),requestAnimationFrame((()=>{document.getElementById("help-center-tour-next-button")?.focus()}))}}},{title:(0,s.__)("Page Title","extendify-local"),text:(0,s.__)("Edit the page title by clicking it. Note: The title may or may not show up on the published page, depending on the page template used.","extendify-local"),attachTo:{element:()=>Re()?'iframe[name="editor-canvas"]':".wp-block-post-title",offset:()=>({marginTop:Re()?15:0,marginLeft:(0,s.isRTL)()?Re()?15:-15:Re()?-15:15}),position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:()=>(0,s.isRTL)()?Re()?"top left":"top right":Re()?"top right":"top left"},events:{beforeAttach:async()=>{await window.wp.data.dispatch("core/editor").editPost({title:"Sample Post"})}}},{title:(0,s.__)("Blocks","extendify-local"),text:(0,s.__)("Each block will show up on the page and can be edited by clicking on it.","extendify-local"),attachTo:{element:()=>Re()?'iframe[name="editor-canvas"]':".wp-block-post-content > p",offset:()=>({marginTop:Re()?15:0,marginLeft:(0,s.isRTL)()?Re()?15:-15:Re()?-15:15}),position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:()=>(0,s.isRTL)()?Re()?"top left":"top right":Re()?"top right":"top left"},events:{beforeAttach:async()=>{if(await window.wp.data.select("core/block-editor").getBlockCount()>0)return;const e=(0,C.createBlock)("core/paragraph",{content:(0,s.__)("This is a sample paragraph block. It can be several sentences long and will span multiple rows. You can add as many blocks as you'd like to the page.","extendify-local")});return await window.wp.data.dispatch("core/block-editor").insertBlock(e),Re()?await window.wp.data.dispatch("core/block-editor").flashBlock(e.clientId):null}}},{title:(0,s.__)("Page and Block Settings","extendify-local"),text:(0,s.__)("Select either page or block to change the settings for the entire page or the block that is selected.","extendify-local"),attachTo:{element:".interface-interface-skeleton__sidebar",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?15:-15},position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top left":"top right"},events:{beforeAttach:async()=>{const e=document.querySelector(`[aria-label="${(0,s.__)("Settings")}"]:not(.is-pressed)`);e?e?.click():document.querySelector('[aria-label="Settings"]:not(.is-pressed)')?.click(),await ke(".interface-interface-skeleton__sidebar"),document.querySelector('.edit-post-sidebar__panel-tab,[data-tab-id="edit-post/document"]')?.click(),await ke(".editor-post-status"),document.querySelector(".edit-post-post-status button")?.click()}}},{title:(0,s.__)("Preview","extendify-local"),text:(0,s.__)("Click preview to view how your changes look on the front end of your site.","extendify-local"),attachTo:{element:".block-editor-post-preview__button-toggle,.editor-preview-dropdown__toggle",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?15:-15},position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top left":"top right"},events:{}},{title:(0,s.__)("Publish or Save","extendify-local"),text:(0,s.__)("Click publish or update to save the changes you have made to the page and make them live on the site.","extendify-local"),attachTo:{element:".editor-post-publish-button__button",offset:{marginTop:15},position:{x:(0,s.isRTL)()?"left":"right",y:"bottom"},hook:(0,s.isRTL)()?"top left":"top right"},events:{}}]},He=new MutationObserver((()=>{document.querySelector(Pe(":not(.is-pressed)"))?.click()})),Ze={id:"plugin-install-tour",title:(0,s.__)("Installing a plugin","extendify-local"),settings:{allowOverflow:!1,startFrom:[window.extSharedData.adminUrl+"plugin-install.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.add("opensub")},steps:[{title:(0,s.__)("Add New plugin menu","extendify-local"),text:(0,s.__)("Click here to access the Add Plugins page.","extendify-local"),attachTo:{element:'#menu-plugins .wp-submenu a[href="plugin-install.php"]',offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.remove("opensub")}}},{title:(0,s.__)("Search","extendify-local"),text:(0,s.__)("Search for a plugin by name or functionality.","extendify-local"),attachTo:{element:".search-form.search-plugins",offset:{marginTop:5,marginLeft:(0,s.isRTL)()?350:-350},boxPadding:{top:-5,bottom:3,left:5,right:5},position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Plugin details","extendify-local"),text:(0,s.__)("See important information about each plugin.","extendify-local"),attachTo:{element:"#the-list .plugin-card:first-child .plugin-card-bottom",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"bottom"},hook:(0,s.isRTL)()?"bottom right":"bottom left"},events:{}},{title:(0,s.__)("Install now","extendify-local"),text:(0,s.__)("Install the plugin. Then, press this button again to activate the plugin.","extendify-local"),attachTo:{element:"#the-list .plugin-card:first-child .install-now",offset:{marginTop:-5,marginLeft:(0,s.isRTL)()?-15:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Upload Plugin","extendify-local"),text:(0,s.__)("If you have a plugin from an external source, you can upload it directly here.","extendify-local"),attachTo:{element:".upload-view-toggle",offset:{marginTop:-5,marginLeft:(0,s.isRTL)()?-15:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}}]},Ie={id:"plugin-management-tour",title:(0,s.__)("Plugin management","extendify-local"),settings:{allowOverflow:!1,startFrom:[window.extSharedData.adminUrl+"plugins.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.add("opensub")},steps:[{title:(0,s.__)("Installed Plugins menu","extendify-local"),text:(0,s.__)("Click this menu to see and manage the plugins you have installed.","extendify-local"),attachTo:{element:"#menu-plugins ul > li:nth-child(2)",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-plugins").classList.remove("opensub")}}},{title:(0,s.__)("Installed plugins","extendify-local"),text:(0,s.__)("See all plugins installed on your site. This includes plugins that are active and deactivated.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1)",offset:{marginTop:15,marginLeft:0},position:{x:(0,s.isRTL)()?"left":"right",y:"bottom"},hook:(0,s.isRTL)()?"top left":"top right"},events:{}},{title:(0,s.__)("Deactivate/activate option","extendify-local"),text:(0,s.__)("Under each plugin you can activate or deactivate it.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1) > td.plugin-title",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Add another","extendify-local"),text:(0,s.__)("Click here to add another plugin to your site.","extendify-local"),attachTo:{element:"a.page-title-action",offset:{marginTop:-5,marginLeft:(0,s.isRTL)()?-15:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}}]},De={id:"site-assistant-tour",title:(0,s.__)("Site Assistant","extendify-local"),settings:{allowOverflow:!1,startFrom:[`${window.extSharedData.adminUrl}admin.php?page=extendify-assist#dashboard`]},steps:[{title:(0,s.__)("Tasks","extendify-local"),text:(0,s.__)("Now that you've created your starter site, make it your own with these follow up tasks.","extendify-local"),showOnlyIf:()=>document.getElementById("assist-tasks-module"),attachTo:{element:"#assist-tasks-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Quick Links","extendify-local"),text:(0,s.__)("Easily access some of the most common items in WordPress with these quick links.","extendify-local"),attachTo:{element:"#assist-quick-links-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onAttach:()=>{}}},{title:(0,s.__)("Website Tools & Plugins","extendify-local"),text:(0,s.__)("See our personalized recommendations for you that will help you accomplish your goals.","extendify-local"),showOnlyIf:()=>document.querySelector("#assist-recommendations-module"),attachTo:{element:"#assist-recommendations-module",offset:{marginTop:window.innerWidth<=1151?-15:2,marginLeft:window.innerWidth<=1151?-25:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Help Center","extendify-local"),text:(0,s.__)("You can always access the help center by clicking this button.","extendify-local"),showOnlyIf:()=>document.querySelector("#wp-admin-bar-help-center-btn"),attachTo:{element:"#wp-admin-bar-help-center-btn",offset:{marginTop:45,marginLeft:(0,s.isRTL)()?5:-5},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Visit your site","extendify-local"),text:(0,s.__)("You can always visit your site by clicking this button.","extendify-local"),attachTo:{element:"#assist-menu-bar",offset:{marginTop:20,marginLeft:(0,s.isRTL)()?5:-5},position:{x:(0,s.isRTL)()?"right":"left",y:"bottom"},hook:(0,s.isRTL)()?"top right":"top left",boxPadding:{top:5,bottom:5,left:5,right:5}},events:{}},{title:(0,s.__)("Site Assistant","extendify-local"),text:(0,s.__)("Come back to the Site Assistant any time by clicking the menu item.","extendify-local"),attachTo:{element:"#toplevel_page_extendify-assist",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onAttach:()=>{document.body.classList.contains("folded")&&(document.body.classList.remove("folded"),document.body.classList.add("temp-open"))},onDetach:()=>{document.body.classList.contains("temp-open")&&(document.body.classList.remove("temp-open"),document.body.classList.add("folded"))}}}]},Me={id:"users-screen-tour",title:(0,s.__)("Users screen","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"users.php"]},onStart:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-users").classList.add("opensub")},steps:[{title:(0,s.__)("All Users menu","extendify-local"),text:(0,s.__)("Click here to view and manage the users on your site.","extendify-local"),attachTo:{element:"#menu-users ul > li:nth-child(2)",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onDetach:()=>{document.body.classList.contains("folded")&&document.querySelector("#menu-users").classList.remove("opensub")}}},{title:(0,s.__)("Users","extendify-local"),text:(0,s.__)("See all of your users, including admin users in this table.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1)",offset:{marginTop:15,marginLeft:0},position:{x:(0,s.isRTL)()?"left":"right",y:"bottom"},hook:(0,s.isRTL)()?"top left":"top right"},events:{}},{title:(0,s.__)("Edit user information","extendify-local"),text:(0,s.__)("Click the edit button to change the user's role, manage their account, or change their profile information.","extendify-local"),attachTo:{element:"tbody#the-list > tr:nth-child(1) > td.username",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{onAttach:()=>{document.querySelector("tbody#the-list > tr:nth-child(1) > td.username .row-actions").style.left="0"},onDetach:()=>{document.querySelector("tbody#the-list > tr:nth-child(1) > td.username .row-actions").style.left="-9999em"}}},{title:(0,s.__)("Search for users","extendify-local"),text:(0,s.__)("Use the search bar to find a particular user.","extendify-local"),attachTo:{element:"p.search-box",offset:{marginTop:-5,marginLeft:(0,s.isRTL)()?15:-15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top left":"top right"},events:{}},{title:(0,s.__)("Add a new user","extendify-local"),text:(0,s.__)("Click the Add New button to add a new user to your site.","extendify-local"),attachTo:{element:".page-title-action",offset:{marginTop:-5,marginLeft:(0,s.isRTL)()?-15:15},boxPadding:{top:5,bottom:5,left:5,right:5},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}}]},Fe={"welcome-tour":{id:"welcome-tour",title:(0,s.__)("Getting started with WordPress","extendify-local"),settings:{allowOverflow:!0,startFrom:[window.extSharedData.adminUrl+"index.php",window.extSharedData.adminUrl+"admin.php?page=extendify-assist#dashboard"],minBoxWidth:"360px"},onStart:()=>{document.body.classList.contains("folded")&&(document.body.classList.remove("folded"),document.body.classList.add("temp-open"))},onFinish:()=>{document.body.classList.contains("temp-open")&&(document.body.classList.remove("temp-open"),document.body.classList.add("folded"))},steps:[{title:(0,s.__)("View Site","extendify-local"),text:(0,s.__)("At any time, you can view your site (from a visitor's perspective) from the top admin bar under your site's name.","extendify-local"),image:"https://assets.extendify.com/tours/welcome/view-site.gif",attachTo:{element:"#wp-admin-bar-view-site",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-10:10},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{beforeAttach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onAttach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onDetach:()=>{const e=document.querySelector("#wp-admin-bar-site-name .ab-sub-wrapper");e.style.position="absolute",e.style.display=""}}},{title:(0,s.__)("Site Assistant","extendify-local"),text:(0,s.__)("Access the Site Assistant at any time.","extendify-local"),attachTo:{element:"#toplevel_page_extendify-assist",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:document.getElementById("toplevel_page_wpSq")?.textContent?.replace(/[^\w\s²]/g,"").trim(),text:(0,s.__)("Click here to go to your website management dashboard. From there you will be able to create more websites, and manage your account settings.","extendify-local"),showOnlyIf:()=>document.getElementById("toplevel_page_wpSq"),attachTo:{element:"#toplevel_page_wpSq",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Dashboard","extendify-local"),text:(0,s.__)("The default WordPress dashboard will have some overall site metrics and modules added from certain plugins.","extendify-local"),attachTo:{element:"#menu-dashboard",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Posts","extendify-local"),text:(0,s.__)("Manage and create blog posts.","extendify-local"),attachTo:{element:"#menu-posts",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Media","extendify-local"),text:(0,s.__)("Add, edit, or remove images and other media from your library. When you upload an image to be used on your site, it will be added to the library.","extendify-local"),attachTo:{element:"#menu-media",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Pages","extendify-local"),text:(0,s.__)("Use the pages menu to add, delete, or edit the pages on your site.","extendify-local"),image:"https://assets.extendify.com/tours/welcome/add-pages.gif",attachTo:{element:"#menu-pages",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Comments","extendify-local"),text:(0,s.__)("If you have commenting enabled on your posts, you can manage those comments here.","extendify-local"),attachTo:{element:"#menu-comments",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Appearance","extendify-local"),text:(0,s.__)("Manage your theme and access the Site Editor from the Appearance menu. The Site Editor is where you can make global changes to your site (such as the menu, header/footer, and styles).","extendify-local"),attachTo:{element:"#menu-appearance",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Plugins","extendify-local"),text:(0,s.__)("Add or manage the plugins on your site.","extendify-local"),attachTo:{element:"#menu-plugins",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Users","extendify-local"),text:(0,s.__)("Add or manage users on your site, both admin users and others.","extendify-local"),attachTo:{element:"#menu-users",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Tools","extendify-local"),text:(0,s.__)("Import/export post data, check site health, and edit theme or plugin files directly in the WordPress admin.","extendify-local"),attachTo:{element:"#menu-tools",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Settings","extendify-local"),text:(0,s.__)("Advanced settings for your site and for certain plugins.","extendify-local"),attachTo:{element:"#menu-settings",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("Collapse menu","extendify-local"),text:(0,s.__)("Use this toggle to collapse or expand the sidebar menu.","extendify-local"),attachTo:{element:"#collapse-menu",offset:{marginTop:0,marginLeft:(0,s.isRTL)()?-15:15},position:{x:(0,s.isRTL)()?"left":"right",y:"top"},hook:(0,s.isRTL)()?"top right":"top left"},events:{}},{title:(0,s.__)("User","extendify-local"),text:(0,s.__)("Manage your profile or log out of your account here.","extendify-local"),attachTo:{element:"#wp-admin-bar-user-actions",offset:{marginTop:5,marginLeft:(0,s.isRTL)()?15:-15},position:{x:(0,s.isRTL)()?"right":"left",y:"top"},hook:(0,s.isRTL)()?"top left":"top right"},events:{beforeAttach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="relative",e.style.display="block"},onAttach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="relative",e.style.display="block",document.querySelector("#help-center-tour-next-button")?.focus()},onDetach:()=>{const e=document.querySelector("#wp-admin-bar-my-account .ab-sub-wrapper");e.style.position="absolute",e.style.display=""}}}]},"plugin-install-tour":Ze,"plugin-management-tour":Ie,"page-editor-tour":qe,"library-tour":Ne,"users-screen-tour":Me,"site-assistant-tour":De},Oe=({onOpen:e,classes:t})=>{const{startTour:n}=Ce(),{setVisibility:a}=ve(),r=Object.values(Fe).filter((e=>e.settings.startFrom.includes(window.location.href)||!e.settings.startFrom));return(0,o.createElement)("section",{className:t,"data-test":"help-center-tours-section"},(0,o.createElement)("button",{"data-test":"help-center-tours-open-button",type:"button",onClick:e,className:x()("m-0 flex w-full cursor-pointer justify-between gap-2 rounded-md border border-gray-200 bg-transparent p-2.5 text-left hover:bg-gray-100 rtl:text-right",{"rounded-b-none":r.length>0})},(0,o.createElement)(m.Z,{icon:xe,className:"rounded-full border-0 bg-design-main fill-design-text p-2",size:48}),(0,o.createElement)("div",{className:"grow pl-1"},(0,o.createElement)("h1",{className:"m-0 p-0 text-lg font-medium"},(0,s.__)("Tours","extendify-local")),(0,o.createElement)("p",{className:"m-0 p-0 text-xs text-gray-800"},(0,s.__)("Learn more about your WordPress admin","extendify-local"))),(0,o.createElement)("div",{className:"flex h-12 grow-0 items-center justify-between"},(0,o.createElement)(m.Z,{icon:(0,s.isRTL)()?u.Z:h.Z,size:24,className:"fill-current text-gray-700"}))),r.length>0&&(0,o.createElement)("button",{type:"button",className:"text-md m-0 flex w-full cursor-pointer items-center justify-between gap-2 rounded-md rounded-t-none border border-t-0 border-gray-200 bg-transparent p-3 px-4 pl-[4.25rem] text-left font-medium text-gray-900 hover:bg-gray-100 rtl:pl-4 rtl:pr-[4.25rem] rtl:text-right",onClick:()=>{a("minimized"),n(r[0])}},(0,s.__)("Tour this page","extendify-local"),(0,o.createElement)(m.Z,{icon:be,size:16,className:(0,s.isRTL)()?"rotate-180":""})))},Ve=[{slug:"tours",title:(0,s.__)("Tours","extendify-local"),component:()=>{const{wasCompleted:e,startTour:t}=Ce(),{setVisibility:n}=ve();return(0,o.createElement)("section",{className:"p-4"},(0,o.createElement)("ul",{className:"m-0 flex flex-col gap-2 p-0","data-test":"help-center-tours-items-list"},Object.values(Fe).map((a=>{const{id:r,title:i}=a;return(0,o.createElement)("li",{key:r,className:"m-0 p-0"},(0,o.createElement)("button",{type:"button",className:"m-0 flex w-full cursor-pointer items-center justify-between gap-2 bg-gray-100 px-4 py-3.5 text-sm font-medium text-gray-900 hover:bg-gray-150",onClick:()=>{n("minimized"),t(a)}},i,e(r)?(0,o.createElement)(m.Z,{"data-test":"restart-tour-icon",icon:we,size:16}):(0,o.createElement)(m.Z,{"data-test":"play-tour-icon",icon:be,className:(0,s.isRTL)()?"rotate-180":"",size:16})))}))))}}],Be=[{slug:"dashboard",title:(0,s.__)("Help Center","extendify-local"),component:()=>{const{navigateTo:e}=We();return(0,o.createElement)("div",{className:"mx-auto flex w-full max-w-md flex-col gap-3 rounded-2xl p-4"},(0,o.createElement)(ge,{onOpen:()=>e("knowledge-base")}),(0,o.createElement)(Oe,{onOpen:()=>e("tours"),classes:"hidden md:block"}),window.extSharedData?.aiChatEnabled&&(0,o.createElement)(Y,{onOpen:()=>e("ai-chat")}))}},...ye,...Ve,...ee],ze={history:[],viewedPages:[],current:null},je=(0,E.Ue)((0,_.tJ)((0,_.mW)(((e,t)=>{var n;return{...ze,...null!==(n=(0,v.a)(window.extHelpCenterData.userData.routerData)?.state)&&void 0!==n?n:{},goBack:()=>{if(t().history.length<2)return;const n=t().history[1];g.j.getState().incrementActivity(`hc-${n.slug}-back`),e((e=>({history:e.history.slice(1),current:n})))},setCurrent:n=>{if(!n)return;if(t().history[0]?.slug===n.slug)return;const o=t(),a=(new Date).toISOString(),r=a,i=o.viewedPages.find((e=>e.slug===n.slug)),l=[...o.viewedPages.filter((e=>e.slug!==n.slug)),i?{...i,count:Number(i.count)+1,lastViewedAt:a}:{slug:n.slug,firstViewedAt:r,lastViewedAt:a,count:1}];w()({path:"/extendify/v1/help-center/router-data",method:"POST",data:{state:{viewedPages:l}}}),e({history:[n,...o.history].filter(Boolean),current:n,viewedPages:l})},reset:()=>e({...ze})}}),{name:"Extendify Help Center Router"}),{name:"extendify-help-center-router",storage:(0,_.FL)((()=>sessionStorage)),partialize:({history:e,current:t})=>({history:e,current:{...t,component:null}})})),We=()=>{var e,t;const{current:n,setCurrent:a,history:r,goBack:l,reset:s}=je(),c=null!==(e=null!==(t=n?.component)&&void 0!==t?t:Be.find((e=>e.slug===n?.slug))?.component)&&void 0!==e?e:()=>null;return(0,i.useEffect)((()=>{n||a(Be[0])}),[n,a]),{current:n,CurrentPage:(0,i.useCallback)((()=>(0,o.createElement)("div",{role:"region","aria-live":"polite",className:"h-full"},(0,o.createElement)("h1",{className:"sr-only"},n?.title),(0,o.createElement)(c,null))),[n]),navigateTo:e=>{const t=Be.find((t=>t.slug===e));if(!t)return a(Be[0]);g.j.getState().incrementActivity(`hc-${t.slug}`),a(t)},goBack:l,history:r,reset:s}},{partnerLogo:$e,partnerName:Ue}=window.extSharedData,Qe=()=>{const{visibility:e,setVisibility:t}=ve(),{incrementActivity:n}=(0,g.j)(),{current:a,history:r}=We(),i="minimized"===e,l=()=>{const e=i?"open":"minimized";n(`hc-toggle-button-${e}`),t(e)};return(0,o.createElement)("div",{className:"relative flex items-center justify-end gap-x-2 bg-banner-main p-4"},(0,o.createElement)("div",{role:i?"button":"heading",onClick:i?l:void 0,"aria-label":i?(0,s.__)("Show Help Center","extendify-local"):void 0,"aria-expanded":i?"false":"true",className:x()("flex w-full justify-between bg-banner-main",{"cursor-pointer":i})},(0,o.createElement)("div",{className:x()("flex w-full gap-1",{"gap-4":1===r.length})},(0,o.createElement)(Ke,null),a?.title&&(0,o.createElement)("span",{className:"border-banner-text text-base font-medium text-banner-text"},a.title))),(0,o.createElement)("div",{className:"flex items-center justify-end gap-2.5"},(0,o.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button","data-test":"help-center-toggle-minimize-button",onClick:l},i?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.Z,{className:"rotate-90 fill-current",icon:u.Z,size:24}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Show Help Center","extendify-local"))):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.Z,{className:"fill-current",icon:p.Z,size:24}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Minimize Help Center","extendify-local")))),(0,o.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button","data-test":"help-center-close-button",onClick:()=>{n(`hc-close-button-when-${e}`),t("closed")}},(0,o.createElement)(m.Z,{icon:f.Z,size:24}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("close","extendify-local")))))},Ke=()=>{const{goBack:e,history:t}=We(),{visibility:n}=ve();return t.length>1&&"open"===n?(0,o.createElement)("button",{className:"m-0 cursor-pointer border-0 bg-transparent fill-banner-text p-0 text-banner-text",type:"button",onClick:e},(0,o.createElement)(m.Z,{icon:(0,s.isRTL)()?h.Z:u.Z}),(0,o.createElement)("span",{className:"sr-only"},(0,s.__)("Go back","extendify-local"))):$e?(0,o.createElement)("div",{className:"flex h-6 justify-center bg-banner-main after:relative after:-right-2 after:top-0.5 after:mr-2 after:text-banner-text after:opacity-40 after:content-['|'] rtl:after:-right-0"},(0,o.createElement)("div",{className:"flex h-6 max-w-[9rem] overflow-hidden"},(0,o.createElement)("img",{className:"max-h-full max-w-full object-contain",src:$e,alt:Ue}))):null},Ge=()=>(0,o.createElement)("div",{className:"overflow-hidden rounded-md border border-gray-500 shadow-2xl","data-test":"help-center-minimize-state"},(0,o.createElement)(Qe,null)),Je=()=>{const{CurrentPage:e}=We();return(0,o.createElement)("div",{className:"h-full w-full"},(0,o.createElement)(e,null))},Ye=()=>{const{visibility:e}=ve(),{reset:t}=We(),{reset:n}=ie(),{reset:a}=O();return(0,i.useEffect)((()=>{"closed"===e&&(t(),n(),a())}),[a,n,t,e]),"minimized"===e?(0,o.createElement)("div",{className:"extendify-help-center"},(0,o.createElement)("div",{className:"fixed bottom-0 right-0 z-high mx-auto w-[420px] md:m-8 rtl:left-0 rtl:right-auto"},(0,o.createElement)(Ge,null))):"open"!==e?null:(0,o.createElement)(c.Vq,{ref:async()=>{await Promise.resolve(),document?.documentElement?.style&&(document.documentElement.style.overflow="unset",document.documentElement.style.paddingRight="unset")},className:"extendify-help-center","data-test":"help-center-modal",open:"open"===e,static:!0,onClose:()=>{}},(0,o.createElement)("div",{className:"fixed bottom-0 right-0 z-high mx-auto h-full max-h-[589px] w-full max-w-[420px] md:m-8 md:mt-20 rtl:left-0 rtl:right-auto"},(0,o.createElement)(d.E.div,{key:"help-center-modal",initial:{y:6,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.2,delay:.1},className:"relative mx-auto h-full w-full shadow-2xl-flipped sm:flex sm:overflow-hidden md:rounded-md md:shadow-2xl"},(0,o.createElement)(c.$N,{className:"sr-only"},(0,s.__)("Extendify Help Center","extendify-local")),(0,o.createElement)("div",{className:"relative flex h-full w-full flex-col rounded-md border border-gray-400 bg-gray-50 md:overflow-hidden"},(0,o.createElement)(Qe,null),(0,o.createElement)("div",{className:"flex-grow overflow-y-auto overscroll-contain"},(0,o.createElement)(Je,null))))))},Xe=e=>{const{top:t,right:n,bottom:o,left:a,width:r,height:i,x:l,y:s}=e.getBoundingClientRect();return{top:t,right:n,bottom:o,left:a,width:r,height:i,x:l,y:s}},et=()=>{var e,t;const n=(0,i.useRef)(),{currentTour:a,currentStep:r,startTour:u,closeCurrentTour:p,getStepData:f,onTourPage:h}=Ce(),{settings:g}=a||{},{image:y,title:x,text:b,attachTo:w,events:v,options:E}=f(r),{queueTourForRedirect:_,queuedTour:L,clearQueuedTour:T}=ve(),{element:C,frame:k,offset:S,position:N,hook:R,boxPadding:A}=w||{},P=(0,i.useMemo)((()=>"function"==typeof C?C():C),[C]),q=(0,i.useMemo)((()=>"function"==typeof k?k():k),[k]),H=(0,i.useMemo)((()=>"function"==typeof S?S():S),[S]),Z=(0,i.useMemo)((()=>"function"==typeof R?R():R),[R]),I=(0,i.useRef)(),D=(0,i.useRef)(!1),[M,F]=(0,i.useState)(null),[O,V]=(0,i.useState)(!1),[z,j]=(0,i.useState)(!1),[W,$]=(0,i.useState)(null),[U,Q]=(0,i.useState)({x:void 0,y:void 0,...H}),K=(0,i.useCallback)(((e,t)=>{Q(20===e?{x:e,y:t}:{x:e,y:t,...H})}),[H]),G=(0,i.useCallback)((()=>{const e=Z?.split(" ")||[];return{x:e.includes("right")?n.current?.offsetWidth:0,y:e.includes("bottom")?n.current?.offsetHeight:0}}),[Z]),J=(0,i.useCallback)((()=>{var e,t,o,a;if(!M)return;const r=q&&null!==(e=document.querySelector(q)?.contentDocument)&&void 0!==e?e:document,i=Xe(null!==(t=r.querySelector(P))&&void 0!==t?t:M);if(r!==document){const e=Xe(r.defaultView.frameElement);i.x+=e.x,i.left+=e.x,i.right+=e.x,i.y+=e.y,i.top+=e.y,i.bottom+=e.y}if(window.innerWidth<=960)return void p("closed-resize");if(void 0===N?.x)return K(void 0,void 0),$(null),void j(!1);const l=Math.max(20,i?.[N.x]-G().x),s=Math.max(20,i?.[N.y]-G().y),c=n.current;K(Math.min(l,window.innerWidth-(null!==(o=c?.offsetWidth)&&void 0!==o?o:0)-20),Math.min(s,window.innerHeight-(null!==(a=c?.offsetHeight)&&void 0!==a?a:0)-20)),$(i)}),[M,N,G,K,q,P,p]);if((0,i.useLayoutEffect)((()=>{g?.startFrom&&(h()||(V(!0),_(a.id),p("redirected"),window.location.assign(g?.startFrom[0]),window.location.href.split("#")[0]===g.startFrom[0].split("#")[0]&&window.location.reload()))}),[g?.startFrom,a,_,p,h]),(0,i.useEffect)((()=>{r&&document.querySelectorAll("[inert]").forEach((e=>e?.removeAttribute("inert")))}),[r]),(0,i.useEffect)((()=>{const e=e=>{const{tourSlug:t}=e.detail;Fe[t]&&requestAnimationFrame((()=>{window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),u(Fe[t])}))};return window.addEventListener("extendify-assist:start-tour",e),()=>{window.removeEventListener("extendify-assist:start-tour",e)}}),[u]),(0,i.useLayoutEffect)((()=>{if(O)return;const e=L;let t=0;if(!e||!Fe[e])return T();const n=()=>{requestAnimationFrame((()=>{u(Fe[e])})),T()};return addEventListener("load",n),"complete"===document.readyState&&(t=requestAnimationFrame(n)),()=>{cancelAnimationFrame(t),removeEventListener("load",n)}}),[u,L,T,O]),(0,i.useEffect)((()=>{var e,t;if(!P)return;const n=null!==(t=(q&&null!==(e=document.querySelector(q)?.contentDocument)&&void 0!==e?e:document).querySelector(P))&&void 0!==t?t:document.querySelector(P);return n?(F(n),()=>F(null)):void 0}),[q,P]),(0,i.useLayoutEffect)((()=>{if(M&&!O)return j(!0),J(),addEventListener("resize",J),E?.allowPointerEvents||(M.style.pointerEvents="none"),()=>{removeEventListener("resize",J),M.style.pointerEvents="auto"}}),[O,M,J,E]),(0,i.useEffect)((()=>{D.current||r&&(D.current=!0)}),[r]),(0,i.useEffect)((()=>{if(void 0===r||!M)return;v?.onAttach?.(M);let e=0;const t=requestAnimationFrame((()=>{M.scrollIntoView({block:"start"}),J(),e=requestAnimationFrame(J)}));return I?.current?.focus(),()=>{v?.onDetach?.(M),cancelAnimationFrame(t),cancelAnimationFrame(e)}}),[r,v,M,J,I]),(0,i.useLayoutEffect)((()=>{if(g?.allowOverflow)return document.documentElement.classList.add("ext-force-overflow-auto"),()=>{document.documentElement.classList.remove("ext-force-overflow-auto")}}),[g]),!z)return null;const Y=ot(W,A);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.M,null,Boolean(a)&&(0,o.createElement)(c.Vq,{as:d.E.div,static:!0,initialFocus:I,className:"extendify-help-center",open:Boolean(a),onClose:()=>{}},(0,o.createElement)("div",{className:"relative z-max"},(0,o.createElement)(d.E.div,{ref:n,animate:{opacity:1,...U},initial:{opacity:0,...U},onAnimationComplete:()=>{J()},transition:{duration:D.current?.5:0,ease:"easeInOut"},className:"fixed left-0 top-0 z-20 flex max-w-xs flex-col bg-transparent shadow-2xl sm:overflow-hidden",style:{minWidth:null!==(e=g?.minBoxWidth)&&void 0!==e?e:"325px"}},(0,o.createElement)("button",{"data-test":"close-tour",className:"absolute right-0 top-0 z-20 m-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-white p-0 leading-none outline-none ring-1 ring-gray-200 focus:shadow-none focus:ring-wp focus:ring-design-main rtl:left-0 rtl:right-auto",onClick:()=>p("closed-manually"),"aria-label":(0,s.__)("Close Modal","extendify-local")},(0,o.createElement)(m.Z,{icon:B.Z,className:"h-4 w-4 fill-current"})),(0,o.createElement)(c.Vq.Title,{className:"sr-only"},null!==(t=a?.title)&&void 0!==t?t:(0,s.__)("Tour","extendify-local")),y&&(0,o.createElement)("div",{className:"w-full p-6",style:{minHeight:150,background:"linear-gradient(58.72deg, #485563 7.71%, #29323C 92.87%)"}},(0,o.createElement)("img",{src:y,className:"block w-full",alt:x})),(0,o.createElement)("div",{className:"relative m-0 bg-white p-6 pt-0 text-left rtl:text-right"},x&&(0,o.createElement)("h2",{className:"mb-2 text-xl font-medium"},x),b&&(0,o.createElement)("p",{className:"mb-6"},b),(0,o.createElement)(nt,{initialFocus:I})))))),E?.allowPointerEvents||(0,o.createElement)("div",{"aria-hidden":!0,className:"fixed inset-0 z-max-1"}),(0,o.createElement)(l.M,null,Boolean(a)&&void 0!==W?.left&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(d.E.div,{initial:{opacity:0,clipPath:"polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%, 0 0)"},animate:{opacity:1,clipPath:`polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%, 0 0, ${Y.left}px 0, ${Y.left}px ${Y?.bottom}px, ${Y?.right}px ${Y.bottom}px, ${Y.right}px ${Y.top}px, ${Y.left}px ${Y.top}px)`},transition:{duration:D.current?.5:0,ease:"easeInOut"},className:"fixed inset-0 z-max-1 hidden bg-black/70 lg:block","aria-hidden":"true"}),(0,o.createElement)(tt,{rectWithPadding:Y,finishedStepOne:D}))))},tt=({rectWithPadding:e,finishedStepOne:t})=>{const[n,a]=(0,i.useState)(!1);return(0,o.createElement)(d.E.div,{initial:{...null!=e?e:{}},animate:{...null!=e?e:{}},transition:{duration:t.current?.5:0,ease:"easeInOut"},onAnimationStart:()=>a(!1),onAnimationComplete:()=>a(!0),className:x()("fixed inset-0 z-high hidden border-2 lg:block",{"border-transparent":!n,"border-design-main":n,"inset-y-auto right-0":(0,s.isRTL)()}),"aria-hidden":"true"})},nt=({initialFocus:e})=>{const{goToStep:t,completeCurrentTour:n,currentStep:a,preparingStep:r,getStepData:i,hasNextStep:c,nextStep:m,hasPreviousStep:u,prevStep:p,currentTour:f}=Ce(),{options:h={}}=i(a),{hideBackButton:g=!1}=h,{steps:y,settings:x}=f||{};return(0,o.createElement)("div",{id:"extendify-tour-navigation",className:"flex w-full items-center justify-between"},(0,o.createElement)("div",{className:"flex flex-1 justify-start rtl:flex-none"},(0,o.createElement)(l.M,null,u()&&!g&&(0,o.createElement)(d.E.div,{initial:{opacity:0},animate:{opacity:1}},(0,o.createElement)("button",{className:"flex h-8 items-center justify-center gap-2 rounded-sm bg-transparent p-0 text-gray-900 ring-design-main hover:bg-transparent focus:outline-none focus:ring-wp focus:ring-offset-1 focus:ring-offset-white disabled:opacity-60",onClick:p,disabled:r>-1},r2&&!x?.hideDotsNav?(0,o.createElement)("nav",{role:"navigation","aria-label":(0,s.__)("Tour Steps","extendify-local"),className:"flex flex-1 -translate-x-3 items-center justify-center gap-1"},y.map(((e,n)=>(0,o.createElement)("div",{key:n},(0,o.createElement)("button",{"aria-label":(0,s.sprintf)( // translators: %1$s is the current step, %2$s is the total number of steps (0,s.__)("%1$s of %2$s","extendify-local"),n+1,y.length),"aria-current":n===a,className:"m-0 block h-2.5 w-2.5 cursor-pointer rounded-full p-0 ring-offset-1 ring-offset-white focus:outline-none focus:ring-wp focus:ring-design-main "+(n===a?"bg-design-main":"bg-gray-300"),onClick:()=>t(n),disabled:r>-1}))))):null,(0,o.createElement)("div",{className:"flex flex-1 justify-end rtl:flex-none"},c()?(0,o.createElement)(j.Button,{ref:e,id:"help-center-tour-next-button","data-test":"help-center-tour-next-button",onClick:m,disabled:r>-1,className:"flex gap-2 bg-design-main text-design-text focus:text-design-text disabled:opacity-60",variant:"primary"},r>a&&(0,o.createElement)(j.Spinner,{className:"m-0 h-4 text-design-main"}),(0,o.createElement)("span",null,(0,s.__)("Next","extendify-local"))):(0,o.createElement)(j.Button,{id:"help-center-tour-next-button","data-test":"help-center-tour-next-button",onClick:()=>{n()},className:"bg-design-main",variant:"primary"},(0,s.__)("Done","extendify-local"))))},ot=(e,t)=>{var n,o,a,r,i,l,s,c,d,m;return{top:e.top-(null!==(n=t?.top)&&void 0!==n?n:0),left:e.left-(null!==(o=t?.left)&&void 0!==o?o:0),right:e.right+(null!==(a=t?.right)&&void 0!==a?a:0),bottom:e.bottom+(null!==(r=t?.bottom)&&void 0!==r?r:0),width:e.width+(null!==(i=t?.left)&&void 0!==i?i:0)+(null!==(l=t?.right)&&void 0!==l?l:0),height:e.height+(null!==(s=t?.top)&&void 0!==s?s:0)+(null!==(c=t?.bottom)&&void 0!==c?c:0),x:e.x-(null!==(d=t?.left)&&void 0!==d?d:0),y:e.y-(null!==(m=t?.top)&&void 0!==m?m:0)}},at=()=>{const{setVisibility:e,visibility:t}=ve(),{navigateTo:n}=We();return(0,i.useEffect)((()=>{const o=t=>{t?.detail?.page&&n(t.detail.page),e("open")},a=()=>{"open"===t&&e("minimized")};return window.addEventListener("extendify-hc:open",o),window.addEventListener("extendify-hc:minimize",a),()=>{window.removeEventListener("extendify-hc:open",o),window.removeEventListener("extendify-hc:minimize",a)}}),[e,t,n]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(l.M,null,(0,o.createElement)(Ye,null)),(0,o.createElement)(et,null))},rt=(e,t)=>{"function"==typeof i.createRoot?(0,i.createRoot)(t).render(e):(0,i.render)(e,t)},it=()=>{const e=new URLSearchParams(window.location.search);return["page"].includes(e.get("extendify-launch"))};var lt=n(8817),st=n(6329);const ct=()=>{const{setVisibility:e}=ve(),{incrementActivity:t}=(0,g.j)();return(0,o.createElement)("button",{type:"button","data-test":"help-center-adminbar-button",onClick:()=>{e("open"),t("hc-admin-bar-button")},className:"m-1.5 -mt-1 inline-flex h-6 cursor-pointer items-center justify-center gap-1 rounded-sm border-0 bg-wp-theme-main p-1 px-2 leading-extra-tight text-white ring-offset-1 ring-offset-wp-theme-bg focus:outline-none focus:ring-wp focus:ring-wp-theme-main"},(0,s.__)("Help","extendify-local"),(0,o.createElement)(j.Icon,{icon:st.Z,width:18,height:18,className:x()("fill-design-text",{"scale-x-[-1]":(0,s.isRTL)()})}))},dt=()=>{const{setVisibility:e}=ve(),{incrementActivity:t}=(0,g.j)();return(0,o.createElement)(j.Button,{className:"is-compact ml-1 inline-flex gap-1","data-test":"help-center-editor-page-button",onClick:()=>{e("open"),t("hc-editor-page-button")},variant:"primary"},(0,s.__)("Help","extendify-local"),(0,o.createElement)(m.Z,{icon:st.Z,width:18,height:18,className:x()("fill-design-text",{"scale-x-[-1]":(0,s.isRTL)()})}))};(()=>{if(it())return;const e="wp-admin-bar-help-center-btn";if(document.getElementById(e))return;const t=Object.assign(document.createElement("li"),{className:"extendify-help-center",id:e});document.querySelector("#wp-admin-bar-my-account")?.after(t),rt((0,o.createElement)(ct,null),t)})(),(0,lt.registerPlugin)("extendify-help-center-buttons",{render:()=>(0,o.createElement)(mt,null)});const mt=()=>((0,i.useEffect)((()=>{if(it())return;const e="extendify-gtnbrg-help-center-btn";if(document.getElementById(e))return;const t=Object.assign(document.createElement("span"),{className:"extendify-help-center",id:e});requestAnimationFrame((()=>{requestAnimationFrame((()=>{document.getElementById(e)||(document.querySelector('[aria-controls="edit-post:document"]')?.after(t),document.querySelector('[aria-controls="edit-site:template"]')?.after(t),rt((0,o.createElement)(dt,null),t))}))}))}),[]),null);r()((()=>{if(it()||window!==window.top)return;const e="extendify-help-center-main";if(document.getElementById(e))return;const t=Object.assign(document.createElement("div"),{className:"extendify-help-center",id:e});document.body.append(t),rt((0,o.createElement)(at,null),t)}))},9196:e=>{e.exports=window.React},1850:e=>{e.exports=window.ReactDOM},6989:e=>{e.exports=window.wp.apiFetch},4981:e=>{e.exports=window.wp.blocks},5609:e=>{e.exports=window.wp.components},9307:e=>{e.exports=window.wp.element},5736:e=>{e.exports=window.wp.i18n},8817:e=>{e.exports=window.wp.plugins},444:e=>{e.exports=window.wp.primitives}},e=>{e.O(0,[746,857],(()=>(4701,e(e.s=4701)))),e.O()}]);