(()=>{vare={7675(e,t,s){"use strict";s.d(t,{y:()=>i});varr=s(76416),n=function(e,t){vars={};for(varrine)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeofObject.getOwnPropertySymbols){varn=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(s[r[n]]=e[r[n]])}returns};consto="text/event-stream",a="last-event-id";functioni(e,t){var{signal:s,headers:i,onopen:c,onmessage:u,onclose:d,onerror:p,openWhenHidden:h,fetch:m}=t,g=n(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);returnnewPromise((t,n)=>{constf=Object.assign({},i);letb;functionv(){b.abort(),document.hidden||_()}f.accept||(f.accept=o),h||document.addEventListener("visibilitychange",v);letk=1e3,y=0;functionx(){document.removeEventListener("visibilitychange",v),window.clearTimeout(y),b.abort()}null==s||s.addEventListener("abort",()=>{x(),t()});constj=null!=m?m:window.fetch,w=null!=c?c:l;asyncfunction_(){vars;b=newAbortController;try{consts=awaitj(e,Object.assign(Object.assign({},g),{headers:f,signal:b.signal}));awaitw(s),await(0,r.q5)(s.body,(0,r.iv)((0,r.VL)(e=>{e?f[a]=e:deletef[a]},e=>{k=e},u))),null==d||d(),x(),t()}catch(e){if(!b.signal.aborted)try{constt=null!==(s=null==p?void0:p(e))&&void0!==s?s:k;window.clearTimeout(y),y=window.setTimeout(_,t)}catch(e){x(),n(e)}}}_()})}functionl(e){constt=e.headers.get("content-type");if(!(null==t?void0:t.startsWith(o)))thrownewError(`Expected content-type to be ${o}, Actual: ${t}`)}},76416(e,t,s){"use strict";asyncfunctionr(e,t){consts=e.getReader();letr;for(;!(r=awaits.read()).done;)t(r.value)}functionn(e){lett,s,r,n=!1;returnfunction(o){void0===t?(t=o,s=0,r=-1):t=function(e,t){consts=newUint8Array(e.length+t.length);returns.set(e),s.set(t,e.length),s}(t,o);consta=t.length;leti=0;for(;s<a;){n&&(10===t[s]&&(i=++s),n=!1);leto=-1;for(;s<a&&-1===o;++s)switch(t[s]){case58:-1===r&&(r=s-i);break;case13:n=!0;case10:o=s}if(-1===o)break;e(t.subarray(i,o),r),i=s,r=-1}i===a?t=void0:0!==i&&(t=t.subarray(i),s-=i)}}functiono(e,t,s){letr=a();constn=newTextDecoder;returnfunction(o,i){if(0===o.length)null==s||s(r),r=a();elseif(i>0){consts=n.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),l=n.decode(o.subarray(a));switch(s){case"data":r.data=r.data?r.data+"\n"+l:l;break;case"event":r.event=l;break;case"id":e(r.id=l);break;case"retry":consts=parseInt(l,10);isNaN(s)||t(r.retry=s)}}}}functiona(){return{data:"",event:"",id:"",retry:void0}}s.d(t,{VL:()=>o,iv:()=>n,q5:()=>r})},87399(e){!function(){"use strict";vart=[],s=3988292384;functionr(e){vart,r,n,o,a=-1;for(t=0,n=e.length;t<n;t+=1){for(o=255&(a^e[t]),r=0;r<8;r+=1)1&~o?o>>>=1:o=o>>>1^s;a=a>>>8^o}return-1^a}functionn(e,s){varr,o,a;if(void0!==n.crc&&s&&e||(n.crc=~0,e)){for(r=n.crc,o=0,a=e.length;o<a;o+=1)r=r>>>8^t[255&(r^e[o])];returnn.crc=r,-1^r}}!function(){vare,r,n;for(r=0;r<256;r+=1){for(e=r,n=0;n<8;n+=1)1&e?e=s^e>>>1:e>>>=1;t[r]=e>>>0}}(),e.exports=function(e,t){vars;e="string"==typeofe?(s=e,Array.prototype.map.call(s,function(e){returne.charCodeAt(0)})):e;return((t?r(e):n(e))>>>0).toString(16)},e.exports.direct=r,e.exports.table=n}()},51601(e,t,s){varr;e.exports=(r=r||function(e,t){varr;if("undefined"!=typeofwindow&&window.crypto&&(r=window.crypto),"undefined"!=typeofself&&self.crypto&&(r=self.crypto),"undefined"!=typeofglobalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeofwindow&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeofwindow&&window.crypto&&(r=window.crypto),!r)try{r=s(42305)}catch(e){}varn=function(){if(r){if("function"==typeofr.getRandomValues)try{returnr.getRandomValues(newUint32Array(1))[0]}catch(e){}if("function"==typeofr.randomBytes)try{returnr.randomBytes(4).readInt32LE()}catch(e){}}thrownewError("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){functione(){}returnfunction(t){vars;returne.prototype=t,s=newe,e.prototype=null,s}}(),a={},i=a.
// Translators: %d is the current requests balance.
__("Requests available: <counter>%d</counter>","jetpack"),a),{counter:a<s?(0,o.jsx)("span",{className:"ai-assistant-featured-image__usage-counter-no-limit"}):(0,o.jsx)("strong",{})});return(0,o.jsxs)("div",{className:"ai-assistant-featured-image__usage-counter",children:[(0,o.jsx)("span",{children:i}),(0,o.jsx)("span",{children:l})]})}},89289(e,t,s){"use strict";s.d(t,{A:()=>x});varr=s(85985),n=s(56427),o=s(47143),a=s(43656),i=s(86087),l=s(27723),c=s(10067),u=s.n(c),d=s(43984),p=s(72448),h=s(71508),m=s(62038),g=s(96390),f=s(3620),b=s(35918),v=s(75988),k=s(10790);const__=l.__,y=u()("jetpack-ai-client:featured-image");functionx({busy:e,disabled:t,placement:s,onClose:c=()=>{}}){const[u,x]=(0,i.useState)(s===v.hB),j=(0,b.A)(),{getPostContent:w,isEditedPostEmpty:_}=(0,h.A)(),{postTitle:C,postFeaturedMediaId:A,isEditorPanelOpened:S}=(0,o.useSelect)(e=>({postTitle:e(a.store).getEditedPostAttribute("title"),postFeaturedMediaId:e(a.store).getEditedPostAttribute("featured_media"),isEditorPanelOpened:e(a.store).isEditorPanelOpened??e("core/edit-post").isEditorPanelOpened}),[]),{saveToMediaLibrary:E}=(0,m.A)(),{tracks:N}=(0,r.st)(),{recordEvent:T}=N,[B,P]=(0,i.useState)(null),[I,M]=(0,i.useState)(""),{enableComplementaryArea:L}=(0,o.useDispatch)("core/interface"),{clearSelectedBlock:R}=(0,o.useDispatch)("core/block-editor"),{toggleEditorPanelOpened:D}=(0,o.useDispatch)("core/edit-post"),{editPost:F,toggleEditorPanelOpened:O}=(0,o.useDispatch)(a.store),{requireUpgrade:z,requestsCount:U,requestsLimit:H,currentTier:q,costs:V}=(0,p.A)(),$=(0,r.Bd)(q),G=V?.[v.oW]?.activeModel??10,W=G===V?.[v.oW]?.stableDiffusion?v.Dk:v.bb,Z=$===r.Ti,J=H-U<G,K=O??D,{pointer:Y,current:Q,setCurrent:X,processImageGeneration:ee,handlePreviousImage:te,handleNextImage:se,currentImage:re,currentPointer:ne,images:oe,imageStyles:ae,guessStyle:ie}=(0,f.A)({autoStart:!1,cost:G,type:"featured-image-generation",feature:v.oW,previousMediaId:A}),le=(0,i.useCallback)(()=>{x(!1),c?.()},[c]),ce=(0,i.useCallback)(()=>{x(!0)},[]),ue=(0,i.useCallback)(e=>{constt=C+"\n\n"+w();returnie(e,"featured-image-guess-style",t)},[C,w,ie]),de=(0,i.useCallback)(({userPrompt:e,style:t})=>(T("jetpack_ai_featured_image_generation_generate_image",{placement:s,model:W,site_type:j,style:t,userPrompt:e}),x(!0),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch(e=>{T("jetpack_ai_featured_image_generation_error",{placement:s,error:e?.message,model:W,site_type:j,style:t})})),[T,s,W,j,ee,w,J,C]),pe=(0,i.useCallback)(async()=>{ne.generating=!0;conste=awaitue("");P(e);constt=awaitde({userPrompt:"",style:e});t&&(y("handleFirstGenerate",t.revisedPrompt),M(t.revisedPrompt||""))},[ne,de,ue]),he=(0,i.useCallback)(({userPrompt:e,style:t})=>{T("jetpack_ai_featured_image_generation_generate_another_image",{placement:s,model:W,site_type:j,style:t}),X(()=>oe.length),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch(r=>{T("jetpack_ai_featured_image_generation_error",{placement:s,error:r?.message,model:W,site_type:j,style:t,userPrompt:e})})},[T,s,W,j,X,ee,C,w,J,oe]),me=(0,i.useCallback)(({userPrompt:e,style:t})=>{T("jetpack_ai_featured_image_generation_try_again",{placement:s,model:W,site_type:j,style:t}),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch(e=>{T("jetpack_ai_featured_image_generation_error",{placement:s,error:e?.message,model:W,site_type:j,style:t})})},[T,s,W,j,ee,w,J,C]),ge=(0,i.useCallback)(()=>(R(),L("core/edit-post","edit-post/document")),[R,L]),fe=(0,i.useCallback)(()=>{T("jetpack_ai_featured_image_generation_use_image",{placement:s,model:W,site_type:j});conste=e=>{F({featured_media:e}),le(),setTimeout(()=>{conste=S("featured-image"),t=S("post-status");ge().then(()=>{e||K("featured-image"),t||K("post-status")})},500)};re?.libraryId?e(re?.libraryId):E(re?.image).then(t=>{e(t?.id)}).catch(e=>{T("jetpack_ai_featured_image_saving_error",{placement:s,error:e?.message,model:W,site_type:j})})},[T,s,W,j,re?.libraryId,re?.image,F,le,S,ge,K,E]),be=__("Generate another image","jetpack"),ve=__("Generate","jetpack
// Translators: %d is the cost of generating a featured image.
__("Featured image generation costs %d requests per image. You don't have enough requests to generate another image.","jetpack"),G):null,_e=(0,k.jsx)(n.Button,{onClick:fe,variant:"primary",disabled:!re?.image||re?.generating||re?.libraryId===A,children:__("Set as featured image","jetpack")});return(0,k.jsxs)(k.Fragment,{children:[(s===d.s6||s===d.wb)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"jetpack-ai-assistant__help-text",children:__("Based on your post content.","jetpack")}),(0,k.jsx)(n.Button,{onClick:ce,isBusy:e,disabled:t||J,variant:"secondary",__next40pxDefaultSize:!0,children:__("Generate image","jetpack")})]}),(0,k.jsx)(g.A,{autoStart:ke&&!A,autoStartAction:pe,images:oe,currentIndex:Q,title:__("Generate a featured image with AI","jetpack"),cost:G,open:u,placement:s,onClose:le,onTryAgain:me,onGenerate:Y?.current>0||A?he:de,generating:ne?.generating,notEnoughRequests:J,requireUpgrade:z,upgradeDescription:we,currentLimit:H,currentUsage:U,isUnlimited:Z,hasError:Boolean(ne?.error),handlePreviousImage:te,handleNextImage:se,acceptButton:_e,generateButtonLabel:Y?.current>0?be:ve,instructionsPlaceholder:__("Describe the featured image you'd like to create and select a style.","jetpack"),imageStyles:ae,onGuessStyle:ue,prompt:I,setPrompt:M,initialStyle:B,inputDisabled:xe,actionDisabled:je})]})}},83158(e,t,s){"use strict";s(85985),s(56427),s(86087),s(27723);varr=s(10067),n=s.n(r);s(72448),s(71508),s(62038),s(96390),s(3620),s(35918),s(10790);n()("jetpack-ai:general-purpose-image")},3620(e,t,s){"use strict";s.d(t,{A:()=>p});varr=s(47143),n=s(86087),o=s(27723),a=s(93832),i=s(31439),l=s(72448),c=s(62614),u=s(62038),d=s(75988);const__=o.__;functionp({feature:e,type:t,cost:s,autoStart:o=!0,previousMediaId:p}){const{generateImageWithParameters:h}=(0,c.Ay)(),{increaseRequestsCount:m,featuresControl:g}=(0,l.A)(),{saveToMediaLibrary:f}=(0,u.A)(),{createNotice:b}=(0,r.useDispatch)("core/notices"),v=(0,n.useRef)(0),[k,y]=(0,n.useState)(0),[x,j]=(0,n.useState)([{generating:o}]),w=e===d.oW?"featured-image":"image",_=g?.[w],C=_?.styles,A=(0,n.useCallback)((e,t)=>{j(s=>{constr=[...s];returnr[t]={...r[t],...e},r})},[]),S=(0,r.useSelect)(e=>e("core")?.getEntityRecord?.("postType","attachment",p),[p]);(0,n.useEffect)(()=>{S&&A({image:S.source_url,libraryId:S.id,libraryUrl:S.source_url,generating:!1},v.current)},[S,A]);constE=(0,n.useCallback)(e=>{b("success",e,{type:"snackbar",isDismissible:!0})},[b]),N=(0,n.useCallback)(()=>{m(s)},[m,s]),T=(0,n.useCallback)(e=>{if(!e)return"image.png";constt=e.split(" ").slice(0,10).join(" ");return(0,a.cleanForSlug)(t)+".png"},[]),B=(0,n.useCallback)(({userPrompt:s,postContent:r,notEnoughRequests:n,style:o=null})=>newPromise((a,i)=>{if(p&&0===v.current&&v.current++,A({generating:!0,error:null},v.current),n)returnA({generating:!1,error:newError(__("You don't have enough requests to generate another image.","jetpack"))},v.current),voida({});constl=h({feature:e,size:"1792x1024",responseFormat:"b64_json",messages:[{role:"jetpack-ai",context:{type:t,request:s||null,content:r,style:o}}],style:o||""}),c=T(s);l.then(e=>{if(e.data.length>0){constt="data:image/png;base64,"+e.data[0].b64_json,r=s||null,n=e.data[0].revised_prompt||null;A({image:t,prompt:r,revisedPrompt:n},v.current),N(),f(t,c).then(e=>{E(__("Image saved to media library.","jetpack")),A({libraryId:e?.id,libraryUrl:e?.url,generating:!1},v.current),v.current+=1,a({image:t,libraryId:e?.id,libraryUrl:e?.url,revisedPrompt:n})}).catch(()=>{A({generating:!1},v.current),v.current+=1,a({image:t})})}}).catch(e=>{A({generating:!1,error:e},v.current),i(e)})}),[A,h,e,t,N,f,E,T,p]),P=(0,n.useCallback)(()=>{y(Math.max(k-1,0))},[k]),I=(0,n.useCallback)(()=>{y(Math.min(k+1,x.length-1))},[k,x.length]),M=(0,n.useCallback)(asyncfunction(e,t="",s=""){if(!C||!C.length)returnnull;constr=[{role:"jetpack-ai",context:{type:t||"general-image-guess-style",request:e,content:s}}];try{conste=await(0,i.A)(r,{feature:"jetpack-ai-image-generator"});if(!e)returnnull;constt=C.find(({value:t})=>t===e);returnt?t.value:null}catch(e){Promise.reject(e)}}
// translators: %1$d: number of requests remaining
__("You have %1$d requests remaining.","jetpack"),e)}),(0,p.jsx)(r.Button,{variant:"link",onClick:s,href:n,target:n?"_blank":null,children:(0,p.jsx)("span",{children:__("Upgrade now","jetpack")})})]})}functionw({error:e,code:t,onTryAgainClick:s,onUpgradeClick:n,upgradeUrl:a}){consti=e||__("Something went wrong","jetpack");return(0,p.jsxs)(v,{severity:m,children:[(0,p.jsx)("span",{children:(0,o.sprintf)(
// translators: %1$d: A dynamic error message
__("Error: %1$s","jetpack"),i)}),t===u.Or?(0,p.jsx)(r.Button,{variant:"link",onClick:n,href:a,target:a?"_blank":null,children:(0,p.jsx)("span",{children:__("Upgrade now","jetpack")})}):(0,p.jsx)(r.Button,{variant:"link",onClick:s,children:(0,p.jsx)("span",{children:__("Try again","jetpack")})})]})}},14016(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(56427),n=s(27723),o=s(51489),a=s(6754),i=s(10790);const__=n.__,l=({requestingState:e,onClose:t,title:s})=>(0,i.jsxs)("div",{className:"ai-assistant-modal__header",children:[(0,i.jsxs)("div",{className:"ai-assistant-modal__title-wrapper",children:[(0,i.jsx)(a.A,{state:e}),(0,i.jsx)("h1",{className:"ai-assistant-modal__title",children:s})]}),(0,i.jsx)(r.Button,{icon:o.A,label:__("Close","jetpack"),onClick:t})]});functionc({children:e,handleClose:t,hideHeader:s=!0,requestingState:n="init",title:o=__("AI Assistant","jetpack"),maxWidth:a=720}){return(0,i.jsx)(r.Modal,{__experimentalHideHeader:s,className:"ai-assistant-modal",shouldCloseOnClickOutside:!1,onRequestClose:t,children:(0,i.jsxs)("div",{className:"ai-assistant-modal__content",style:{maxWidth:a},children:[(0,i.jsx)(l,{requestingState:n,onClose:t,title:o}),(0,i.jsx)("hr",{className:"ai-assistant-modal__divider"}),e]})})}},57853(e,t,s){"use strict";s.d(t,{A:()=>b,Q:()=>f});varr=s(3924),n=s(85985),o=s(82201),a=s(56427),i=s(86087),l=s(27723),c=s(10067),u=s.n(c),d=s(42694),p=s(72448),h=s(71567),m=s(10790);const__=l.__,g=u()("jetpack-ai-client:upgrade-prompt"),f=({variant:e="error"})=>{constt=(()=>{const{usagePeriod:e}=(0,p.A)(),t=(e=>{constt=__("You've reached this month's request limit, per our <link><span>fair usage policy</span></link>.","jetpack");if(!e)returnt;
// Translators: %s is the date when the requests will reset.
consts=__("Requests will reset on %s.","jetpack");return`${t}${(0,l.sprintf)(s,e)}`})((e=>{if(!e?.nextStart)returnnull;constt=newDate(e.nextStart);returnt.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e));return(0,i.createInterpolateElement)(t,{link:(0,m.jsx)("a",{href:"https://jetpack.com/redirect/?source=ai-assistant-fair-usage-policy",target:"_blank",rel:"noreferrer"}),span:(0,m.jsx)("span",{})})})();return"muted"===e?(0,m.jsx)("span",{className:"jetpack-ai-fair-usage-notice-muted-variant",children:t}):"error"===e?(0,m.jsx)(a.Notice,{status:"error",isDismissible:!1,className:"jetpack-ai-fair-usage-notice",children:t}):null},b=e=>{const{upgradeType:t,currentTier:s}=(0,p.A)();return1===s?.value?(0,m.jsx)(f,{}):"vip"===t?(({description:e=null,useLightNudge:t=!1})=>{consts=t?h.U:o.cb,r=(0,i.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(s,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:e||r,goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null})})({description:e.description,useLightNudge:e?.useLightNudge}):(({placement:e=null,description:t=null,useLightNudge:s=!1})=>{consta=s?h.U:o.cb,{checkoutUrl:c}=(0,d.A)(),u=(0,n.CP)(),{nextTier:f,tierPlansEnabled:b,currentTier:v,requestsCount:k}=(0,p.A)(),{tracks:y}=(0,n.st)(),x=(0,i.useCallback)(()=>{g("upgrade",e),y.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:v?.slug,requests_count:k,placement:e})},[v,k,y,e]),j=(0,i.useCallback)(()=>{g("contact us",e),y.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})},[y,e]);if(!u){conste=(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Reach out to the site administrator to upgrade and keep using Jetpack AI.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(a,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:t||e,visible:!0,align:null,title:null,context:null})}if(b){if(!f){conste=(0,r.A)("jetpack-ai-tiers-more-requests-contact"),s=__("You have reached the request limit for your current plan.","jetpack");return(0,m.jsx)(a,{buttonText:__("Contact Us","jetpack"),description:t||s,className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:j,target:"_blank"})}conste=(0,i.createInterpolateElement)((0,l.sprintf)(/* Translators: %d: the number of requests allowed */
__("You have reached the requests limit for your current plan. <strong>Upgrade now to increase your requests limit to %d.</strong>","jetpack"),f.limit),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(a,{buttonText:(0,l.sprintf)(/* Translators: %d: the number of requests */
__("Upgrade to %d requests","jetpack"),f.limit),checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:t||e,goToCheckoutPage:x,visible:!0,align:"center",title:null,context:null,target:"_blank"})}return(0,m.jsx)(a,{buttonText:__("Upgrade","jetpack"),checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Upgrade now to keep using it.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})}),goToCheckoutPage:x,visible:!0,align:null,title:null,context:null,target:"_blank"})})(e)}},71567(e,t,s){"use strict";s.d(t,{U:()=>a});varr=s(56427),n=s(27723),o=s(10790);const__=n.__,a=({title:e,description:t,buttonText:s=null,checkoutUrl:n=null,goToCheckoutPage:a=null,isRedirecting:i=!1,showButton:l=!0,target:c="_top"})=>{constu=__("Redirecting…","jetpack");return(0,o.jsx)("div",{className:"jetpack-upgrade-plan-banner-light",children:(0,o.jsx)(r.Notice,{status:"error",isDismissible:!1,children:(0,o.jsxs)("p",{children:[e&&(0,o.jsx)("strong",{children:e}),t," ",l&&(0,o.jsx)(r.Button,{href:i?null:n,onClick:a,variant:"link",target:c,children:(0,o.jsx)("span",{children:i?u:s})})]})})})}},43984(e,t,s){"use strict";s.d(t,{A4:()=>l,DD:()=>j,DT:()=>B,Gm:()=>g,HM:()=>w,JR:()=>_,K2:()=>A,Rq:()=>T,UA:()=>m,UD:()=>C,br:()=>d,d5:()=>v,eJ:()=>h,fD:()=>p,fv:()=>k,im:()=>a,mI:()=>S,mT:()=>N,oZ:()=>o,pE:()=>f,s6:()=>P,sn:()=>i,so:()=>n,u0:()=>y,uQ:()=>x,vE:()=>u,wb:()=>I,yQ:()=>E,yy:()=>c,z5:()=>b});varr=s(27723);const__=r.__,n={en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")}},o={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},a="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",h="changeTone",m="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v="transformListToTable",k="writePostFromList",y=__("Translate","jetpack"),x=__("Change tone","jetpack"),j=__("Correct spelling and grammar","jetpack"),w=__("Simplify","jetpack"),_=__("Summarize","jetpack"),C=__("Make shorter","jetpack"),A=__("Expand","jetpack"),S=__("Turn list into a table","jetpack"),E=__("Write a post from this list","jetpack"),N=__("Generate a post title","jetpack"),T=__("Summary based on title","jetpack"),B=__("Continue writing","jetpack"),P="jetpack-sidebar",I="document-settings"},2166(e,t,s){"use strict";s.d(t,{R:()=>a});varr=s(51609),n=s(10790);consto=(0,r.createContext)({}),a=({value:e,children:t})=>(0,n.jsx)(o.Provider,{value:e,children:t})},13965(e,t,s){"use strict";s.d(t,{Rb:()=>r.R});varr=s(2166);s(59886),s(53471)},53471(e,t,s){"use strict";s(51609),s(78836),s(13965)},59886(e,t,s){"use strict";varr=s(29491),n=s(86087),o=s(46219),a=s(13965),i=s(10790);(0,r.createHigherOrderComponent)(e=>t=>{const{suggestion:s,error:r,requestingState:l,request:c,stopSuggestion:u,eventSource:d}=(0,o.Ay)(),p=(0,n.useMemo)(()=>({suggestion:s,requestingError:r,requestingState:l,eventSource:d,requestSuggestion:c,stopSuggestion:u}),[s,r,l,d,c,u]);return(0,i.jsx)(a.Rb,{value:p,children:(0,i.jsx)(e,{...t})})},"withAiDataProvider")},42694(e,t,s){"use strict";s.d(t,{A:()=>i});varr=s(3924),n=s(97999),o=s(85985),a
// translators: %d is the number of requests
__("%d requests remaining.","jetpack"),j)}),S&&(0,k.jsxs)(k.Fragment,{children:["",(0,k.jsx)(n.Button,{variant:"link",href:A,target:"_blank",onClick:()=>{s(h.AN,{context:q,placement:h.Cn})},children:(0,k.jsx)("span",{children:__("Upgrade","jetpack")})})]}),"",(0,k.jsx)(n.Tooltip,{text:__("Logo generation costs 10 requests; prompt enhancement costs 1 request each","jetpack"),placement:"bottom",children:(0,k.jsx)(a.A,{className:"prompt-footer__icon",icon:i.A})})]}),H&&V&&(0,k.jsx)(v.G,{}),H&&!V&&(0,k.jsx)(b.Q,{}),_&&(0,k.jsx)("div",{className:"jetpack-ai-logo-generator__prompt-error",children:__("Error enhancing prompt. Please try again.","jetpack")}),C&&(0,k.jsx)("div",{className:"jetpack-ai-logo-generator__prompt-error",children:__("Error generating logo. Please try again.","jetpack")})]})]})}},64024(e,t,s){"use strict";s.d(t,{G:()=>h});varr=s(85985),n=s(56427),o=s(86087),a=s(27723),i=s(13109),l=s(84699),c=s(61356),u=s(60674),d=s(88725),p=s(10790);const__=a.__,h=()=>{const{tracks:e}=(0,r.st)(),{recordEvent:t}=e,s=__("Upgrade","jetpack"),a=(0,o.createInterpolateElement)(__("Not enough requests left to generate a logo. <strong>Upgrade now to increase it.</strong>","jetpack"),{strong:(0,p.jsx)("strong",{})}),{nextTierCheckoutURL:h}=(0,u.Q)(),{context:m}=(0,d.A)();return(0,p.jsx)("div",{className:"jetpack-upgrade-plan-banner",children:(0,p.jsxs)("div",{className:"jetpack-upgrade-plan-banner__wrapper",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)(i.A,{className:"jetpack-upgrade-plan-banner__icon",icon:l.A}),(0,p.jsx)("span",{className:"jetpack-upgrade-plan-banner__banner-description",children:a})]}),(0,p.jsx)(n.Button,{href:h,target:"_blank",className:"is-primary",onClick:()=>{t(c.AN,{context:m,placement:c.tF})},children:(0,p.jsx)("span",{children:s})})]})})}},35421(e,t,s){"use strict";s.d(t,{R:()=>u});varr=s(3924),n=s(85985),o=s(56427),a=s(27723),i=s(61356),l=s(88725),c=s(10790);const__=a.__,u=({onCancel:e,upgradeURL:t,reason:s})=>{const{tracks:a}=(0,n.st)(),{recordEvent:u}=a,d=__("Upgrade your Jetpack AI for access to logo generation. This upgrade will also increase the amount of monthly requests you can use in for all AI-powered features.","jetpack"),p=__("Not enough requests left to generate a logo. Upgrade your Jetpack AI to increase the amount of requests you can use in all AI-powered features.","jetpack"),h=(0,r.A)("ai-logo-generator-fair-usage-policy",{anchor:"usage-limitations-and-upgrades"}),{context:m}=(0,l.A)();return(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-message-wrapper",children:[(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-message",children:[(0,c.jsx)("span",{className:"jetpack-ai-logo-generator-modal__loading-message",children:"feature"===s?d:p}),"",(0,c.jsx)(o.Button,{variant:"link",href:h,target:"_blank",children:(0,c.jsx)("span",{children:__("Learn more about Jetpack AI.","jetpack")})})]}),(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-actions",children:[(0,c.jsx)(o.Button,{variant:"tertiary",onClick:e,children:(0,c.jsx)("span",{children:__("Cancel","jetpack")})}),(0,c.jsx)(o.Button,{variant:"primary",href:t,target:"_blank",onClick:()=>{u(i.AN,{context:m,placement:i.Tz}),e()},children:(0,c.jsx)("span",{children:__("Upgrade","jetpack")})})]})]})}},48204(e,t,s){"use strict";s.d(t,{H:()=>c});varr=s(56427),n=s(27723),o=s(1866),a=s(13022),i=s(36791),l=s(10790);const__=n.__,c=({className:e=null,onVisitBlankTarget:t})=>(0,l.jsxs)("div",{className:(0,a.A)("jetpack-ai-logo-generator-modal-visit-site-banner",e),children:[(0,l.jsx)("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__jetpack-logo",children:(0,l.jsx)("img",{src:i,alt:"Jetpack"})}),(0,l.jsxs)("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__content",children:[(0,l.jsx)("strong",{children:__("Do you want to know all the amazing things you can do with Jetpack AI?","jetpack")}),(0,l.jsx)("span",{children:__("Generate and tweak content, create forms, get feedback and much more.","jetpack")}),(0,l.jsx)("div",{children:(0,l.jsxs)(r.Bu
// Translators: %s is the date when the requests will reset.
consts=__("Requests will reset on %s.","jetpack");return`${t}${(0,a.sprintf)(s,e)}`})((e=>{if(!e?.nextStart)returnnull;constt=newDate(e.nextStart);returnt.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e)),s=(0,r.A)("ai-logo-generator-fair-usage-policy",{anchor:"jetpack-ai-usage-limit"});return(0,o.createInterpolateElement)(t,{link:(0,l.jsx)("a",{href:s,target:"_blank",rel:"noreferrer"}),span:(0,l.jsx)("span",{})})}},88725(e,t,s){"use strict";s.d(t,{A:()=>f});varr=s(47143),n=s(10067),o=s.n(n),a=s(51609),i=s(31439),l=s(62614),c=s(93869),u=s(51391),d=s(19362),p=s(28229),h=s(74423),m=s(44461);constg=o()("jetpack-ai-calypso:use-logo-generator"),f=()=>{const{setSelectedLogoIndex:e,setIsSavingLogoToLibrary:t,setIsApplyingLogo:s,setIsRequestingImage:n,setIsEnhancingPrompt:o,increaseAiAssistantRequestsCount:f,addLogoToHistory:b,setContext:v,setIsLoadingHistory:k}=(0,r.useDispatch)(h.E),{logos:y,selectedLogoIndex:x,selectedLogo:j,siteDetails:w,isSavingLogoToLibrary:_,isApplyingLogo:C,isEnhancingPrompt:A,isBusy:S,isRequestingImage:E,getAiAssistantFeature:N,requireUpgrade:T,context:B,tierPlansEnabled:P,isLoadingHistory:I}=(0,r.useSelect)(e=>{constt=e(h.E);return{logos:t.getLogos(),selectedLogoIndex:t.getSelectedLogoIndex(),selectedLogo:t.getSelectedLogo(),siteDetails:t.getSiteDetails(),isSavingLogoToLibrary:t.getIsSavingLogoToLibrary(),isApplyingLogo:t.getIsApplyingLogo(),isRequestingImage:t.getIsRequestingImage(),isEnhancingPrompt:t.getIsEnhancingPrompt(),isBusy:t.getIsBusy(),getAiAssistantFeature:t.getAiAssistantFeature,requireUpgrade:t.getRequireUpgrade(),context:t.getContext(),tierPlansEnabled:t.getTierPlansEnabled(),isLoadingHistory:t.getIsLoadingHistory()}},[]),{setFirstLogoPromptFetchError:M,setEnhancePromptFetchError:L,setLogoFetchError:R,setSaveToLibraryError:D,setLogoUpdateError:F}=(0,m.A)(),{generateImageWithParameters:O}=(0,l.Ay)(),{saveToMediaLibrary:z}=(0,c.A)(),{ID:U=null,name:H=null,description:q=null}=w||{},V=U?String(U):null,$=N(V),G=$?.costs?.["jetpack-ai-logo-generator"]?.logo,W=$?.featuresControl?.["logo-generator"],Z=W?.styles||[],J=(0,a.useCallback)(asyncfunction(){M(null),f();try{conste=await(0,u.A)();if(!e||!e.token)thrownewError("No token provided");g("Generating first prompt for site");constt={question:`Generate a simple and short prompt asking for a logo based on the site's name and description, keeping the same language.\nExample for a site named "The minimalist fashion blog", described as "Daily inspiration for all things fashion": A logo for a minimalist fashion site focused on daily sartorial inspiration with a clean and modern aesthetic that is sleek and sophisticated.\nAnother example, now for a site called "El observatorio de aves", described as "Un sitio dedicado a nuestros compañeros y compañeras entusiastas de la observación de aves.": Un logo para un sitio web dedicado a la observación de aves, capturando la esencia de la naturaleza y la pasión por la avifauna en un diseño elegante y representativo, reflejando una estética natural y apasionada por la vida silvestre.\n\nSite name: ${H}\nSite description: ${q}`,feature:"jetpack-ai-logo-generator",stream:!1},s="https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query",r={Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},n=awaitfetch(s,{method:"POST",headers:r,body:JSON.stringify(t)}).then(e=>e.json());returnn?.choices?.[0]?.message?.content}catch(e){throwf(-1),M(e),e}},[M,f,H,q]),K=(0,a.useCallback)(asyncfunction(e){if(R(null),!Z||!Z.length)returnnull;constt=[{role:"jetpack-ai",context:{type:"ai-assistant-guess-logo-style",request:e,name:H,description:q}}];try{conste=await(0,i.A)(t,{feature:"jetpack-ai-logo-generator"});if(!e)returnnull;consts=Z.find(({value:t})=>t===e);returns?s.value:null}catch(e){g("Error guessing style",e),Promise.reject(e)}},[Z,H,q]),Y=(0,a.useCallback)(asyncfunction({prompt:e,style:t=null}){R(null);try{consts=await(0,u.A)();if(!s||!s.token)thrownewError("No token provided");if("auto"===t)thrownewError("Auto style is not supported");g("Generatingimagew
// translators: Default description for a Facebook post
__("Visit the post for more.","jetpack")]}),(0,p.jsx)("div",{className:"facebook-preview__info",children:(0,p.jsx)(d.A,{name:"info"})})]})})]})]}),(0,p.jsx)(c.A,{})]})}},44381(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(27723),n=s(98714),o=(s(84998),s(10790));const__=r.__,a=()=>(0,o.jsx)("ul",{className:"facebook-preview__post-actions",children:[{icon:"like",
_n("visitor","visitors",parseInt(A),"jetpack",0),N=/* Translators: Number of views */
_n("hit","hits",parseInt(A),"jetpack",0);return(0,h.jsxs)("div",{...C,children:[(0,h.jsx)(i.InspectorControls,{children:(0,h.jsx)(d.z,{attributes:e,setAttributes:s})}),(0,h.jsx)("div",{className:t,children:o||null===k?(0,h.jsx)("p",{className:"jetpack-blog-stats__loading",children:__("Loading stats…","jetpack")}):(0,h.jsxs)("p",{children:[(0,h.jsxs)("span",{children:[(0,n.ZV)(A)," "]}),(0,h.jsx)(i.RichText,{tagName:"span",placeholder:"visitors"===b?E:N,value:f,allowedFormats:["core/bold","core/italic","core/link"],onChange:e=>s({label:e})})]})})]})}},95184(e,t,s){"use strict";varr=s(74997),n=s(94375),o=s(35116),a=s(20201);(0,n.M)(o,{edit:a.A,save:()=>null,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog-stats"===e,transform:({instance:e})=>{constt=e.raw.title?(0,r.createBlock)("core/heading",{content:e.raw.title,level:3}):null,s=(0,r.createBlock)("jetpack/blog-stats",{label:e.raw.hits});returnt?[t,s]:s}}]}})},51744(e,t,s){"use strict";s.d(t,{k:()=>c});varr=s(97999),n=s(85985),o=s(56427),a=s(27723),i=s(35116),l=s(10790);const__=a.__,c=({className:e,isLoading:t,changeStatus:s})=>{consta=(0,r.isWoASite)()?"https://wordpress.com/support/stats/":"https://jetpack.com/support/jetpack-stats/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(o.Placeholder,{icon:(0,n.sh)(i),instructions:__("You'll need to activate the Stats module to use this block. Please note that hits are only counted while this module is active.","jetpack"),label:i.title,children:[(0,l.jsx)(o.Button,{disabled:t,isBusy:t,onClick:()=>s(!0),variant:"secondary",children:t?__("Activating Stats","jetpack"):__("Activate Stats","jetpack",0)}),(0,l.jsx)("div",{children:(0,l.jsx)(o.ExternalLink,{href:a,children:__("Learn more about the Stats module.","jetpack")})})]})})}},12169(e,t,s){"use strict";s.d(t,{A:()=>g});varr=s(1455),n=s.n(r),o=s(94715),a=s(56427),i=s(47143),l=s(86087),c=s(27723),u=s(93832),d=s(13022),p=s(54919),h=s(9075),m=s(10790);const__=c.__,_x=c._x;constg=(0,a.withNotices)(function({attributes:e,noticeOperations:t,noticeUI:s,setAttributes:r}){constg=(0,l.useRef)(!1),{answersLink:f,answersLinkText:b,gravatars:v,promptFetched:k,promptId:y,promptLabel:x,promptText:j,showLabel:w,showResponses:_,tagsAdded:C,isBloganuary:A}=e,S=(0,o.useBlockProps)({className:"jetpack-blogging-prompt"});(0,h.J)(y,C,e=>r({tagsAdded:e}));constE=(0,i.useSelect)(e=>{const{getEntityRecord:t,hasFinishedResolution:s}=e("core"),r=t("root","site")?.language||"en_US";returns("getEntityRecord",["root","site"])?r:null},[]);(0,l.useEffect)(()=>{if(!E||g.current||k)return;conste=()=>{r({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};lets="/wpcom/v3/blogging-prompts";if(y)s+="/"+encodeURIComponent(y);else{conste=newDate;s+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}s=(0,u.addQueryArgs)(s,{_locale:E,force_year:(newDate)?.getFullYear()}),g.current=!0,n()({path:s}).then(e=>{constt=y?e:e[0],s=(0,p.i)(E);r({answersLink:t.answered_link+`?locale=${s}`,answersLinkText:t.answered_link_text,gravatars:t.answered_users_sample.map(({avatar:e})=>({url:e})),promptFetched:!0,promptLabel:t.label,promptText:t.text,promptId:t.id,isBloganuary:!!t.bloganuary_id})}).catch(s=>{r({promptFetched:!0});constn="rest_post_invalid_id"===s.code&&y?(o=y,(0,m.jsxs)(m.Fragment,{children:[(0,c.sprintf)(/* translators: %d is the prompt id. */
__("Prompt with id %d not found.","jetpack"),o)," ",(0,m.jsx)(a.Button,{variant:"link",onClick:e,children:__("Reset prompt","jetpack")})]})):(t=>(0,m.jsxs)(m.Fragment,{children:[(0,c.sprintf)(/* translators: %s is the error message. */
__("Error while fetching prompt: %s","jetpack"),t)," ",(0,m.jsx)(a.Button,{variant:"link",onClick:e,children:__("Retry","jetpack")})]}))(s.message);varo;t.removeAllNotices(),t.createErrorNotice(n)})},[g,t,k,y,r,E]);constN=e=>{r({showLabel:e})},T=e=>{r({showResponses:e})},B=(0,d.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":A});return(0,m.jsxs)("div",{...S,children:[s,(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(o.InspectorControls,{children:(0,m.jsxs)(a.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack"),children:[(0,m.jsx)(a.ToggleControl,{label:__("Show prompt label","jetpack"),checked:w,onChange:N,__nextHasNoMarginBottom:!0}),(0,m.jsx)(a.ToggleControl,{label:__("Show other responses","jetpack"),checked:_,onChange:T,__nextHasNoMarginBottom:!0})]})})}),k?(0,m.jsxs)(m.Fragment,{children:[w&&(0,m.jsx)("div",{className:B,children:x}),(0,m.jsx)("div",{className:"jetpack-blogging-prompt__text",children:j}),_&&y&&(0,m.jsxs)("div",{className:"jetpack-blogging-prompt__answers",children:[v&&v.slice(0,3).map(({url:e})=>e&&(0,m.jsx)("img",{className:"jetpack-blogging-prompt__answers-gravatar",src:e},e)),(0,m.jsx)("a",{className:"jetpack-blogging-prompt__answers-link",href:f,target:"_blank",rel:"external noreferrer noopener",children:b})]})]}):(0,m.jsx)("div",{className:"jetpack-blogging-prompt__spinner",children:(0,m.jsx)(a.Spinner,{})})]})})},87888(e,t,s){"use strict";varr=s(74997),n=s(47143),o=s(27723),a=s(94375),i=s(30552),l=s(32442),c=s(12169),u=s(63757),d=s(94530),p=s(86239),h=s(57028);const__=o.__,m=newURL(document.location.href),g=m.pathname.endsWith("/wp-admin/post-new.php"),f=g?m.searchParams.get("answer_prompt")??"0":"0",b=parseInt(f),v={edit:c.A,save:h.A,example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View all responses","jetpack"),gravatars:[{url:u},{url:d},{url:p}],promptLabel:__("Daily writing prompt","jetpack"),promptText:__("What's your favorite place to visit?","jetpack"),promptFetched:!0,promptId:1234,showResponses:!0,showLabel:!0,tagsAdded:!0,isBloganuary:!1}}};b||(0,a.M)(l,v);asyncfunctionk(e){await(0,i.O)();(0,r.getBlockType)("jetpack/blogging-prompt")||awaitnewPromise(e=>{(0,a.M)(l,v),setTimeout(e,0)});const{insertBlocks:t}=(0,n.dispatch)("core/block-editor");t([(0,r.createBlock)("jetpack/blogging-prompt",{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void0,!1)}g&&b&&k(b)},57028(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(13022),o=s(10790);consta=function({attributes:e}){const{answersLink:t,answersLinkText:s,gravatars:a,promptId:i,promptLabel:l,promptText:c,showLabel:u,showResponses:d,isBloganuary:p}=e,h=r.useBlockProps.save({className:"jetpack-blogging-prompt"}),m=(0,n.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":p});return(0,o.jsxs)("div",{...h,children:[u&&(0,o.jsx)("div",{className:m,children:l}),(0,o.jsx)("div",{className:"jetpack-blogging-prompt__text",children:c}),d&&i&&(0,o.jsxs)("div",{className:"jetpack-blogging-prompt__answers",children:[a.map(({url:e})=>e&&(0,o.jsx)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:e},e)),(0,o.jsx)("a",{className:"jetpack-blogging-prompt__answers-link",href:t,target:"_blank",rel:"external noreferrer noopener",children:s})]})]})}},9075(e,t,s){"use strict";s.d(t,{J:()=>c});varr=s(1455),n=s.n(r),o=s(47143),a=s(86087),i=s(89877);functionl(e){constt=(0,i.escapeHTML)(e);returnn()({path:"/wp/v2/tags",method:"POST",data:{name:t}}).catch(t=>"term_exists"!==t.code?Promise.reject(t):Promise.resolve({id:t.data.term_id,name:e}))}functionc(e,t,s){const{editPost:r}=(0,o.useDispatch)("core/editor"),n=(0,a.useRef)("not-started"),{getEditedPostAttribute:i}=(0,o.useSelect)(e=>e("core/editor"),[]),c=(0,o.useSelect)(e=>e("core/editor").getEditedPostAttribute("type"),[]),u=(0,o.useSelect)(e=>e("core/editor").getEditedPostAttribute("tags")||[],[]),d=(0,o.useSelect)(e=>e("core").getPostType("post")?.taxonomies?.includes("post_tag"),[]),p=(0,a.useMemo)(()=>0===u.length?null:{_fields:"id,na
__("No sites found for %s.","jetpack"),s)})]}),e.length>0&&(0,o.jsx)("ul",{"aria-live":"polite",children:e.map((e,s)=>{constr=i?.some?.(t=>t?.id===e?.blog_id)||!1;return(0,o.jsx)("li",{className:"jetpack-blogroll__appender-result-container",children:(0,o.jsxs)("button",{className:"jetpack-blogroll__appender-result-title",disabled:r,onClick:()=>t(e),children:[(0,o.jsx)("div",{className:"jetpack-blogroll__appender-result-image",children:e.site_icon&&(0,o.jsx)("img",{src:e.site_icon,alt:e.name,onError:e=>{e.target.parentNode.classList.add("empty-site-icon")}})}),(0,o.jsxs)("div",{className:"jetpack-blogroll__appender-result-text",children:[(0,o.jsx)("span",{className:"jetpack-blogroll__appender-result-title",children:e.name}),(0,o.jsx)("span",{className:"jetpack-blogroll__appender-result-description",children:e.description})]})]})},`${e.blog_id}-${s}`)})})]})}},17454(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(56427),n=s(27723),o=s(10790);const__=n.__;functiona({value:e,onChange:t}){return(0,o.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,o.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Search for sites to add","jetpack"),hideLabelFromVision:!0,placeholder:__("Search…","jetpack"),value:e,onChange:e=>t(e)})})}},37127(e,t,s){"use strict";s.d(t,{A:()=>h});varr=s(56427),n=s(47143),o=s(86087),a=s(27723),i=s(60167),l=s(92507),c=s(85101),u=s(40536),d=s(17454),p=s(10790);const__=a.__;functionh({isLoading:e,subscriptions:t,clientId:s}){const[a,h]=(0,o.useState)(!1),[m,g]=(0,o.useState)(),[f,b]=(0,o.useState)(""),{insertBlock:v}=(0,n.dispatch)("core/block-editor"),{siteDetails:k,isLoading:y}=(0,l.A)({siteURL:f,subscriptions:t,enabled:f});returne?(0,p.jsx)(r.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.Button,{className:"block-editor-button-blogroll-block-appender",ref:g,icon:i.A,label:__("Add Blogroll Item","jetpack"),onClick:()=>{h(e=>!e)}}),a&&(0,p.jsxs)(r.Popover,{anchor:m,className:"jetpack-blogroll__appender",children:[(0,p.jsx)(d.A,{value:f,onChange:b}),(0,p.jsx)(u.A,{results:k,onSelect:e=>{v((0,c.FN)(e),void0,s),h(!1)},searchInput:f,isLoading:y})]})]})}},63166(e,t,s){"use strict";s.d(t,{A:()=>v});varr=s(94715),n=s(74997),o=s(56427),a=s(47143),i=s(86087),l=s(27723),c=s(13022),u=s(2274),d=s(26247),p=s(37127),h=s(32130),m=s(46542),g=s(25688),f=s(85101),b=s(10790);const__=l.__;constv=function({className:e,attributes:t,setAttributes:s,clientId:l}){const{show_avatar:v,show_description:k,open_links_new_window:y,ignore_user_blogs:x,load_placeholders:j}=t,w=(0,d.A)(),{isLoading:_,recommendations:C,errorMessage:A}=(0,h.A)(j),{isLoading:S,subscriptions:E,errorMessage:N}=(0,g.A)({ignore_user_blogs:x});(0,m.b)({clientId:l});const{replaceInnerBlocks:T}=(0,a.dispatch)("core/block-editor");(0,i.useEffect)(()=>{if(j&&C.length){s({load_placeholders:!1});conste=[(0,n.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];T(l,e)}},[C,j,s,l,T]);constB=(0,r.useBlockProps)({className:(0,c.A)(e,{"hide-avatar":!v,"hide-description":!k})});if(!w)return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(u.A,{block:"Blogroll",explanation:__("Connect your WordPress.com account to use the Blogroll block.","jetpack")})});constP=A||N;return(0,b.jsxs)("div",{...B,children:[(0,b.jsx)(r.InnerBlocks,{template:[["core/heading",{content:__("Blogroll","jetpack"),level:3}]],allowedBlocks:["jetpack/blogroll-item"],renderAppender:()=>!_&&(0,b.jsx)(p.A,{isLoading:S,subscriptions:E,clientId:l})}),P&&(0,b.jsx)(o.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:P})}),j&&_&&(0,b.jsx)(o.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(o.Spinner,{})}),(0,b.jsx)(r.InspectorControls,{children:(0,b.jsxs)(o.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(o.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>s({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(o.ToggleControl,{label:__("Show description","jetpack"),checked:!!k,onChange:()
// translators: %s is a link to the cookie policy.
__("Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: %s.","jetpack"),`<a href="https://automattic.com/cookies/">${__("Cookie Policy","jetpack")}</a>`)},15216(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(94715),n=s(56427),o=s(27723),a=s(68071),i=s(34839),l=s(10790);const__=o.__;constc=function({clientId:e,attributes:t,setAttributes:s}){const{consentExpiryDays:c,align:u,text:d=a.a}=t;(0,i.w)(e);constp=(0,r.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${u}`});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.InspectorControls,{children:(0,l.jsxs)(n.PanelBody,{title:__("Block Settings","jetpack"),children:[(0,l.jsx)(n.SelectControl,{label:__("Alignment","jetpack"),value:u,options:[{label:(0,o.isRTL)()?__("Right","jetpack"):__("Left","jetpack"),value:"left"},{label:__("Full","jetpack"),value:"full"},{label:__("Wide","jetpack"),value:"wide"},{label:(0,o.isRTL)()?__("Left","jetpack"):__("Right","jetpack"),value:"right"}],onChange:e=>function(e){constt=["wide","full"].includes(e)?{width:void0,height:void0}:{};s({...t,align:e})}(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:c,type:"number",min:"1",max:"365",onChange:e=>s({consentExpiryDays:parseInt(e)}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)("p",{children:__("Note: The block position in the editor is not indicative of the position on the front end. The block will always be positioned at the bottom of the page.","jetpack")})]})}),(0,l.jsxs)("div",{...p,style:p.style,children:[(0,l.jsx)(r.RichText,{tagName:"p",value:d,onChange:e=>s({text:e})}),(0,l.jsx)(r.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})]})]})}},78165(e,t,s){"use strict";varr=s(94375),n=s(74095),o=s(15216),a=s(75757);(0,r.M)(n,{edit:o.A,save:a.A})},75757(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(68071),o=s(10790);functiona({attributes:e}){constt=r.useBlockProps.save(),{text:s=n.a,consentExpiryDays:a}=e;return(0,o.jsxs)("div",{...t,style:t.style,role:"dialog","aria-modal":"true",children:[(0,o.jsx)(r.RichText.Content,{tagName:"p",value:s}),(0,o.jsx)(r.InnerBlocks.Content,{}),(0,o.jsx)("span",{children:a})]})}},34839(e,t,s){"use strict";s.d(t,{w:()=>l});varr=s(74997),n=s(29491),o=s(3582),a=s(47143),i=s(86087);functionl(e){constt=(0,a.useSelect)(e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:s}=e("core/editor");returnt()||s()},[]),s=!(!(0,n.usePrevious)(t)||t),[,l]=(0,o.useEntityProp)("root","site","cookie_consent_template"),{saveEditedEntityRecord:c}=(0,a.useDispatch)(o.store),[u,d]=(0,i.useState)(!1),p=(0,a.useSelect)(e=>{const{getBlock:t}=e("core/block-editor");returnt}),h=(0,i.useCallback)(e=>{d(!0),l(e),c("root","site",void0,{cookie_consent_template:e}).finally(()=>{d(!1)})},[d,l,c]);(0,i.useEffect)(()=>()=>{p(e)||h(null)},[]),(0,i.useEffect)(()=>{s&&!u&&h((0,r.serialize)([p(e)]))},[s,u,h,p,e])}},75800(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(4567),n=s(3975),o=s(94715),a=s(86087),i=s(13022),l=s(72730),c=s(10790);constu=({className:e=null,currency:t=null,defaultValue:s=null,disabled:u=!1,label:d="",onChange:p=null,value:h=""})=>{const[m,g]=(0,a.useState)((0,r.Ay)(h,t,{symbol:""})),[f,b]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),y=(0,a.useRef)(null),x=(0,a.useCallback)((e,s)=>{g(r=>{if(e!==r){constr=(0,l.C_)(e,t);r&&r>=(0,l.dv)(t)?(k(!1),s&&p?.(r)):k(!0)}returne})},[t,p]),j=()=>{y.current&&(y.current.focus(),b(!0))};return(0,a.useEffect)(()=>{if(!y.current)return;conste=y.current,n=()=>{b(!1),m||x((0,r.Ay)(s,t,{symbol:""}))};returne.addEventListener("blur",n),()=>{e.removeEventListener("blur",n)}},[t,s,m,y,x]),(0,a.useEffect)(()=>{f||v||g((0,r.Ay)(h,t,{symbol:""}))},[t,f,v,h]),(0,a.useEffect)(()=>{x((0,r.Ay)(h,t,{symbol:""}))},[t,h]),(0,c.jsxs)("div",{className:(0,i.A)("donations__amount",e,{"has-focus":f,"has-error":v}),role:"button",tabIndex:0,onC
// translators: %d: Tier level e.g: "1", "2", "3"
__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{consts=[...x];s[t]=e,k("amounts",s)})(e,t),value:e},`jetpack-donations-amount-${t}`))}),m&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>s({customAmountText:e})}),(0,c.jsx)(i.A,{currency:l,label:__("Custom amount","jetpack"),defaultValue:100*(0,a.dv)(l),className:"donations__custom-amount",disabled:!0})]}),(0,c.jsx)("hr",{className:"donations__separator"}),(0,c.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:v("extraText")??u.extraText,onChange:e=>k("extraText",e)}),(0,c.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper",children:(0,c.jsx)(r.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:__("Write a message…","jetpack"),value:v("buttonText")||u[b]?.buttonText,onChange:e=>{returnt=e,voids({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});vart},allowedFormats:j})})]})}},36580(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(86087),n=s(27723),o=s(13022),a=s(57018),i=s(62225),l=s(10790);const__=n.__,c=e=>{const{attributes:t,products:s,setAttributes:n}=e,{oneTimeDonation:c,monthlyDonation:u,annualDonation:d}=t,[p,h]=(0,r.useState)("one-time"),m=(0,r.useCallback)(e=>p===e,[p]),g={"one-time":{title:__("One-Time","jetpack")},...u.show&&{"1 month":{title:__("Monthly","jetpack")}},...d.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,r.useEffect)(()=>{c.planId===s["one-time"]&&u.planId===s["1 month"]&&d.planId===s["1 year"]||n({...s["one-time"]&&{oneTimeDonation:{...c,planId:s["one-time"]}},...s["1 month"]&&{monthlyDonation:{...u,planId:s["1 month"]}},...s["1 year"]&&{annualDonation:{...d,planId:s["1 year"]}}})},[c,u,d,n,s]),(0,r.useEffect)(()=>{!u.show&&m("1 month")&&h("one-time"),!d.show&&m("1 year")&&h("one-time")},[u,d,h,m]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"donations__container",children:[Object.keys(g).length>1&&(0,l.jsx)("div",{className:"donations__nav",children:Object.entries(g).map(([e,{title:t}])=>(0,l.jsx)("div",{role:"button",tabIndex:0,className:(0,o.A)("donations__nav-item",{"is-active":m(e)}),onClick:()=>h(e),onKeyDown:()=>h(e),children:t},`jetpack-donations-nav-item-${e}`))}),(0,l.jsx)("div",{className:"donations__content",children:(0,l.jsx)(i.A,{activeTab:p,attributes:t,setAttributes:n})})]}),(0,l.jsx)(a.A,{...e})]})}},75703(e,t,s){"use strict";functionr(){if("undefined"==typeofwindow)return{};conste=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeofe?{}:e}s.d(t,{O:()=>r})},36850(e,t,s){"use strict";s.d(t,{GY:()=>n,_t:()=>r,gQ:()=>o});constr=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,n=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,o="https://www.eventbrite.com/e/test-event-tickets-123456789"},38449(e,t,s){"use strict";s.d(t,{o:()=>c,s:()=>u});varr=s(56427),n=s(27723),o=s(5873),a=s(72660),i=s(10790);const__=n.__,_x=n._x,l=[{value:"inline",label:__("In-page Embed","jetpack"),preview:(0,i.jsx)("div",{className:"block-editor-block-preview__container",children:(0,i.jsx)("img",{src:a,alt:__("In page Eventbrite checkout example","jetpack")})})},{value:"modal",label:__("Button & Modal","jetpack")}],c=({setEditingUrl:e})=>(0,i.jsx)(r.ToolbarGroup,{children:(0,i.jsx)(r.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),u=({attributes:e,clientId:t,setAttributes:s})=>(0,i.jsx)(o.A,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:t,styleOptions:l,onSelectStyle:s,activeStyle:e.style,attributes:e,viewportWidth:130})},77629(e,t,s){"use strict";s.d(t,{A:()=>r});constr=[s(87879).A]},87879(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(94715),n=s(74997),o=s(27723),a=s(13022),i=s(66087),l=s(10790);const_x=o._x,c=["text","backgroundColor","textColor","customBackgroundColor","customTextCo
_n("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",e,"jetpack"),e):__("There are currently no posts in your Instagram account.","jetpack");return(0,a.jsx)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice",children:(0,a.jsx)(r.Notice,{isDismissible:!1,status:"info",children:t})})})():null,(0,a.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Posts","jetpack"),value:p,onChange:e=>c({count:e}),min:1,max:o.V}),(0,a.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>c({columns:e}),min:1,max:6}),(0,a.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>c({spacing:e}),min:0,max:50}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:m,onChange:()=>c({isStackedOnMobile:!m})})]})]})}},11148(e,t,s){"use strict";s.d(t,{A:()=>k});varr=s(85985),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(78218),d=s(89525),p=s(80427),h=s(57926),m=s(86975),g=s(49783),f=s(53495),b=s(80619),v=s(10790);const__=i.__,k=(0,o.withNotices)(e=>{constt=(0,n.useBlockProps)(),{attributes:s,isSelected:i,noticeOperations:k,noticeUI:y,setAttributes:x}=e,{accessToken:j,align:w,columns:_,count:C,isStackedOnMobile:A,spacing:S}=s;(0,a.useEffect)(()=>{conste=(0,u.y)(d.attributes,s);(0,c.isEqual)(e,s)||x(e)},[s,x]);const[E,N]=(0,a.useState)(j),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:B}=(0,f.A)(),{images:P,isLoadingGallery:I,setImages:M}=(0,b.A)({accessToken:j,noticeOperations:k,setAttributes:x,setSelectedAccount:N}),{connectToService:L,disconnectFromService:R,isConnecting:D,isRequestingUserConnections:F,userConnections:O}=(0,g.A)({accessToken:j,noticeOperations:k,selectedAccount:E,setAttributes:x,setImages:M,setSelectedAccount:N}),z=(0,r.gB)(),U=C>P.length?P.length:C,H=!I&&(!j||(0,c.isEmpty)(P)),q=!H,V=j&&I&&(0,c.isEmpty)(P),$=!H&&!V,G=(0,l.A)(t.className,{[`align${w}`]:w}),W=(0,l.A)("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${_}`,{"is-stacked-on-mobile":A}),Z={gridGap:S,"--latest-instagram-posts-spacing":S?`${S}px`:void0},J={padding:S},K=e=>{if(P[e]){constt=P[e];return(0,v.jsx)(m.A,{alt:t.title||t.url,src:t.url,attributes:s,spacing:S})}return(0,v.jsx)("img",{alt:__("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMyc2tBwAEOgG/c94mJwAAAABJRU5ErkJggg=="})},Y=()=>{E&&p.B!==E?x({accessToken:E,instagramUser:O.find(e=>e.token===E).username}):L()};return(0,v.jsxs)("div",{...t,className:G,children:[H&&(0,v.jsx)(o.Placeholder,{icon:"instagram",instructions:z?F||O.length?void0:__("Connect to Instagram to start sharing your images.","jetpack"):__("First, you'll need to connect your WordPress.com account.","jetpack"),label:__("Latest Instagram Posts","jetpack"),notices:y,children:z?(()=>{conste=O.length>0,t=[...O.map(e=>({label:`@${e.username}`,value:e.token})),{label:__("Add a new account","jetpack"),value:p.B}],s=D||F||e&&!E;return(0,v.jsxs)("div",{children:[e&&(0,v.jsx)(o.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>N(e),options:t,selected:E}),p.B===E&&(0,v.jsx)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions",children:__("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")}),(0,v.jsxs)(o.Button,{disabled:s,variant:"primary",onClick:Y,children:[D&&__("Connecting…","jetpack"),F&&__("Loading your connections…","jetpack"),!D&&!F&&__("Connect to Instagram","jetpack")]})]})})():(0,v.jsx)(o.Button,{disabled:T||!B,href:B,variant:"secondary",children:__("Connect to WordPress.com","jetpack")})}),V&&(0,v.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,v.jsx)(o.Spinner,{}),(0,v.jsx)("p",{children:__("Embedding…","jetpack")})]}),$&&(
__("<span>%1$d</span> likes","jetpack"),v.length),{span:(0,h.jsx)("span",{className:"wpl-count-number"})})})})})]})]})}},67511(e,t,s){"use strict";varr=s(94375),n=s(71969),o=s(434);(0,r.M)(n,{edit:o.A,save:()=>null})},40483(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(94715),n=s(56427),o=s(27723),a=s(13022),i=s(54790),l=s(10790);const__=o.__,c={name:"jetpack/button",attributes:{element:"button",text:__("Join my Mailchimp audience","jetpack"),uniqueId:"mailchimp-widget-id"}},u=({attributes:e,setAttributes:t,audition:s})=>{const{emailPlaceholder:o=i.Bd,consentText:u=i.Do,processingLabel:d=i.HD,successLabel:p=i.XO,errorLabel:h=i.Ys}=e,m={[i.k1]:d,[i.EM]:p,[i.Dc]:h}[s];return(0,l.jsxs)("div",{className:(0,a.A)({[`${i.j7}_notication-audition`]:s}),children:[(0,l.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-label":o,className:`${i.j7}_text-input`,disabled:!0,onChange:()=>!1,placeholder:o,title:__("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),(0,l.jsx)(r.InnerBlocks,{template:[[c.name,c.attributes]],templateLock:"all"}),(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),s&&(0,l.jsx)("div",{className:`${i.j7}_notification ${i.j7}_${s}`,role:s===i.Dc?"alert":"status",children:m})]})}},54790(e,t,s){"use strict";s.d(t,{Bd:()=>d,Dc:()=>a,Do:()=>p,EM:()=>o,HD:()=>h,JA:()=>c,XO:()=>m,Ys:()=>g,an:()=>l,gI:()=>u,j7:()=>i,k1:()=>n});varr=s(27723);const__=r.__,n="processing",o="success",a="error",i="wp-block-jetpack-mailchimp",l=0,c=1,u=2,d=__("Enter your email","jetpack"),p=__("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack"),h=__("Processing…","jetpack"),m=__("Success! You're on the list.","jetpack"),g=__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},20093(e,t,s){"use strict";s.d(t,{o:()=>d});varr=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(54790),l=s(60462),c=s(10790);const__=a.__,u=({auditionNotification:e,clearAudition:t,setAttributes:s,emailPlaceholder:r=i.Bd,processingLabel:o=i.HD,successLabel:a=i.XO,errorLabel:u=i.Ys,interests:d,signupFieldTag:p,signupFieldValue:h,connectURL:m})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.PanelBody,{title:__("Text Elements","jetpack"),children:(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Email Placeholder","jetpack"),value:r,onChange:e=>{s({emailPlaceholder:e}),t()}})}),(0,c.jsxs)(n.PanelBody,{title:__("Notifications","jetpack"),children:[(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Processing text","jetpack"),value:o,onChange:t=>{s({processingLabel:t}),e(i.k1)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:a,onChange:t=>{s({successLabel:t}),e(i.EM)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:u,onChange:t=>{s({errorLabel:t}),e(i.Dc)}})]}),(0,c.jsxs)(n.PanelBody,{title:__("Mailchimp Groups","jetpack"),children:[(0,c.jsx)(l.A,{interests:d,onChange:(e,t)=>{constr=[...newSet([...d,e])].filter(s=>!(s===e&&!t)&&s);s({interests:r})}}),(0,c.jsx)(n.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/",children:__("Learn about groups","jetpack")})]}),(0,c.jsxs)(n.PanelBody,{title:__("Signup Location Tracking","jetpack"),children:[(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Tag","jetpack"),placeholder:__("SIGNUP","jetpack"),value:p,onChange:e=>s({signupFieldTag:e})}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Value","jetpack"),placeholder:__("website","jetpack"),value:h,onChange:e=>s({signupFieldValue:e})}),(0,c.jsx)(n.External
_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,"jetpack","jetpack"),e.length),"assertive"):t(__("No results.","jetpack"),"assertive"))}render(){const{onChange:e,onKeyDown:t}=this,{children:s,instanceId:n,completer:o}=this.props,{selectedIndex:a,filteredOptions:i}=this.state,{key:c=""}=i[a]||{},{className:d}=o,p=i.length>0,h=p?`components-autocomplete-listbox-${n}`:null,m=p?`components-autocomplete-item-${n}-${c}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[s({isExpanded:p,listBoxId:h,activeId:m,onChange:e,onKeyDown:t}),p&&(0,u.jsx)(r.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:h,role:"listbox",className:"components-autocomplete__results",children:i.map((e,t)=>(0,u.jsx)(r.Button,{id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:(0,l.A)("components-autocomplete__result",d,{"is-selected":t===a}),onClick:()=>this.select(e),children:e.label},e.key))})})]})}}consth=(0,n.compose)([r.withSpokenMessages,n.withInstanceId,r.withFocusOutside])(p)},82063(e,t,s){"use strict";functionr(e,t){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[e][t?"details":"no_details"]}s.d(t,{o:()=>r})},16815(e,t,s){"use strict";s.d(t,{BY:()=>i,ES:()=>n,_t:()=>o,iU:()=>a,jF:()=>r});constr=e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0};functionn(e,t){consts=newe.LngLatBounds;returnt.forEach(e=>{s.extend([e.coordinates.longitude,e.coordinates.latitude])}),s}functiono(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}functiona(e,t){e.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${t}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}functioni(e){returnnewe.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},42470(e,t,s){"use strict";s.d(t,{IR:()=>u,K5:()=>l,Sm:()=>a,Yc:()=>c,c6:()=>o,nQ:()=>i});varr=s(34377);functionn(e){returnMath.abs(6371e3*Math.cos(e*Math.PI/180)*2*Math.PI/256)}functiono(e,t){return512/Math.pow(2,e)*.5*n(t)}functiona(e,t){consts=e/n(t);returnMath.log2(512/(s/.5))}functioni(e,t){if(0===t.length)returnnull;consts=newe.Coordinate(-90,180),r=newe.Coordinate(90,-180);t.forEach(e=>{s.latitude=Math.max(s.latitude,e.coordinates.latitude),s.longitude=Math.min(s.longitude,e.coordinates.longitude),r.latitude=Math.min(r.latitude,e.coordinates.latitude),r.longitude=Math.max(r.longitude,e.coordinates.longitude)});constn=newe.Coordinate(s.latitude-.5*(s.latitude-r.latitude),s.longitude+.5*(r.longitude-s.longitude)),o=newe.CoordinateSpan(1.3*Math.abs(s.latitude-r.latitude),1.3*Math.abs(r.longitude-s.longitude));returnnewe.CoordinateRegion(n,o)}functionl(e,t){return()=>{consts=e.createElement("div");returns.classList.add("mapkit-popup-content"),t(s),s}}functionc(e,t){returnnewPromise(s=>{if(t.mapkitScriptIsLoading)(0,r.Cu)(t,"mapkit").then(e=>{s(e)});else{t.mapkitScriptIsLoading=!0;constn=e.createElement("script");n.addEventListener("load",async()=>{conste=await(0,r.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,s(e)},{once:!0}),n.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",n.crossOrigin="a
__("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${Array.isArray(N)?N.join("%2C"):""}&type=${s}&theme=${r}&overlay=false&domain=${B}&lang=${P&&g.L.includes(P)?P:"en-US"}&newtab=${I}&disablega=true`})]})})()]})]})})},82144(e,t,s){"use strict";varr=s(94715),n=s(74997),o=s(94375),a=s(79018),i=s(34157),l=s(8100),c=s(71833),u=s(50387),d=s(84260),p=s(10790);(0,o.M)(a,{edit:c.A,save:({attributes:{rid:e}})=>{constt=r.useBlockProps.save();return(0,p.jsx)("div",{...t,children:e?.map((e,t)=>(0,p.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},`${e}-${t}`))})},attributes:a.attributes,styles:(0,u.Iy)(),transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&0===e.textContent.indexOf("http")&&(d.XA.test(e.textContent)||d.JJ.test(e.textContent)),transform:e=>{constt=(0,d.a9)(e.textContent);return(0,n.createBlock)("jetpack/opentable",t)}}]},deprecated:[i.A,l.A]})},82101(e,t,s){"use strict";s.d(t,{L:()=>n,P:()=>r});constr=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],n=r.map(e=>e.value)},98233(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(56427),n=s(86087),o=s(27723),a=s(66087),i=s(10790);const__=o.__,_n=o._n,l=/^\s*(http[s]?:\/\/|<script)/;functionc(e){const[t,s]=(0,n.useState)(""),[o,c]=(0,n.useState)(e.rids||[]),u=/^(\d+)$|\(#(\d+)\)$/,d=(0,i.jsx)(r.FormTokenField,{value:o,saveTransform:e=>l.test(e)?"":e.trim(),onInputChange:s,label:_n("Restaurant ID","Restaurant IDs",o.length,"jetpack"),...e,onChange:t=>{consts=t.map(e=>{constt=u.exec(e);if(t){returnt[1]||t[2]}returne});c(s),e.onChange&&e.onChange(s)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0});return(0,i.jsx)("div",{className:"wp-block-jetpack-opentable-restaurant-picker",children:e.onSubmit?(0,i.jsxs)("form",{onSubmit:s=>{s.preventDefault(),e.onSubmit((0,a.isEmpty)(o)?t:o)},children:[d,(0,i.jsx)(r.Button,{variant:"secondary",type:"submit",children:__("Embed","jetpack")})]}):d})}},50387(e,t,s){"use strict";s.d(t,{Iy:()=>o,K5:()=>a,i9:()=>n});varr=s(27723);const__=r.__,n={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},o=e=>[{name:"standard",label:__("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:__("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:__("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&n].filter(Boolean),a=e=>o(e).map(e=>e.name)},59038(e,t,s){"use strict";s.d(t,{A:()=>n});varr=s(86087);functionn(e){constt=(0,r.useRef)(void0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},84260(e,t,s){"use strict";s.d(t,{JJ:()=>n,XA:()=>o,a9:()=>a});constr=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,n=/restref=([0-9]+)&/,o=/rid=([0-9]+)&/,a=e=>{if(e)return(e=>{if(!e)return;lett="";if(t=0===e.indexOf("http")?newURL(e):newURL("http:"+e),!t.host||-1===t.host.indexOf("opentable")||!t.search)return;consts=newURLSearchParams(t.search);letr=s.get("theme");"button"===s.get("type")&&(r=s.get("type"));letn=s.getAll("rid");if(n&&0!==n.length||(n=s.getAll("restref")),!n||0===n.length)return;consto={};n&&(o.rid=n);consta=s.get("domain");a&&(o.domain=a);consti=s.get("iframe");i&&(o.iframe=i);constl=s.get("lang");l&&(o.lang=l);constc=s.get("newtab");returnc&&(o.newtab=c),r&&(o.style=r),o})((e=>{constt=e.match(r);returnt&&t[1]?t[1]:n.test(e)||o.test(e)?e:void0})(e))}},72347(e,t,s){"use strict";s.d(t,{A:()=>f});varr=s(94715),n=s(47143),o=s(86087),a=s(52619),i=s(27723),l=s(13022),c=s(2274),u=s(72462),d=s(53796),p=s(26247),h=s(16521),m=s(10790);const__=i.__,g=["jetpack/recurring-payments"];constf=function({clientId:e,attributes:t}){const{layout:s,fontSize:i}=t,{connectUrl:f,isApiConnected:b}=(0,n.useSelect)(e=>{const{getConnectUrl:t,isApiStateConnected:s}=e(h.M);return{connectUrl:t(),isApiConnected:s()}}),v=(0,p.A)(),k=(0,n.useSelect)(t=>t("core/block-editor")
`${(0,i.sprintf)(__("Loading: %s","jetpack"),s)}${o}`,"assertive"),!0};loadAndPlay=e=>{this.recordUserInteraction(),this.loadTrack(e)&&this.props.playMediaSource(this.props.playerId)};getTrack=e=>this.props.tracks[e];handleError=e=>{if(!this.state.hasUserInteraction){constt=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState(()=>{thrownewError(t)})}this.props.errorMediaSource(this.props.playerId),(0,r.speak)(`${__("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")};handlePlay=()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})};handlePause=()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==u.pF&&this.props.pauseMediaSource(this.props.playerId)};handleTimeChange=e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)};handleJump=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)};handleSkip=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)};updateMediaData=e=>{this.props.updateMediaSourceData(this.props.playerId,{duration:e.target?.duration,domId:e.target?.id})};registerPlayer(){conste=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:u.vh}),this.props.setDefaultMediaSource(t)}componentDidMount(){this.props.playerId&&this.registerPlayer()}componentWillUnmount(){this.props.playerId&&this.props.unregisterMediaSource(this.props.playerId)}componentDidUpdate(e){constt=e=>e?.length?e.map(e=>e.guid):[],s=t(this.props.tracks),r=newSet(t(e.tracks));s.length===r.size&&s.every(e=>r.has(e))||this.loadTrack(0)}staticgetDerivedStateFromProps(e,t){returne.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:s,cover:r,tracks:n,attributes:o,currentTime:a,playerState:u}=this.props,{itemsToShow:m,primaryColor:f,customPrimaryColor:b,hexPrimaryColor:v,secondaryColor:k,customSecondaryColor:y,hexSecondaryColor:x,backgroundColor:j,customBackgroundColor:w,hexBackgroundColor:_,showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S}=o,{currentTrack:E}=this.state,N=n.slice(0,m),T=this.getTrack(E),B=(0,d.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:j,customBackgroundColor:w}),P={color:y,backgroundColor:w,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":x,"--jetpack-podcast-player-background":_},I=(0,l.A)("jetpack-podcast-player",u,B.secondary.classes,B.background.classes);return(0,g.jsxs)("section",{className:I,style:P,"aria-labelledby":t||T&&T.title?`${e}__title`:void0,"aria-describedby":T&&T.description?`${e}__track-description`:void0,"data-jetpack-iframe-ignore":!0,children:[(0,g.jsx)(p.A,{playerId:e,title:t,link:s,cover:r,track:this.getTrack(E),showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S,colors:B,children:(0,g.jsx)(c.A,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(E).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:u,currentTime:a,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})}),N.length>1&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h4",{id:`jetpack-podcast-player__tracklist-title--${e}`,className:"jetpack-podcast-player--visually-hidden",children:(0,i.sprintf)(
// translators: %s is the track title.
__("Playlist: %s","jetpack"),t)}),(0,g.jsx)("p",{id:`jetpack-podcast-player__tracklist-description--${e}`,className:"jetpack-podcast-player--visually-hidden",children:__("Select an episode to play it in the audio player.","jetpack")}),(0,g.jsx)(h.A,{playerId:e,playerState:u,currentTrack:E,tracks:N,selectTrack:this.selectTrack,colors:B})]})]})}}f.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};constb=(0,n.compose)([m.A,(0,o.withSelect)((e,t)=>{const{playerId:s}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:n}=e(u.ax);return{currentTime:r(s),playerState:n(s)}}),(0,o.withDispatch)(e=>{const{registerMediaSource:t,updateMediaSourceData:s,unregisterMediaSource:r,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(u.ax);return{registerMediaSource:t,updateMediaSourceData:s,unregisterMediaSource:r,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}})])(f)},74050(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(86087),n=s(27723),o=s(10790);const__=n.__,a=(0,r.memo)(({link:e,title:t,colors:s})=>(0,o.jsxs)("div",{className:"jetpack-podcast-player__track-error",children:[__("Episode unavailable.","jetpack")," ",e&&(0,o.jsx)("span",{className:s.secondary.classes,style:{color:s.secondary.custom},children:(0,o.jsxs)("a",{className:"jetpack-podcast-player__link",href:e,rel:"noopener noreferrer nofollow",target:"_blank",children:[(0,o.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${(0,n.sprintf)(/* translators: %s is the title of the track. This text is visually hidden from the screen, but available to screen readers. */
__("%s:","jetpack"),t)}`}),__("Open in a new tab","jetpack")]})})]}))},35311(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(86087),n=s(27723),o=s(62796),a=s(10790);const __=n.__,i=(0,r.memo)(({isPlaying:e,isError:t,className:s})=>{let r,n;t?(n="error",
f=t?__("track","jetpack"):void0;return(0,c.jsxs)("li",{className:m,style:Object.keys(g).length?g:null,children:[(0,c.jsxs)("a",{className:"jetpack-podcast-player__link jetpack-podcast-player__track-link",href:e.link||e.src,role:"button","aria-current":f,onClick:e=>{e.shiftKey||e.metaKey||e.altKey||(e.preventDefault(),n(u))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),n(u))},children:[(0,c.jsx)(l.A,{className:"jetpack-podcast-player__track-status-icon",isPlaying:s,isError:r}),(0,c.jsx)("span",{className:"jetpack-podcast-player__track-title",children:e.title}),e.duration&&(0,c.jsx)("time",{className:"jetpack-podcast-player__track-duration",dateTime:e.duration,children:e.duration})]}),t&&r&&(0,c.jsx)(i.A,{link:e.link,title:e.title,colors:d})]})})},81166(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(86087),n=s(27723),o=s(10790);const__=n.__;functiona(e){classtextendsr.Component{state={didError:!1,isIE11AudioIssue:!1};componentDidCatch=(e,t)=>{this.props.onError(e,t)};staticgetDerivedStateFromError=e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)});render(){const{didError:t,isIE11AudioIssue:s}=this.state;returnt?(0,o.jsx)("section",{className:"jetpack-podcast-player",children:(0,o.jsx)("p",{className:"jetpack-podcast-player__error",children:s?__('The podcast player cannot be displayed as your browser settings do not allow for sounds to be played in webpages. This can be changed in your browser’s "Internet options" settings. In the "Advanced" tab you will have to check the box next to "Play sounds in webpages" in the "Multimedia" section. Once you have confirmed that the box is checked, please press "Apply" and then reload this page.',"jetpack"):__("An unexpected error occurred within the Podcast Player. Reloading this page might fix the problem.","jetpack",0)})}):(0,o.jsx)(e,{...this.props})}}returnt.defaultProps={onError:()=>{}},t}},38288(e,t,s){"use strict";s.d(t,{Q:()=>n,g:()=>r});constr="podcast-feed",n="embed-block"},18029(e,t,s){"use strict";s.d(t,{A:()=>n});varr=s(98329);constn={attributes:{url:{type:"string"},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:r.A},hexPrimaryColor:{type:"string",validator:r.A},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:r.A},hexSecondaryColor:{type:"string",validator:r.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:r.A},hexBackgroundColor:{type:"string",validator:r.A},exampleFeedData:{type:"object"}},supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:()=>null}},60025(e,t,s){"use strict";s.d(t,{A:()=>N});varr=s(97999),n=s(94715),o=s(74997),a=s(56427),i=s(29491),l=s(47143),c=s(86087),u=s(27723),d=s(93832),p=s(10067),h=s.n(p),m=s(66087),g=s(49487),f=s(34377),b=s(78218),v=s(50961),k=s(1624),y=s(57162),x=s(38288),j=s(90388),w=s(90764),_=s(19812),C=s(10790);const__=u.__,A=h()("jetpack:podcast-player:edit"),S=()=>{},E=(0,r.isWpcomPlatformSite)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",N=(0,i.compose)([(0,l.withDispatch)((e,{clientId:t,attributes:s})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,o.createBlock)("core/embed",{url:s.url}))}})),(0,n.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),a.withNotices,i.withInstanceId,g.T])(({instanceId:e,attributes:t,setAttributes:s,noticeOperations:{createErrorNotice:r,removeAllNotices:o},noticeUI:i,primaryColor:l,setPrimaryColor:u,secondaryColor:p,setSecondaryColor:h,fallbackTextColor:g,backgroundColor:N,setBackgroundColor:T,fallbackBackgroundColor:B,isSelected:P,replaceWithEmbedBlock:I})=>{constM=(0,b.y)(k.attributes,t),{url:L,selectedEpisodes:R,itemsToShow:D,showCoverArt:F,showEpisodeTitle:O,showEpisodeDescription:z,exampleFeedData:U}=M,H=`jetpack-podcast-player-block-${e}`,q=(0,n.u
_n("This block will only appear to people who have visited this page more than %d time.","This block will only appear to people who have visited this page more than %d times.",+a,"jetpack"),a):1===a?__("This block will only appear to people who are visiting this page for the first time.","jetpack"):(0,l.sprintf)(/* translators: %d: the number of people. */
_n("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+a,"jetpack"),a)}),(0,p.jsx)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container",children:(0,p.jsx)(n.InnerBlocks,{})})]})})},53183(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(94715),n=s(10790);consto=()=>{conste=r.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container",children:(0,n.jsx)(r.InnerBlocks.Content,{})})})}},84730(e,t,s){"use strict";s.d(t,{DF:()=>r,aV:()=>o,et:()=>n});constr="after-visits",n="before-visits",o=3},31566(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(84730),o=s(10790);consta={attributes:{criteria:{type:"string",default:n.DF},threshold:{type:"number",default:n.aV}},supports:{html:!1},save:({className:e})=>(0,o.jsx)("div",{className:e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},79238(e,t,s){"use strict";varr=s(94375),n=s(20242),o=s(34570),a=s(53183),i=s(31566);(0,r.M)(n,{edit:o.A,save:a.A,deprecated:[i.A]})},24097(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(94715),n=s(10790);functiono(){conste=(0,r.useBlockProps)();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(r.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]})})}},38136(e,t,s){"use strict";varr=s(94375),n=s(58180),o=s(24097),a=s(92908),i=s(92335),l=s(7651);(0,r.M)(n,{edit:o.A,save:a.A,variations:i.A},[{name:l.UU,settings:l.W0}])},92908(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(94715),n=s(10790);consto=()=>{conste=r.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(r.InnerBlocks.Content,{})})}},57699(e,t,s){"use strict";s.d(t,{N:()=>r});constr=[{code:"US",label:"🇺🇸 +1",value:"1US"},{code:"CA",label:"🇨🇦 +1",value:"1CA"},{code:"BS",label:"🇧🇸 +1242",value:"1242BS"},{code:"BB",label:"🇧🇧 +1246",value:"1246BB"},{code:"AI",label:"🇦🇮 +1264",value:"1264AI"},{code:"AG",label:"🇦🇬 +1268",value:"1268AG"},{code:"VG",label:"🇻🇬 +1284",value:"1284VG"},{code:"VI",label:"🇻🇮 +1340",value:"1340VI"},{code:"BM",label:"🇧🇲 +1441",value:"1441BM"},{code:"GD",label:"🇬🇩 +1473",value:"1473GD"},{code:"TC",label:"🇹🇨 +1649",value:"1649TC"},{code:"MS",label:"🇲🇸 +1664",value:"1664MS"},{code:"MP",label:"🇲🇵 +1670",value:"1670MP"},{code:"GU",label:"🇬🇺 +1671",value:"1671GU"},{code:"AS",label:"🇦🇸 +1684",value:"1684AS"},{code:"LC",label:"🇱🇨 +1758",value:"1758LC"},{code:"DM",label:"🇩🇲 +1767",value:"1767DM"},{code:"VC",label:"🇻🇨 +1784",value:"1784VC"},{code:"DO",label:"🇩🇴 +1849",value:"1849DO"},{code:"TT",label:"🇹🇹 +1868",value:"1868TT"},{code:"KN",label:"🇰🇳 +1869",value:"1869KN"},{code:"JM",label:"🇯🇲 +1876",value:"1876JM"},{code:"PR",label:"🇵🇷 +1939",value:"1939PR"},{code:"EG",label:"🇪🇬 +20",value:"20EG"},{code:"MA",label:"🇲🇦 +212",value:"212MA"},{code:"DZ",label:"🇩🇿 +213",value:"213DZ"},{code:"TN",label:"🇹🇳 +216",value:"216TN"},{code:"LY",label:"🇱🇾 +218",value:"218LY"},{code:"GM",label:"🇬🇲 +220",value:"220GM"},{code:"SN",label:"🇸🇳 +221",value:"221SN"},{code:"MR",label:"🇲🇷 +222",value:"222MR"},{code:"ML",label:"🇲🇱 +223",value:"223ML"},{code:"GN",label:"🇬🇳 +224",value:"224GN"},{code:"CI",label:"🇨🇮 +225",value:"225CI"},{code:"BF",label:"🇧🇫 +226",value:"226BF"},{code:"NE",label:"🇳🇪 +227",value:"227NE"},{code:"TG",label:"🇹🇬 +228",value:"228TG"},{code:"BJ",label:"🇧🇯 +229",value:"229BJ"},{code:"MU",label:"🇲🇺 +230",value:"230MU"},{code:"LR",label:"🇱🇷 +231",value:"231LR"},{code:"SL",label:"🇸🇱 +232",value:"232SL"},{code:"GH",label:"🇬🇭 +233",value:"233GH"},{code:"NG",label:"🇳🇬 +234",value:"234NG"},{code:"TD",label:"🇹🇩 +235",value:"235TD"},{code:"CF",label:"🇨🇫 +236",value:"236CF"},{code:"CM",label:"🇨🇲 +237",value:"237CM"},{code:"CV",label:"🇨🇻 +238",value:"238CV"},{c
title:__("Native Share","jetpack"),icon:(0,o.jsx)(n.d6,{icon:"share",size:24}),description:__("Share the post using your phone’s built-in sharing menu, or copy the link to the clipboard on desktop.","jetpack")}];a.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)});consti=a},11906(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(94715),n=s(56427),o=s(27723),a=s(88901),i=s(10790);const__=o.__,l=[{name:__("Small","jetpack"),value:"has-small-icon-size"},{name:__("Normal","jetpack"),value:"has-normal-icon-size"},{name:__("Large","jetpack"),value:"has-large-icon-size"},{name:__("Huge","jetpack"),value:"has-huge-icon-size"}],c=e=>{const{attributes:t,setAttributes:s}=e,{size:o}=t,c=e=>o===e||!o&&"has-normal-icon-size"===e;return(0,i.jsx)(r.BlockControls,{group:"other",children:(0,i.jsx)(n.ToolbarDropdownMenu,{label:__("Size","jetpack"),text:__("Size","jetpack"),icon:null,popoverProps:{position:"bottom right"},children:()=>(0,i.jsx)(n.MenuGroup,{children:l.map(({name:e,value:t})=>(0,i.jsx)(n.MenuItem,{icon:c(t)&&a.A,isSelected:c(t),role:"menuitemradio",onClick:()=>{s({size:t})},children:e},t))})})})}},67650(e,t,s){"use strict";s.d(t,{A:()=>i});varr=s(94715),n=s(56427),o=s(27723),a=s(10790);const__=o.__,i=(0,r.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})(e=>{const{clientId:t,attributes:s,iconBackgroundColor:o,iconColor:i,setAttributes:l,setIconBackgroundColor:c,setIconColor:u}=e,{iconBackgroundColorValue:d,iconColorValue:p}=s,{styleType:h}=s,m=(0,r.__experimentalUseMultipleOriginColorsAndGradients)(),g=[{value:i.color||p,onChange:e=>{u(e),l({iconColorValue:e})},label:__("Icon color","jetpack"),resetAllFilter:()=>{u(void0),l({iconColorValue:void0})}},{value:o.color||d,gradients:"",onChange:e=>{c(e),l({iconBackgroundColorValue:e})},onGradientChange:()=>{},label:__("Icon background","jetpack"),resetAllFilter:()=>{c(void0),l({iconBackgroundColorValue:void0})}}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.InspectorControls,{children:(0,a.jsx)(n.PanelBody,{title:__("Settings","jetpack"),children:(0,a.jsx)(n.MenuItemsChoice,{choices:[/* translators: Sharing: Sharing button option label. */
{value:"text",label:__("Text Only","jetpack")}],value:h,onSelect:e=>l({styleType:e})})})}),(0,a.jsxs)(r.InspectorControls,{group:"color",children:[g.map(({onChange:e,label:s,value:n,resetAllFilter:o})=>(0,a.jsx)(r.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n,label:s,onColorChange:e,isShownByDefault:!0,resetAllFilter:o,enableAlpha:!0,clearable:!0}],panelId:t,gradients:"",...m},`social-links-color-${s}`)),(0,a.jsx)(r.ContrastChecker,{textColor:p,backgroundColor:d,isLargeText:!1})]})]})})},83597(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(94715),n=s(27723),o=s(13022),a=s(11906),i=s(67650),l=s(10790);const__=n.__,c=["jetpack/sharing-button"];constu=function(e){const{attributes:t}=e,{size:s}=t,n=(0,l.jsx)("li",{children:__("Click plus to add a Sharing Button","jetpack")}),u=(0,o.A)(s,"jetpack-sharing-buttons__services-list"),d=(0,r.useBlockProps)({className:u}),p=(0,r.useInnerBlocksProps)(d,{allowedBlocks:c,placeholder:n,templateLock:!1,orientation:t.layout?.orientation??"horizontal",sharingEventsAdded:!0,__experimentalAppenderTagName:"li"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.A,{...e}),(0,l.jsx)(i.A,{...e}),(0,l.jsx)("ul",{...p})]})}},74956(e,t,s){"use strict";varr=s(94375),n=s(32870),o=s(83597),a=s(53840);(0,r.M)(n,{edit:o.A,save:a.A})},53840(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(13022),o=s(10790);functiona({attributes:e}){const{size:t}=e,s=(0,n.A)(t,"jetpack-sharing-buttons__services-list"),a=r.useBlockProps.save({className:s}),i=r.useInnerBlocksProps.save(a);return(0,o.jsx)("ul",{...i,id:"jetpack-sharing-serivces-list"})}},48715(e,t,s){"use strict";varr=s(85985),n=s(18692);(0,r.vp)(n.U,n.W)},18692(e,t,s){"use strict";s.d(t,{U:()=>u,W:()=>d});varr=s(56427),n=s(47143),o=s(86087),a=s(27723),i=s(71046),l=s(90062),c=s(10790);const__=a.__,u="shortlinks",d={render:()=>(0,c.jsx)(h,{})};classpextendso.Component{render(){const{shortlink:e}=this.props;returne?(0,c.jsx)(l.A,{children:(0,c.jsx)(r.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1,children:(0,c.jsx)(i.A,{link:e})})}):null}}consth=(0,n.withSelect)(e=>{constt=e("core/editor").getCurrentPost();return{shortlink:t?.jetpack_shortlink??""}})(p)},94247(e,t,s){"use strict";s.d(t,{H:()=>c,o:()=>u});varr=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(66087),l=s(10790);const__=a.__,_x=a._x;functionc({attributes:{autoplay:e,delay:t,effect:s,images:r,sizeSlug:a},imageSizeOptions:c,onChangeImageSize:u,setAttributes:d}){constp="undefined"!=typeofwindow&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,h=[{label:_x("Slide","Slideshow transition effect","jetpack"),value:"slide"},{label:_x("Fade","Slideshow transition effect","jetpack"),value:"fade"}];return(0,l.jsxs)(o.Fragment,{children:[(0,l.jsxs)(n.PanelBody,{title:__("Autoplay","jetpack"),children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Autoplay","jetpack"),help:__("Autoplay between slides","jetpack"),checked:e,onChange:e=>{d({autoplay:e})}}),e&&(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Delay between transitions (in seconds)","jetpack"),value:t,onChange:e=>{d({delay:e})},min:1,max:5}),e&&p&&(0,l.jsx)("span",{children:__("The Reduce Motion accessibility option is selected, therefore autoplay will be disabled in this browser.","jetpack")})]}),(0,l.jsx)(n.PanelBody,{title:__("Effects","jetpack"),children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Transition","jetpack"),value:s,onChange:e=>{d({effect:e})},options:h})}),!(0,i.isEmpty)(r)&&!(0,i.isEmpty)(c)&&(0,l.jsx)(n.PanelBody,{title:__("Image Settings","jetpack"),children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Size","jetpack"),value:a,options:c,onChange:e=>u(e)})})]})}functionu({allowedMediaTypes:e,attributes:{images:t},onSelectImages:s}){return(0,l.jsx)(o.Fragment,{children:!!t.length&&(0,l.jsx)(n.ToolbarGroup,{children:(0,l.jsx)(n.ToolbarItem,{childr
__("Go to slide %s","jetpack"),e)+'"></button>'}elsen+=`<div class="swiper-pagination-simple">${t} / ${s}</div>`;returnn}},16445(e,t,s){"use strict";s.d(t,{A:()=>f});varr=s(63162),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(94107),d=s(39126),p=s(31837),h=s(57464),m=s(10790);const__=i.__;classgextendsa.Component{pendingRequestAnimationFrame=null;resizeObserver=null;staticdefaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then(e=>{this.swiperInstance=e,this.initializeResizeObserver(e)}).catch(()=>{e(__("The Swiper library could not be loaded.","jetpack"))})}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:s,delay:r,effect:n,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),n!==e.effect||s!==e.autoplay||r!==e.delay||o!==e.images){lett;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then(e=>{this.swiperInstance=e,this.initializeResizeObserver(e)}).catch(()=>{a(__("The Swiper library could not be loaded.","jetpack"))})}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=newu.A(()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame(()=>{(0,h.bz)(e),e.update()})}),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)returnnull;const{autoplay:e,className:t,delay:s,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?s:null,"data-effect":a,children:(0,m.jsxs)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef,children:[(0,m.jsx)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper",children:i.map(({alt:e,caption:t,id:s,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,r.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${s}`,"data-id":s,src:a}),(0,r.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(n.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},s||a))}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,m.jsx)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,m.jsx)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})]})})}prefersReducedMotion=()=>"undefined"!=typeofwindow&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"custom",renderCustom:p.y}},{init:h.rQ,imagesReady:h.bz,paginationRender:h.n7,transitionEnd:h.WF})}constf=g},82233(e,t,s){"use strict";s.d(t,{A:()=>r});constr={html:!1,align:["cente
__("Go to slide %s","jetpack"),e)+'"></button>'}elsen+=`<div class="swiper-pagination-simple">${t} / ${s}</div>`;returnn}},41952(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(241),o=s(10790);consta=({attributes:{align:e,autoplay:t,delay:s,effect:a,images:i},className:l})=>{constc=r.useBlockProps.save({className:l});return(0,o.jsx)(n.A,{align:e,autoplay:t,className:c.className,delay:s,effect:a,images:i})}},241(e,t,s){"use strict";s.d(t,{A:()=>f});varr=s(63162),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(94107),d=s(33170),p=s(30889),h=s(34308),m=s(10790);const__=i.__;classgextendsa.Component{pendingRequestAnimationFrame=null;resizeObserver=null;staticdefaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then(e=>{this.swiperInstance=e,this.initializeResizeObserver(e)}).catch(()=>{e(__("The Swiper library could not be loaded.","jetpack"))})}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:s,delay:r,effect:n,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),n!==e.effect||s!==e.autoplay||r!==e.delay||o!==e.images){lett;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then(e=>{this.swiperInstance=e,this.initializeResizeObserver(e)}).catch(()=>{a(__("The Swiper library could not be loaded.","jetpack"))})}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=newu.A(()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame(()=>{(0,h.bz)(e),e.update()})}),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)returnnull;const{autoplay:e,className:t,delay:s,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?s:null,"data-effect":a,style:{"--aspect-ratio":i[0]?.aspectRatio?`calc(${i[0].aspectRatio})`:void0},children:(0,m.jsxs)("div",{className:"wp-block-jetpack-slideshow_container swiper",ref:this.slideshowRef,children:[(0,m.jsx)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper",children:i.map(({alt:e,caption:t,id:s,url:a,aspectRatio:i},c)=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,r.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${s}`,"data-id":s,"data-aspect-ratio":i,src:a}),(0,r.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(n.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},s?`${s}-${c}`:`${a}-${c}`))}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,m.jsx)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,m.jsx)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})]})})}prefersReducedMotion=()=>"undefined"!=typeofwindow&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion(
__("Slide %d, currently selected","jetpack"),s+1):(0,r.sprintf)(/* translators: %d: Slide number. */
_n("<span>%s reader</span> issubscribed.","<span>%s readers</span> aresubscribed.",M,"jetpack"),(0,o.qe)(M,{numberFormatOptions:{maximumFractionDigits:1}})),{span:(0,h.jsx)("span",{style:{fontWeight:"bold"}})})}),_&&(0,h.jsx)(a.__experimentalPanelColorGradientSettings,{title:__("Color","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:s.color,onColorChange:T,gradientValue:g.gradientValue,onGradientChange:g.setGradient,label:__("Button Background","jetpack")},{colorValue:L.color,onColorChange:B,label:__("Button Text","jetpack")},{colorValue:m.color,onColorChange:N,label:__("Border","jetpack")}],initialOpen:!0,children:(0,h.jsx)(a.ContrastChecker,{fontSize:j.size,textColor:L.color,backgroundColor:k.color,fallbackButtonBackgroundColor:y,fallbackTextColor:x})}),!_&&(0,h.jsx)(a.PanelColorSettings,{title:__("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:s.color,onChange:T,label:__("Button Background Color","jetpack")},{value:L.color,onChange:B,label:__("Button Text Color","jetpack")},{value:m.color,onColorChange:N,label:__("Border Color","jetpack")}],initialOpen:!1,children:(0,h.jsx)(a.ContrastChecker,{fontSize:j.size,textColor:L.color,backgroundColor:k.color,fallbackButtonBackgroundColor:y,fallbackTextColor:x})}),(0,h.jsx)(i.PanelBody,{title:__("Typography","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel",children:(0,h.jsx)(a.FontSizePicker,{withSlider:!0,value:j.size,onChange:e=>{constt=e||p.Fm;E({fontSize:t,customFontSize:t})},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,h.jsxs)(i.PanelBody,{title:__("Border","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel",children:[(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:f,label:__("Border Radius","jetpack"),min:p.rG,max:p.Bs,initialPosition:p.Kn,allowReset:!0,onChange:e=>E({borderRadius:e})}),(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:b,label:__("Border Weight","jetpack"),min:p.ZS,max:p.JD,initialPosition:p.aS,allowReset:!0,onChange:e=>E({borderWeight:e})})]}),(0,h.jsxs)(i.PanelBody,{title:__("Spacing","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel",children:[(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:C,label:__("Space Inside","jetpack"),min:p.rE,max:p.Vy,initialPosition:p.oi,allowReset:!0,onChange:e=>E({padding:e})}),(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:I,label:__("Space Between","jetpack"),min:p.Hq,max:p.Zi,initialPosition:p.E,allowReset:!0,onChange:e=>E({spacing:e})}),(0,h.jsx)(d.s,{width:R,onChange:e=>{E({buttonWidth:e,buttonOnNewLine:v||"100%"===e})}})]}),(0,h.jsxs)(i.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel",children:[(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show subscriber count","jetpack"),checked:P,onChange:()=>{E({showSubscribersTotal:!P,includeSocialFollowers:void0!==w&&w})},help:()=>{if(!M||M<1)return__("This will remain hidden until there is at least one subscriber.","jetpack")}}),O&&(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,disabled:!P,label:__("Include social followers in count","jetpack"),checked:void0===w||w,onChange:()=>{E({includeSocialFollowers:void0!==w&&!w})}}),(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Place button on new line","jetpack"),checked:v,onChange:()=>{E({buttonOnNewLine:!v})}}),(0,h.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:D,label:__("Input placeholder text","jetpack"),help:__("Edit the placeholder text of the email address input.","jetpack"),onChange:e=>E({subscribePlaceholder:e})}),!(0,r.isSimpleSite)()&&(0,h.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:F,label:__("Success message","jetpack"),help:__("Edit the message displayed when a user subscribes.","jetpack"),onChange:e=>E({successMessage:e})}),t&&
_n("Join %s other subscriber","Join %s other subscribers",r,"jetpack"),(0,n.qe)(r,{numberFormatOptions:{maximumFractionDigits:1}}))}}),{availableNewsletterCategories:Q,areNewsletterCategoriesEnabled:X}=(0,l.useSelect)(e=>{constt=e(f.M);return{availableNewsletterCategories:t.getNewsletterCategories(),areNewsletterCategoriesEnabled:t.getNewsletterCategoriesEnabled()}}),ee=w({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}),te=w({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}),se={"no-border-radius":0===L,[B.class]:B.class,"has-text-color":A.color,[A.class]:A.class},re={...se,"has-background":r.color||ee.gradientValue,[r.class]:!ee.gradientValue&&r.class,[ee.gradientClass]:ee.gradientClass},ne={...se,"has-background":x.color||te.gradientValue,[x.class]:!te.gradientValue&&x.class,[te.gradientClass]:te.gradientClass},oe=e=>e||v.E,ae={color:A.color,borderColor:N.color,borderRadius:L?L+"px":v.Kn+"px",borderWidth:R?R+"px":v.aS+"px",fontSize:B.size?B.size:v.Fm,padding:(e=>{constt=e||v.oi;returnt+"px "+Math.round(1.5*t)+"px "+t+"px "+Math.round(1.5*t)+"px"})(z)},ie={"--subscribe-block-border-radius":L?L+"px":v.Kn+"px"},le={...ae,...!r.color&&ee.gradientValue?{background:ee.gradientValue}:{backgroundColor:r.color}},ce={...ae,...!x.color&&te.gradientValue?{background:te.gradientValue}:{backgroundColor:x.color},width:D?.length?D:"auto"};"button"!==J&&(W?ce.marginTop=oe(q)+"px":ce.marginLeft=oe(q)+"px");constue=(0,i.usePrevious)(x);return(0,c.useEffect)(()=>{ue?.color===N?.color&&N?.color!==x?.color&&T(x.color)},[x,ue,N,T]),(0,y.jsxs)("div",{...I,className:(0,d.A)(I.className,"wp-block-jetpack-subscriptions__container","wp-block-jetpack-subscriptions__supports-newline",W?"wp-block-jetpack-subscriptions__use-newline":void0,G?"wp-block-jetpack-subscriptions__show-subs":void0),children:[(0,y.jsx)(o.InspectorControls,{children:(0,y.jsx)(k.A,{areNewsletterCategoriesEnabled:X,availableNewsletterCategories:Q,buttonBackgroundColor:x,borderColor:N,buttonGradient:te,borderRadius:L,borderWeight:R,buttonOnNewLine:W,emailFieldBackgroundColor:r,fallbackButtonBackgroundColor:C,fallbackTextColor:S,fontSize:B,includeSocialFollowers:O,isGradientAvailable:j,padding:z,preselectNewsletterCategories:U,setAttributes:s,setBorderColor:T,setButtonBackgroundColor:_,setTextColor:E,showSubscribersTotal:G,spacing:q,subscriberCount:K,textColor:A,buttonWidth:D,selectedNewsletterCategoryIds:H,subscribePlaceholder:$,submitButtonText:V,successMessage:Z})}),(0,y.jsx)(o.BlockControls,{children:(0,y.jsx)(a.ToolbarGroup,{children:(0,y.jsx)(a.ToolbarButton,{href:(0,g.Qu)(P),target:"_blank",children:P?_x("Manage plans","unused context to distinguish translations","jetpack"):__("Set up a paid plan","jetpack")})})}),(0,y.jsxs)("div",{style:ie,children:[(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__container is-not-subscriber",children:(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form",children:(0,y.jsxs)("div",{className:"wp-block-jetpack-subscriptions__form-elements",children:["button"!==J&&(0,y.jsx)(a.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,placeholder:$,disabled:!0,className:(0,d.A)(re,"wp-block-jetpack-subscriptions__textfield"),style:le}),(0,y.jsx)(o.RichText,{className:(0,d.A)(ne,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>s({submitButtonText:e}),style:ce,value:V,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})]})})}),G&&(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__subscount",children:Y})]})]})})},13554(e,t,s){"use strict";varr=s(85985),n=s(74997),o=s(47143),a=s(43656),i=s(86087),l=s(52619),c=s(27723),u=s(12549),d=s(94157),p=s(94375),h=s(99876),m=s(63200),g=s(39025),f=s(38387),b=s(3722),v=s(74500),k=s(48313),y=s(10790);const__=c.__,x=h.name.replace("jetpack/","");(0,p.M)(h,{edit:f.h,transforms:{from:[{type:"block",isMultiBlock:!1,blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog_subscription"===
__("image %1$d of %2$d in gallery","jetpack"),t+1,s.length);return(0,d.jsx)(l.A,{alt:e.alt,"aria-label":a,height:e.height,id:e.id,origUrl:e.url,isSelected:n===t,link:e.link,linkTo:r,url:this.photonize(e),width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:o}=this.props,a=h(o)?u.A:c.A,i=this.props.images.map(this.renderImage,this);return(0,d.jsxs)("div",{className:s,children:[(0,d.jsx)(a,{align:e,columns:r,images:n,layoutStyle:o,renderedImages:i}),t]})}}functionh(e){return["circle","square"].includes(e)}functionm(e,t={}){consts={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(newURL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,n]ofObject.entries(t))r.searchParams.set(Object.hasOwn(s,e)?s[e]:e,n);returnr.toString()}},58070(e,t,s){"use strict";s.d(t,{A:()=>d});varr=s(86087),n=s(94107),o=s(29971),a=s(75303),i=s(56237),l=s(34896),c=s(5236),u=s(10790);classdextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{for(const{contentRect:t,target:s}ofe){const{width:e}=t;(0,c.S)(s).forEach(t=>(0,c.r)(t,e))}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=newn.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:n}=this.props,c=(0,l.mJ)(s),d="columns"===r?(0,l.FL)(c,t):(0,l.VU)(c,{isWide:["full","wide"].includes(e)});letp=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:d.map((e,t)=>(0,u.jsx)(i.A,{children:e.map((e,t)=>{consts=n.slice(p,p+e);returnp+=e,(0,u.jsx)(o.A,{children:s},t)})},t))})}}},34896(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));returnt.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);consta=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);returns(a,A)};returns([],e)}functionA(e,t){returns=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}functionS(e){returnt=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}functionE(
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:h,srcSet:m}=(0,l.A)(e,{layoutStyle:c});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":p,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:u===t,link:e.link,linkTo:a,origUrl:e.url,showMovers:o.length>1,srcSet:m,url:h,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:i,roundedCorners:p}=this.props,h=(0,l.s)(i)?u.A:c.A,m=this.props.images.map(this.renderImage,this),g=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(s,{[`has-rounded-corners-${g}`]:g>0}),children:[(0,d.jsx)(h,{align:e,columns:r,images:n,layoutStyle:i,renderedImages:m}),t]})}}},84255(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(86087),n=s(84394),o=s(38548),a=s(70954),i=s(89195),l=s(10790);classcextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c}=this.props,u=(0,i.mJ)(s),d="columns"===r?(0,i.FL)(u,t):(0,i.VU)(u,{isWide:["full","wide"].includes(e)});letp=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:d.map((e,t)=>(0,l.jsx)(a.A,{children:e.map((e,t)=>{consts=c.slice(p,p+e);returnp+=e,(0,l.jsx)(n.A,{children:s},t)})},t))})}}},89195(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));returnt.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);consta=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);returns(a,A)};returns([],e)}functionA(e,t){returns=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}functionS(e){returnt=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}functionE(e){returne>=1&&e<2}functionN(e){returne<1}functionT(e){returnt=>t>=e}functionB(e){returnt=>t<e}},70954(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(13022),n=s(10790);functiono({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},51475(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(66087),n=s(43566),o=s(84394),a=s(38548),i=s(70954),l=s(10790);functionc({columns:e,renderedImages:t}){consts=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].map((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,l.jsx)(o.A,{children:e},t))},t))})}},14294(e,t,s){"use strict";s.d(t,{A:()=>l});varr=s(90907),n=s(43566),o=s(65378),a=s(10790);functioni(e){returnMath.min(3,e.images.length)}functionl({attributes:e}){const{imageFilter:t,images:s}=e;if(!s.length)returnnull;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p}=e;return(0,a.jsx)(o.A,{align:l,className:c,columns:u,imageFilter:t,images:s,isSave:!0,layoutStyle:(0,r.D
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void0:p(t),onMoveForward:a?void0:h(t),onRemove:a?void0:m(t),onSelect:a?void0:g(t),origUrl:e.url,setAttributes:a?void0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:i,roundedCorners:p,onResize:h,isSave:m,columnWidths:g}=this.props,f=(0,l.s)(i)?u.A:c.A,b=this.props.images.map(this.renderImage,this),v=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(s,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void0:h}),t]})}}},56420(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(86087),n=s(54001),o=s(99309),a=s(46479),i=s(70394),l=s(10790);classcextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(s),p="columns"===r?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});leth=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,l.jsx)(a.A,{children:e.map((e,s)=>{constr=c.slice(h,h+e);returnh+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[s],children:r},s)})},t))})}}},70394(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));returnt.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);consta=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);returns(a,A)};returns([],e)}functionA(e,t){returns=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}functionS(e){returnt=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}functionE(e){returne>=1&&e<2}functionN(e){returne<1}functionT(e){returnt=>t>=e}functionB(e){returnt=>t<e}},46479(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(13022),n=s(10790);functiono({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},65216(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(66087),n=s(60041),o=s(54001),a=s(99309),i=s(46479),l=s(10790);functionc({columns:e,renderedImages:t}){consts=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].map((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,l.jsx)(o.A,{children:e},t))},t))})}},28635(e,t,s){"use strict";s.d(t,{A:()=>l});varr=s(90907),n=s(60041),o=s(77511),a=s(10790);functioni(e){returnMath.min(3,e.images.length)}functionl({a
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void0:p(t),onMoveForward:a?void0:h(t),onRemove:a?void0:m(t),onSelect:a?void0:g(t),origUrl:e.url,setAttributes:a?void0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:i,roundedCorners:p,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,l.s)(i)?u.A:c.A,v=this.props.images.map(this.renderImage,this),k=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{style:m,className:(0,o.A)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:r,columnWidths:g?f:void0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void0:h}),t]})}}},91341(e,t,s){"use strict";s.d(t,{A:()=>d});varr=s(86087),n=s(94107),o=s(78608),a=s(52042),i=s(9276),l=s(71245),c=s(86461),u=s(10790);classdextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{for(const{contentRect:t,target:s}ofe){const{width:e}=t,r=[];(0,c.S)(s).forEach(t=>{r.push((0,c.r)(t,e))}),void0!==this.props.onResize&&this.props.onResize(r)}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=newn.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,s){letr=0;returne.map(e=>e.map(e=>{consts=t.slice(r,r+e);returnr+=e,s})).map(e=>(0,c.r)(e,s))}render(){const{align:e,columns:t,images:s,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(s),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();letm=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,u.jsx)(i.A,{children:e.map((e,s)=>{constr=c.slice(m,m+e);returnm+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[s],children:r},s)})},t))})}}},71245(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));returnt.length>=3&&4!==t.length&&6!==t.le
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void0:p(t),onMoveForward:a?void0:h(t),onRemove:a?void0:m(t),onSelect:a?void0:g(t),origUrl:e.url,setAttributes:a?void0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:i,roundedCorners:p,onResize:h,isSave:m,columnWidths:g}=this.props,f=(0,l.s)(i)?u.A:c.A,b=this.props.images.map(this.renderImage,this),v=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(s,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void0:h}),t]})}}},62579(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(86087),n=s(89798),o=s(38448),a=s(26054),i=s(79167),l=s(10790);classcextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(s),p="columns"===r?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});leth=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,l.jsx)(a.A,{children:e.map((e,s)=>{constr=c.slice(h,h+e);returnh+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[s],children:r},s)})},t))})}}},79167(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));returnt.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);consta=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);returns(a,A)};returns([],e)}functionA(e,t){returns=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}functionS(e){returnt=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}functionE(e){returne>=1&&e<2}functionN(e){returne<1}functionT(e){returnt=>t>=e}functionB(e){returnt=>t<e}},26054(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(13022),n=s(10790);functiono({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},58711(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(66087),n=s(41314),o=s(89798),a=s(38448),i=s(26054),l=s(10790);functionc({columns:e,renderedImages:t}){consts=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].map((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,l.jsx)(o.A,{children:e},t))},t))})}},91162(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(94715),n=s(13022),o=s(90907),a=s(35463),i=s(29520),l=s(6454),c=s(10790);functionu({attributes:e}){con
__("Open image %1$d of %2$d in full-screen","jetpack"),t+1,o.length),k=u.A,{src:y,srcSet:x}=(0,c.A)(e,{layoutStyle:l});return(0,d.jsx)(k,{alt:e.alt,"aria-label":v,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:i,customLink:e.customLink,onMoveBackward:a?void0:p(t),onMoveForward:a?void0:h(t),onRemove:a?void0:m(t),onSelect:a?void0:g(t),origUrl:e.url,setAttributes:a?void0:b(t),showMovers:o.length>1,srcSet:x,url:y,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:u,roundedCorners:p,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,c.s)(u)?l.A:i.A,v=this.props.images.map(this.renderImage,this),k=u!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{style:m,className:(0,o.A)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:r,columnWidths:g?f:void0,images:n,layoutStyle:u,renderedImages:v,onResize:g?void0:h}),t]})}}},80720(e,t,s){"use strict";s.d(t,{A:()=>u});varr=s(94715),n=s(13022),o=s(90907),a=s(35463),i=s(29520),l=s(1456),c=s(10790);functionu({attributes:e}){const{imageFilter:t,images:s}=e;if(!s.length)returnnull;const{align:u,className:d,columns:p=(0,i.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,c.jsxs)("div",{...f,className:(0,n.A)(f.className,d),children:[" ",(0,c.jsx)(l.A,{align:u,columns:p,imageFilter:t,images:s,isSave:!0,layoutStyle:(0,o.D)(a.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},69813(e,t,s){"use strict";s.d(t,{A:()=>r});constr={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},29520(e,t,s){"use strict";s.d(t,{Ay:()=>v,EB:()=>f});varr=s(85985),n=s(94715),o=s(56427),a=s(43656),i=s(86087),l=s(27723),c=s(66087),u=s(90907),d=s(76585),p=s(35463),h=s(77530),m=s(10309),g=s(10790);const__=l.__;functionf(e){returne.images.length>0?Math.min(3,e.images.length):3}constb=e=>{constt=(0,c.pick)(e,[["alt"],["id"],["link"]]);returnt.url=e?.sizes?.large?.url||e?.media_details?.sizes?.large?.source_url||e.url,t},v=(0,o.withNotices)(({attributes:e,isSelected:t,noticeOperations:s,noticeUI:l,setAttributes:c})=>{const{align:v,columns:k=f(e),imageFilter:y,images:x,linkTo:j,roundedCorners:w,columnWidths:_}=e,C=(0,u.D)(p.kc,e.className),A=(0,n.useBlockProps)(),[S,E]=(0,i.useState)(null),[N,T]=(0,i.useState)(void0===_||0===_?.length),B=e=>{c({images:e,ids:e.map(({id:e})=>parseInt(e,10))})},P=e=>{(0,a.mediaUpload)({allowedTypes:p.eN,filesList:e,onFileChange:e=>B((x||[]).concat(e.map(b))),onError:s.createErrorNotice}),T(!0)},I=e=>()=>{constt=x.filter((t,s)=>e!==s);E(null),T(!0),B(t),c({columns:k?Math.min(t.length,k):k})},M=e=>()=>{S!==e&&E(e)},L=e=>{constt=e.map(e=>{constt=x.find(t=>parseInt(t.id,10)===parseInt(e.id,10));returnt?.customLink?{...b(e),customLink:t.customLink}:b(e)});B(t),c({columns:k?Math.min(e.length,k):k}),T(!0)},R=(e,t)=>{consts=[...x];s.splice(t,1,x[e]),s.splice(e,1,x[t]),E(t),T(!0),B(s)},D=e=>()=>{e!==x.length-1&&R(e,e+1)},F=e=>()=>{0!==e&&R(e,e-1)},O=e=>{N&&c({columnWidths:e})},z=e=>P(e.target.files),U=e=>t=>{x[e]&&B([...x.slice(0,e),{...x[e],...t},...x.slice(e+1)])};letH;return(0,i.useEffect)(()=>{t||null===S||E(null)},[t,S,E]),H=0===x.length?(0,g.jsx)(n.MediaPlaceholder,{icon:(0,r.sh)(d),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:L,accept:"image/*",allowedTypes:p.eN,multiple:!0,notices:l,onError:s.createErrorNotice}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.M,{layoutStyle:C,images:x,columns:k,selectedImage:S,setImageAttributes:U,onColumnsChange:e=>c({columns:e}),roundedCorners:w,onRoundedCornersChange:e=>c({roundedCorners:e}),linkTo:j,onLinkToChange:e=>c({linkTo:e})}),l,(0,g.jsxs)(m.A,{className:"tiled-gallery__wrapper",align:v,columns:k,imageFilter:y,images:x,layoutStyle:C,linkTo:j,onMoveBackward:F,onMoveForward:D,onRemoveImage:I,onSelectImage:M,onResize:O,roundedCorners:w,selectedImage:t?S:null,setImageAttributes:U,children:[(0,g.js
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),y=a?l.A:i.A,{src:x,srcSet:j}=(0,c.A)(e,{layoutStyle:d});return(0,p.jsx)(y,{alt:e.alt,"aria-label":k,columns:s,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:b===t,link:e.link,linkTo:u,customLink:e.customLink,onMoveBackward:a?void0:h(t),onMoveForward:a?void0:m(t),onRemove:a?void0:g(t),onSelect:a?void0:f(t),origUrl:e.url,setAttributes:a?void0:v(t),showMovers:o.length>1,srcSet:j,url:x,width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,layoutStyle:i,roundedCorners:l,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,c.s)(i)?d.A:u.A,v=this.props.images.map(this.renderImage,this),k=i!==a.aQ?Math.min(l,a.WN):0;return(0,p.jsxs)("div",{style:m,className:(0,o.A)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,p.jsx)(b,{align:e,columns:r,columnWidths:g?f:void0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void0:h}),t]})}}},31238(e,t,s){"use strict";s.d(t,{A:()=>d});varr=s(86087),n=s(94107),o=s(98627),a=s(54359),i=s(43645),l=s(74176),c=s(18980),u=s(10790);classdextendsr.Component{gallery=(0,r.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{for(const{contentRect:t,target:s}ofe){const{width:e}=t,r=[];(0,c.S)(s).forEach(t=>{r.push((0,c.r)(t,e))}),void0!==this.props.onResize&&this.props.onResize(r)}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=newn.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,s){letr=0;returne.map(e=>e.map(e=>{consts=t.slice(r,r+e);returnr+=e,s})).map(e=>(0,c.r)(e,s))}render(){const{align:e,columns:t,images:s,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(s),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();letm=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,u.jsx)(i.A,{children:e.map((e,s)=>{constr=c.slice(m,m+e);returnm+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[s],children:r},s)})},t))})}}},74176(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});varr=s(66087);functionn(e){returne.map(o)}functiono({height:e,width:t}){returne&&t?t/e:1}functiona(e,t){if(e.length<=t)return[Array(e.length).fill(1)];consts=(0,r.sum)(e)/t,n=[];leto=e,a=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,t=>{constr=a<=(e+1)*s;returnr&&(a+=t),r}).length;n.push(t),o=o.slice(t)}returnn.push(o.length),[n]}consti=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){returne>=2}]);functionC(e,{isWide:t}={}){consts=(e,n)=>{if(!n.length)returne;leto;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){consts=(0,r.sum)(t.slice(0,4));returny(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){constn=(0,r.sum)(t.slice(0,3));return
__("Display %s","jetpack"),e.label.toLowerCase()),checked:i[e.id]||!1,onChange:(s=e.id,e=>{constr={...i,[s]:e};if(Object.values(r).every(e=>!1===e))returnf(!0);l(r),t({postTypes:r}),f(!1)})},e.id);vars}),g&&(0,a.jsx)(r.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1,children:__("At least one item must be selected.","jetpack")})]}),(0,a.jsxs)(r.PanelBody,{title:__("Metadata settings","jetpack"),children:[(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:c,onChange:e=>t({displayAuthor:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})]})]})}functionl({attributes:e,setAttributes:t}){const{layout:s}=e,n=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===s},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===s}];return(0,a.jsx)(r.ToolbarGroup,{controls:n})}},96894(e,t,s){"use strict";s.d(t,{A:()=>m});varr=s(85985),n=s(1455),o=s.n(n),a=s(94715),i=s(86087),l=s(13022),c=s(9522),u=s(20600),d=s(8031),p=s(10790);functionh(e){return(0,p.jsxs)("div",{className:"jetpack-top-posts-item",children:[e.displayThumbnail&&e.thumbnail&&(0,p.jsx)("a",{className:"jetpack-top-posts-thumbnail-link",children:(0,p.jsx)("img",{className:"jetpack-top-posts-thumbnail",src:e.thumbnail,alt:e.title,rel:"nofollow noopener noreferrer",target:"_blank"})}),e.displayThumbnail&&!e.thumbnail&&(0,p.jsx)("a",{className:"jetpack-top-posts-thumbnail-link",children:(0,p.jsx)("div",{className:"jetpack-top-posts-mock-thumbnail"})}),(0,p.jsx)("span",{className:"jetpack-top-posts-title",children:(0,p.jsx)("a",{children:e.title})}),e.displayDate&&(0,p.jsx)("span",{className:"jetpack-top-posts-date has-small-font-size",children:e.date}),e.displayAuthor&&(0,p.jsx)("span",{className:"jetpack-top-posts-author has-small-font-size",children:e.author}),e.displayContext&&e.context&&(0,p.jsx)("span",{className:"jetpack-top-posts-context has-small-font-size",children:(0,p.jsx)("a",{children:e.context[0].cat_name})})]})}constm=function({attributes:e,setAttributes:t}){const{isLoadingModules:s,isChangingStatus:n,isModuleActive:m,changeStatus:g}=(0,r.q7)("stats"),f=(0,a.useBlockProps)(),{className:b}=f,[v,k]=(0,i.useState)(),[y,x]=(0,i.useState)(),[j,w]=(0,i.useState)(),[_,C]=(0,i.useState)({}),{displayAuthor:A,displayContext:S,displayDate:E,displayThumbnail:N,layout:T,period:B,postsToShow:P,postTypes:I}=e;letM;return(0,i.useEffect)(()=>{o()({path:"/wpcom/v2/post-types"}).then(e=>{w(e),e.forEach(e=>{I&&I[e.id]&&C(t=>({...t,[e.id]:!0}))})})},[I]),(0,i.useEffect)(()=>{m&&o()({path:`/wpcom/v2/top-posts?period=${B}`}).then(e=>{k(e)})},[B,m]),(0,i.useEffect)(()=>{conste=v;if(!e)return;constt=[];for(lets=0;t.length!==P&&(e[s]&&I[e[s].type]&&t.push((0,p.jsx)(h,{title:e[s].title,date:e[s].date,author:e[s].author,thumbnail:e[s].thumbnail,context:e[s].context,displayDate:E,displayAuthor:A,displayThumbnail:N,displayContext:S},"jetpack-top-posts-"+e[s].id)),e[s]);s++);x(t)},[A,S,E,N,v,I,P,x]),M=m||s?y?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.InspectorControls,{children:(0,p.jsx)(u.O,{attributes:e,setAttributes:t,toggleAttributes:_,setToggleAttributes:C,postTypesData:j})}),(0,p.jsx)(a.BlockControls,{children:(0,p.jsx)(u.G,{attributes:e,setAttributes:t})}),(0,p.jsx)("div",{"data-item-count":y.length,children:(0,p.jsx)("div",{className:"jetpack-top-posts-wrapper",children:y})})]}):(0,p.jsx)(c.G,{}):(0,p.jsx)(d.k,{className:b,changeStatus:g,isLoading:n}),(0,p.jsx)("div",{...f,className:(0,l.A)(b,`is-${T}-layout`),children:M})}},99883(e,t,s){"use strict";varr=s(74997),n=s(94375),o=s(35075),a=s(96894);(0,n.M)(o,{edit:a.A,save:()=>null,transforms:{from:[{t
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:L,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Loop","jetpack"),/* translators: Tooltip describing the "loop" option for the VideoPress player */
__("Restarts the video when it reaches the end","jetpack")),onChange:this.toggleAttribute("loop"),checked:O,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:z,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),/* translators: Tooltip describing the "controls" option for the VideoPress player */
__("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:D,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),/* translators: Tooltip describing the "playsinline" option for the VideoPress player */
__("Play the video inline instead of full-screen on mobile devices","jetpack")),onChange:this.toggleAttribute("playsinline"),checked:U,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),/* translators: Tooltip describing the "preload" option for the VideoPress player */
__("Content to dowload before the video is played","jetpack")),value:q??"",onChange:e=>u({preload:e}),options:[{value:"auto",label:_x("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:_x("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:_x("None","VideoPress preload setting","jetpack")}],help:this.getPreloadHelp(),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,C.jsx)(i.MediaUploadCheck,{children:(0,C.jsxs)(l.BaseControl,{className:"editor-video-poster-control",children:[(0,C.jsx)(l.BaseControl.VisualLabel,{children:__("Poster Image","jetpack")}),(0,C.jsx)(i.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:A,render:({open:e})=>(0,C.jsx)(l.Button,{variant:"secondary",onClick:e,ref:this.posterImageButton,"aria-describedby":Z,children:J?__("Replace image","jetpack",0):__("Select Poster Image","jetpack")})}),(0,C.jsx)("p",{id:Z,hidden:!0,children:J?(0,h.sprintf)(/* translators: %s: an image URL. */
__("The current poster image url is %s","jetpack"),H??M):__("There is no poster image currently selected","jetpack")}),J&&(0,C.jsx)(l.Button,{onClick:this.onRemovePoster,variant:"link",isDestructive:!0,children:__("Remove Poster Image","jetpack")})]})}),(0,d.createInterpolateElement)(__("Send us your <a>VideoPress feedback</a>","jetpack"),{a:(0,C.jsx)(l.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})]}),(0,C.jsx)(y.A,{attributes:t,setAttributes:u,useAverageColor:V,toggleAttribute:this.toggleAttribute}),(0,C.jsxs)(l.PanelBody,{title:__("Video File Settings","jetpack"),children:[(0,C.jsx)(l.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:N??"",disabled:k||j,options:[{label:_x("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:_x("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:_x("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"}],onChange:this.onChangeRating,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,C.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
__("Uploading (%s%%)","jetpack"),x)}),(0,c.jsx)("div",{className:"resumable-upload__file-size",children:w})]}),(0,c.jsx)("div",{className:"resumable-upload__actions",children:(0,c.jsx)(r.Button,{variant:"link",onClick:()=>{p&&(u?p.start():p.abort(),d(!u))},children:u?"Resume":"Pause"})})]})})}},80534(e,t,s){"use strict";s.d(t,{Q:()=>n,l:()=>a});varr=s(10781);constn=function(e){returnnewPromise(function(t,s){constr=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...r}).done(function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})}).fail(function(e){s(e)})})},o={},a=({onUploadUuidRetrieved:e,onError:t,onProgress:s,onSuccess:a})=>(i,l)=>{constc=newr._O(i,{onError:t,onProgress:s,endpoint:l.url,removeFingerprintOnSuccess:!0,withCredentials:!1,autoRetry:!0,overridePatchMethod:!1,chunkSize:1e7,allowedFileTypes:["video/*"],metadata:{filename:i.name,filetype:i.type},retryDelays:[0,1e3,3e3,5e3,1e4],onAfterResponse:function(t,s){if(s.getStatus()>=400)return;constr=s.getHeader("x-videopress-upload-guid"),n=s.getHeader("x-videopress-upload-media-id"),i=s.getHeader("x-videopress-upload-src-url");if(r&&n&&i)returnvoid(a&&a({mediaId:Number(n),guid:r,src:i}));constl={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach(function(e){constt=s.getHeader(e);t&&(c[l[e]]=t)}),c.key&&c.token&&(o[c.key]=c.token),c.key&&e(c.key)},onBeforeRequest:function(e){constt=e._method;["HEAD","OPTIONS"].indexOf(t)>=0&&(e._method="GET",e.setHeader("X-HTTP-Method-Override",t)),["DELETE","PUT","PATCH"].indexOf(t)>=0&&(e._method="POST",e.setHeader("X-HTTP-Method-Override",t)),e._xhr.open(e._method,e._url,!0);for(consttofObject.keys(e._headers))e.setHeader(t,e._headers[t]);if("POST"===t){if(!!!l.token)throw"should never happen";e.setHeader("x-videopress-upload-token",l.token)}if(["OPTIONS","GET","HEAD","DELETE","PUT","PATCH"].indexOf(t)>=0){consts=newURL(e._url).pathname.split("/"),r=s[s.length-1];if(o[r])e.setHeader("x-videopress-upload-token",o[r]);elseif("HEAD"===t)returnn(r).then(t=>(o[r]=t.token,e.setHeader("x-videopress-upload-token",t.token),e))}returnPromise.resolve(e)}});returnc.findPreviousUploads().then(function(e){e.length&&c.resumeFromPreviousUpload(e[0]),c.start()}),c}},41560(e,t,s){"use strict";s.d(t,{A:()=>l});varr=s(94715),n=s(29491),o=s(13022),a=s(17900),i=s(10790);constl=(0,n.createHigherOrderComponent)(e=>t=>{const{attributes:{autoplay:s,caption:n,controls:l,guid:c,loop:u,muted:d,playsinline:p,poster:h,preload:m,videoPressClassNames:g,className:f,align:b,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:x,maxWidth:j}={}}=t;if(!c)returne(t);constw=r.useBlockProps.save({className:(0,o.A)("wp-block-video",f,g,{[`align${b}`]:b})}),_=(0,a.e)(c,{autoplay:s,controls:l,loop:u,muted:d,playsinline:p,poster:h,preload:m,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:x});letC={};returnj&&j.length>0&&"100%"!==j&&(C={maxWidth:j,margin:"auto"}),(0,i.jsxs)("figure",{...w,children:[(0,i.jsx)("div",{className:"wp-block-embed__wrapper",style:C,children:`\n${_}\n`}),!r.RichText.isEmpty(n)&&(0,i.jsx)(r.RichText.Content,{tagName:"figcaption",value:n})]})},"withVideoPressSave")},57954(e,t,s){"use strict";s.d(t,{A:()=>c});varr=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(10790);const__=a.__;classlextendso.Component{constructor(){super(...arguments);const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}}handleChangeSeekbarColor=e=>{this.setState({seekbarColor:e})};handleChangeSeekbarLoadingColor=e=>{this.setState({seekbarLoadingColor:e})};handleChangeSeekbarPlayedColor=e=>{this.setState({seekbarPlayedColor:e})};saveColors=()=>{const{seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:s}=this.state,{setAttributes:r}=this.props;r({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:s})};render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}=this.state,{toggleAt
__("Delete %s","jetpack"),e.label),disabled:r===t,children:r===t?__("Deleting","jetpack"):__("Delete","jetpack",0)})})]},t)),(0,d.jsx)(a.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list",children:u})}functionk({track:e,guid:t,onChange:s,onClose:r,onCancel:n,trackExists:u}){const[g,f]=(0,l.useState)(),[v=!1,k]=(0,l.useState)(),{label:y="",srcLang:x="",kind:j=p}=e,w=e.tmpFile?e.tmpFile.name:"";if(!(0,i.useSelect)(e=>e(o.store).getSettings().mediaUpload,[]))returnnull;return(0,d.jsx)(a.NavigableMenu,{children:(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor",children:[(0,d.jsx)("span",{className:"videopress-block-tracks-editor__single-track-editor-label",children:__("Edit track","jetpack")}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file",children:[(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label",children:[(0,d.jsxs)("span",{children:[__("File","jetpack"),":"]}),""!==w&&(0,d.jsx)("span",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label-name",children:(0,d.jsx)("strong",{children:w})}),(0,d.jsx)(o.MediaUploadCheck,{children:(0,d.jsx)(a.FormFileUpload,{onChange:t=>{constr=t.target.files;!r.length>0||(e.tmpFile=r[0],s(e))},accept:Object.entries(h).join(),render:({openFileDialog:e})=>(0,d.jsx)(a.Button,{variant:"link",onClick:()=>{e()},children:""===w?__("Select track","jetpack"):__("Change track","jetpack",0)}),disabled:v})})]}),(0,d.jsx)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-help",children:(0,c.sprintf)(/* translators: %s: The allowed file types to be uploaded as a video text track." */
__("Allowed formats: %s","jetpack"),Object.keys(h).join(", "))})]}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language",children:[(0,d.jsx)(a.TextControl,{onChange:t=>s({...e,label:t}),label:__("Label","jetpack"),value:y,help:__("Title of track","jetpack"),disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,d.jsx)(a.TextControl,{onChange:t=>s({...e,srcLang:t}),label:__("Source language","jetpack"),value:x,help:__("Language tag (en, fr, etc.)","jetpack"),disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,d.jsx)(a.SelectControl,{className:"videopress-block-tracks-editor__single-track-editor-kind-select",options:m,value:j,label:/* translators: %s: The kind of video text track e.g: "Subtitles, Captions" */
__("Kind","jetpack"),onChange:t=>{s({...e,kind:t})},disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-buttons-container",children:[v?(0,d.jsx)(a.Spinner,{}):(0,d.jsx)(a.Button,{variant:"secondary",disabled:!e.tmpFile,onClick:()=>{f(null),""===y&&(e.label=__("English","jetpack")),""===x&&(e.srcLang="en"),void0===e.kind&&(e.kind=p),u(e)?f(__("A track already exists for that language and kind.","jetpack")):(k(!0),b(e,t).then(()=>{s(e),f(null),r()}).catch(e=>{e.message&&f(e.message)}).finally(()=>{k(!1)}))},children:__("Save","jetpack")}),(0,d.jsx)(a.Button,{variant:"link",onClick:n,children:__("Close","jetpack")})]}),g&&(0,d.jsx)("div",{className:"videopress-block-tracks-editor__single-track-editor-error",children:/* translators: %s: An error message returned after a failed video track file upload." *//* translators: %s: An error message returned after a failed video track file upload." */
c=__("Upgrade to %s to use this premium block","jetpack"),u=(__("Upgrade your plan to use this premium block","jetpack"),_x("Upgrade","Call to action to buy a new plan","jetpack")),d=({onRedirect:e,align:t,className:s,title:d=l,description:p=null,buttonText:h=u,visible:m=!0,requiredPlan:g,context:f})=>{const[b,v,k]=(0,r._6)(g,e),y=(0,o.useSelect)(e=>{if(p)returnp;constt=e("wordpress-com/plans"),s=t&&t.getPlan(g);returns?(0,a.sprintf)(c,s.product_name_short):null},[p,g]);returny&&(0,i.jsx)(n.cb,{align:t,buttonText:h,checkoutUrl:b,className:s,context:f,description:y,goToCheckoutPage:v,isRedirecting:k,title:d,visible:m})}},23887(e,t,s){"use strict";s.d(t,{W:()=>r,r:()=>n});constr=({plan:e,blockName:t,context:s,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:s})},n=({plan:e,blockName:t,context:s,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:s})}},3120(e,t,s){"use strict";s.d(t,{e:()=>h});varr=s(85985),n=s(94715),o=s(29491),a=s(47143),i=s(86087),l=s(95104),c=s(26845),u=s(23887),d=s(10790);constp=(0,o.createHigherOrderComponent)(e=>t=>{const{name:s,clientId:o,isSelected:p,attributes:h,setAttributes:m}=t||{},g=(0,r.tu)(s);if(!g)return(0,d.jsx)(e,{...t});constf=(0,r.sH)(s),b=(0,r.GT)(s),[v,k]=(0,i.useState)(!f),[y,x]=(0,i.useState)(!1),j="editor-canvas",w=(0,a.useSelect)(e=>e("core/block-editor").hasSelectedInnerBlock(o,!0),[o]),{hasParentBanner:_}=(0,i.useContext)(l.j)||{},C=(p||w)&&v&&!_,{tracks:A}=(0,r.st)(),S=(0,i.useMemo)(()=>({plan:g,blockName:s,context:j,tracks:A}),[g,s,A]);(0,i.useEffect)(()=>{C&&x(!0)},[C,x]),(0,i.useEffect)(()=>{!y&&C&&(0,u.r)(S)},[y,S,C]),(0,i.useEffect)(()=>k(!f),[h,k,f]),(0,i.useEffect)(()=>{m({shouldDisplayFrontendBanner:!_})},[m,_]);constE=(0,n.useBlockProps)();return(0,d.jsx)(l.b,{onBannerVisibilityChange:k,hasParentBanner:C,children:(0,d.jsxs)("div",{ref:E.ref,style:{maxWidth:"unset"},children:[(0,d.jsx)(c.Ay,{className:`is-${s.replace(/\//,"-")}-paid-block`,title:null,align:h?.align,visible:C,description:b?.description,requiredPlan:g,context:j,onRedirect:()=>(0,u.W)(S)}),(0,d.jsx)(e,{...t})]})})},"withUpgradeBanner");functionh(e,t){return(0,r.tu)(t)?{...e,edit:p(e.edit)}:e}},76047(e,t,s){"use strict";s.d(t,{k6:()=>o,s6:()=>r,wb:()=>n});constr="jetpack-sidebar",n="document-settings",o="pre-publish"},23162(e,t,s){"use strict";s.d(t,{A:()=>M});varr=s(96865),n=s(85985),o=s(82201),a=s(56427),i=s(3582),l=s(47143),c=s(43656),u=s(52619),d=s(27723),p=s(10067),h=s.n(p),m=s(51609),g=s(44732),f=s(48499),b=s(90062),v=s(50976),k=s(81932),y=s(37215),x=s(76318),j=s(27970),w=s(76047),_=s(45606),C=s(10790);const__=d.__,A=c.PluginPrePublishPanel,S=c.PluginDocumentSettingPanel,E=h()("jetpack-ai-assistant-plugin:sidebar"),N=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-usage-panel"]?.available||!1,T=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-featured-image-generator"]?.available||!1,B=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-title-optimization"]?.available||!1,P=(0,f.C)("ai-title-optimization-keywords-support"),I=({placement:e,requireUpgrade:t,upgradeType:s,showUsagePanel:n,showFairUsageNotice:o})=>{const{checkoutUrl:i}=(0,r.ON)(),{productPageUrl:d}=(0,g.A)(),p=(0,k.Ul)(),h=(0,l.useSelect)(e=>e(c.store).isEditedPostEmpty(),[]),{editPost:f}=(0,l.useDispatch)(c.store),b=(0,m.useCallback)(e=>{f({featured_media:e.id})},[f]),w=(0,m.useMemo)(()=>{consts=(0,u.applyFilters)("jetpack.ai.imageGenerationHandler",null,{entryPoint:"featured-image",onImageSelect:b,extra:{placement:e,disabled:t}});return"function"==typeofs?s:null},[b,e,t]),A=__("Optimize Publishing","jetpack"),S=__("Optimize Title","jetpack"),E=P?S:A;return(0,C.jsxs)(C.Fragment,{children:[o&&(0,C.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__feature-section",children:(0,C.jsx)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,C.jsx)(r.QA,{variant:"muted"})})}),h&&(0,C.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__warning-content",children:(0,C.jsx)(a.Notice,{isDismissible:!1,status:"wa
__("You have reached the limit of <strong>%d requests</strong>. <button><span>Upgrade to continue generating feedback.</span></button>","jetpack"),p),g=(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,i.jsx)("strong",{})}),f=(0,o.createInterpolateElement)(20===p?h:m,{strong:(0,i.jsx)("strong",{}),button:(0,i.jsx)(n.Button,{variant:"link",onClick:d,href:c,target:"_blank"}),span:(0,i.jsx)("span",{})});return(0,i.jsx)("p",{children:"vip"===t?g:f})}},1661(e,t,s){"use strict";s.d(t,{S:()=>r});constr="jetpack-ai-breve"},27180(e,t,s){"use strict";s.d(t,{A:()=>m});varr=s(85985),n=s(56427),o=s(29491),a=s(47143),i=s(27723),l=s(51609),c=s(29526),u=s(80555),d=s(81932),p=s(36205),h=s(10790);const__=i.__,m=(0,o.compose)((0,a.withSelect)(e=>({blocks:e("core/block-editor").getBlocks(),disabledFeatures:e("jetpack/ai-breve").getDisabledFeatures()})))(({blocks:e,disabledFeatures:t})=>{const[s,i]=(0,l.useState)(null),{toggleFeature:m,toggleProofread:g,setPopoverHover:f,setHighlightHover:b,setPopoverAnchor:v}=(0,a.useDispatch)("jetpack/ai-breve"),{tracks:k}=(0,r.st)(),y=(0,a.useSelect)(e=>e("jetpack/ai-breve").isProofreadEnabled(),[]),x=(0,l.useCallback)(()=>{if(!y)return;constt=(0,p.M)(e),s=(0,u.A)(t),r="number"==typeofs?s.toFixed(2):null;i(r)},[e,y]),j=(0,o.useDebounce)(x,250),w=(0,l.useCallback)(e=>t=>{k.recordEvent("jetpack_ai_breve_feature_toggle",{type:e,on:t}),m(e,t)},[k,m]),_=(0,l.useCallback)(()=>{k.recordEvent("jetpack_ai_breve_toggle",{on:!y}),g()},[k,y,g]);return(0,l.useEffect)(()=>{j()},[j]),(e=>{const[t,s]=(0,l.useState)(!1);t||(e(),s(!0))})(x),(0,l.useEffect)(()=>{f(!1),b(!1),v({target:null,virtual:null})},[f,b,v,y,t]),(0,h.jsxs)("div",{className:"jetpack-ai-proofread",children:[(0,h.jsx)(n.PanelRow,{children:(0,h.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,h.jsx)(n.ToggleControl,{checked:y,onChange:_,label:__("Show issues & suggestions","jetpack"),__nextHasNoMarginBottom:!0})})}),y&&(0,h.jsx)(n.PanelRow,{children:(0,h.jsxs)(n.Card,{size:"small",className:"jetpack-ai__write-brief-card",children:[(0,h.jsx)(n.CardBody,{size:"small",children:(0,h.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,h.jsx)("div",{className:"feature-checkboxes-container",children:c.A.map(e=>(0,d.Ur)(e.config.name)&&(0,h.jsx)(n.CheckboxControl,{className:y?"":"is-disabled",disabled:!y,"data-breve-type":e.config.name,label:e.config.title,checked:!t.includes(e.config.name),onChange:w(e.config.name),__nextHasNoMarginBottom:!0},e.config.name))})})}),(0,h.jsx)(n.CardFooter,{size:"small",className:"jetpack-ai-proofread__grade-level-container",children:null===s?(0,h.jsx)("p",{className:"jetpack-ai-proofread__help-text",children:__("Write to see your grade level.","jetpack")}):(0,h.jsxs)("div",{className:"jetpack-ai-proofread__grade-label",children:[s," ",__("Reading grade score","jetpack")]})})]})})]})})},64949(e,t,s){"use strict";s.d(t,{Ay:()=>c,jp:()=>i,zz:()=>a});varr=s(27723),n=s(53817),o=s(80811);const__=r.__,a=o.A,i={name:"complex-words",title:__("Complex words","jetpack"),tagName:"span",className:"jetpack-ai-breve__has-proofread-highlight--complex-words",defaultEnabled:!0},l=newRegExp(`\\b(${Object.keys(o.A).map(n.N).join("|")})\\b`,"gi");functionc(e){constt=e.matchAll(l),s=[];for(consteoft){constt=e[0].trim();s.push({text:t,suggestion:o.A[t],startIndex:e.index,endIndex:e.index+t.length})}returns}},80811(e,t,s){"use strict";s.d(t,{A:()=>r});constr={"a and/or b":"a or b or both","able to":"can",accompany:"go with",accomplish:"do",accorded:"given",accordingly:"so",accrue:"add",accurate:"correct",activate:"turn on",additional:"more",address:"discuss","adjacent to":"next to",administer:"manage",advantageous:"helpful","adversely impact on":"hurt",advise:"recommend","afford an opportunity":"allow",aircraft:"plane",allocate:"divide","allows you to":"lets you",alternative:"other",anticipate:"expect","a number of":"some",apparent:"clear",appreciable:"many",approximate:"about","arrive onboard":"arrive","asamean
// Translators: %1$d is the number of images with alt text, %2$d is the total number of images.
__("Alt text added to %1$d of %2$d images","jetpack"),t.length,e.length)):v(__("Alt text added to all images","jetpack")):v("")},[]);constx=(0,i.useMemo)(()=>({"seo-title":m?null:k,"seo-meta-description":g?null:y,"images-alt-text":f?null:b}),[g,b,f,y,k,m]),j=(0,i.useMemo)(()=>Object.values(x).every(e=>!e),[x]),w=__("Want to fine-tune this metadata further?","jetpack"),_=__("No metadata found. Add it to improve search engine visibility.","jetpack");return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(n.PanelRow,{className:"jetpack-seo-sidebar__feature-section jetpack-seo-sidebar__feature-section--toggle",children:[(0,h.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,className:"ai-seo-enhancer-toggle",help:j?_:w,label:__("Metadata","jetpack"),id:"jetpack-seo-enhancer-generated-metadata",children:!j&&d.G.map(e=>x[e]?(0,h.jsxs)("div",{className:"jetpack-seo-enhancer-summary-feature",children:[(0,h.jsx)("div",{className:"jetpack-seo-enhancer-summary-feature__icon-container",children:(0,h.jsx)(c.A,{className:"jetpack-seo-enhancer-summary-feature__icon",icon:u.A})}),(0,h.jsx)(n.BaseControl,{className:"jetpack-seo-enhancer-summary-feature__control",label:d.z[e],id:e,help:x[e],__nextHasNoMarginBottom:!0,children:null},e)]},e):null)}),(0,h.jsx)(n.Button,{variant:"secondary",__next40pxDefaultSize:!0,className:"jetpack-seo-enhancer-summary__edit-button",onClick:e,children:__("Edit SEO metadata","jetpack")})]})})}},6363(e,t,s){"use strict";functionr(e){return{type:"SET_BUSY",isBusy:e}}functionn(e){return{type:"SET_TITLE_BUSY",isBusy:e}}functiono(e){return{type:"SET_DESCRIPTION_BUSY",isBusy:e}}functiona(e){return{type:"SET_IS_TOGGLING_AUTO_ENHANCE",isToggling:e}}functioni(e){return{type:"SET_IS_AUTO_ENHANCE_ENABLED",isEnabled:e}}functionl(e,t){return{type:"SET_IMAGE_BUSY",clientId:e,isBusy:t}}functionc(e,t){return{type:"SET_IMAGE_FAILED",clientId:e,failed:t}}functionu(e,t){return{type:"SET_FEATURE_ENABLED",feature:e,enabled:t}}s.r(t),s.d(t,{setBusy:()=>r,setDescriptionBusy:()=>o,setFeatureEnabled:()=>u,setImageBusy:()=>l,setImageFailed:()=>c,setIsAutoEnhanceEnabled:()=>i,setIsTogglingAutoEnhance:()=>a,setTitleBusy:()=>n})},16204(e,t,s){"use strict";s.d(t,{M:()=>d});varr=s(97999),n=s(85985),o=s(47143),a=s(4167),i=s(6363),l=s(49824),c=s(16886);letu=!1;try{if(!(0,r.isSimpleSite)()){conste=(0,o.select)(n.Ft).getJetpackModules()["seo-tools"],t=e&&"ai_seo_enhancer_enabled"ine.options;u=t&&e.options?.ai_seo_enhancer_enabled?.current_value}}catch{u=!1}constd=(0,o.createReduxStore)("jetpack/seo-enhancer",{reducer:l.A,selectors:c,actions:i,initialState:function(){conste=a.G.reduce((e,t)=>(e[t]=!0,e),{});try{constt=localStorage.getItem("jetpack-seo-enhancer-features"),s=t?JSON.parse(t):{};for(consttofa.G)e[t]=s[t]??!0}catch{}return{isBusy:!1,isTogglingAutoEnhance:!1,isAutoEnhanceEnabled:u,busyImages:{},failedImages:{},features:e}}()});(0,o.register)(d)},49824(e,t,s){"use strict";s.d(t,{A:()=>r});constr=function(e,t){lets=e;switch(t.type){case"SET_BUSY":return{...e,isBusy:t.isBusy};case"SET_TITLE_BUSY":return{...e,isTitleBusy:t.isBusy};case"SET_DESCRIPTION_BUSY":return{...e,isDescriptionBusy:t.isBusy};case"SET_IS_TOGGLING_AUTO_ENHANCE":return{...e,isTogglingAutoEnhance:t.isToggling};case"SET_IS_AUTO_ENHANCE_ENABLED":return{...e,isAutoEnhanceEnabled:t.isEnabled};case"SET_IMAGE_BUSY":return{...e,busyImages:{...e.busyImages,[t.clientId]:t.isBusy}};case"SET_IMAGE_FAILED":return{...e,failedImages:{...e.failedImages,[t.clientId]:t.failed}};case"SET_FEATURE_ENABLED":returns={...e,features:{...e.features,[t.feature]:t.enabled}},r=s.features,localStorage.setItem("jetpack-seo-enhancer-features",JSON.stringify(r)),s;default:returne}varr}},16886(e,t,s){"use strict";s.r(t),s.d(t,{getEnabledFeatures:()=>p,hasImageFailed:()=>d,isAnyImageBusy:()=>u,isAutoEnhanceEnabled:()=>l,isBusy:()=>n,isDescriptionBusy:()=>a,isImageAltTextFeatureEnabled:()=>h,isImageBusy:()=>c,isTitleBusy:()=>o,isTogglingAutoEnhance:()=>i});varr=s(47143);functionn(e){returne.isBusy}functiono(e){returne.isTitleBusy}functiona(e){returne.isDescriptionBusy}functioni(e){
// translators: %1$d: number of days until the next usage count reset, %2$s: date of next reset
__("Requests will reset to <strong>%1$d</strong> on %2$s.","jetpack"),l,d),{strong:(0,c.jsx)("strong",{})}));constb=s/l,v=(0,c.jsxs)(c.Fragment,{children:[t===n.Ti&&(0,c.jsx)("p",{children:__("Unlimited requests.","jetpack")}),(t===n._X||t===n.ds)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"jetpack-ai-usage-panel__available-requests",children:f}),(0,c.jsx)(u,{usage:b})]})]}),k=(0,c.jsx)(r.A,{height:100,className:"jetpack-ai-usage-panel__loading-placeholder"}),y=(0,c.jsxs)(c.Fragment,{children:[!p&&g.length?g.join(" ").concat(" "):null,!p&&m]});return(0,c.jsxs)(o.BaseControl,{__nextHasNoMarginBottom:!0,help:y,children:[(0,c.jsx)(o.BaseControl.VisualLabel,{children:__("Available Requests","jetpack")}),!p&&v,p&&k]})}},27970(e,t,s){"use strict";s.d(t,{A:()=>g});varr=s(96865),n=s(3924),o=s(97999),a=s(85985),i=s(56427),l=s(38443),c=s(86087),u=s(27723),d=s(75956),p=s(93471),h=s(10790);const__=u.__;functionm({isOverLimit:e,requestsCount:t,requestsLimit:s,nextStart:r,planType:n,loading:o,canUpgrade:c,showContactUsCallToAction:d,nextLimit:m,contactUsURL:g,handleContactUsClick:f,checkoutUrl:b,handleUpgradeClick:v}){constk=((e,t)=>e===a._X?__("Upgrade","jetpack"):t?(0,u.sprintf)(
// translators: %1$d: an integer, the number of requests to upgrade to on the next tier
__("Get %1$d requests","jetpack"),t):__("Get more requests","jetpack"))(n,m),y=(x=r)?(0,l.gmdateI18n)("F j",x):null;varx;return(0,h.jsx)("div",{className:"jetpack-ai-usage-panel",children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p.A,{isOverLimit:e,requestsCount:t,requestsLimit:s,nextResetDate:y,planType:n,loading:o}),!o&&(n===a._X||n===a.ds)&&c&&(0,h.jsxs)("div",{className:"jetpack-ai-usage-panel-upgrade-button",children:[d&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("p",{children:__("Need more requests?","jetpack")}),(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Contact us for more requests","jetpack"),href:g,onClick:f,children:(0,h.jsx)("span",{children:__("Contact Us","jetpack")})})]}),!d&&(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Upgrade your Jetpack AI plan","jetpack"),href:b,onClick:v,children:(0,h.jsx)("span",{children:k})})]})]})})}functiong({placement:e=null}){const{checkoutUrl:t}=(0,r.ON)(),{contactUsURL:s}=(()=>{conste=(0,n.A)("jetpack-ai-tiers-more-requests-contact"),{autosaveAndRedirect:t,isRedirecting:s}=(0,a.ZR)(e);return{contactUsURL:e,autosaveAndRedirectContactUs:t,isRedirectingContactUs:s}})(),{tracks:i}=(0,d.A)(),l=(0,a.CP)(),{requestsCount:u,requestsLimit:p,isOverLimit:g,usagePeriod:f,currentTier:b,nextTier:v,loading:k}=(0,r.yM)(),y=(0,a.Bd)(b),x=(0,c.useCallback)(()=>{i.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:u,...e?{placement:e}:{}})},[i,b,u,e]),j=(0,c.useCallback)(()=>{i.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:u,...e?{placement:e}:{}})},[i,b,u,e]),w=(0,o.isWpcomPlatformSite)()&&y===a.ds&&!v;return(0,h.jsx)(m,{isOverLimit:g,requestsCount:u,requestsLimit:p,nextStart:f?.nextStart,nextLimit:v?.limit,planType:y,loading:k,canUpgrade:l,showContactUsCallToAction:w,contactUsURL:s,handleContactUsClick:j,checkoutUrl:t,handleUpgradeClick:x})}},56199(e,t,s){"use strict";s.d(t,{k:()=>r});constr="block_settings_sidebar"},88797(e,t,s){"use strict";varr=s(85985),n=s(23806);(0,r.vp)(n.U,n.W)},23806(e,t,s){"use strict";s.d(t,{U:()=>n,W:()=>o});varr=s(23162);constn="ai-assistant-plugin",o={render:r.A}},1176(e,t,s){"use strict";s.d(t,{N:()=>u});varr=s(96865),n=s(56427),o=s(27723),a=s(51609),i=s(2162),l=s(62402),c=s(10790);const__=o.__;functionu({minWords:e=10,maxWords:t=100,disabled:s,words:o,onWordsNumberChange:u,language:d,onLanguageChange:p,tone:h,onToneChange:m}){const[g,f]=(0,a.useState)(!1);constb=d?.split(" ")[0],v=r.so[b]?.label||__("Language","jetpack"),k=r.oZ[h]?.label||__("Tone","jetpack");return(0,c.jsxs)("div",{className:"jetpack-ai-generate-excerpt-control",children:[(0,c.jsxs)(n.BaseControl,{className:"jetpack-ai-generate-excerpt-control__header",__nextHasNoMarginBottom:!0,children:[(0,c.jsx)(n.BaseControl.VisualLabel,{children:__("Settings","jetpack")}),(0,c.jsx)(n.Button,{label:__("Advanced AI options","jetpack"),icon:r.cj,onClick:function(){f(e=>!e)},"aria-pressed":g,isSmall:!0})]}),g&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.HU,{disabled:s,onChange:p,value:d,label:v}),(0,c.jsx)(l.hN,{disabled:s,label:k,value:h,onChange:m})]}),(0,c.jsx)(n.RangeControl,{label:__("Desired length","jetpack"),value:o,onChange:u,min:e,max:t,help:__("Sets the desired length in words for the auto-generated excerpt. The final count may vary due to how AI works.","jetpack"),showTooltip:!1,disabled:s,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}},25101(e,t,s){"use strict";varr=s(85985),n=s(47143),o=s(43656),a=s(52619),i=s(10067),l=s.n(i),c=s(54681),u=s(10821),d=s(33792);constp=l()("jetpack-ai-content-lens:registration"),h=window?.Jetpack_Editor_Initial_State?.available_blocks["ai-content-lens"];h?.available&&((0,a.addFilter)("blocks.registerBlockType","jetpack/ai-content-lens-features",function(e,t){returnt!==c.name?e:(0,u.Bi)()?((0,r.vp)(d.s,d.$),p("Registered AI Excerpt plugin"),(0,(0,n.dispatch)(o.store).removeEditorPanel)("post-excerpt"),p("Removed the post-excerpt panel"),e):e}),p("Added filter for AI Content Lens features"))},33251(e,t,s){"use strict";s.d(t,{g:()=>b})
// Translators: %1$d is the number of words in the excerpt.
_n("%1$d word","%1$d words",R,"jetpack"),R),F="requesting"===T||"suggesting"===T||"done"===T&&!x,O="requesting"===T||"suggesting"===T,z=O||"done"===T;const{requireUpgrade:U,isOverLimit:H}=(0,r.yM)();return(0,g.jsxs)("div",{className:"jetpack-ai-post-excerpt",children:[(0,g.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,label:__("Write an excerpt (optional)","jetpack"),onChange:e=>f({excerpt:e}),help:R?D:null,value:L,disabled:z}),(0,n.isWpcomPlatformSite)()?(0,g.jsx)(a.k4,{supportLink:__("https://wordpress.com/support/excerpts/","jetpack"),supportPostId:1569,children:__("Learn more about manual excerpts","jetpack")}):(0,g.jsx)(i.ExternalLink,{href:__("https://jetpack.com/support/create-better-post-excerpts-with-ai/","jetpack"),children:__("Learn more about manual excerpts","jetpack")}),(0,g.jsxs)("div",{className:"jetpack-generated-excerpt__ai-container",children:[B?.code&&"error_quota_exceeded"!==B.code&&(0,g.jsx)(i.Notice,{status:B.severity,isDismissible:!1,className:"jetpack-ai-assistant__error",children:B.message}),H&&(0,g.jsx)(r.Hb,{placement:"excerpt-panel"}),(0,g.jsx)(m.N,{words:k,onWordsNumberChange:e=>{y(e),j(!0)},language:w,onLanguageChange:e=>{_(e),j(!0)},tone:C,onToneChange:e=>{A(e),j(!0)},disabled:O||U}),(0,g.jsx)(i.BaseControl,{help:M?.length?null:__("Add content to generate an excerpt.","jetpack"),__nextHasNoMarginBottom:!0,children:(0,g.jsxs)("div",{className:"jetpack-generated-excerpt__generate-buttons-container",children:[(0,g.jsx)(i.Button,{onClick:function(){f({excerpt:t}),h.recordEvent("jetpack_ai_assistant_block_discard",{feature:"jetpack-ai-content-lens",model:I}),P()},variant:"secondary",isDestructive:!0,disabled:"done"!==T||U,children:__("Discard","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){f({excerpt:N}),h.recordEvent("jetpack_ai_assistant_block_accept",{feature:"jetpack-ai-content-lens",model:I}),P()},variant:"secondary",disabled:"done"!==T||U,children:__("Accept","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){j(!1),P();constt=[{role:"jetpack-ai",context:{type:"ai-content-lens",contentType:"post-excerpt",postId:Number(s),words:k,language:w,tone:C,content:`Post content:\n${M}\n`}}];b(),h.recordEvent("jetpack_ai_assistant_block_request",{feature:"jetpack-ai-content-lens",model:I}),e.current=window?.performance?.now?.()||null,S(t,{feature:"jetpack-ai-content-lens",model:I})},variant:"secondary",isBusy:O,disabled:F||U||!M,children:__("Generate","jetpack")})]})})]})]})}constb=()=>{if((0,l.useSelect)(e=>{const{getCurrentPostType:t}=e(c.store),s=t();return"wp_template"===s||"wp_template_part"===s||"wp_block"===s},[]))returnnull;conste=e=>{constt=c.PluginDocumentSettingPanel;return(0,g.jsx)(t,{...e})};return(0,g.jsx)(c.PostTypeSupportCheck,{supportKeys:"excerpt",children:(0,g.jsx)(e,{className:(0,h.m)("ai-content-lens")?"is-beta-extension inset-shadow":"",name:"ai-content-lens-plugin",title:__("Excerpt","jetpack"),children:(0,g.jsx)(f,{})})})}},33792(e,t,s){"use strict";s.d(t,{$:()=>o,s:()=>n});varr=s(33251);constn="ai-content-lens",o={render:r.g}},31009(e,t,s){"use strict";s.d(t,{m:()=>l});varr=s(3924),n=s(85985),o=s(56427),a=s(27723),i=s(10790);const__=a.__,l=({changeStatus:e,isLoading:t,isModuleActive:s})=>{const{tracks:a}=(0,n.st)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:__("Activate the Likes feature to allow others to like your posts.","jetpack")}),(0,i.jsx)(o.Button,{disabled:s||t,isBusy:t,onClick:()=>(a.recordEvent("jetpack_editor_likes_enable"),e(!0)),variant:"secondary",children:t?__("Activating Likes","jetpack"):__("Activate Likes","jetpack",0)}),(0,i.jsx)("div",{className:"components-likes-placeholder__learn-more",children:(0,i.jsx)(o.ExternalLink,{href:(0,r.A)("jetpack-support-likes"),children:__("Learn more about Jetpack Likes.","jetpack")})})]})}},79013(e,t,s){"use strict";s.d(t,{L:()=>i});varr=s(50723),n=s(11876),o=s(56427),a=s(10790);consti=()=>(0,a.jsx)(r.Ay,{children:(0,a.jsx)(o.Placeholder,{children:(0,a.jsxs)(o.Flex,{gap:2,direction:"column",style:{flexBasis:"100%",padding:"0 1em"},children:[(0,a.jsx)(o.FlexItem,{children:(0,a.jsx
__("To use the SEO feature you need to upgrade to the %s plan","jetpack"),h)}),(0,c.jsx)("div",{className:"components-seo-upsell__learn-more",children:(0,c.jsx)(n.k4,{supportLink:"https://wordpress.com/support/seo-tools/",supportPostId:120916,children:g})}),(0,c.jsx)(o.Button,{href:u?null:t,onClick:e=>{e.preventDefault(),p.recordEvent("jetpack_seo_tools_upsell_click"),s(e)},target:"_top",icon:i.A,className:(0,l.A)("components-seo-upsell__button is-primary",{"jetpack-upgrade-plan__hidden":!t}),isBusy:u,children:u?__("Redirecting…","jetpack"):m})]})}},99463(e,t,s){"use strict";s.d(t,{P:()=>a});varr=s(56427),n=s(27723),o=s(10790);const__=n.__,_n=n._n,a=({suggestedLimit:e,value:t,label:s,...a})=>{consti=!e||t.length<=e?(0,n.sprintf)(/* translators: %d: the number of characters in a sentence. */
_n("%d character","%d characters",t.length,"jetpack"),t.length):(0,n.sprintf)(/* translators: %1$d: suggested character limit, %2$d: number of characters in a sentence. */
__("It is recommended to use less than %1$d characters in this field. (%2$d/%1$d)","jetpack"),e,t.length);return(0,o.jsx)("div",{className:"jetpack-seo-message-box",children:(0,o.jsx)(r.TextareaControl,{__nextHasNoMarginBottom:!0,label:s,help:i,value:t,...a})})}},92411(e,t,s){"use strict";s.d(t,{A:()=>d});varr=s(85985),n=s(86087),o=s(27723),a=s(99463),i=s(53189),l=s(10790);const__=o.__,c=!0===(0,r.FB)("ai-seo-enhancer")?.available;classuextendsn.Component{onMessageChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props,t=__("Write a description…","jetpack"),s=__("Add a compelling, keyword-rich summary that appears in search results (ideally under 156 characters)","jetpack");return(0,l.jsx)(a.P,{value:e,onChange:this.onMessageChange,label:__("SEO Description","jetpack"),placeholder:c?s:t,suggestedLimit:156,rows:4})}}constd=(0,i.m)("advanced_seo_description")(u)},44921(e,t,s){"use strict";varr=s(85985),n=s(37802);(0,r.vp)(n.U,n.W)},37802(e,t,s){"use strict";s.d(t,{U:()=>C,W:()=>T});varr=s(70499),n=s(97999),o=s(85985),a=s(82201),i=s(56427),l=s(3582),c=s(47143),u=s(43656),d=s(86087),p=s(27723),h=s(89870),m=s(12430),g=s(77682),f=s(96012),b=s(76262),v=s(51626),k=s(24294),y=s(92411),x=s(5664),j=s(9411),w=s(80151),_=s(10790);const__=p.__,C="seo",A="function"==typeof(0,c.select)(u.store).isPublishSidebarOpened,S=!0===(0,o.FB)("ai-seo-enhancer")?.available&&A,E=!(0,n.isSimpleSite)(),N=()=>{const{isLoadingModules:e,isChangingStatus:t,isModuleActive:s,changeStatus:p}=(0,o.q7)("seo-tools"),C=(0,c.useSelect)(e=>e(u.store).isPublishSidebarOpened?.(),[]),{updateSeoData:N,isBusy:T}=(0,f.X)(),B=(0,c.useSelect)(e=>{constt=e(u.store).getCurrentPostType(),s=e(l.store).getPostType(t);returns?.viewable},[]),P=(0,d.useRef)(!1),{isEnabled:I,isToggling:M}=(0,g.S)(),{closePublishSidebar:L}=(0,c.useDispatch)(u.store);(0,d.useEffect)(()=>{S&&C&&!P.current&&!T&&I&&!M&&E&&A&&N({trigger:"auto"}),P.current=C},[C,N,T,I,M]);if(!B)returnnull;constR=(0,o.tu)("advanced-seo"),D=(0,n.isWpcomPlatformSite)(),F=!(0,o.tu)("ai-seo-enhancer");if(D&&!1!==R)return(0,_.jsx)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:(0,_.jsx)(k.A,{requiredPlan:R})});if(!s)return(0,_.jsx)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:e?(0,_.jsx)(v.G,{}):(0,_.jsx)(b.l,{changeStatus:p,isModuleActive:s,isLoading:t})});constO={icon:(0,_.jsx)(a.jt,{}),title:__("SEO","jetpack"),initialOpen:S};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:[S&&F&&(0,_.jsx)(h.k,{placement:"document-settings",disableAutoEnhance:!E}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(w.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(y.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(r.m2,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(x.A,{})})]}),(0,_.jsx)(u.PluginPrePublishPanel,{...O,children:(0,_.jsxs)("div",{className:"jetpack-seo-panel",children:[S&&F&&(0,_.jsx)(h.k,{placement:"jetpack-prepublish-sidebar",disableAutoEnhance:!E}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(w.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(y.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(r.m2,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(x.A,{})})]})}),S&&(0,_.jsx)(u.PluginPostPublishPanel,{...O,children:(0,_.jsx)("div",{className:"jetpack-seo-panel",children:(0,_.jsx)(m.A,{onEdit:async()=>{awaitL(),(0,j.k)()}})})})]})},T={render:()=>(0,_.jsx)(N,{})}},5664(e,t,s){"use strict";s.d(t,{A:()=>i});varr=s(56427),n=s(27723),o=s(53189),a=s(10790);const__=n.__,i=(0,o.m)("jetpack_seo_noindex")(({metaValue:e,updateMetaValue:t})=>(0,a.jsx)(r.ToggleControl,{label:__("Hide page from search engines","jetpack"),help:__("Ifselected,a'noindex'tagwillhelpinstructsearchenginestonotincludethispageinsearchresults.Thispagewillalsoberemovedfr
// translators: %1$s: formatted price, %2$s: plan interval
__("%1$s / %2$s","jetpack"),o,s)}functionv({onClose:e,product:t}){const{selectedProductIds:s,setSelectedProductIds:r}=(0,h.B)(),{id:n,title:a}=t,i=s&&s.includes(n),l=i?c.A:void0,u=t?" "+b(t):null;return(0,f.jsxs)(o.MenuItem,{icon:l,onClick:t=>{t.preventDefault();consto=i?s.filter(e=>e!==n):[...s,n];r(o),e()},selected:i,value:n,children:[a," : ",u]})}functionk({onClose:e}){const{clientId:t,productType:s}=(0,h.B)(),r=(0,a.useSelect)(e=>e(d.M).getSiteSlug()),n=(0,m.A)(t);if(p.Wd===(0,p.AU)())return(0,f.jsx)(o.MenuItem,{children:r&&(0,f.jsx)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${r}#add-new-payment-plan`,children:(0,g.W)("add a new product",s)})});return(0,f.jsx)(o.MenuItem,{onClick:t=>{t.preventDefault(),n(),setTimeout(()=>{conste=document.getElementById("new-product-title");null!==e&&e.focus()},100),e()},children:(0,g.W)("add a new product",s)})}functiony(){const{products:e,productType:t,selectedProductIds:s}=(0,h.B)(),r=(0,a.useSelect)(e=>e(d.M).getSelectedProducts(s),[s]);leti=null,c=u.A;returnr.length>1?i=__("Multiple products selected","jetpack"):1===r.length&&(i=b(r[0])),r.length!=r.length&&(i=(0,g.W)("product not found",t),c=l.A),(0,f.jsx)(n.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,f.jsx)(o.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:c,label:(0,g.W)("select a product",t),text:i,children:({onClose:t})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.MenuGroup,{children:e.map(e=>(0,f.jsx)(v,{onClose:t,product:e},e.id))}),(0,f.jsx)(o.MenuGroup,{children:(0,f.jsx)(k,{onClose:t})})]})})})}},21212(e,t,s){"use strict";s.d(t,{A:()=>i});varr=s(94715),n=s(47143),o=s(14309),a=s(59340);functioni(e){constt=(0,a.AU)(),{selectBlock:s}=(0,n.useDispatch)(r.store),{enableComplementaryArea:i}=(0,n.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,n.useDispatch)(o.store);return()=>{switch(e&&s(e),t){casea.O3:returni("core/edit-site","edit-site/block-inspector");casea.RZ:returni("core/edit-widgets","edit-widgets/block-inspector");default:l(),i("core/edit-post","edit-post/block")}}}},1990(e,t,s){"use strict";s.d(t,{G:()=>l,W:()=>a});varr=s(27723),n=s(29726);const__=r.__,o={"add a new product":{[n._$]:__("Add a new payment plan","jetpack"),[n.h5]:__("Add a new subscription","jetpack")},"product not found":{[n._$]:__("Payment plan not found","jetpack"),[n.h5]:__("Subscription not found","jetpack")},"select a product":{[n._$]:__("Select a payment plan","jetpack"),[n.h5]:__("Select a subscription","jetpack")},"default new product title":{[n._$]:__("Monthly Subscription","jetpack"),[n.h5]:__("Monthly Subscription","jetpack")},"manage your products":{[n._$]:__("Manage your payment plans.","jetpack"),[n.h5]:__("Manage your subscriptions.","jetpack")},"saving product":{[n._$]:__("Saving payment plan…","jetpack"),[n.h5]:__("Saving subscription…","jetpack")},"add product":{[n._$]:__("Add payment plan","jetpack"),[n.h5]:__("Add subscription","jetpack")},"product requires a name":{[n._$]:__("Payment plan requires a name","jetpack"),[n.h5]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[n._$]:__("Payment plan requires a valid price","jetpack"),[n.h5]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[n._$]:__("Successfully created payment plan","jetpack"),[n.h5]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[n._$]:__("There was an error when adding the payment plan.","jetpack"),[n.h5]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[n._$]:__("Invalid payment plan configured for this block.","jetpack"),[n.h5]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[n._$]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[n.h5]:__("Thesubscribebuttonwillbehiddenfromyourvisitorsuntilyouselectaval
_n("This post will be sent to everyone subscribed to %1$s (%2$s subscriber).","This post will be sent to everyone subscribed to %1$s (%2$s subscribers).",r??0,"jetpack"),n,o):(0,c.sprintf)(
_n("This post was sent to everyone subscribed to %1$s (<link>%2$s subscriber</link>).","This post was sent to everyone subscribed to %1$s (<link>%2$s subscribers</link>).",r??0,"jetpack"),n,o)};functionf(e,t){return(0,r.getAdminUrl)(`admin.php?page=stats#!/stats/email/opens/day/${t}/${e}`)}constb=function({accessLevel:e,prePublish:t=!1}){consts=(0,a.useSelect)(e=>e("core/block-editor").getBlocks().some(e=>e.name===u.name)),{isScheduledPost:r,isPostOlderThanADay:b,postCategories:v,postId:k,postMeta:y}=(0,a.useSelect)(e=>{const{isCurrentPostScheduled:t,getEditedPostAttribute:s,getCurrentPost:r}=e(i.store),n=r()?.status,o=newDate(r()?.date),a=newDate(Date.now()-864e5);return{isScheduledPost:t(),isPostOlderThanADay:"publish"===n&&o<a,postCategories:s("categories"),postId:r()?.id,postMeta:s("meta")}}),x=window.Jetpack_Editor_Initial_State?.wpcomBlogId,{emailSubscribersCount:j,hasFinishedLoading:w,newsletterCategories:_,newsletterCategoriesEnabled:C,newsletterCategorySubscriberCount:A,paidSubscribersCount:S,totalEmailsSentCount:E}=(0,a.useSelect)(e=>{const{getNewsletterCategories:t,getNewsletterCategoriesEnabled:s,getNewsletterCategoriesSubscriptionsCount:r,getSubscriberCounts:n,getTotalEmailsSentCount:o,hasFinishedResolution:a}=e(h.M),{emailSubscribers:i,paidSubscribers:l}=n();return{hasFinishedLoading:[a("getSubscriberCounts"),a("getNewsletterCategories"),a("getNewsletterCategoriesSubscriptionsCount")].every(Boolean),emailSubscribersCount:i,newsletterCategories:t(),newsletterCategoriesEnabled:s(),newsletterCategorySubscriberCount:r(),paidSubscribersCount:l,totalEmailsSentCount:b?o(x,k):null}});if(!w)return(0,m.jsx)(o.Animate,{type:"loading",children:({className:e})=>(0,m.jsx)("p",{className:`jetpack-subscribe-affirmation-loading ${e}`,children:__("Loading…","jetpack")})});constN=e===d.P2.paid_subscribers.key,T=t||r,B=(0,p.Yc)({accessLevel:e,subscribers:b?E:j,paidSubscribers:S,postHasPaywallBlock:s});letP;returnP=y?.[d.KG]?__("Not sent via email.","jetpack"):(0,n.lk)()?__("Your site is in Coming Soon mode. Emails are sent only when your site is public.","jetpack"):C&&_.length>0&&!N?g({futureTense:T,isPaidPost:N,newsletterCategories:_,postCategories:v,reachCount:b?E:A}):(({futureTense:e,isPaidPost:t,postHasPaywallBlock:s,reachCount:r})=>{constn=r.toLocaleString();returne?t&&!s?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s paid subscriber</strong>.","This post will be sent to <strong>%s paid subscribers</strong>.",r,"jetpack"),n):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s subscriber</strong>.","This post will be sent to <strong>%s subscribers</strong>.",r,"jetpack"),n):t&&!s?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <link>%s paid subscriber</link>.","This post was sent to <link>%s paid subscribers</link>.",r,"jetpack"),n):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <link>%s subscriber</link>.","This post was sent to <link>%s subscribers</link>.",r,"jetpack"),n)})({futureTense:T,isPaidPost:N,postHasPaywallBlock:s,reachCount:B}),(0,m.jsx)("p",{children:(0,l.createInterpolateElement)(P,{strong:(0,m.jsx)("strong",{}),link:(0,m.jsx)("a",{href:f(x,k)})})})}},64234(e,t,s){"use strict";s.d(t,{Qu:()=>l,fI:()=>c,mf:()=>u});varr=s(56427),n=s(86087),o=s(27723),a=s(37906),i=s(10790);const__=o.__,l=e=>{constt="https://wordpress.com/earn/payments/"+location.hostname;returne?t:t+"#add-tier-plan"},c=(e,t)=>"public"!==e&&t!==a.P2.everybody.key,u=()=>(0,i.jsx)(r.Notice,{status:"warning",isDismissible:!1,className:"edit-post-post-misconfiguration__warning",children:(0,n.createInterpolateElement)(__("You’ll need to change the post’s access to Everybody or visibility to Public.<br/><br/>Subscribers aren’t able to view private or password-protected posts.","jetpack"),{br:(0,i.jsx)("br",{})})})},14435(e,t,s){"use strict";varr=s(97999),n=s(85985),o=s(1455),a=s.n(o),i=s(47143),l=s(27723);s(692);const__=l.__;functionc(){conste=(0,n.GE)();returnwindow?.location&&e?(0,r.isWpcomPlatformSite)()?`https://wordpress.com/plans/my-plan/${e}`:`${window.location.protocol}//${e.replace("::","/")}/wp-admin/admin.php?page=jetpack#/my-plan`:null}(async()=>{if(window?.location){if(newURLSearchParams(window.location.search).get("plan_upgraded")){lete=null;e:try{if((0,r.isSimpleSite)())breake;constt=awaita()({path:"/jetpack/v4/site"});e=JSON.parse(t.data).plan.product_name}finally{constt=c();(0,i.dispatch)("core/notices").createNotice("success",e?(0,l.sprintf)(/* translators: %s is the plan name, such as Jetpack Premium. */
__("Congratulations! Your site is now on the %s plan.","jetpack"),e):__("Congratulations! Your site is now on a paid plan.","jetpack"),{isDismissible:!0,...t&&{actions:[{url:c(),label:__("View my plan","jetpack")}]}})}}}})()},79366(e,t,s){"object"==typeofwindow&&window.Jetpack_Block_Assets_Base_Url&&(s.p=window.Jetpack_Block_Assets_Base_Url)},59740(e,t,s){"use strict";varr=s(74997),n=s(47143),o=s(93832),a=s(30552);const{url:i,title:l,text:c,comment_content:u,comment_author:d}=(0,o.getQueryArgs)(window.location.href);i&&(async()=>{await(0,a.O)();conste=[];if(c&&c!==l){constt=`<a href="${i}">${l}</a>`;e.push((0,r.createBlock)("core/quote",{value:`<p>${c}</p>`,citation:t}))}u&&e.push((0,r.createBlock)("core/quote",{value:u,citation:d})),e.push((0,r.createBlock)("core/embed",{url:i,type:"wp-embed"})),(0,n.dispatch)("core/editor").resetEditorBlocks(e)})()},94375(e,t,s){"use strict";s.d(t,{A:()=>i,M:()=>l});varr=s(85985),n=s(74997),o=s(52619);consta="jetpack/";functioni(e,t,s=[],i=!0){constl="string"==typeofe?e:e.name,c=l.startsWith(a),u=c?l.slice(8):l,{available:d,details:p,unavailableReason:h}=(0,r.FB)(u),m=(0,r.aq)(h,p),g=i||c?a:"";if(!d&&!m)return!1;constf=g+u,b=(0,n.registerBlockType)("object"==typeofe?e:f,t);returnm&&(0,o.addFilter)("editor.BlockListBlock",`${f}-with-has-warning-is-interactive-class-names`,(0,r.BT)(f)),s.forEach(e=>(0,n.registerBlockType)(g+e.name,e.settings)),b}functionl(e,t,s,n){returni(e,{...t,icon:(0,r.Cq)(e),attributes:e.attributes||{}},s,n)}},62289(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(5573),n=s(10790);consto=(e,t=24,s=24,o="0 0 24 24")=>(0,n.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:o,children:[(0,n.jsx)(r.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e]})},64882(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(94715),n=s(13022),o=s(10790);consta=(e,t,s,a,i,l={})=>{const{isSelected:c}=t,u=t.attributes[e];returnl.className=(0,n.A)(l.className,`jetpack-${e}-block`,{"is-selected":c}),(0,o.jsxs)("div",{...l,children:[!c&&""!==u&&a(t),(c||""===u)&&(0,o.jsx)(r.PlainText,{value:u,placeholder:s,"aria-label":s,onChange:i})]})}},21929(e,t,s){"use strict";varr=s(47143),n=s(27723);s(692);const__=n.__;if("undefined"!=typeofwindow&&window.location){conste=newURLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,r.dispatch)("core/notices").createNotice("success",__("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):e.get("stripe_connect_cancelled")&&(0,r.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},56145(e,t,s){"use strict";s.d(t,{A:()=>a});varr=s(1455),n=s.n(r);consto=()=>{};functiona(e,t=o){returnt(!0),newPromise((s,r)=>{n()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then(n=>{t(!1);consto=n.status?parseInt(n.status,10):null;o&&o>=400?r():s(n.url||e)},()=>{t(!1),r()})})}},26247(e,t,s){"use strict";s.d(t,{A:()=>o});varr=s(39384),n=s(97999);consto=()=>{const{isUserConnected:e}=(0,r.useConnection)();return(0,n.isSimpleSite)()||e}},89303(e,t,s){"use strict";s.d(t,{A:()=>n});varr=s(86087);functionn({attributes:e,disableEffects:t=!1,setAttributes:s}){const{align:n,width:o}=e,a=(e=>{constt=(0,r.useRef)(void0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current})(n);(0,r.useEffect)(()=>{if(t)return;a!==n&&("left"===n||"right"===n)&&o?.includes("%")&&s({width:void0})},[n,t,a,s,o])}},30552(e,t,s){"use strict";s.d(t,{O:()=>n});varr=s(47143);functionn(){returnnewPromise((e,t)=>{if(o())returnvoide();consts=(0,r.subscribe)(()=>{o()&&(clearTimeout(n),s(),e())}),n=setTimeout(()=>{s(),t(newError("Timeout: Waiting for the editor to be ready has timed out."))},7e3)})}functiono(){conste=(0,r.select)("core/editor"),t=(0,r.select)("core/block-editor");return!(!e||!t)&&(e.isCleanNewPost()||e.getCurrentPostId()||t.getBlocks().length>0)}},38062(e,t,s){"use strict";s.d(t,{D:()=>d,s:()=>p});varr=s(56427),n=s(86087),o=s(27723),a=s(13022),i=s(10790);const__=o.__,l=[{value:"%",label:"
// translators: %s: Price
__("Minimum allowed price is %s.","jetpack"),(0,r.vv)(k,b)),m),voidn(!1);if(!(0,c.kF)(b,v))return(0,d.S)((0,l.W)("product requires a valid price",t),m),voidn(!1);try{constr=awaito()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),a={id:r.id,title:r.title,interval:r.interval,price:r.price,currency:r.currency},c=m.select(u.EF).getProducts();i(p(c.concat([a]))),s([a.id]),h&&(0,d.L)((0,l.W)("successfully created product",t),m),n(!0)}catch{(0,d.S)((0,l.W)("there was an error when adding the product",t),m),n(!1)}},v=e=>({type:"SET_SUBSCRIBER_COUNTS",subscriberCounts:e}),k=e=>({type:"SET_TOTAL_EMAILS_SENT_COUNT",totalEmailsSentCount:e}),y=e=>({type:"SET_NEWSLETTER_CATEGORIES",newsletterCategories:e}),x=e=>({type:"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT",newsletterCategoriesSubscriptionsCount:e})},3696(e,t,s){"use strict";s.d(t,{EF:()=>r,JA:()=>o,an:()=>n,gI:()=>a,ky:()=>i});constr="jetpack/membership-products",n=0,o=1,a=2,i="tier"},16521(e,t,s){"use strict";s.d(t,{M:()=>c});varr=s(47143),n=s(66314),o=s(3696),a=s(91497),i=s(18410),l=s(92955);constc=(0,r.createReduxStore)(o.EF,{actions:n,reducer:a.A,resolvers:i,selectors:l,__experimentalUseThunks:!0});(0,r.register)(c)},91497(e,t,s){"use strict";s.d(t,{A:()=>n});constr={products:[],apiState:s(3696).an,connectUrl:null,siteSlug:"",connectedAccountDefaultCurrency:"",subscriberCounts:{totalSubscribers:null,socialFollowers:null,emailSubscribers:null,paidSubscribers:null},newsletterCategories:{enabled:!1,categories:[]}};functionn(e=r,t){switch(t.type){case"SET_PRODUCTS":return{...e,products:t.products};case"SET_CONNECT_URL":return{...e,connectUrl:t.connectUrl};case"SET_API_STATE":return{...e,apiState:t.apiState};case"SET_SITE_SLUG":return{...e,siteSlug:t.siteSlug};case"SET_CONNECTED_ACCOUNT_DEFAULT_CURRENCY":return{...e,connectedAccountDefaultCurrency:t.connectedAccountDefaultCurrency};case"SET_SUBSCRIBER_COUNTS":return{...e,subscriberCounts:t.subscriberCounts};case"SET_TOTAL_EMAILS_SENT_COUNT":return{...e,totalEmailsSentCount:t.totalEmailsSentCount};case"SET_NEWSLETTER_CATEGORIES":return{...e,newsletterCategories:t.newsletterCategories};case"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT":return{...e,newsletterCategoriesSubscriptionsCount:t.newsletterCategoriesSubscriptionsCount}}returne}},18410(e,t,s){"use strict";s.r(t),s.d(t,{fetchNewsletterCategoriesSubscriptionsCount:()=>x,getNewsletterCategories:()=>S,getNewsletterCategoriesSubscriptionsCount:()=>E,getNewsletterTierProducts:()=>w,getProducts:()=>_,getSubscriberCounts:()=>C,getTotalEmailsSentCount:()=>A});varr=s(97999),n=s(1455),o=s.n(n),a=s(43656),i=s(93832),l=s(29726),c=s(1990),u=s(56539),d=s(27574),p=s(66314),h=s(3696),m=s(34884);constg="membership-products-resolver-getProducts",f="membership-products-resolver-getSubscriberCounts",b="membership-products-resolver-getTotalEmailsSentCount",v="membership-products-resolver-getNewsletterCategories",k="membership-products-resolver-getNewsletterCategoriesSubscriptionsCount";lety=!1;constx=asynce=>{constt=awaito()({path:`/wpcom/v2/newsletter-categories/count?term_ids=${e.join(",")}`,method:"GET"});if(!t||"object"!=typeoft)thrownewError("Unexpected API response");consts=t?.errors&&Object.values(t.errors)?.[0]?.[0];if(s)thrownewError(s);returnt},j=(e,t,s)=>{if(e.length>0)return;constr=s.getProductsNoResolver()[0]?.id;r&&t([r])},w=(e=l._$,t=[],s=()=>{})=>_(e,t,s,!1),_=(e=l._$,t=[],s=()=>{},r=!0)=>async({dispatch:n,registry:l,select:f})=>{if(awaitu.A.blockExecution(g),y)returnvoidj(t,s,f);constb=u.A.acquire(g);try{constu=await(async()=>{conste=(0,i.getQueryArg)(window.location.href,"origin"),t=(0,i.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===e?"gutenberg-wpcom":"gutenberg",type:"all",is_editable:!0}),s=awaito()({path:t,method:"GET"});if(!s&&"object"!=typeofs)thrownewError("Unexpected API response");constr=s?.errors&&Object.values(s.errors)?.[0]?.[0];if(r)thrownewError(r);returns})();((e,t,s)=>{constr=t.select(a.store).getCurrentPostId();s((0,p.setConnectUrl)((0,d.A)(r,e.connect_url))),s((0,p.setSi