kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/editor-beta.js

152 lines
1.4 MiB
JavaScript
Raw Normal View History

2022-04-02 10:26:41 +02:00
/*! For license information please see editor-beta.js.LICENSE.txt */
2025-07-27 19:58:08 +02:00
(()=>{var e,t,r,s,n={7675:(e,t,r)=>{"use strict";r.d(t,{y:()=>l});var s=r(76416),n=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(r[s[n]]=e[s[n]])}return r};const o="text/event-stream",a=1e3,i="last-event-id";function l(e,t){var{signal:r,headers:l,onopen:u,onmessage:d,onclose:p,onerror:h,openWhenHidden:m,fetch:g}=t,f=n(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,n)=>{const b=Object.assign({},l);let v;function k(){v.abort(),document.hidden||C()}b.accept||(b.accept=o),m||document.addEventListener("visibilitychange",k);let y=a,x=0;function j(){document.removeEventListener("visibilitychange",k),window.clearTimeout(x),v.abort()}null==r||r.addEventListener("abort",(()=>{j(),t()}));const w=null!=g?g:window.fetch,_=null!=u?u:c;async function C(){var r;v=new AbortController;try{const r=await w(e,Object.assign(Object.assign({},f),{headers:b,signal:v.signal}));await _(r),await(0,s.q5)(r.body,(0,s.iv)((0,s.VL)((e=>{e?b[i]=e:delete b[i]}),(e=>{y=e}),d))),null==p||p(),j(),t()}catch(e){if(!v.signal.aborted)try{const t=null!==(r=null==h?void 0:h(e))&&void 0!==r?r:y;window.clearTimeout(x),x=window.setTimeout(C,t)}catch(e){j(),n(e)}}}C()}))}function c(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(o)))throw new Error(`Expected content-type to be ${o}, Actual: ${t}`)}},76416:(e,t,r)=>{"use strict";async function s(e,t){const r=e.getReader();let s;for(;!(s=await r.read()).done;)t(s.value)}function n(e){let t,r,s,n=!1;return function(o){void 0===t?(t=o,r=0,s=-1):t=function(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,o);const a=t.length;let i=0;for(;r<a;){n&&(10===t[r]&&(i=++r),n=!1);let o=-1;for(;r<a&&-1===o;++r)switch(t[r]){case 58:-1===s&&(s=r-i);break;case 13:n=!0;case 10:o=r}if(-1===o)break;e(t.subarray(i,o),s),i=r,s=-1}i===a?t=void 0:0!==i&&(t=t.subarray(i),r-=i)}}function o(e,t,r){let s=a();const n=new TextDecoder;return function(o,i){if(0===o.length)null==r||r(s),s=a();else if(i>0){const r=n.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),l=n.decode(o.subarray(a));switch(r){case"data":s.data=s.data?s.data+"\n"+l:l;break;case"event":s.event=l;break;case"id":e(s.id=l);break;case"retry":const r=parseInt(l,10);isNaN(r)||t(s.retry=r)}}}}function a(){return{data:"",event:"",id:"",retry:void 0}}r.d(t,{VL:()=>o,iv:()=>n,q5:()=>s})},51113:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(86087);const n=(0,s.forwardRef)((function({icon:e,size:t=24,...r},n){return(0,s.cloneElement)(e,{width:t,height:t,...r,ref:n})}))},66955:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(5573),n=r(10790);const o=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})})},62510:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(5573),n=r(10790);const o=(0,n.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(s.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})})},62599:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(5573),n=r(10790);const o=(0,n.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)(s.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467
2025-04-25 12:30:07 +02:00
// Translators: %d is the cost of one image.
// Translators: %d is the cost of one image.
2025-07-27 19:58:08 +02:00
(0,n.sprintf)(__("Requests needed: <counter>%d</counter>","jetpack"),r),{counter:(0,o.jsx)("span",{})}),l=(0,s.createInterpolateElement)((0,n.sprintf)(
2025-04-25 12:30:07 +02:00
// Translators: %d is the current requests balance.
2025-07-27 19:58:08 +02:00
__("Requests available: <counter>%d</counter>","jetpack"),a),{counter:a<r?(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,r)=>{"use strict";r.d(t,{A:()=>x});var s=r(85985),n=r(56427),o=r(47143),a=r(43656),i=r(86087),l=r(27723),c=r(10067),u=r.n(c),d=r(43984),p=r(72448),h=r(71508),m=r(62038),g=r(96390),f=r(3620),b=r(35918),v=r(75988),k=r(10790);const __=l.__,y=u()("jetpack-ai-client:featured-image");function x({busy:e,disabled:t,placement:r,onClose:c=()=>{}}){const[u,x]=(0,i.useState)(r===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,s.st)(),{recordEvent:T}=N,[P,B]=(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:z}=(0,o.useDispatch)(a.store),{requireUpgrade:O,requestsCount:U,requestsLimit:H,currentTier:V,costs:q}=(0,p.A)(),$=(0,s.Bd)(V),G=q?.[v.oW]?.activeModel??10,W=G===q?.[v.oW]?.stableDiffusion?v.Dk:v.bb,Z=$===s.Ti,J=H-U<G,K=z??D,{pointer:Y,current:Q,setCurrent:X,processImageGeneration:ee,handlePreviousImage:te,handleNextImage:re,currentImage:se,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=>{const t=C+"\n\n"+w();return ie(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:r,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:r,error:e?.message,model:W,site_type:j,style:t})})))),[T,r,W,j,ee,w,J,C]),pe=(0,i.useCallback)((async()=>{ne.generating=!0;const e=await ue("");B(e);const t=await de({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:r,model:W,site_type:j,style:t}),X((()=>oe.length)),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch((s=>{T("jetpack_ai_featured_image_generation_error",{placement:r,error:s?.message,model:W,site_type:j,style:t,userPrompt:e})}))}),[T,r,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:r,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:r,error:e?.message,model:W,site_type:j,style:t})}))}),[T,r,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:r,model:W,site_type:j});const e=e=>{F({featured_media:e}),le(),setTimeout((()=>{const e=S("featured-image"),t=S("post-status");ge().then((()=>{e||K("featured-image"),t||K("post-status")}))}),500)};se?.libraryId?e(se?.libraryId):E(se?.image).then((t=>{e(t?.id)})).catch((e=>{T("jetpack_ai_featured_image_saving_error",{placement:r,error:e?.message,model:W,site_type:j})}))}),[T,r,W,j,se?.libraryId,se?.image,F,le,S,ge,K,E]),be=__("Generate another imag
2025-04-25 12:30:07 +02:00
// Translators: %d is the cost of generating a featured image.
2025-07-27 19:58:08 +02:00
__("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:!se?.image||se?.generating||se?.libraryId===A,children:__("Set as featured image","jetpack")});return(0,k.jsxs)(k.Fragment,{children:[(r===d.s6||r===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:r,onClose:le,onTryAgain:me,onGenerate:Y?.current>0||A?he:de,generating:ne?.generating,notEnoughRequests:J,requireUpgrade:O,upgradeDescription:we,currentLimit:H,currentUsage:U,isUnlimited:Z,hasError:Boolean(ne?.error),handlePreviousImage:te,handleNextImage:re,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:P,inputDisabled:xe,actionDisabled:je})]})}},83158:(e,t,r)=>{"use strict";r(85985),r(56427),r(86087),r(27723);var s=r(10067),n=r.n(s);r(72448),r(71508),r(62038),r(96390),r(3620),r(35918),r(10790);n()("jetpack-ai:general-purpose-image")},3620:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var s=r(47143),n=r(86087),o=r(27723),a=r(93832),i=r(31439),l=r(72448),c=r(62614),u=r(62038),d=r(75988);const __=o.__;function p({feature:e,type:t,cost:r,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,s.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((r=>{const s=[...r];return s[t]={...s[t],...e},s}))}),[]),S=(0,s.useSelect)((e=>e("core")?.getMedia?.(p)),[p]);(0,n.useEffect)((()=>{S&&A({image:S.source_url,libraryId:S.id,libraryUrl:S.source_url,generating:!1},v.current)}),[S,A]);const E=(0,n.useCallback)((e=>{b("success",e,{type:"snackbar",isDismissible:!0})}),[b]),N=(0,n.useCallback)((()=>{m(r)}),[m,r]),T=(0,n.useCallback)((e=>{if(!e)return"image.png";const t=e.split(" ").slice(0,10).join(" ");return(0,a.cleanForSlug)(t)+".png"}),[]),P=(0,n.useCallback)((({userPrompt:r,postContent:s,notEnoughRequests:n,style:o=null})=>new Promise(((a,i)=>{if(p&&0===v.current&&v.current++,A({generating:!0,error:null},v.current),n)return A({generating:!1,error:new Error(__("You don't have enough requests to generate another image.","jetpack"))},v.current),void a({});const l=h({feature:e,size:"1792x1024",responseFormat:"b64_json",messages:[{role:"jetpack-ai",context:{type:t,request:r||null,content:s,style:o}}],style:o||""}),c=T(r);l.then((e=>{if(e.data.length>0){const t="data:image/png;base64,"+e.data[0].b64_json,s=r||null,n=e.data[0].revised_prompt||null;A({image:t,prompt:s,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]),B=(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)((async function(e,t="",r=""){if(!C||!C.length)return null;const s=[{role:"jetpack-ai",context:{type:t||"general-image-guess-style",request:e,content:r}}];try{const e=await(0,i.A)(s,{feature:"jetpack-ai-image-generator"});if(!e)return null;const t=C.find((({value:t})=>t===e));return t?t.value:null}catch(e){Promise.rej
2024-04-17 11:32:24 +02:00
// translators: %1$d: number of requests remaining
2025-07-27 19:58:08 +02:00
__("You have %1$d requests remaining.","jetpack"),e)}),(0,p.jsx)(s.Button,{variant:"link",onClick:r,href:n,target:n?"_blank":null,children:__("Upgrade now","jetpack")})]})}function w({error:e,code:t,onTryAgainClick:r,onUpgradeClick:n,upgradeUrl:a}){const i=e||__("Something went wrong","jetpack");return(0,p.jsxs)(v,{severity:m,children:[(0,p.jsx)("span",{children:(0,o.sprintf)(
2025-02-28 08:42:11 +01:00
// translators: %1$d: A dynamic error message
2025-07-27 19:58:08 +02:00
__("Error: %1$s","jetpack"),i)}),t===u.Or?(0,p.jsx)(s.Button,{variant:"link",onClick:n,href:a,target:a?"_blank":null,children:__("Upgrade now","jetpack")}):(0,p.jsx)(s.Button,{variant:"link",onClick:r,children:__("Try again","jetpack")})]})}},14016:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(56427),n=r(27723),o=r(10991),a=r(6754),i=r(10790);const __=n.__,l=({requestingState:e,onClose:t,title:r})=>(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:r})]}),(0,i.jsx)(s.Button,{icon:o.A,label:__("Close","jetpack"),onClick:t})]});function c({children:e,handleClose:t,hideHeader:r=!0,requestingState:n="init",title:o=__("AI Assistant","jetpack"),maxWidth:a=720}){return(0,i.jsx)(s.Modal,{__experimentalHideHeader:r,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,r)=>{"use strict";r.d(t,{A:()=>b,Q:()=>f});var s=r(3924),n=r(85985),o=r(82201),a=r(56427),i=r(86087),l=r(27723),c=r(10067),u=r.n(c),d=r(42694),p=r(72448),h=r(71567),m=r(10790);const __=l.__,g=u()("jetpack-ai-client:upgrade-prompt"),f=({variant:e="error"})=>{const t=(()=>{const{usagePeriod:e}=(0,p.A)(),t=(e=>{const t=__("You've reached this month's request limit, per our <link>fair usage policy</link>.","jetpack");if(!e)return t;
2025-02-28 08:42:11 +01:00
// Translators: %s is the date when the requests will reset.
2025-07-27 19:58:08 +02:00
const r=__("Requests will reset on %s.","jetpack");return`${t} ${(0,l.sprintf)(r,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.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"})})})();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:r}=(0,p.A)();return 1===r?.value?(0,m.jsx)(f,{}):"vip"===t?(({description:e=null,useLightNudge:t=!1})=>{const r=t?h.U:o.cb,s=(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)(r,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:e||s,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:r=!1})=>{const a=r?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){const e=(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){const e=(0,s.A)("jetpack-ai-tiers-more-requests-contact"),r=__("You have reached the request limit for your current plan.","jetpack");return(0,m.jsx)(a,{buttonText:__("Contact Us","jetpack"),description:t||r,className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:j,target:"_blank"})}const e=(0,i.createInterpolateElement)((0,l.sprintf)(/* Translators: number of requests */
__("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: 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,r)=>{"use strict";r.d(t,{U:()=>a});var s=r(56427),n=r(27723),o=r(10790);const __=n.__,a=({title:e,description:t,buttonText:r=null,checkoutUrl:n=null,goToCheckoutPage:a=null,isRedirecting:i=!1,showButton:l=!0,target:c="_top"})=>{const u=__("Redirecting…","jetpack");return(0,o.jsx)("div",{className:"jetpack-upgrade-plan-banner-light",children:(0,o.jsx)(s.Notice,{status:"error",isDismissible:!1,children:(0,o.jsxs)("p",{children:[e&&(0,o.jsx)("strong",{children:e}),t," ",l&&(0,o.jsx)(s.Button,{href:i?null:n,onClick:a,variant:"link",target:c,children:i?u:r})]})})})}},43984:(e,t,r)=>{"use strict";r.d(t,{A4:()=>l,DD:()=>j,DT:()=>P,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:()=>B,sn:()=>i,so:()=>n,u0:()=>y,uQ:()=>x,vE:()=>u,wb:()=>I,yQ:()=>E,yy:()=>c,z5:()=>b});var s=r(27723);const __=s.__,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"),P=__("Continue writing","jetpack"),B="jetpack-sidebar",I="document-settings"},2166:(e,t,r)=>{"use strict";r.d(t,{R:()=>a});var s=r(51609),n=r(10790);const o=(0,s.createContext)({}),a=({value:e,children:t})=>(0,n.jsx)(o.Provider,{value:e,children:t})},13965:(e,t,r)=>{"use strict";r.d(t,{Rb:()=>s.R});var s=r(2166);r(59886),r(53471)},53471:(e,t,r)=>{"use strict";r(51609),r(78836),r(13965)},59886:(e,t,r)=>{"use strict";var s=r(29491),n=r(86087),o=(r(51609),r(46219)),a=r(13965),i=r(10790);(0,s.createHigherOrderComponent)((e=>t=>{const{suggestion:r,error:s,requestingState:l,request:c,stopSuggestion:u,eventSource:d}=(0,o.Ay)(),p=(0,n.useMemo)((()=>({suggestion:r,requestingError:s,requestingState:l,eventSource:d,requestSuggestion:c,stopSuggestion:u})),[r,s,l,d,c,u]);return(0,i.jsx)(a.Rb,{value:p,children:(0,i.jsx)(e,{...t})})}),"withAiDataProvider")},42694:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(3924),n=r(97999),o=r(8
2025-04-25 12:30:07 +02:00
// translators: %u is the number of requests
2025-07-27 19:58:08 +02:00
__("%u requests remaining.","jetpack"),j)}),S&&(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(n.Button,{variant:"link",href:A,target:"_blank",onClick:()=>{r(h.AN,{context:V,placement:h.Cn})},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&&q&&(0,k.jsx)(v.G,{}),H&&!q&&(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,r)=>{"use strict";r.d(t,{G:()=>h});var s=r(85985),n=r(56427),o=r(86087),a=r(27723),i=r(51113),l=r(23751),c=r(61356),u=r(60674),d=r(88725),p=r(10790);const __=a.__,h=()=>{const{tracks:e}=(0,s.st)(),{recordEvent:t}=e,r=__("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:r})]})})}},35421:(e,t,r)=>{"use strict";r.d(t,{R:()=>u});var s=r(3924),n=r(85985),o=r(56427),a=r(27723),i=r(61356),l=r(88725),c=r(10790);const __=a.__,u=({onCancel:e,upgradeURL:t,reason:r})=>{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,s.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"===r?d:p})," ",(0,c.jsx)(o.Button,{variant:"link",href:h,target:"_blank",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:__("Cancel","jetpack")}),(0,c.jsx)(o.Button,{variant:"primary",href:t,target:"_blank",onClick:()=>{u(i.AN,{context:m,placement:i.Tz}),e()},children:__("Upgrade","jetpack")})]})]})}},48204:(e,t,r)=>{"use strict";r.d(t,{H:()=>c});var s=r(56427),n=r(27723),o=r(53512),a=r(13022),i=r(36791),l=r(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)(s.Button,{variant:"link",href:"https://jetpack.com/redirect/?source=logo_generator_learn_more_about_jetpack_ai",target:"_blank",onClick:t||
2025-02-28 08:42:11 +01:00
// Translators: %s is the date when the requests will reset.
2025-07-27 19:58:08 +02:00
const r=__("Requests will reset on %s.","jetpack");return`${t} ${(0,a.sprintf)(r,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e)),r=(0,s.A)("ai-logo-generator-fair-usage-policy",{anchor:"jetpack-ai-usage-limit"});return(0,o.createInterpolateElement)(t,{link:(0,l.jsx)("a",{href:r,target:"_blank",rel:"noreferrer"})})}},88725:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(47143),n=r(10067),o=r.n(n),a=r(51609),i=r(31439),l=r(62614),c=r(93869),u=r(51391),d=r(19362),p=r(28229),h=r(74423),m=r(44461);const g=o()("jetpack-ai-calypso:use-logo-generator"),f=()=>{const{setSelectedLogoIndex:e,setIsSavingLogoToLibrary:t,setIsApplyingLogo:r,setIsRequestingImage:n,setIsEnhancingPrompt:o,increaseAiAssistantRequestsCount:f,addLogoToHistory:b,setContext:v,setIsLoadingHistory:k}=(0,s.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:P,tierPlansEnabled:B,isLoadingHistory:I}=(0,s.useSelect)((e=>{const t=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:z}=(0,l.Ay)(),{saveToMediaLibrary:O}=(0,c.A)(),{ID:U=null,name:H=null,description:V=null}=w||{},q=U?String(U):null,$=N(q),G=$?.costs?.["jetpack-ai-logo-generator"]?.logo,W=$?.featuresControl?.["logo-generator"],Z=W?.styles||[],J=(0,a.useCallback)((async function(){M(null),f();try{const e=await(0,u.A)();if(!e||!e.token)throw new Error("No token provided");g("Generating first prompt for site");const t={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: ${V}`,feature:"jetpack-ai-logo-generator",stream:!1},r="https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query",s={Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},n=await fetch(r,{method:"POST",headers:s,body:JSON.stringify(t)}).then((e=>e.json()));return n?.choices?.[0]?.message?.content}catch(e){throw f(-1),M(e),e}}),[M,f,H,V]),K=(0,a.useCallback)((async function(e){if(R(null),!Z||!Z.length)return null;const t=[{role:"jetpack-ai",context:{type:"ai-assistant-guess-logo-style",request:e,name:H,description:V}}];try{const e=await(0,i.A)(t,{feature:"jetpack-ai-logo-generator"});if(!e)return null;const r=Z.find((({value:t})=>t===e));return r?r.value:null}catch(e){g("Error guessing style",e),Promise.reject(e)}}),[Z,H,V]),Y=(0,a.useCallback)((async function({prompt:e,style:t=null}){R(null);try{const r=await(0,u.A)();if(!r||!r.token)throw new Error("No token provided");if("auto"===t)throw new Error("Auto style is not supported");g("Generating image with prompt",
__("(opens in a new tab)","jetpack")})]}),C=b?"_blank":void 0,A=r?.[0]&&null!==r[0]&&"components-tooltip"!==r?.[0]?.props?.className;return(0,u.jsxs)(s.Button,{target:C,variant:n,className:(0,i.A)(j,{"has-text":!!p&&A}),icon:b?void 0:p,iconSize:h,disabled:m,"aria-disabled":m,isDestructive:g,text:k,...x,children:[f&&(0,u.jsx)(s.Spinner,{}),(0,u.jsx)("span",{children:r}),_]})}));d.displayName="Button";const p=d},69222:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(29491),n=r(86087),o=r(27723),a=r(51112),i=r(78478),l=r(10790);const __=o.__,c=({buttonStyle:e="icon",textToCopy:t,onCopy:r,...o})=>{const[c,u]=(0,n.useState)(!1),d=(0,n.useRef)(),p=(0,s.useCopyToClipboard)(t,(()=>{d.current&&clearTimeout(d.current),u(!0),r?.(),d.current=setTimeout((()=>{u(!1),d.current=void 0}),3e3)}));(0,n.useEffect)((()=>()=>{d.current&&clearTimeout(d.current)}),[]);let h=null,m=null;"text"!==e&&(h=c?(0,l.jsx)(i.Nr,{}):(0,l.jsx)(i.ui,{}));const g=__("Copy to clipboard","jetpack");return"icon"!==e&&(m=c?__("Copied!","jetpack"):g),(0,l.jsx)(a.A,{"aria-label":g,icon:h,children:m,ref:p,...o})}},78478:(e,t,r)=>{"use strict";r.d(t,{Nr:()=>l,ui:()=>c});var s=r(56427),n=r(13022),o=(r(84705),r(56058)),a=r(10790);const i=({className:e,size:t=24,viewBox:r="0 0 24 24",opacity:i=1,color:l="#2C3338",children:c})=>{const u={className:(0,n.A)(o.A.iconWrapper,e),width:t,height:t,viewBox:r,opacity:i,fill:void 0};return l&&(u.fill=l),(0,a.jsx)(s.SVG,{...u,fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(s.G,{opacity:i,children:c})})},l=({size:e,className:t=o.A["checkmark-icon"],color:r})=>(0,a.jsx)(i,{className:t,size:e,color:r,children:(0,a.jsx)(s.Path,{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"})}),c=({size:e,className:t=o.A["clipboard-icon"],color:r})=>(0,a.jsx)(i,{className:t,size:e,color:r,children:(0,a.jsx)(s.Path,{d:"M5.625 5.5H15.375C15.444 5.5 15.5 5.55596 15.5 5.625V15.375C15.5 15.444 15.444 15.5 15.375 15.5H5.625C5.55596 15.5 5.5 15.444 5.5 15.375V5.625C5.5 5.55596 5.55596 5.5 5.625 5.5ZM4 5.625C4 4.72754 4.72754 4 5.625 4H15.375C16.2725 4 17 4.72754 17 5.625V10V15.375C17 16.2725 16.2725 17 15.375 17C15.375 17 6.52246 17 5.625 17C4.72754 17 4 16.2725 4 15.375V5.625ZM18.5 17.2812V8.28125H20V17.2812C20 18.7995 18.7704 20 17.2511 20H6.25V18.5H17.2511C17.9409 18.5 18.5 17.9721 18.5 17.2812Z"})})},67142:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(27723),n=r(13022),o=(r(51609),r(10790));const __=s.__,a=({logoColor:e="#069e08",showText:t=!0,className:r,height:s=32,...a})=>{const i=t?"0 0 118 32":"0 0 32 32";return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:i,className:(0,n.A)("jetpack-logo",r),"aria-labelledby":"jetpack-logo-title",height:s,...a,role:"img",children:[(0,o.jsx)("title",{id:"jetpack-logo-title",children:__("Jetpack Logo","jetpack")}),(0,o.jsx)("path",{fill:e,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),(0,o.jsx)("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),(0,o.jsx)("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),(0,o.jsx)("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),(0,o.jsx)("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5
_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:r})}),(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=>r({label:e})})]})})]})}},95184:(e,t,r)=>{"use strict";var s=r(74997),n=r(94375),o=r(35116),a=r(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})=>{const t=e.raw.title?(0,s.createBlock)("core/heading",{content:e.raw.title,level:3}):null,r=(0,s.createBlock)("jetpack/blog-stats",{label:e.raw.hits});return t?[t,r]:r}}]}})},51744:(e,t,r)=>{"use strict";r.d(t,{k:()=>c});var s=r(97999),n=r(85985),o=r(56427),a=r(27723),i=r(35116),l=r(10790);const __=a.__,c=({className:e,isLoading:t,changeStatus:r})=>{const a=(0,s.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:()=>r(!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,r)=>{"use strict";r.d(t,{A:()=>g});var s=r(1455),n=r.n(s),o=r(94715),a=r(56427),i=r(47143),l=r(86087),c=r(27723),u=r(93832),d=r(13022),p=r(54919),h=r(9075),m=r(10790);const __=c.__,_x=c._x;const g=(0,a.withNotices)((function({attributes:e,noticeOperations:t,noticeUI:r,setAttributes:s}){const g=(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=>s({tagsAdded:e})));const E=(0,i.useSelect)((e=>{const{getEntityRecord:t,hasFinishedResolution:r}=e("core"),s=t("root","site")?.language||"en_US";return r("getEntityRecord",["root","site"])?s:null}),[]);(0,l.useEffect)((()=>{if(!E||g.current||k)return;const e=()=>{s({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};let r="/wpcom/v3/blogging-prompts";if(y)r+="/"+encodeURIComponent(y);else{const e=new Date;r+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}r=(0,u.addQueryArgs)(r,{_locale:E,force_year:(new Date)?.getFullYear()}),g.current=!0,n()({path:r}).then((e=>{const t=y?e:e[0],r=(0,p.i)(E);s({answersLink:t.answered_link+`?locale=${r}`,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((r=>{s({promptFetched:!0});const n="rest_post_invalid_id"===r.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")})]}))(r.message);var o;t.removeAllNotices(),t.createErrorNotice(n)}))}),[g,t,k,y,s,E]);const N=e=>{s({showLabel:e})},T=e=>{s({showResponses:e})},P=(0,d.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":A});return(0,m.jsxs)("div",{...S,children:[r,(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:P,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,r)=>{"use strict";var s=r(74997),n=r(47143),o=r(27723),a=r(94375),i=r(27734),l=r(32442),c=r(12169),u=r(63757),d=r(94530),p=r(86239),h=r(57028);const __=o.__,m=new URL(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);async function k(e){await(0,i.O)();(0,s.getBlockType)("jetpack/blogging-prompt")||await new Promise((e=>{(0,a.M)(l,v),setTimeout(e,0)}));const{insertBlocks:t}=(0,n.dispatch)("core/block-editor");t([(0,s.createBlock)("jetpack/blogging-prompt",{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,s.createBlock)("core/paragraph")],0,void 0,!1)}g&&b&&k(b)},57028:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(13022),o=r(10790);const a=function({attributes:e}){const{answersLink:t,answersLinkText:r,gravatars:a,promptId:i,promptLabel:l,promptText:c,showLabel:u,showResponses:d,isBloganuary:p}=e,h=s.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:r})]})]})}},9075:(e,t,r)=>{"use strict";r.d(t,{J:()=>c});var s=r(1455),n=r.n(s),o=r(47143),a=r(86087),i=r(89877);function l(e){const t=(0,i.escapeHTML)(e);return n()({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})))}function c(e,t,r){const{editPost:s}=(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===
__("No sites found for %s.","jetpack"),r)})]}),e.length>0&&(0,o.jsx)("ul",{"aria-live":"polite",children:e.map(((e,r)=>{const s=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:s,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}-${r}`)}))})]})}},17454:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(56427),n=r(27723),o=r(10790);const __=n.__;function a({value:e,onChange:t}){return(0,o.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,o.jsx)(s.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,r)=>{"use strict";r.d(t,{A:()=>h});var s=r(56427),n=r(47143),o=r(86087),a=r(27723),i=r(45459),l=r(92507),c=r(85101),u=r(40536),d=r(17454),p=r(10790);const __=a.__;function h({isLoading:e,subscriptions:t,clientId:r}){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});return e?(0,p.jsx)(s.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.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)(s.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),void 0,r),h(!1)},searchInput:f,isLoading:y})]})]})}},63166:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var s=r(94715),n=r(74997),o=r(56427),a=r(47143),i=r(86087),l=r(27723),c=r(13022),u=r(2274),d=r(26247),p=r(37127),h=r(32130),m=r(46542),g=r(25688),f=r(85101),b=r(10790);const __=l.__;const v=function({className:e,attributes:t,setAttributes:r,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){r({load_placeholders:!1});const e=[(0,n.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];T(l,e)}}),[C,j,r,l,T]);const P=(0,s.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")})});const B=A||N;return(0,b.jsxs)("div",{...P,children:[(0,b.jsx)(s.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})}),B&&(0,b.jsx)(o.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:B})}),j&&_&&(0,b.jsx)(o.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(o.Spinner,{})}),(0,b.jsx)(s.InspectorControls,{children:(0,b.jsxs)(o.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(o.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>r({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(o.ToggleControl,{label:__("Show description","jetpack"),checke
2025-02-28 08:42:11 +01:00
// translators: %s is a link to the cookie policy.
2025-07-27 19:58:08 +02:00
__("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,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(94715),n=r(56427),o=r(27723),a=r(68071),i=r(34839),l=r(10790);const __=o.__;const c=function({clientId:e,attributes:t,setAttributes:r}){const{consentExpiryDays:c,align:u,text:d=a.a}=t;(0,i.w)(e);const p=(0,s.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${u}`});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.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){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};r({...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=>r({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)(s.RichText,{tagName:"p",value:d,onChange:e=>r({text:e})}),(0,l.jsx)(s.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})]})]})}},78165:(e,t,r)=>{"use strict";var s=r(94375),n=r(74095),o=r(15216),a=r(75757);(0,s.M)(n,{edit:o.A,save:a.A})},75757:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(68071),o=r(10790);function a({attributes:e}){const t=s.useBlockProps.save(),{text:r=n.a,consentExpiryDays:a}=e;return(0,o.jsxs)("div",{...t,style:t.style,role:"dialog","aria-modal":"true",children:[(0,o.jsx)(s.RichText.Content,{tagName:"p",value:r}),(0,o.jsx)(s.InnerBlocks.Content,{}),(0,o.jsx)("span",{children:a})]})}},34839:(e,t,r)=>{"use strict";r.d(t,{w:()=>l});var s=r(74997),n=r(29491),o=r(3582),a=r(47143),i=r(86087);function l(e){const t=(0,a.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:r}=e("core/editor");return t()||r()}),[]),r=!(!(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");return t})),h=(0,i.useCallback)((e=>{d(!0),l(e),c("root","site",void 0,{cookie_consent_template:e}).finally((()=>{d(!1)}))}),[d,l,c]);(0,i.useEffect)((()=>()=>{p(e)||h(null)}),[]),(0,i.useEffect)((()=>{r&&!u&&h((0,s.serialize)([p(e)]))}),[r,u,h,p,e])}},75800:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(4567),n=r(3975),o=r(94715),a=r(86087),i=r(13022),l=r(72730),c=r(10790);const u=({className:e=null,currency:t=null,defaultValue:r=null,disabled:u=!1,label:d="",onChange:p=null,value:h=""})=>{const[m,g]=(0,a.useState)((0,s.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,r)=>{g((s=>{if(e!==s){const s=(0,l.C_)(e,t);s&&s>=(0,l.dv)(t)?(k(!1),r&&p?.(s)):k(!0)}return e}))}),[t,p]),j=()=>{y.current&&(y.current.focus(),b(!0))};return(0,a.useEffect)((()=>{if(!y.current)return;const e=y.current,n=()=>{b(!1),m||x((0,s.Ay)(r,t,{symbol:""}))};return e.addEventListener("blur",n),()=>{e.removeEventListener("blur",n)}}),[t,r,m,y,x]),(0,a.useEffect)((()=>{f||v||g((0,s.Ay)(h,t,{symbol:""}))}),[t,f,v,h]),(0,a.useEffect)((()=>{x((0,s.Ay)(h,t,{symbol:""}))}),[t,h]),(0,c.jsxs)("div",{className:(0,i.A)("donations__amount",e,{"has-focus":f,"has-er
2022-12-15 17:41:53 +01:00
// translators: %d: Tier level e.g: "1", "2", "3"
2025-07-27 19:58:08 +02:00
__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{const r=[...x];r[t]=e,k("amounts",r)})(e,t),value:e},`jetpack-donations-amount-${t}`)))}),m&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>r({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)(s.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)(s.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:__("Write a message…","jetpack"),value:v("buttonText")||u[b]?.buttonText,onChange:e=>{return t=e,void r({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});var t},allowedFormats:j})})]})}},36580:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(86087),n=r(27723),o=r(13022),a=r(57018),i=r(62225),l=r(10790);const __=n.__,c=e=>{const{attributes:t,products:r,setAttributes:n}=e,{oneTimeDonation:c,monthlyDonation:u,annualDonation:d}=t,[p,h]=(0,s.useState)("one-time"),m=(0,s.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,s.useEffect)((()=>{c.planId===r["one-time"]&&u.planId===r["1 month"]&&d.planId===r["1 year"]||n({...r["one-time"]&&{oneTimeDonation:{...c,planId:r["one-time"]}},...r["1 month"]&&{monthlyDonation:{...u,planId:r["1 month"]}},...r["1 year"]&&{annualDonation:{...d,planId:r["1 year"]}}})}),[c,u,d,n,r]),(0,s.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,r)=>{"use strict";function s(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}r.d(t,{O:()=>s})},36850:(e,t,r)=>{"use strict";r.d(t,{GY:()=>n,_t:()=>s,gQ:()=>o});const s=/^\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,r)=>{"use strict";r.d(t,{o:()=>c,s:()=>u});var s=r(56427),n=r(27723),o=r(5873),a=r(72660),i=r(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)(s.ToolbarGroup,{children:(0,i.jsx)(s.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),u=({attributes:e,clientId:t,setAttributes:r})=>(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:r,activeStyle:e.style,attributes:e,viewportWidth:130})},77629:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s=[r(87879).A]},87879:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(94715),n=r(74997),o=r(27723),a=r(13022),i=r(66087),l=r(10790);const _x=o._x,c=["text","backgroundColor","textColor","customBac
2024-04-17 11:32:24 +02:00
// translators: default aspect ratio for the embedded Google document.
{label:__("Default","jetpack"),value:""},
// translators: aspect ratio for the embedded Google document.
{label:__("100% - Show the whole document","jetpack"),value:"ar-100"},
// translators: aspect ratio for the embedded Google document.
2025-07-27 19:58:08 +02:00
{label:__("50% - Show half of the document","jetpack"),value:"ar-50"}];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o.Fragment,{children:(0,c.jsx)(i.A,{icon:u.src,instructions:[__("Copy and paste your document link below.","jetpack"),__("If your document is private, only readers logged into a Google account with shared access to the document may view it.","jetpack")].join(" "),label:d,patterns:p,placeholder:_x("Enter the link here…","Embed block placeholder","jetpack"),mapUrl:()=>{if(0===p.length||""===f)return a;const e=a.match(p[0]);return null===e||void 0===e[1]||void 0===e[2]||void 0===e[3]?a:`${e[1]}://${e[2]}/${f}/d/${e[3]}/preview`},mismatchErrorMessage:__("The document couldnt be embedded. To embed a document, use the link in your browser address bar when editing the document.","jetpack"),checkGoogleDocVisibility:!0,...e})}),(0,c.jsx)(o.Fragment,{children:(0,c.jsx)(s.InspectorControls,{children:(0,c.jsxs)(n.PanelBody,{children:[(0,c.jsx)("p",{children:__("Select a different aspect-ratio to show more (or less) of your embedded document.","jetpack")}),(0,c.jsx)(n.SelectControl,{label:__("Aspect Ratio","jetpack"),value:t,options:b,onChange:e=>l({aspectRatio:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})})})]})}},85779:(e,t,r)=>{"use strict";var s=r(94375),n=r(94575),o=r(94806),a=r(10467),i=r(72371),l=r(60288);(0,s.M)(n,{edit:o.A,save:a.A,transforms:(0,i.A)(n.name),variations:l.A})},93261:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(56427),n=r(27723),o=r(13022),a=r(10790);const _x=n._x,i=({className:e,icon:t,instructions:r,label:n,notices:i,url:l,onSubmit:c,placeholder:u,updateUrl:d})=>(0,a.jsx)("div",{className:(0,o.A)("wp-block-jetpack-google-docs-embed-editmode",e),children:(0,a.jsx)(s.Placeholder,{icon:t,label:n,instructions:r,notices:i,children:(0,a.jsxs)("form",{onSubmit:c,children:[(0,a.jsx)("input",{type:"url",value:l||"",className:"components-placeholder__input",placeholder:u,onChange:e=>d(e.target.value)}),(0,a.jsx)(s.Button,{variant:"primary",type:"submit",children:_x("Embed","button label","jetpack")})]})})})},58725:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(1455),n=r.n(s),o=r(94715),a=r(74997),i=r(56427),l=r(29491),c=r(86087),u=r(27723),d=r(92687),p=r(93261),h=r(22336),m=r(10790);const __=u.__,_x=u._x,g=({children:e,mapUrl:t,url:r,className:s,interactive:o,toggleInteractive:a,noticeUI:i=null,noticeOperations:l={},checkGoogleDocVisibility:u=!1})=>{if((0,c.useEffect)((()=>{u&&n()({path:`/wpcom/v2/checkGoogleDocVisibility?url=${r}`}).catch((()=>{l.removeAllNotices(),l.createNotice({status:"warning",content:__("This document is private. Only readers logged into a Google account that the document is shared with can view it.","jetpack")})}))}),[r,u,l]),e)return e;let d=!1;return i&&(d=!0),(0,m.jsxs)(m.Fragment,{children:[i,(0,m.jsx)(h.A,{url:t(r),className:s,interactive:o,toggleInteractive:a,isPrivateURL:d})]})},f=(0,l.compose)(i.withNotices)((e=>{const{attributes:t,className:r,isSelected:s,setAttributes:n,icon:l="superhero-alt",instructions:h=__("Paste a link to the content you want to display.","jetpack"),forceEditing:f=!1,mismatchErrorMessage:b=__("It does not look like an embeddable URL.","jetpack"),label:v,mapUrl:k=e=>e,noticeOperations:y,noticeUI:x,patterns:j,placeholder:w=__("Enter URL to embed here…","jetpack"),children:_,onSubmitUrl:C=()=>{},checkGoogleDocVisibility:A=!1}=e,{url:S}=t,[E,N]=(0,c.useState)(!1),[T,P]=(0,c.useState)(!1),[B,I]=(0,c.useState)(S);f&&!E&&N(!0);(0,c.useEffect)((()=>{!s&&T&&P(!1)}),[s]);const M=(0,c.useRef)(null),L=(0,o.useBlockProps)({className:"wp-block-jetpack-google-docs-embed",ref:M}),{title:R}=(0,a.getBlockType)(e.name),D=(0,u.sprintf)(/* translators: %s is replaced with the name of the embed provider */
_x("%s URL","placeholder label","jetpack"),R);return(0,m.jsxs)("div",{...L,children:[(0,m.jsx)(o.BlockControls,{children:(0,m.jsx)(i.ToolbarGroup,{children:!E&&(0,m.jsx)(i.ToolbarButton,{icon:d.A,label:__("Edit URL","jetpack"),isActive:E,onClick:()=>{y.removeAllNotices(),N(!E)}})})}),E||!S?(0,m.jsx)(p.A,{className:r,icon:l,instructions:h,label:v||D,url:B,notices:x,placeholder:w,onSubmit:e=>{if(e&&e.preventDefault(),!j[0].test(B))return y.removeAllNotices(),void y.createErrorNotice(b);y.removeAllNotices(),N(!1),n({url:B}),C(B)},updateUrl:I}):(0,m.jsx)(g,{children:_,mapUrl:k,url:B,className:r,interactive:T,toggleInteractive:P,noticeUI:x,noticeOperations:y,checkGoogleDocVisibility:A})]})}))},22336:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(56427),n=r(27723),o=r(10790);const __=n.__,a=e=>{const{allowFullScreen:t=!0,isPrivateURL:r=!1,interactive:n,toggleInteractive:a,title:i=__("Embed URL","jetpack"),url:l}=e;return(0,o.jsxs)("figure",{children:[r?(0,o.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper wp-block-jetpack-google-docs-embed__wrapper--error",children:(0,o.jsxs)("p",{className:"wp-block-jetpack-google-docs-embed__error-msg",children:[__("This Google Document is private.","jetpack"),(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),(0,o.jsx)(s.ExternalLink,{href:l,children:__("Click here to open this document.","jetpack")})]})}):(0,o.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper",children:(0,o.jsx)("iframe",{src:l,allowFullScreen:t,title:i,height:"450"})}),!n&&(0,o.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__interactive-overlay",onMouseUp:()=>a(!0)})]})}},10467:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(10790);const n=e=>{const{attributes:t}=e;return(0,s.jsx)("figure",{children:(0,s.jsx)("div",{className:"embed__wrapper",children:`\n${t.url}\n`})})}},72371:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(74997),n=r(86087),o=r(10790);const a=e=>{const t=[/^(http|https):\/\/(docs\.google.com)\/(spreadsheets|document|presentation)\/d\/([A-Za-z0-9_-]+).*?$/i];return{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&t[0].test(e.textContent)&&1===e.textContent?.match(/https/gi)?.length,transform:t=>(0,s.createBlock)(e,{url:t.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e})=>{const t=(0,o.jsx)("a",{href:e,children:e});return(0,s.createBlock)("core/paragraph",{content:(0,n.renderToString)(t)})}}]}}},60288:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(85985),n=r(27723);const __=n.__,o=[{name:"jetpack/google-docs",isDefault:!0,title:__("Google Docs","jetpack"),description:__("Embed a Google Document.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z' /><path fill='#FDFFFF' d='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M50,39H14v-5h36V39z M50,46H14v5h36V46z M40,58H14v5h26V58z' /></svg>",keywords:[__("document","jetpack"),__("gsuite","jetpack"),__("doc","jetpack")],attributes:{variation:"jetpack/google-docs"},isActive:["variation"]},{name:"jetpack/google-sheets",isDefault:!0,title:__("Google Sheets","jetpack"),description:__("Embed a Google Sheet.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z' /><path fill='#FDFFFF' d='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M12,34.5v28h40v-28H12z M17,39.5h12.5V46H17V39.5z M17,51h12.5v6.5H17V51z M47,57.5H34.5V51H47V57.5z M47,46 H34.5v-6.5H47V46z' /></svg>",keywords:[__("sheet","jetpack"),__("spreadsheet","jetpack")],attributes:{variation:"jetpack/google-sheets"},isActive:["variation"]},{name:"jetpack/google-slides",isDefault:!0,title:__("Google Slides","jetpack"),description:__("Embed a Google Slides presentation.","jetpack"),icon:"<svg viewBox='0 0 64 88' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z' /><path fill='#FDFFFF' d=
_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)(s.Notice,{isDismissible:!1,status:"info",children:t})})})():null,(0,a.jsx)(s.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)(s.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>c({columns:e}),min:1,max:6}),(0,a.jsx)(s.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>c({spacing:e}),min:0,max:50}),(0,a.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:m,onChange:()=>c({isStackedOnMobile:!m})})]})]})}},11148:(e,t,r)=>{"use strict";r.d(t,{A:()=>k});var s=r(85985),n=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(78218),d=r(89525),p=r(80427),h=r(57926),m=r(86975),g=r(49783),f=r(53495),b=r(80619),v=r(10790);const __=i.__,k=(0,o.withNotices)((e=>{const t=(0,n.useBlockProps)(),{attributes:r,isSelected:i,noticeOperations:k,noticeUI:y,setAttributes:x}=e,{accessToken:j,align:w,columns:_,count:C,isStackedOnMobile:A,spacing:S}=r;(0,a.useEffect)((()=>{const e=(0,u.y)(d.attributes,r);(0,c.isEqual)(e,r)||x(e)}),[r,x]);const[E,N]=(0,a.useState)(j),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:P}=(0,f.A)(),{images:B,isLoadingGallery:I,setImages:M}=(0,b.A)({accessToken:j,noticeOperations:k,setAttributes:x,setSelectedAccount:N}),{connectToService:L,disconnectFromService:R,isConnecting:D,isRequestingUserConnections:F,userConnections:z}=(0,g.A)({accessToken:j,noticeOperations:k,selectedAccount:E,setAttributes:x,setImages:M,setSelectedAccount:N}),O=(0,s.gB)(),U=C>B.length?B.length:C,H=!I&&(!j||(0,c.isEmpty)(B)),V=!H,q=j&&I&&(0,c.isEmpty)(B),$=!H&&!q,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`:void 0},J={padding:S},K=e=>{if(B[e]){const t=B[e];return(0,v.jsx)(m.A,{alt:t.title||t.url,src:t.url,attributes:r,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:(0,c.find)(z,{token:E}).username}):L()};return(0,v.jsxs)("div",{...t,className:G,children:[H&&(0,v.jsx)(o.Placeholder,{icon:"instagram",instructions:O?F||z.length?void 0:__("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:O?(()=>{const e=z.length>0,t=[...(0,c.map)(z,(e=>({label:`@${e.username}`,value:e.token}))),{label:__("Add a new account","jetpack"),value:p.B}],r=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:r,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||!P,href:P,variant:"secondary",children:__("Connect to WordPress.com","jetpack")})}),q&&(0,v.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,v.jsx)(o.Spinner,{}),(0,v.jsx)("p",{children:__("Embedding…","jetp
2024-02-16 11:03:01 +01:00
// translators: %$1s: Number of likes
2025-07-27 19:58:08 +02:00
__("<span>%1$d</span> likes","jetpack"),v.length),{span:(0,h.jsx)("span",{className:"wpl-count-number"})})})})})]})]})}},67511:(e,t,r)=>{"use strict";var s=r(94375),n=r(71969),o=r(434);(0,s.M)(n,{edit:o.A,save:()=>null})},40483:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(94715),n=r(56427),o=r(27723),a=r(13022),i=r(54790),l=r(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:r})=>{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}[r];return(0,l.jsxs)("div",{className:(0,a.A)({[`${i.j7}_notication-audition`]:r}),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)(s.InnerBlocks,{template:[[c.name,c.attributes]],templateLock:"all"}),(0,l.jsx)(s.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),r&&(0,l.jsx)("div",{className:`${i.j7}_notification ${i.j7}_${r}`,role:r===i.Dc?"alert":"status",children:m})]})}},54790:(e,t,r)=>{"use strict";r.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});var s=r(27723);const __=s.__,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,r)=>{"use strict";r.d(t,{o:()=>d});var s=r(94715),n=r(56427),o=r(86087),a=r(27723),i=r(54790),l=r(60462),c=r(10790);const __=a.__,u=({auditionNotification:e,clearAudition:t,setAttributes:r,emailPlaceholder:s=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:s,onChange:e=>{r({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=>{r({processingLabel:t}),e(i.k1)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:a,onChange:t=>{r({successLabel:t}),e(i.EM)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:u,onChange:t=>{r({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)=>{const s=[...new Set([...d,e])].filter((r=>!(r===e&&!t)&&r));r({interests:s})}}),(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=>r({signupFieldTag:e})}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Value","jetpack"),placeholder:__("website","jetpack"),value:h,onChange:e=>r({signupFieldValue:e})}),(0,c.j
_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:r,instanceId:n,completer:o}=this.props,{selectedIndex:a,filteredOptions:i}=this.state,{key:d=""}=i[a]||{},{className:p}=o,h=i.length>0,m=h?`components-autocomplete-listbox-${n}`:null,g=h?`components-autocomplete-item-${n}-${d}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[r({isExpanded:h,listBoxId:m,activeId:g,onChange:e,onKeyDown:t}),h&&(0,u.jsx)(s.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:m,role:"listbox",className:"components-autocomplete__results",children:(0,c.map)(i,((e,t)=>(0,u.jsx)(s.Button,{id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:(0,l.A)("components-autocomplete__result",p,{"is-selected":t===a}),onClick:()=>this.select(e),children:e.label},e.key)))})})]})}}const h=(0,n.compose)([s.withSpokenMessages,n.withInstanceId,s.withFocusOutside])(p)},82063:(e,t,r)=>{"use strict";function s(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"]}r.d(t,{o:()=>s})},16815:(e,t,r)=>{"use strict";r.d(t,{BY:()=>i,ES:()=>n,_t:()=>o,iU:()=>a,jF:()=>s});const s=e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0};function n(e,t){const r=new e.LngLatBounds;return t.forEach((e=>{r.extend([e.coordinates.longitude,e.coordinates.latitude])})),r}function o(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}function a(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`}function i(e){return new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},42470:(e,t,r)=>{"use strict";r.d(t,{IR:()=>d,K5:()=>c,Sm:()=>i,Yc:()=>u,c6:()=>a,nQ:()=>l});var s=r(34377);const n=6371e3;function o(e){return Math.abs(n*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function a(e,t){return 512/Math.pow(2,e)*.5*o(t)}function i(e,t){const r=e/o(t);return Math.log2(512/(r/.5))}function l(e,t){if(0===t.length)return null;const r=new e.Coordinate(-90,180),s=new e.Coordinate(90,-180);t.forEach((e=>{r.latitude=Math.max(r.latitude,e.coordinates.latitude),r.longitude=Math.min(r.longitude,e.coordinates.longitude),s.latitude=Math.min(s.latitude,e.coordinates.latitude),s.longitude=Math.max(s.longitude,e.coordinates.longitude)}));const n=new e.Coordinate(r.latitude-.5*(r.latitude-s.latitude),r.longitude+.5*(s.longitude-r.longitude)),o=new e.CoordinateSpan(1.3*Math.abs(r.latitude-s.latitude),1.3*Math.abs(s.longitude-r.longitude));return new e.CoordinateRegion(n,o)}function c(e,t){return()=>{const r=e.createElement("div");return r.classList.add("mapkit-popup-content"),t(r),r}}function u(e,t){return new Promise((r=>{if(t.mapkitScriptIsLoading)(0,s.Cu)(t,"mapkit").then((e=>{r(e)}));else{t.mapkitScriptIsLoading=!0;const n=e.createElement("script");n.addEventListener("load",(async()=>{const e=await(0,s.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,r(e)}),{once:!0}),n.src="https://cdn.apple-mapkit.com/
__("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${(0,d.join)(N,"%2C")}&type=${r}&theme=${s}&overlay=false&domain=${P}&lang=${B&&g.L.includes(B)?B:"en-US"}&newtab=${I}&disablega=true`})]})})()]})]})}))},82144:(e,t,r)=>{"use strict";var s=r(94715),n=r(74997),o=r(94375),a=r(79018),i=r(34157),l=r(8100),c=r(71833),u=r(50387),d=r(84260),p=r(10790);(0,o.M)(a,{edit:c.A,save:({attributes:{rid:e}})=>{const t=s.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=>{const t=(0,d.a9)(e.textContent);return(0,n.createBlock)("jetpack/opentable",t)}}]},deprecated:[i.A,l.A]})},82101:(e,t,r)=>{"use strict";r.d(t,{L:()=>n,P:()=>s});const s=[{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=s.map((e=>e.value))},98233:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(56427),n=r(86087),o=r(27723),a=r(66087),i=r(10790);const __=o.__,_n=o._n,l=/^\s*(http[s]?:\/\/|<script)/;function c(e){const[t,r]=(0,n.useState)(""),[o,c]=(0,n.useState)(e.rids||[]),u=/^(\d+)$|\(#(\d+)\)$/,d=(0,i.jsx)(s.FormTokenField,{value:o,saveTransform:e=>l.test(e)?"":e.trim(),onInputChange:r,label:_n("Restaurant ID","Restaurant IDs",o.length,"jetpack"),...e,onChange:t=>{const r=t.map((e=>{const t=u.exec(e);if(t){return t[1]||t[2]}return e}));c(r),e.onChange&&e.onChange(r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0});return(0,i.jsx)("div",{className:"wp-block-jetpack-opentable-restaurant-picker",children:e.onSubmit?(0,i.jsxs)("form",{onSubmit:r=>{r.preventDefault(),e.onSubmit((0,a.isEmpty)(o)?t:o)},children:[d,(0,i.jsx)(s.Button,{variant:"secondary",type:"submit",children:__("Embed","jetpack")})]}):d})}},50387:(e,t,r)=>{"use strict";r.d(t,{Iy:()=>a,K5:()=>i,i9:()=>o});var s=r(27723),n=r(66087);const __=s.__,o={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},a=e=>(0,n.compact)([{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)&&o]),i=e=>a(e).map((e=>e.name))},59038:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(86087);function n(e){const t=(0,s.useRef)(void 0);return(0,s.useEffect)((()=>{t.current=e}),[e]),t.current}},84260:(e,t,r)=>{"use strict";r.d(t,{JJ:()=>n,XA:()=>o,a9:()=>a});const s=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,n=/restref=([0-9]+)&/,o=/rid=([0-9]+)&/,a=e=>{if(e)return(e=>{if(!e)return;let t="";if(t=0===e.indexOf("http")?new URL(e):new URL("http:"+e),!t.host||-1===t.host.indexOf("opentable")||!t.search)return;const r=new URLSearchParams(t.search);let s=r.get("theme");"button"===r.get("type")&&(s=r.get("type"));let n=r.getAll("rid");if(n&&0!==n.length||(n=r.getAll("restref")),!n||0===n.length)return;const o={};n&&(o.rid=n);const a=r.get("domain");a&&(o.domain=a);const i=r.get("iframe");i&&(o.iframe=i);const l=r.get("lang");l&&(o.lang=l);const c=r.get("newtab");return c&&(o.newtab=c),s&&(o.style=s),o})((e=>{const t=e.match(s);return t&&t[1]?t[1]:n.test(e)||o.test(e)?e:void 0})(e))}},72347:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(94715),n=r(47143),o=r(86087),a=r(52619),i=r(27723),l=r(13022),c=r(2274),u=r(72462),d=r(53796),p=r(26247),h=r(16521),m=r(10790);const __=i.__,g=["jetpack/recurring-payments"];const f=function({clientId:e,attributes:t}){const{layout:r,fontSize:i}=t,{connectUrl:f,isApiConnected:b}=(0,n.useSelect)((e=>{const{getConnectUrl:t,isApiStateConnected:r}=e(h.M);return{connectUrl:t(),isApiConnected:r()}})),v=(0,p.A)(),k=(0,n.useSel
`${(0,i.sprintf)(__("Loading: %s","jetpack"),r)} ${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){const t=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState((()=>{throw new Error(t)}))}this.props.errorMediaSource(this.props.playerId),(0,s.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(){const e=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){const t=e=>e?.length?e.map((e=>e.guid)):[],r=t(this.props.tracks),s=new Set(t(e.tracks));r.length===s.size&&r.every((e=>s.has(e)))||this.loadTrack(0)}static getDerivedStateFromProps(e,t){return e.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:r,cover:s,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),P=(0,d.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:j,customBackgroundColor:w}),B={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,P.secondary.classes,P.background.classes);return(0,g.jsxs)("section",{className:I,style:B,"aria-labelledby":t||T&&T.title?`${e}__title`:void 0,"aria-describedby":T&&T.description?`${e}__track-description`:void 0,"data-jetpack-iframe-ignore":!0,children:[(0,g.jsx)(p.A,{playerId:e,title:t,link:r,cover:s,track:this.getTrack(E),showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S,colors:P,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)(
2022-12-15 17:41:53 +01:00
// translators: %s is the track title.
2025-07-27 19:58:08 +02:00
__("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:P})]})]})}}f.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};const b=(0,n.compose)([m.A,(0,o.withSelect)(((e,t)=>{const{playerId:r}=t,{getMediaSourceCurrentTime:s,getMediaPlayerState:n}=e(u.ax);return{currentTime:s(r),playerState:n(r)}})),(0,o.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:s,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(u.ax);return{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:s,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(f)},74050:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(86087),n=r(27723),o=r(10790);const __=n.__,a=(0,s.memo)((({link:e,title:t,colors:r})=>(0,o.jsxs)("div",{className:"jetpack-podcast-player__track-error",children:[__("Episode unavailable.","jetpack")," ",e&&(0,o.jsx)("span",{className:r.secondary.classes,style:{color:r.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,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(86087),n=r(27723),o=r(62796),a=r(10790);const __=n.__,i=(0,s.memo)((({isPlaying:e,isError:t,className:r})=>{let s,n;t?(n="error",
2022-04-02 10:26:41 +02:00
/* translators: This is text to describe the current state. This will go
before the track title, such as "Error: [The title of the track]". */
2025-07-27 19:58:08 +02:00
s=__("Error:","jetpack")):e&&(n="playing",
2022-04-02 10:26:41 +02:00
/* translators: Text to describe the current state. This will go before the
track title, such as "Playing: [The title of the track]". */
2025-07-27 19:58:08 +02:00
s=__("Playing:","jetpack"));const i=o[n];return i?(0,a.jsxs)("span",{className:`${r} ${r}--${n}`,children:[(0,a.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${s} `}),i]}):(0,a.jsx)("span",{className:r})}))},91677:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(86087),n=r(27723),o=r(13022),a=r(19812),i=r(74050),l=r(35311),c=r(10790);const __=n.__,u=(0,s.memo)((({track:e,isActive:t,isPlaying:r,isError:s,selectTrack:n,index:u,colors:d={primary:{},secondary:{}}})=>{const p=(0,a.tQ)("color",d.primary.name),h=(0,a.tQ)("color",d.secondary.name),m=(0,o.A)("jetpack-podcast-player__track",{"is-active":t,"has-primary":t&&(d.primary.name||d.primary.custom),[p]:t&&!!p,"has-secondary":!t&&(d.secondary.name||d.secondary.custom),[h]:!t&&!!h}),g={};t&&d.primary.custom&&!p?g.color=d.primary.custom:t||!d.secondary.custom||h||(g.color=d.secondary.custom);const
2022-04-02 10:26:41 +02:00
/* translators: This needs to be a single word with no spaces. It describes
the current item in the group. A screen reader will announce it as "[title],
current track". */
2025-07-27 19:58:08 +02:00
f=t?__("track","jetpack"):void 0;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:r,isError:s}),(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&&s&&(0,c.jsx)(i.A,{link:e.link,title:e.title,colors:d})]})}))},81166:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(86087),n=r(27723),o=r(10790);const __=n.__;function a(e){class t extends s.Component{state={didError:!1,isIE11AudioIssue:!1};componentDidCatch=(e,t)=>{this.props.onError(e,t)};static getDerivedStateFromError=e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)});render(){const{didError:t,isIE11AudioIssue:r}=this.state;return t?(0,o.jsx)("section",{className:"jetpack-podcast-player",children:(0,o.jsx)("p",{className:"jetpack-podcast-player__error",children:r?__('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 browsers "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 occured within the Podcast Player. Reloading this page might fix the problem.","jetpack",0)})}):(0,o.jsx)(e,{...this.props})}}return t.defaultProps={onError:()=>{}},t}},38288:(e,t,r)=>{"use strict";r.d(t,{Q:()=>n,g:()=>s});const s="podcast-feed",n="embed-block"},18029:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(93832),n=r(98329);const o={attributes:{url:{type:"string",validator:s.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:n.A},hexPrimaryColor:{type:"string",validator:n.A},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:n.A},hexSecondaryColor:{type:"string",validator:n.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:n.A},hexBackgroundColor:{type:"string",validator:n.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,r)=>{"use strict";r.d(t,{A:()=>E});var s=r(97999),n=r(94715),o=r(74997),a=r(56427),i=r(29491),l=r(47143),c=r(86087),u=r(27723),d=r(93832),p=r(10067),h=r.n(p),m=r(66087),g=r(49487),f=r(34377),b=r(78218),v=r(50961),k=r(1624),y=r(57162),x=r(38288),j=r(90388),w=r(90764),_=r(19812),C=r(10790);const __=u.__,A=h()("jetpack:podcast-player:edit"),S=(0,s.isWpcomPlatformSite)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",E=(0,i.compose)([(0,l.withDispatch)(((e,{clientId:t,attributes:r})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,o.createBlock)("core/embed",{url:r.url}))}}))),(0,n.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),a.withNotices,i.withInstanceId,g.T])((({instanceId:e,attributes:t,setAttributes:r,noticeOperations:{createErrorNotice:s,removeAllNotices:o},noticeUI:i,primaryColor:l,setPrimaryColor:u,secondaryColor:p,setSecondaryColor:h,fallbackTextColor:g,backgroundColor:E,setBackgroundColor:N,fallbackBackgroundColor:T,isSelected:P,replaceWithEmbedBlock:B})=>{const I=(0,b.y)(k.attributes,t),{url:M,selectedEpisodes:L,itemsToShow:R,showCoverArt:D,showEpisodeTitle:F,showEpisodeDescription:z,exampleFeedData:O}=I,U=`jetpack-
2024-04-17 11:32:24 +02:00
// translators: Prep Time label for a recipe block.
default:__("Prep Time","jetpack")},cookTime:{type:"string",default:"30m"},cookTimeUnit:{type:"string",default:"m"},cookTimeLabel:{type:"string",
// translators: Cook Time label for a recipe block.
default:__("Cook Time","jetpack")},servings:{type:"number",default:4},servingsLabel:{type:"string",
// translators: Servings label for a recipe block.
2025-07-27 19:58:08 +02:00
default:__("Servings","jetpack")}}},54886:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(94715),n=r(56427),o=r(10790);const a=[{value:"m",label:"min"},{value:"h",label:"hours"}];const i=function({className:e,attributes:t,setAttributes:r}){const{prepTime:i,prepTimeLabel:l,cookTime:c,cookTimeLabel:u,servings:d,servingsLabel:p}=t,h=(0,s.useBlockProps)({className:e});return(0,o.jsx)("div",{...h,children:(0,o.jsxs)("div",{className:"wp-container wp-recipe-block-details",children:[(0,o.jsxs)("div",{className:"group",children:[(0,o.jsx)(n.TextControl,{value:l,onChange:e=>r({prepTimeLabel:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,o.jsx)(n.__experimentalUnitControl,{onChange:e=>r({prepTime:e}),onUnitChange:e=>r({prepTimeUnit:e}),isUnitSelectTabbable:!0,value:i,units:a,__next40pxDefaultSize:!0})]}),(0,o.jsxs)("div",{className:"group",children:[(0,o.jsx)(n.TextControl,{value:u,onChange:e=>r({cookTimeLabel:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,o.jsx)(n.__experimentalUnitControl,{onChange:e=>r({cookTime:e}),onUnitChange:e=>{r({cookTimeUnit:e})},isUnitSelectTabbable:!0,value:c,units:a,__next40pxDefaultSize:!0})]}),(0,o.jsxs)("div",{className:"group",children:[(0,o.jsx)(n.TextControl,{value:p,onChange:e=>r({servingsLabel:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,o.jsx)(n.TextControl,{type:"number",value:d,onChange:e=>r({servings:parseInt(e)}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,o.jsx)("div",{className:"group",children:(0,o.jsx)(s.InnerBlocks,{allowedBlocks:["jetpack/button"],template:[["jetpack/button",{text:"Print Recipe"}]]})})]})})}},67868:(e,t,r)=>{"use strict";r.d(t,{U:()=>c,W:()=>u});var s=r(85985),n=r(27723),o=r(85660),a=r(80375),i=r(54886),l=r(80339);const __=n.__,c="recipe-details",u={apiVersion:3,title:__("Recipe Details","jetpack"),description:__("Recipe Details","jetpack"),keywords:[],supports:{align:["left","right","center"]},icon:(0,s.Cq)(o),category:"widgets",attributes:a.A,edit:i.A,save:l.A,parent:["jetpack/recipe"]}},80339:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=({attributes:e})=>{const{prepTime:t,prepTimeLabel:r,cookTime:o,cookTimeLabel:a,servings:i,servingsLabel:l}=e,c=s.useBlockProps.save();return(0,n.jsxs)("div",{...c,children:[(0,n.jsxs)("div",{className:"wp-block-jetpack-recipe-details__detail",children:[(0,n.jsx)("p",{children:r}),(0,n.jsx)("p",{itemProp:"prepTime",content:`PT${t.toUpperCase()}`,children:t})]}),(0,n.jsxs)("div",{className:"wp-block-jetpack-recipe-details__detail",children:[(0,n.jsx)("p",{children:a}),(0,n.jsx)("p",{itemProp:"cookTime",content:`PT${o.toUpperCase()}`,children:o})]}),(0,n.jsxs)("div",{className:"wp-block-jetpack-recipe-details__detail",children:[(0,n.jsx)("p",{children:l}),(0,n.jsx)("p",{itemProp:"recipeYield",children:i})]}),(0,n.jsx)("div",{className:"wp-block-jetpack-recipe-details__detail wp-block-jetpack-recipe-details__detail--print",children:(0,n.jsx)(s.InnerBlocks.Content,{})})]})}},81629:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(27723),o=r(10790);const __=n.__;const a=function({className:e}){const t=[["jetpack/recipe-hero"],["core/heading",{level:2,placeholder:__("Recipe Title","jetpack"),className:"wp-block-jetpack-recipe-title"}],["core/separator",{color:"--wp--custom--color--foreground",className:"is-style-wide",style:"wide"}],["core/paragraph",{placeholder:__("Recipe Description","jetpack"),className:"wp-block-jetpack-recipe-description"}],["jetpack/recipe-details",{}],["core/columns",{},[["core/column",{width:"33.33%"},[["core/heading",{level:3,
2024-04-17 11:32:24 +02:00
// translators: Ingredients heading for a recipe block.
content:__("Ingredients","jetpack")}],["jetpack/recipe-ingredients-list"]]],["core/column",{width:"66.66%"},[["core/heading",{level:3,
// translators: Instructions heading for a recipe block.
2025-07-27 19:58:08 +02:00
content:__("Instructions","jetpack")}],["jetpack/recipe-steps"]]]]]];return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("div",{...(0,s.useBlockProps)({className:e}),children:(0,o.jsx)(s.InnerBlocks,{template:t})})})}},16636:(e,t,r)=>{"use strict";var s=r(94375),n=r(85660),o=r(67868),a=r(81629),i=r(35970),l=r(64947),c=r(665),u=r(5440),d=r(54348),p=r(95413);(0,s.M)(n,{edit:a.A,save:u.A},[{name:o.U,settings:o.W},{name:i.UU,settings:i.W0},{name:c.UU,settings:c.W0},{name:l.UU,settings:l.W0},{name:p.UU,settings:p.W0},{name:d.UU,settings:d.W0}])},82628:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=function({className:e,hasInnerBlocks:t}){const r=(0,s.useBlockProps)({className:e});return(0,n.jsx)("div",{...r,children:(0,n.jsx)(s.InnerBlocks,{allowedBlocks:["core/image","jetpack/slideshow","core/cover"],renderAppender:!t&&s.InnerBlocks.ButtonBlockAppender})})}},35970:(e,t,r)=>{"use strict";r.d(t,{UU:()=>l,W0:()=>c});var s=r(85985),n=r(27723),o=r(85660),a=r(82628),i=r(66249);const __=n.__,l="recipe-hero",c={apiVersion:3,title:__("Recipe Hero","jetpack"),description:__("Image area for the recipe.","jetpack"),keywords:[],icon:(0,s.Cq)(o),category:"widgets",edit:a.A,save:i.A,parent:["jetpack/recipe"]}},66249:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=()=>{const e=s.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(s.InnerBlocks.Content,{})})}},70922:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={ingredient:{type:"string",selector:".ingredientText"}}},68835:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=function({className:e,attributes:t,setAttributes:r}){const{ingredient:o}=t,a=(0,s.useBlockProps)({className:e});return(0,n.jsx)("div",{...a,children:(0,n.jsx)(s.RichText,{tagName:"p",className:"ingredientText",value:o,onChange:e=>r({ingredient:e})})})}},64947:(e,t,r)=>{"use strict";r.d(t,{UU:()=>c,W0:()=>u});var s=r(85985),n=r(27723),o=r(85660),a=r(70922),i=r(68835),l=r(51166);const __=n.__,c="recipe-ingredient-item",u={apiVersion:3,title:__("Recipe Ingredient Item","jetpack"),description:__("A single ingredient associated with a recipe.","jetpack"),keywords:[],icon:(0,s.Cq)(o),category:"widgets",attributes:a.A,edit:i.A,save:l.A,parent:["jetpack/recipe"]}},51166:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=({attributes:e})=>{const{ingredient:t}=e,r=s.useBlockProps.save();return(0,n.jsx)("div",{...r,children:(0,n.jsx)(s.RichText.Content,{tagName:"p",itemprop:"recipeIngredient",value:t})})}},75636:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={ingredients:{type:"string[]"}}},17257:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=function({className:e}){const t=(0,s.useBlockProps)({className:e});return(0,n.jsx)("div",{...t,children:(0,n.jsx)(s.InnerBlocks,{allowedBlocks:["jetpack/recipe-ingredient-item"],renderAppender:s.InnerBlocks.ButtonBlockAppender})})}},665:(e,t,r)=>{"use strict";r.d(t,{UU:()=>c,W0:()=>u});var s=r(85985),n=r(27723),o=r(85660),a=r(75636),i=r(17257),l=r(89732);const __=n.__,c="recipe-ingredients-list",u={apiVersion:3,title:__("Recipe Ingredients List","jetpack"),description:__("Recipe ingredient list","jetpack"),icon:(0,s.Cq)(o),category:"widgets",keywords:[],attributes:a.A,edit:i.A,save:l.A,parent:["jetpack/recipe"]}},89732:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=()=>{const e=s.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(s.InnerBlocks.Content,{})})}},5440:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=({className:e})=>(0,n.jsx)("div",{className:e,children:(0,n.jsx)(s.InnerBlocks.Content,{})})},95478:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=function({className:e}){const t=(0,s.useBlockProps)({className:e});return(0,n.jsx)("li",{children:(0,n.jsx)("div",{...t,children:(0,n.jsx)(s.InnerBlocks,{allowedBlocks:["core/image","core/heading","core/paragraph","core/list","core/button"]})})})}},54348:(e,t,r)=>{"use strict";r.d(t,{UU:()=>l,W0:()=>c});var s=r
_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: placeholder is a number. */
_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,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=()=>{const e=s.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)(s.InnerBlocks.Content,{})})})}},84730:(e,t,r)=>{"use strict";r.d(t,{DF:()=>s,aV:()=>o,et:()=>n});const s="after-visits",n="before-visits",o=3},31566:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(84730),o=r(10790);const a={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)(s.InnerBlocks.Content,{})})}},79238:(e,t,r)=>{"use strict";var s=r(94375),n=r(20242),o=r(34570),a=r(53183),i=r(31566);(0,s.M)(n,{edit:o.A,save:a.A,deprecated:[i.A]})},24097:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);function o(){const e=(0,s.useBlockProps)();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(s.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]})})}},38136:(e,t,r)=>{"use strict";var s=r(94375),n=r(58180),o=r(24097),a=r(92908),i=r(92335),l=r(7651);(0,s.M)(n,{edit:o.A,save:a.A,variations:i.A},[{name:l.UU,settings:l.W0}])},92908:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(94715),n=r(10790);const o=()=>{const e=s.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(s.InnerBlocks.Content,{})})}},57699:(e,t,r)=>{"use strict";r.d(t,{N:()=>s});const s=[{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:"🇨<EFBFBD><EFBFBD><EFBFBD>
2025-02-28 08:42:11 +01:00
// translators: option to print the content - a verb.
label:__("Print","jetpack")},
// translators: option to print the content - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Print","jetpack"),icon:(0,o.jsx)(n.d6,{icon:"print",size:24})},{name:"facebook",attributes:{service:"facebook",label:"Facebook"},title:"Facebook",icon:(0,o.jsx)(n.d6,{icon:"facebook",size:24})},{name:"linkedin",attributes:{service:"linkedin",label:"LinkedIn"},title:"LinkedIn",isDefault:!0,icon:(0,o.jsx)(n.d6,{icon:"linkedin",size:24})},{name:"mail",attributes:{service:"mail",
2025-02-28 08:42:11 +01:00
// translators: option to share the content by email - a verb.
label:__("Mail","jetpack")},
// translators: option to share the content by email - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Mail","jetpack"),keywords:["email","e-mail"],icon:(0,o.jsx)(n.d6,{icon:"mail",size:24})},{name:"mastodon",attributes:{service:"mastodon",label:"Mastodon"},title:"Mastodon",icon:(0,o.jsx)(n.d6,{icon:"mastodon",size:24})},{name:"pinterest",attributes:{service:"pinterest",label:"Pinterest"},title:"Pinterest",icon:(0,o.jsx)(n.d6,{icon:"pinterest",size:24})},{name:"pocket",attributes:{service:"pocket",label:"Pocket"},title:"Pocket",icon:(0,o.jsx)(n.d6,{icon:"pocket",size:24})},{name:"reddit",attributes:{service:"reddit",label:"Reddit"},title:"Reddit",icon:(0,o.jsx)(n.d6,{icon:"reddit",size:24})},{name:"telegram",attributes:{service:"telegram",label:"Telegram"},title:"Telegram",icon:(0,o.jsx)(n.d6,{icon:"telegram",size:24})},{name:"threads",attributes:{service:"threads",label:"Threads"},title:"Threads",icon:(0,o.jsx)(n.d6,{icon:"threads",size:24})},{name:"tumblr",attributes:{service:"tumblr",label:"Tumblr"},title:"Tumblr",icon:(0,o.jsx)(n.d6,{icon:"tumblr",size:24})},{name:"whatsapp",attributes:{service:"whatsapp",label:"WhatsApp"},title:"WhatsApp",icon:(0,o.jsx)(n.d6,{icon:"whatsapp",size:24})},{name:"x",attributes:{service:"x",label:"X"},keywords:["twitter","x"],title:"X",icon:(0,o.jsx)(n.d6,{icon:"x",size:24})},{name:"nextdoor",attributes:{service:"nextdoor",label:"Nextdoor"},title:"Nextdoor",icon:(0,o.jsx)(n.d6,{icon:"nextdoor",size:24})},{name:"native-share",attributes:{service:"share",
2025-02-28 08:42:11 +01:00
// translators: option to share the content - a verb.
label:__("Share","jetpack")},
// translators: option to share the content - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Native Share","jetpack"),icon:(0,o.jsx)(n.d6,{icon:"share",size:24}),description:__("Share the post using your phones 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)}));const i=a},11906:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(94715),n=r(56427),o=r(27723),a=r(83883),i=r(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:r}=e,{size:o}=t,c=e=>o===e||!o&&"has-normal-icon-size"===e;return(0,i.jsx)(s.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:()=>{r({size:t})},children:e},t)))})})})}},67650:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(94715),n=r(56427),o=r(27723),a=r(10790);const __=o.__,i=(0,s.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((e=>{const{clientId:t,attributes:r,iconBackgroundColor:o,iconColor:i,setAttributes:l,setIconBackgroundColor:c,setIconColor:u}=e,{iconBackgroundColorValue:d,iconColorValue:p}=r,{styleType:h}=r,m=(0,s.__experimentalUseMultipleOriginColorsAndGradients)(),g=[{value:i.color||p,onChange:e=>{u(e),l({iconColorValue:e})},label:__("Icon color","jetpack"),resetAllFilter:()=>{u(void 0),l({iconColorValue:void 0})}},{value:o.color||d,gradients:"",onChange:e=>{c(e),l({iconBackgroundColorValue:e})},onGradientChange:()=>{},label:__("Icon background","jetpack"),resetAllFilter:()=>{c(void 0),l({iconBackgroundColorValue:void 0})}}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.InspectorControls,{children:(0,a.jsx)(n.PanelBody,{title:__("Settings","jetpack"),children:(0,a.jsx)(n.MenuItemsChoice,{choices:[/* translators: Sharing: Sharing button option label. */
2024-02-16 11:03:01 +01:00
{value:"icon-text",label:__("Icon & Text","jetpack")},/* translators: Sharing: Sharing button option label. */
{value:"icon",label:__("Icon Only","jetpack")},/* translators: Sharing: Sharing button option label. */
2025-07-27 19:58:08 +02:00
{value:"text",label:__("Text Only","jetpack")}],value:h,onSelect:e=>l({styleType:e})})})}),(0,a.jsxs)(s.InspectorControls,{group:"color",children:[g.map((({onChange:e,label:r,value:n,resetAllFilter:o})=>(0,a.jsx)(s.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n,label:r,onColorChange:e,isShownByDefault:!0,resetAllFilter:o,enableAlpha:!0,clearable:!0}],panelId:t,gradients:"",...m},`social-links-color-${r}`))),(0,a.jsx)(s.ContrastChecker,{textColor:p,backgroundColor:d,isLargeText:!1})]})]})}))},83597:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(94715),n=r(27723),o=r(13022),a=r(11906),i=r(67650),l=r(10790);const __=n.__,c=["jetpack/sharing-button"];const u=function(e){const{attributes:t}=e,{size:r}=t,n=(0,l.jsx)("li",{children:__("Click plus to add a Sharing Button","jetpack")}),u=(0,o.A)(r,"jetpack-sharing-buttons__services-list"),d=(0,s.useBlockProps)({className:u}),p=(0,s.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,r)=>{"use strict";var s=r(94375),n=r(32870),o=r(83597),a=r(53840);(0,s.M)(n,{edit:o.A,save:a.A})},53840:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(13022),o=r(10790);function a({attributes:e}){const{size:t}=e,r=(0,n.A)(t,"jetpack-sharing-buttons__services-list"),a=s.useBlockProps.save({className:r}),i=s.useInnerBlocksProps.save(a);return(0,o.jsx)("ul",{...i,id:"jetpack-sharing-serivces-list"})}},48715:(e,t,r)=>{"use strict";var s=r(85985),n=r(18692);(0,s.vp)(n.U,n.W)},18692:(e,t,r)=>{"use strict";r.d(t,{U:()=>d,W:()=>p});var s=r(56427),n=r(47143),o=r(86087),a=r(27723),i=r(66087),l=r(71046),c=r(90062),u=r(10790);const __=a.__,d="shortlinks",p={render:()=>(0,u.jsx)(m,{})};class h extends o.Component{render(){const{shortlink:e}=this.props;return e?(0,u.jsx)(c.A,{children:(0,u.jsx)(s.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1,children:(0,u.jsx)(l.A,{link:e})})}):null}}const m=(0,n.withSelect)((e=>{const t=e("core/editor").getCurrentPost();return{shortlink:(0,i.get)(t,"jetpack_shortlink","")}}))(h)},52362:(e,t,r)=>{"use strict";r.d(t,{OS:()=>n,Z3:()=>s,oU:()=>o});const s="jp_pay_product",n="USD",o=[n,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"]},77513:(e,t,r)=>{"use strict";r.d(t,{H:()=>a});var s=r(56427),n=r(27723),o=r(10790);const __=n.__;function a({setAttributes:e,postLinkText:t}){return(0,o.jsx)(s.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,children:(0,o.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Purchase link text","jetpack"),help:__("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text",placeholder:__("Click here to purchase","jetpack"),onChange:t=>e({postLinkText:t}),value:t})})}},54719:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(86087),n=r(10790);const o={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:({attributes:e})=>{const{productId:t}=e;return t?(0,n.jsx)(s.RawHTML,{children:`[simple-payment id="${t}"]`}):null}}},14604:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var s=r(94715),n=r(56427),o=r(29491),a=r(47143),i=r(86087),l=r(27723),c=r(13022),u=r(39904),d=r(66087),p=r(72730),h=r(90840),m=r(52362),g=r(96632),f=r(95964),b=r(56658),v=r(10790);const __=l
__("%s is not a valid email address.","jetpack"),r):null,fieldPriceError:"spay_price"===t?__("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}validateAttributes=()=>{const e=this.validatePrice(),t=this.validateTitle(),r=this.validateEmail(),s=this.validateCurrency();return e&&t&&r&&s};validateCurrency=()=>{const{currency:e}=this.props.attributes;return m.oU.includes(e)};validatePrice=()=>{const{currency:e,price:t}=this.props.attributes;if(!t||0===parseFloat(t))return this.setState({fieldPriceError:__("If youre selling something, you need a price tag. Add yours here.","jetpack")}),!1;if(Number.isNaN(parseFloat(t)))return this.setState({fieldPriceError:__("Invalid price","jetpack")}),!1;if(parseFloat(t)<0)return this.setState({fieldPriceError:__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1;const{precision:r}=(0,p.iV)(e);return(0,b.w1)(t)>r?0===r?(this.setState({fieldPriceError:__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,l.sprintf)(/* translators: Placeholder is a number of decimals in a number. */
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",r,"jetpack"),r)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0)};validateEmail=()=>{const{email:e}=this.props.attributes;return e?u.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,l.sprintf)(/* translators: placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:__("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)};validateTitle=()=>{const{title:e}=this.props.attributes;return e?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:__("Please add a brief title so that people know what theyre paying for.","jetpack")}),!1)};handleEmailChange=e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})};handleContentChange=e=>{this.props.setAttributes({content:e})};handlePriceChange=e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void 0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})};handleCurrencyChange=e=>{this.props.setAttributes({currency:e})};handleMultipleChange=e=>{this.props.setAttributes({multiple:!!e})};handleTitleChange=e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})};getCurrencyList=m.oU.map((e=>{const{symbol:t}=(0,p.iV)(e);return{value:e,label:t===e?e:`${e} ${(0,d.trimEnd)(t,".")}`}}));renderSettings=()=>(0,v.jsx)(s.InspectorControls,{children:(0,v.jsx)(n.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,children:(0,v.jsx)(n.TextControl,{label:__("Purchase link text","jetpack"),help:__("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text",placeholder:__("Click here to purchase","jetpack"),onChange:e=>this.props.setAttributes({postLinkText:e}),value:this.props.attributes.postLinkText})})});render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:r}=this.state,{attributes:s,instanceId:o,isSelected:a,setAttributes:i,simplePayment:l}=this.props,{content:u,currency:p,email:m,featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:x,multiple:j,price:w,productId:_,title:C}=s,A=_&&(0,d.isEmpty)(l);if(!a&&A)return(0,v.jsx)("div",{className:"simple-payments__loading",children:(0,v.jsx)(f.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"})});if(!a&&m&&w&&C&&!e&&!t&&!r)return(0,v.jsx)(f.A,{"aria-busy":"false",content:u,featuredMediaUrl:y,featuredMediaTitle:x,formattedPrice:(0,b.N_)(w,p),multiple:j,title:C});const S=A?n.Disabled:"div";return(0,v.jsxs)(S,{className:"wp-block-jetpack-simple-payments",children:[this.renderSettings(),(0,v.jsx)(g.A,{featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:x,setAttributes:i}),(0,v.jsxs)("div",{children:[(0,v.jsx)(n.TextControl,{"aria-describedby":`${o}-title-error`,className:(0,c.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:__("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:C}),(0,v.jsx)(h.A,{id:`${o}-title-error`,isError:!0,children:r}),(0,v.jsx)(n.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:__("Describe your item in a few words","jetpack"),value:u}),(0,v.jsxs)("div",{className:"simple-payments__price-container",children:[(0,v.jsx)(n.SelectControl,{__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:p}),(0,v.jsx)(n.TextControl,{"aria-describedby":`${o}-price-error`,className:(0,c.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,b.N_)(0,p,!1),required:!0,step:"1",type:"number",value:w||""}),(0,v.jsx)(h.A,{id:`${o}-price-error`,isError:!0,children:t})]}),(0,v.jsx)("div",{className:"simple-payments__field-multiple",children:(0,v.jsx)(n.ToggleControl,{checked:Boolean(j),label:__("Allow people to buy more than one item at a t
__("%s is not a valid email address.","jetpack"),T):null),V("spay_price"===t?__("Invalid price.","jetpack"):null)})).finally((()=>{W(!1)}))},K=()=>{const e=Q(),t=ee(),r=X(),s=Y();return e&&t&&r&&s},Y=()=>g.oU.includes(N),Q=()=>{if(!L||0===parseFloat(L))return V(__("If youre selling something, you need a price tag. Add yours here.","jetpack")),!1;if(Number.isNaN(parseFloat(L)))return V(__("Invalid price","jetpack")),!1;if(parseFloat(L)<0)return V(__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")),!1;const{precision:e}=(0,h.iV)(N);return(0,k.w1)(L)>e?0===e?(V(__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")),!1):(V((0,l.sprintf)(/* translators: Placeholder is a number of decimals in a number. */
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",e,"jetpack"),e)),!1):(H&&V(null),!0)},X=()=>T?d.validate(T)?(O&&U(null),!0):(U((0,l.sprintf)(/* translators: Placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),T)),!1):(U(__("We want to make sure payments reach you, so please add an email address.","jetpack")),!1),ee=()=>D?(q&&$(null),!0):($(__("Please add a brief title so that people know what theyre paying for.","jetpack")),!1),te=e=>{o({email:e}),U(null)},re=e=>{o({content:e})},se=e=>{const t=parseFloat(e);isNaN(t)?o({price:void 0}):o({price:t}),V(null)},ne=e=>{o({currency:e})},oe=e=>{o({multiple:!!e})},ae=e=>{o({title:e}),$(null)},ie=g.oU.map((e=>{const{symbol:t}=(0,h.iV)(e);return{value:e,label:t===e?e:`${e} ${(0,p.trimEnd)(t,".")}`}}));let le;if((0,i.useEffect)((()=>{(!R&&w||!C)&&J(),window.wp?.customize?.bind("change",(e=>{let t;const r=e.id.match(/^widget_(.+)(?:\[(\d+)\])$/);if(r){t=`${r[1]}-${parseInt(r[2],10)}`}else t=e.id;t===(0,c.getWidgetIdFromBlock)(A)&&K()&&J()}))}),[]),(0,i.useEffect)((()=>{x&&Z.current&&!(0,p.isEmpty)(x)&&(o({content:(0,p.get)(x,["content","raw"],E),currency:(0,p.get)(x,["meta","spay_currency"],N),email:(0,p.get)(x,["meta","spay_email"],T),featuredMediaId:(0,p.get)(x,["featured_media"],P),featuredMediaUrl:(0,p.get)(j,"url",B),featuredMediaTitle:(0,p.get)(j,"title",I),multiple:Boolean((0,p.get)(x,["meta","spay_multiple"],Boolean(M))),price:(0,p.get)(x,["meta","spay_price"],L||void 0),title:(0,p.get)(x,["title","raw"],D)}),Z.current=!1)}),[x]),(0,i.useEffect)((()=>{S&&(w||!C)&&K()?J():r||K()}),[S,r]),(0,i.useEffect)((()=>{const t=_&&_!==e.postLinkUrl,r=!e.postLinkText;(t||r)&&o({...t&&{postLinkUrl:_},...r&&{postLinkText:__("Click here to purchase.","jetpack")}})}),[_,e]),!r&&F)le=(0,y.jsx)("div",{className:"simple-payments__loading",children:(0,y.jsx)(v.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"})});else if(r||!T||!L||!D||O||H||q){const r=F?n.Disabled:"div";le=(0,y.jsxs)(r,{className:"simple-payments__wrapper",children:[(0,y.jsx)(s.InspectorControls,{children:(0,y.jsx)(f.H,{postLinkText:e.postLinkText,setAttributes:o})}),(0,y.jsx)(b.A,{featuredMediaId:P,featuredMediaUrl:B,featuredMediaTitle:I,setAttributes:o}),(0,y.jsxs)("div",{children:[(0,y.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-title-error`,className:(0,u.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":q}),label:__("Item name","jetpack"),onChange:ae,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:D}),(0,y.jsx)(m.A,{id:`${t}-title-error`,isError:!0,children:q}),(0,y.jsx)(n.TextareaControl,{__nextHasNoMarginBottom:!0,className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:re,placeholder:__("Describe your item in a few words","jetpack"),"aria-label":__("Describe your item in a few words","jetpack"),value:E}),(0,y.jsxs)("div",{className:"simple-payments__price-container",children:[(0,y.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:ne,options:ie,value:N}),(0,y.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-price-error`,className:(0,u.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":H}),label:__("Price","jetpack"),onChange:se,placeholder:(0,k.$g)(0,N,!1),required:!0,step:"1",type:"number",value:L||""}),(0,y.jsx)(m.A,{id:`${t}-price-error`,isError:!0,children:H})]}),(0,y.jsx)("div",{className:"simple-payments__field-multiple",children:(0,y.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,checked:Boolean(M),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:oe})}),(0,y.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-email-${O?"error":"help"}`,className:(0,u.A)("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":O}),label:__("Email","jetpack"),onChange:te,placeholder:__("Email","jetpack"),required:!0
__("Go to slide %s","jetpack"),e)+'"></button>'}else n+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return n}},16445:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(63162),n=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(39126),p=r(31837),h=r(57464),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={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:r,delay:s,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||r!==e.autoplay||s!==e.delay||o!==e.images){let t;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=new u.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)return null;const{autoplay:e,className:t,delay:r,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?r: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:r,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,s.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:a}),(0,s.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})]})},r||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"!=typeof window&&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})}const f=g},82233:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={h
__("Go to slide %s","jetpack"),e)+'"></button>'}else n+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return n}},71576:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(63162),n=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(13895),p=r(74194),h=r(25080),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={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:r,delay:s,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||r!==e.autoplay||s!==e.delay||o!==e.images){let t;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=new u.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)return null;const{autoplay:e,delay:t,effect:r,images:a}=this.props;return(0,m.jsx)("div",{"data-autoplay":e||null,"data-delay":e?t:null,"data-effect":r,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:a.map((({alt:e,caption:t,id:r,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,s.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:a}),(0,s.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})]})},r||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"!=typeof window&&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})}const f=g},89693:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={html:!1,align:["center","
__("Go to slide %s","jetpack"),e)+'"></button>'}else n+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return n}},41952:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(241),o=r(10790);const a=({attributes:{align:e,autoplay:t,delay:r,effect:a,images:i},className:l})=>{const c=s.useBlockProps.save({className:l});return(0,o.jsx)(n.A,{align:e,autoplay:t,className:c.className,delay:r,effect:a,images:i})}},241:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(63162),n=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(33170),p=r(30889),h=r(34308),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={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:r,delay:s,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||r!==e.autoplay||s!==e.delay||o!==e.images){let t;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=new u.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)return null;const{autoplay:e,className:t,delay:r,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?r:null,"data-effect":a,style:{"--aspect-ratio":i[0]?.aspectRatio?`calc(${i[0].aspectRatio})`:void 0},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:r,url:a,aspectRatio:i},c)=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,s.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,"data-aspect-ratio":i,src:a}),(0,s.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})]})},r?`${r}-${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"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autopl
__("Slide %d, currently selected","jetpack"),r+1):(0,s.sprintf)(/* translators: %d: Slide number. */
__("Go to slide %d","jetpack"),r+1)),(0,o.jsx)("button",{role:c?"presentation":"tab",className:(0,n.A)("wp-story-pagination-bullet",{"wp-story-pagination-ellipsis":e}),"aria-label":u,"aria-disabled":c||a,onClick:c||a?void 0:l,disabled:c,children:(0,o.jsx)("div",{className:"wp-story-pagination-bullet-bar",children:(0,o.jsx)("div",{className:"wp-story-pagination-bullet-bar-progress",style:{width:`${i}%`}})})},r)}},35941:(e,t,r)=>{"use strict";r.d(t,{d:()=>a,k:()=>o});var s=r(13022),n=r(10790);const o=({className:e,size:t,label:r,isPressed:o,...a})=>(0,n.jsx)("button",{type:"button","aria-label":r,"aria-pressed":o,className:(0,s.A)("jetpack-mdc-icon-button","circle-icon","outlined","bordered",e),style:{width:`${t}px`,height:`${t}px`},...a}),a=({className:e,size:t=24,label:r,isPressed:o,...a})=>(0,n.jsx)("button",{type:"button","aria-label":r,"aria-pressed":o,className:(0,s.A)("jetpack-mdc-icon-button",e),style:{width:`${t}px`,height:`${t}px`},...a})},20058:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(10790);const n=()=>(0,s.jsx)("div",{className:"wp-story-loading-spinner",children:(0,s.jsx)("div",{className:"wp-story-loading-spinner__outer",children:(0,s.jsx)("div",{className:"wp-story-loading-spinner__inner"})})})},48907:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(27723),n=r(35941),o=r(44227),a=r(10790);const _x=s._x;function i({playing:e,muted:t,onPlayPressed:r,onMutePressed:s,showMute:i}){return(0,a.jsxs)("div",{className:"wp-story-controls",children:[(0,a.jsx)(n.d,{isPressed:e,label:e?_x("pause","Button tooltip text","jetpack"):_x("play","Button tooltip text","jetpack",0),onClick:r,children:e?(0,a.jsx)(o.E$,{}):(0,a.jsx)(o.ud,{})}),i&&(0,a.jsx)(n.d,{isPressed:t,label:t?_x("unmute","Button tooltip text","jetpack"):_x("mute","Button tooltip text","jetpack",0),onClick:s,children:t?(0,a.jsx)(o.lQ,{}):(0,a.jsx)(o.Fz,{})})]})}},41256:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(27723),n=r(35941),o=r(44227),a=r(10790);const __=s.__;function i({fullscreen:e,onExitFullscreen:t,siteIconUrl:r,storyTitle:s}){return e?(0,a.jsxs)("div",{className:"wp-story-meta",children:[(0,a.jsx)("div",{className:"wp-story-icon",children:(0,a.jsx)("img",{alt:__("Site icon","jetpack"),src:r,width:"40",height:"40"})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"wp-story-title",children:s})}),(0,a.jsx)(n.d,{className:"wp-story-exit-fullscreen",label:__("Exit Fullscreen","jetpack"),onClick:t,children:(0,a.jsx)(o.US,{})})]}):null}},44227:(e,t,r)=>{"use strict";r.d(t,{E$:()=>l,Ej:()=>p,Fz:()=>u,US:()=>c,af:()=>h,lQ:()=>d,ud:()=>i});var s=r(5573),n=r(62289),o=r(10790);const a=({children:e,size:t})=>(0,n.A)(e,t,t),i=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M8 5v14l11-7z"})}),l=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}),c=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),u=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})}),d=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}),p=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}),h=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(s.Path,{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})},84545:(e,t,r)=>{"use strict";r.d(t,{$U:()=>c.$U,Dv:()=>s.A,H2:()=>n.A,VS:()=>i.A,Y9:()=>o.A,hJ:()=>a.A,xu:()=>l.A});var s=r(79809),n=r(48907),o=r(41256),a=r(38925),i=r(71645),l=r(20058
_n("<span>%s reader</span> is subscribed.","<span>%s readers</span> are subscribed.",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:r.color,onColorChange:T,gradientValue:g.gradientValue,onGradientChange:g.setGradient,label:__("Button Background","jetpack")},{colorValue:L.color,onColorChange:P,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:r.color,onChange:T,label:__("Button Background Color","jetpack")},{value:L.color,onChange:P,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=>{const t=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:B,onChange:()=>{E({showSubscribersTotal:!B,includeSocialFollowers:void 0!==w&&w})},help:()=>{if(!M||M<1)return __("This will remain hidden until there is at least one subscriber.","jetpack")}}),z&&(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,disabled:!B,label:__("Include social followers in count","jetpack"),checked:void 0===w||w,onChange:()=>{E({includeSocialFollowers:void 0!==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,s.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",s,"jetpack"),(0,n.qe)(s,{numberFormatOptions:{maximumFractionDigits:1}}))}})),{availableNewsletterCategories:Q,areNewsletterCategoriesEnabled:X}=(0,l.useSelect)((e=>{const t=e(f.M);return{availableNewsletterCategories:t.getNewsletterCategories(),areNewsletterCategoriesEnabled:t.getNewsletterCategoriesEnabled()}})),ee=w({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}),te=w({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}),re={"no-border-radius":0===L,[P.class]:P.class,"has-text-color":A.color,[A.class]:A.class},se={...re,"has-background":s.color||ee.gradientValue,[s.class]:!ee.gradientValue&&s.class,[ee.gradientClass]:ee.gradientClass},ne={...re,"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:P.size?P.size:v.Fm,padding:(e=>{const t=e||v.oi;return t+"px "+Math.round(1.5*t)+"px "+t+"px "+Math.round(1.5*t)+"px"})(O)},ie={"--subscribe-block-border-radius":L?L+"px":v.Kn+"px"},le={...ae,...!s.color&&ee.gradientValue?{background:ee.gradientValue}:{backgroundColor:s.color}},ce={...ae,...!x.color&&te.gradientValue?{background:te.gradientValue}:{backgroundColor:x.color},width:D?.length?D:"auto"};"button"!==J&&(W?ce.marginTop=oe(V)+"px":ce.marginLeft=oe(V)+"px");const ue=(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":void 0,G?"wp-block-jetpack-subscriptions__show-subs":void 0),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:s,fallbackButtonBackgroundColor:C,fallbackTextColor:S,fontSize:P,includeSocialFollowers:z,isGradientAvailable:j,padding:O,preselectNewsletterCategories:U,setAttributes:r,setBorderColor:T,setButtonBackgroundColor:_,setTextColor:E,showSubscribersTotal:G,spacing:V,subscriberCount:K,textColor:A,buttonWidth:D,selectedNewsletterCategoryIds:H,subscribePlaceholder:$,submitButtonText:q,successMessage:Z})}),(0,y.jsx)(o.BlockControls,{children:(0,y.jsx)(a.ToolbarGroup,{children:(0,y.jsx)(a.ToolbarButton,{href:(0,g.Qu)(B),target:"_blank",children:B?_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)(se,"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=>r({submitButtonText:e}),style:ce,value:q,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,r)=>{"use strict";var s=r(85985),n=r(74997),o=r(47143),a=r(43656),i=r(86087),l=r(52619),c=r(27723),u=r(67709),d=r(62599),p=r(94375),h=r(99876),m=r(63200),g=r(39025),f=r(38387),b=r(3722),v=r(74500),k=r(48313),y=r(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_subscri
__("image %1$d of %2$d in gallery","jetpack"),t+1,r.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:s,url:this.photonize(e),width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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:r,children:[(0,d.jsx)(a,{align:e,columns:s,images:n,layoutStyle:o,renderedImages:i}),t]})}}function h(e){return["circle","square"].includes(e)}function m(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},s=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,n]of Object.entries(t))s.searchParams.set(Object.hasOwn(r,e)?r[e]:e,n);return s.toString()}},58070:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(86087),n=r(94107),o=r(29971),a=r(75303),i=r(56237),l=r(34896),c=r(5236),u=r(10790);class d extends s.Component{gallery=(0,s.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:r}of e){const{width:e}=t;(0,c.S)(r).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=new n.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:r,layoutStyle:s,renderedImages:n}=this.props,c=(0,l.mJ)(r),d="columns"===s?(0,l.FL)(c,t):(0,l.VU)(c,{isWide:["full","wide"].includes(e)});let p=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)=>{const r=n.slice(p,p+e);return p+=e,(0,u.jsx)(o.A,{children:r},t)}))},t)))})}}},34896:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,s.sum)((0,s.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,s.sum)(o),A=n.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,s.some)((0,s.takeRight)(r,t),(t=>(0,s.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,s.every)((0,s.zipWit
__("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:r,height:e.height,id:e.id,imageFilter:s,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:r,columns:s,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)(r,{[`has-rounded-corners-${g}`]:g>0}),children:[(0,d.jsx)(h,{align:e,columns:s,images:n,layoutStyle:i,renderedImages:m}),t]})}}},84255:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(86087),n=r(84394),o=r(38548),a=r(70954),i=r(89195),l=r(10790);class c extends s.Component{gallery=(0,s.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:s,renderedImages:c}=this.props,u=(0,i.mJ)(r),d="columns"===s?(0,i.FL)(u,t):(0,i.VU)(u,{isWide:["full","wide"].includes(e)});let p=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)=>{const r=c.slice(p,p+e);return p+=e,(0,l.jsx)(n.A,{children:r},t)}))},t)))})}}},89195:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,s.sum)((0,s.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,s.sum)(o),A=n.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,s.some)((0,s.takeRight)(r,t),(t=>(0,s.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,s.every)((0,s.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},70954:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(13022),n=r(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,s.A)("tiled-gallery__row",t),children:e})}},51475:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(66087),n=r(43566),o=r(84394),a=r(38548),i=r(70954),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(n.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,s.take)(t,c)]:[],...(0,s.chunk)((0,s.drop)(t,c),r)].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,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(90907),n=r(43566),o=r(65378),a=r(10790);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p}=e;return(0,a.jsx)(o.A,{align:l,clas
__("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:r,height:e.height,id:e.id,imageFilter:s,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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)(r,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:s,columnWidths:m?g:void 0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},56420:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(86087),n=r(54001),o=r(99309),a=r(46479),i=r(70394),l=r(10790);class c extends s.Component{gallery=(0,s.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:s,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(r),p="columns"===s?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,l.jsx)(a.A,{children:e.map(((e,r)=>{const s=c.slice(h,h+e);return h+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[r],children:s},r)}))},t)))})}}},70394:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,s.sum)((0,s.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,s.sum)(o),A=n.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,s.some)((0,s.takeRight)(r,t),(t=>(0,s.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,s.every)((0,s.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},46479:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(13022),n=r(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,s.A)("tiled-gallery__row",t),children:e})}},65216:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(66087),n=r(60041),o=r(54001),a=r(99309),i=r(46479),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(n.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,s.take)(t,c)]:[],...(0,s.chunk)((0,s.drop)(t,c),r)].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,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(90907),n=r(60041),o=r(77511),a=r(
__("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:r,height:e.height,id:e.id,imageFilter:s,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:s,columnWidths:g?f:void 0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},91341:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(86087),n=r(94107),o=r(78608),a=r(52042),i=r(9276),l=r(71245),c=r(86461),u=r(10790);class d extends s.Component{gallery=(0,s.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:r}of e){const{width:e}=t,s=[];(0,c.S)(r).forEach((t=>{s.push((0,c.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(s)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new n.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,r){let s=0;return e.map((e=>e.map((e=>{const r=t.slice(s,s+e);return s+=e,r})))).map((e=>(0,c.r)(e,r)))}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(r),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=s.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();let m=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,u.jsx)(i.A,{children:e.map(((e,r)=>{const s=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[r],children:s},r)}))},t)))})}}},71245:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,s.sum)((0,s.take)(t,3));r
__("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:r,height:e.height,id:e.id,imageFilter:s,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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)(r,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:s,columnWidths:m?g:void 0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},62579:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(86087),n=r(89798),o=r(38448),a=r(26054),i=r(79167),l=r(10790);class c extends s.Component{gallery=(0,s.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:s,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(r),p="columns"===s?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,l.jsx)(a.A,{children:e.map(((e,r)=>{const s=c.slice(h,h+e);return h+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[r],children:s},r)}))},t)))})}}},79167:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){const n=(0,s.sum)((0,s.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||r)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,s.sum)(o),A=n.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,s.some)((0,s.takeRight)(r,t),(t=>(0,s.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,s.every)((0,s.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},26054:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(13022),n=r(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,s.A)("tiled-gallery__row",t),children:e})}},58711:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(66087),n=r(41314),o=r(89798),a=r(38448),i=r(26054),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(n.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,s.take)(t,c)]:[],...(0,s.chunk)((0,s.drop)(t,c),r)].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,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(94715),n=r(13022),o=r(90907),a=r(
__("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:r,height:e.height,id:e.id,imageFilter:s,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:i,customLink:e.customLink,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:x,url:y,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:s,columnWidths:g?f:void 0,images:n,layoutStyle:u,renderedImages:v,onResize:g?void 0:h}),t]})}}},80720:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(94715),n=r(13022),o=r(90907),a=r(35463),i=r(29520),l=r(1456),c=r(10790);function u({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:u,className:d,columns:p=(0,i.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=s.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:r,isSave:!0,layoutStyle:(0,o.D)(a.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},69813:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},29520:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>k,EB:()=>b});var s=r(85985),n=r(94715),o=r(56427),a=r(43656),i=r(86087),l=r(27723),c=r(66087),u=r(90907),d=r(76585),p=r(35463),h=r(77530),m=r(10309),g=r(10790);const __=l.__,f=3;function b(e){return e.images.length>0?Math.min(f,e.images.length):f}const v=e=>{const t=(0,c.pick)(e,[["alt"],["id"],["link"]]);return t.url=(0,c.get)(e,["sizes","large","url"])||(0,c.get)(e,["media_details","sizes","large","source_url"])||e.url,t},k=(0,o.withNotices)((({attributes:e,isSelected:t,noticeOperations:r,noticeUI:l,setAttributes:f})=>{const{align:k,columns:y=b(e),imageFilter:x,images:j,linkTo:w,roundedCorners:_,columnWidths:C}=e,A=(0,u.D)(p.kc,e.className),S=(0,n.useBlockProps)(),[E,N]=(0,i.useState)(null),[T,P]=(0,i.useState)(void 0===C||0===C?.length),B=e=>{f({images:e,ids:e.map((({id:e})=>parseInt(e,10)))})},I=e=>{(0,a.mediaUpload)({allowedTypes:p.eN,filesList:e,onFileChange:e=>B((j||[]).concat(e.map(v))),onError:r.createErrorNotice}),P(!0)},M=e=>()=>{const t=(0,c.filter)(j,((t,r)=>e!==r));N(null),P(!0),B(t),f({columns:y?Math.min(t.length,y):y})},L=e=>()=>{E!==e&&N(e)},R=e=>{const t=e.map((e=>{const t=j.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t?.customLink?{...v(e),customLink:t.customLink}:v(e)}));B(t),f({columns:y?Math.min(e.length,y):y}),P(!0)},D=(e,t)=>{const r=[...j];r.splice(t,1,j[e]),r.splice(e,1,j[t]),N(t),P(!0),B(r)},F=e=>()=>{e!==j.length-1&&D(e,e+1)},z=e=>()=>{0!==e&&D(e,e-1)},O=e=>{T&&f({columnWidths:e})},U=e=>I(e.target.files),H=e=>t=>{j[e]&&B([...j.slice(0,e),{...j[e],...t},...j.slice(e+1)])};let V;return(0,i.useEffect)((()=>{t||null===E||N(null)}),[t,E,N]),V=0===j.length?(0,g.jsx)(n.MediaPlaceholder,{icon:(0,s.sh)(d),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:R,accept:"image/*",allowedTypes:p.eN,multiple:!0,notices:l,onError:r.createErrorNotice}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.M,{layoutStyle:A,images:j,columns:y,selectedImage:E,setImageAttributes:H,onColumnsChange:e=>f({columns:e}),roundedCorners:_,onRoundedCornersChange:e=>f({roundedCorners:e}),linkTo:w,onLinkToChange:e=>f({linkTo:e})}),l,(0,g.jsxs)(m.A,{className:"tiled-gallery__wrapper",align:k,columns:y,imageFilter:x,images:j,layoutStyle:A,linkTo:w,onMoveBackward:z,onMoveForward:F,onRemoveImage:M,onSelectImage:L,onResize:O,roundedCorners:
__("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:r,height:e.height,id:e.id,imageFilter:s,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:b===t,link:e.link,linkTo:u,customLink:e.customLink,onMoveBackward:a?void 0:h(t),onMoveForward:a?void 0:m(t),onRemove:a?void 0:g(t),onSelect:a?void 0:f(t),origUrl:e.url,setAttributes:a?void 0:v(t),showMovers:o.length>1,srcSet:j,url:x,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:s,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)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,p.jsx)(b,{align:e,columns:s,columnWidths:g?f:void 0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},31238:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(86087),n=r(94107),o=r(98627),a=r(54359),i=r(43645),l=r(74176),c=r(18980),u=r(10790);class d extends s.Component{gallery=(0,s.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:r}of e){const{width:e}=t,s=[];(0,c.S)(r).forEach((t=>{s.push((0,c.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(s)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new n.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,r){let s=0;return e.map((e=>e.map((e=>{const r=t.slice(s,s+e);return s+=e,r})))).map((e=>(0,c.r)(e,r)))}render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(r),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=s.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();let m=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,u.jsx)(i.A,{children:e.map(((e,r)=>{const s=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[r],children:s},r)}))},t)))})}}},74176:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var s=r(66087);function n(e){return(0,s.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,s.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,s.takeWhile)(o,(t=>{const s=a<=(e+1)*r;return s&&(a+=t),s})).length;n.push(t),o=(0,s.drop)(o,t)}return n.push(o.length),[n]}const i=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([P(1.6),(0,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(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,s.overEvery)(T(.9),P(2)),(0,s.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,n)=>{if(!n.length)return e;let o;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,s.sum)((0,s.take)(n,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,s.sum)((0,s.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,r){c
__("Display %s","jetpack"),e.label.toLowerCase()),checked:i[e.id]||!1,onChange:(r=e.id,e=>{const s={...i,[r]:e};if(Object.values(s).every((e=>!1===e)))return f(!0);l(s),t({postTypes:s}),f(!1)})},e.id);var r})),g&&(0,a.jsx)(s.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1,children:__("At least one item must be selected.","jetpack")})]}),(0,a.jsxs)(s.PanelBody,{title:__("Metadata settings","jetpack"),children:[(0,a.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,a.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:c,onChange:e=>t({displayAuthor:e})}),(0,a.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,a.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})]})]})}function l({attributes:e,setAttributes:t}){const{layout:r}=e,n=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===r},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===r}];return(0,a.jsx)(s.ToolbarGroup,{controls:n})}},96894:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var s=r(85985),n=r(1455),o=r.n(n),a=r(94715),i=r(86087),l=r(13022),c=r(9522),u=r(20600),d=r(8031),p=r(10790);function h(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})})]})}const m=function({attributes:e,setAttributes:t}){const{isLoadingModules:r,isChangingStatus:n,isModuleActive:m,changeStatus:g}=(0,s.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:P,postsToShow:B,postTypes:I}=e;let M;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=${P}`}).then((e=>{k(e)}))}),[P,m]),(0,i.useEffect)((()=>{const e=v;if(!e)return;const t=[];for(let r=0;t.length!==B&&(e[r]&&I[e[r].type]&&t.push((0,p.jsx)(h,{title:e[r].title,date:e[r].date,author:e[r].author,thumbnail:e[r].thumbnail,context:e[r].context,displayDate:E,displayAuthor:A,displayThumbnail:N,displayContext:S},"jetpack-top-posts-"+e[r].id)),e[r]);r++);x(t)}),[A,S,E,N,v,I,B,x]),M=m||r?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,r)=>{"use strict";var s=r(74997),n=r(94375),o=r(35075),a=r(96894);(0,n.M)(o,{edit:a.A,save:()=>nu
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:L,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,A.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:z,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:O,__nextHasNoMarginBottom:!0}),(0,A.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,A.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,A.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:V??"",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,A.jsx)(i.MediaUploadCheck,{children:(0,A.jsxs)(l.BaseControl,{className:"editor-video-poster-control",children:[(0,A.jsx)(l.BaseControl.VisualLabel,{children:__("Poster Image","jetpack")}),(0,A.jsx)(i.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:S,render:({open:e})=>(0,A.jsx)(l.Button,{variant:"secondary",onClick:e,ref:this.posterImageButton,"aria-describedby":Z,children:J?__("Replace image","jetpack",0):__("Select Poster Image","jetpack")})}),(0,A.jsx)("p",{id:Z,hidden:!0,children:J?(0,h.sprintf)(/* translators: Placeholder is an image URL. */
__("The current poster image url is %s","jetpack"),H??M):__("There is no poster image currently selected","jetpack")}),J&&(0,A.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,A.jsx)(l.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})]}),(0,A.jsx)(x.A,{attributes:t,setAttributes:u,useAverageColor:q,toggleAttribute:this.toggleAttribute}),(0,A.jsxs)(l.PanelBody,{title:__("Video File Settings","jetpack"),children:[(0,A.jsx)(l.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:_??"",disabled:f||y,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,A.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
__("Display download option and allow viewers to download this video","jetpack")),onChange:this.onChangeAllowDownload,checked:T,disabled:f||B,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.SelectControl,{label:__("Video Privacy","jetpack"),help:this.getPrivacySettingHelp(P),onChange:this.onChangePrivacySetting,value:P??"",options:[{value:v.NF.SITE_DEFAULT,label:_x("Site Default","VideoPress privacy setting","jetpack")},{value:v.NF.PUBLIC,label:_x("Public","VideoPress privacy setting","jetpack")},{value:v.NF.PRIVATE,label:_x("Private","VideoPress privacy setting","jetpack")}],disabled:f||I,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})]})]}),Y=e=>{this.setState({fileForUpload:e[0]})},Q=e=>{e&&e.url?(this.props.setAttributes({src:e.url,id:e.id,poster:e.image?.src!==e.icon?e.image?.src:void 0}),e.videopress_guid&&this.props.setAttributes({guid:e.videopress_guid})):u({src:void 0,id:void 0,poster:void 0})},X=()=>"videoPressUploadPoster"in window,ee=(0,p.escapeHTML)(g?(0,C.T3)(g.name):""),te=({mediaId:e,guid:t,src:r})=>{this.setState({title:this.state.title??ee,fileForUpload:null,isUploadComplete:!!e,isEditingWhileUploading:!!e&&this.state.isEditingWhileUploading,pendingVideoAttributes:e&&t&&r?{id:e,guid:t,src:r}:null})},re=e=>{this.setState({title:e})},se=e=>{this.setState({videoFrameSelectedInMillis:e,videoPosterImageData:null})},ne=()=>{const e=this.state.title;this.updateMetaApiCall({title:e},(()=>this.setState({isUpdatingTitle:!0,title:e})),(()=>this.setState({title:e})),(()=>this.setState({isUpdatingTitle:!1})))},oe=()=>ue({at_time:this.state.videoFrameSelectedInMillis,is_millisec:!0}),ae=()=>ue({poster_attachment_id:this.state.videoPosterImageData.id}),ie=e=>{e.generating?le():ce(e.poster)},le=()=>{setTimeout((()=>{(X()?window.videoPressGetPoster(F):o()({path:`/videos/${F}/poster`,apiNamespace:"rest/v1.1",global:!0,method:"GET"})).then((e=>ie(e)))}),2e3)},ce=e=>{e&&u({poster:e})},ue=e=>{if(X())return window.videoPressUploadPoster(F,e).then((e=>ie(e)));o()({path:`/videos/${F}/poster`,apiNamespace:"rest/v1.1",method:"POST",global:!0,data:e}).catch((e=>e))},de=()=>{const{title:e,videoFrameSelectedInMillis:t}=this.state;e&&ne(),M?ae():null!=t&&oe()},pe=()=>{this.state.pendingVideoAttributes&&u(this.state.pendingVideoAttributes),this.setState({isEditingWhileUploading:!1,pendingVideoAttributes:null}),de()};if(null!=g&&g.name||this.state.isEditingWhileUploading){const e=this.state.title??ee;return(0,A.jsx)(E,{fileForUpload:g,filename:ee,uploadFinished:te,blockSettings:K,onDismissEditor:pe,isUploadComplete:this.state.isUploadComplete,onSelectPoster:this.onSelectPoster,onRemovePoster:this.onRemovePoster,onChangeTitle:re,title:e,videoPosterImageData:this.state.videoPosterImageData,onVideoFrameSelected:se,onSave:de})}const he=f||s,me=m||n||!F,ge=me&&!n&&!he,fe=(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)("div",{className:n||he?"":"videopress-block-hide",children:(0,A.jsx)(k.A,{text:n?__("Uploading…","jetpack"):__("Generating preview…","jetpack",0)})}),(0,A.jsx)("div",{className:ge?"":"videopress-block-hide",children:(0,A.jsx)(e,{...this.props})})]});if(me)return c?(0,A.jsx)(b.f,{onFilesSelected:Y,onMediaItemSelected:Q,children:fe}):(0,A.jsx)(d.Fragment,{children:fe});const{html:be,scripts:ve}=a||{html:null,scripts:null},ke=he||!a;return(0,A.jsxs)(d.Fragment,{children:[K,(0,A.jsx)(N,{...this.props,hideOverlay:this.hideOverlay,html:be,scripts:ve,interactive:w,caption:R,shouldRenderLoadingBlock:ke})]})}}]),"withVideoPressEdit")},27156:(e,t,r)=>{"use strict";var s=r(90372),n=r(97999),o=r(85985),a=r(63162),i=r(94715),l=r(75994),c=r(74997),u=r(56427),d=r(29491),p=r(47143),h=r(43656),m=r(86087),g=r(52619),f=r(27723),b=r(66087),v=r(81837),k=r(59257),y=r(21440),x=r(54727),j=r(65390),w=r(77189),_=r(41560),C=r(47960),A=r(51983),S=r(7345),E=r(40932),N=r(10790);const __=f.__,T=(0,d.createHigherOrderComponent)((e=>t=>{const{name:r}=(0,i.useBlockEditContext)();return"core/video"!==r?(0,N.jsx)(e,{...t}):(0,N.jsxs)(e,{...t,disableDropZone:!0,className:"no-videopress-media-placeholder",children:[(0,N.jsx)(u.Button,{disabled:!0,className:"com
__("Paused (%s%%)","jetpack"),x):(0,o.sprintf)(/* translators: Placeholder is an upload progress percenatage number, from 0-100. */
__("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)(s.Button,{variant:"link",onClick:()=>{p&&(u?p.start():p.abort(),d(!u))},children:u?"Resume":"Pause"})})]})})}},80534:(e,t,r)=>{"use strict";r.d(t,{Q:()=>n,l:()=>a});var s=r(10781);const n=function(e){return new Promise((function(t,r){const s=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...s}).done((function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})})).fail((function(e){r(e)}))}))},o={},a=({onUploadUuidRetrieved:e,onError:t,onProgress:r,onSuccess:a})=>(i,l)=>{const c=new s._O(i,{onError:t,onProgress:r,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,r){if(r.getStatus()>=400)return;const s=r.getHeader("x-videopress-upload-guid"),n=r.getHeader("x-videopress-upload-media-id"),i=r.getHeader("x-videopress-upload-src-url");if(s&&n&&i)return void(a&&a({mediaId:Number(n),guid:s,src:i}));const l={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach((function(e){const t=r.getHeader(e);t&&(c[l[e]]=t)})),c.key&&c.token&&(o[c.key]=c.token),c.key&&e(c.key)},onBeforeRequest:function(e){const t=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(const t of Object.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){const r=new URL(e._url).pathname.split("/"),s=r[r.length-1];if(o[s])e.setHeader("x-videopress-upload-token",o[s]);else if("HEAD"===t)return n(s).then((t=>(o[s]=t.token,e.setHeader("x-videopress-upload-token",t.token),e)))}return Promise.resolve(e)}});return c.findPreviousUploads().then((function(e){e.length&&c.resumeFromPreviousUpload(e[0]),c.start()})),c}},41560:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(94715),n=r(29491),o=r(13022),a=r(17900),i=r(10790);const l=(0,n.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:r,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)return e(t);const w=s.useBlockProps.save({className:(0,o.A)("wp-block-video",f,g,{[`align${b}`]:b})}),_=(0,a.e)(c,{autoplay:r,controls:l,loop:u,muted:d,playsinline:p,poster:h,preload:m,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:x});let C={};return j&&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`}),!s.RichText.isEmpty(n)&&(0,i.jsx)(s.RichText.Content,{tagName:"figcaption",value:n})]})}),"withVideoPressSave")},57954:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var s=r(94715),n=r(56427),o=r(86087),a=r(27723),i=r(10790);const __=a.__;class l extends o.Component{constructor(){super(...arguments);const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}}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:r}=this.state,{setAttributes:s}=this.props;s({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:r})};render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:
__("Delete %s","jetpack"),o.label),disabled:s===i,children:s===i?__("Deleting","jetpack"):__("Delete","jetpack",0)})})]},i))),(0,d.jsx)(a.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list",children:o})}function y({track:e,guid:t,onChange:r,onClose:s,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),[]))return null;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=>{const s=t.target.files;!s.length>0||(e.tmpFile=s[0],r(e))},accept:h,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:/* translators: %s: The allowed file types to be uploaded as a video text track." */ /* translators: %s: The allowed file types to be uploaded as a video text track." */
(0,c.sprintf)(__("Allowed formats: %s","jetpack"),h)})]}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language",children:[(0,d.jsx)(a.TextControl,{onChange:t=>r({...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=>r({...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=>{r({...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"),void 0===e.kind&&(e.kind=p),u(e)?f(__("A track already exists for that language and kind.","jetpack")):(k(!0),b(e,t).then((()=>{r(e),f(null),s()})).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." */
(0,c.sprintf)(__("Error: %s","jetpack"),g)})]})})}function x({tracks:e=[],onChange:t,guid:r}){const[s,n]=(0,l.useState)(null);return(0,d.jsx)(a.Dropdown,{contentClassName:"videopress-block-tracks-editor",renderToggle:({isOpen:e,onToggle:t})=>(0,d.jsx)(a.ToolbarButton,{label:__("Text tracks","jetpack"),showTooltip:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:t,icon:g}),renderContent:()=>null!==s?(0,d.jsx)(y,{track:e[s],guid:r,onChange:r=>{const n=[...e];n[s]=r,t(n)},onClose:()=>n(null),onCancel:()=>{t(e.filter(((e,t)=>t!==s))),n(null)},trackExists:t=>-1!==e.filter(((e,t)=>t!==s)).findIndex((e=>e.kind===t.kind&&e.srcLang===t.srcLang)),__next40pxDefaultSize:!0}):(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(a.NavigableMenu,{children:[(0,d.jsx)(k,{tracks:e,onChange:t,guid:r}),(0,d.jsx)(a.MenuGroup,{className:"videopress-block-tracks-editor__add-tracks-container",label:__("Add tracks","jetpack"),children:(0,d.jsx)(a.MenuItem,{icon:u.A,onClick:()=>{(()=>{const r=e.length,s=[...e];s[r]||(s[r]={}),s[r]={...e[r]},t(s),n(r)})()},children:__("Upload track","jetpack")})})]})})})}},22857:(e,t,r)=>{"use strict";r.d(t,{d:()=>m});var s=r(62410),n=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(51113),c=r(13022),u=r(10790);const __=i.__,d=["image"],p=e=>{const{videoPosterImageUrl:t}=e;return(0,u.jsx)("div",{className:"resumable-upload__editor-thumb-placeholder",children:t?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("img",{src:t,alt:"Poster"}),(0,u.jsx)(l.A,{className:"uploading-editor__play-icon",icon:s.ud})]}):(0,u.jsx)("span",{children:"No Poster Selected"})})},h=e=>{const{onSelectPoster:t,onRemovePoster:r}=e;return(0,u.jsxs)(o.BaseControl,{className:(0,c.A)(e.className,"editor-video-poster-control"),children:[(0,u.jsx)(p,{...e}),(0,u.jsx)(n.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:t,allowedTypes:d,render:({open:e})=>(0,u.jsxs)("div",{className:"poster-selector__buttons",children:[(0,u.jsx)(o.Button,{onClick:r,variant:"link",isDestructive:!0,children:__("Remove Poster Image","jetpack")}),(0,u.jsx)(o.Button,{variant:"secondary",onClick:e,children:__("Select Poster Image","jetpack")})]})})]})},m=e=>{const{file:t,onSelectPoster:r,onRemovePoster:i,videoPosterImageData:c,title:p,onChangeTitle:m,onVideoFrameSelected:g}=e,[f,b]=(0,a.useState)(0),[v,k]=(0,a.useState)(!0),y=(0,a.useRef)(null),x=(0,a.useRef)(null),j=()=>{k(!1)};(0,a.useEffect)((()=>{null!==t&&y&&(y.current.src=URL.createObjectURL(t))}),[t,y]);const w={};return c&&(w.display="none"),(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"uploading-editor",children:[(0,u.jsx)("div",{className:"uploading-editor__summary"}),(0,u.jsxs)("div",{className:"uploading-editor__fields",children:[(0,u.jsx)(o.TextControl,{label:__("Video title","jetpack"),className:"uploading-editor__title",onChange:m,value:p,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,u.jsx)("div",{className:"uploading-editor__content",children:(0,u.jsxs)(o.BaseControl,{__nextHasNoMarginBottom:!0,children:[(0,u.jsx)(o.BaseControl.VisualLabel,{children:__("Video poster (optional)","jetpack")}),v?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"uploading-editor__video-container",children:[(0,u.jsxs)("div",{className:"uploading-editor__video-poster-wrapper",children:[c&&(0,u.jsx)(h,{onSelectPoster:r,onRemovePoster:i,videoPosterImageUrl:c.url}),(0,u.jsx)("video",{ref:y,muted:!0,className:"uploading-editor__video",onDurationChange:e=>{const t=e.target.duration;b(t),y.current&&(y.current.currentTime=t/2)},onError:j,onLoadedMetadata:e=>{e.target.videoHeight||j()},style:w})]}),!c&&(0,u.jsx)(l.A,{className:"uploading-editor__play-icon",icon:s.ud})]}),(0,u.jsx)("span",{style:w,children:(0,u.jsx)(o.RangeControl,{className:"uploading-editor__range",min:"0",step:"0.1",max:f,showTooltip:!1,withInputField:!1,onChange:e=>{g(1e3*e),y.current&&(y.current.currentTime=e)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,u.jsx)("span",{className:"uploading-editor__scrubber-help",style:w,children:(0,a.createInterpolateElement)(__("This is how the video will look. Use the slider to ch
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:r,title:d=l,description:p=null,buttonText:h=u,visible:m=!0,requiredPlan:g,context:f})=>{const[b,v,k]=(0,s._6)(g,e),y=(0,o.useSelect)((e=>{if(p)return p;const t=e("wordpress-com/plans"),r=t&&t.getPlan(g);return r?(0,a.sprintf)(c,r.product_name_short):null}),[p,g]);return y&&(0,i.jsx)(n.cb,{align:t,buttonText:h,checkoutUrl:b,className:r,context:f,description:y,goToCheckoutPage:v,isRedirecting:k,title:d,visible:m})}},23887:(e,t,r)=>{"use strict";r.d(t,{W:()=>s,r:()=>n});const s=({plan:e,blockName:t,context:r,tracks:s})=>{s.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:r})},n=({plan:e,blockName:t,context:r,tracks:s})=>{s.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:r})}},3120:(e,t,r)=>{"use strict";r.d(t,{e:()=>h});var s=r(85985),n=r(94715),o=r(29491),a=r(47143),i=r(86087),l=r(95104),c=r(26845),u=r(23887),d=r(10790);const p=(0,o.createHigherOrderComponent)((e=>t=>{const{name:r,clientId:o,isSelected:p,attributes:h,setAttributes:m}=t||{},g=(0,s.tu)(r);if(!g)return(0,d.jsx)(e,{...t});const f=(0,s.sH)(r),b=(0,s.GT)(r),[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,s.st)(),S=(0,i.useMemo)((()=>({plan:g,blockName:r,context:j,tracks:A})),[g,r,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,_]);const E=(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-${r.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");function h(e,t){return(0,s.tu)(t)?{...e,edit:p(e.edit)}:e}},76047:(e,t,r)=>{"use strict";r.d(t,{k6:()=>o,s6:()=>s,wb:()=>n});const s="jetpack-sidebar",n="document-settings",o="pre-publish"},23162:(e,t,r)=>{"use strict";r.d(t,{A:()=>L});var s=r(96865),n=r(85985),o=r(82201),a=r(56427),i=r(3582),l=r(47143),c=r(14309),u=r(43656),d=r(27723),p=r(10067),h=r.n(p),m=r(44732),g=r(48499),f=r(90062),b=r(50976),v=r(81932),k=r(37215),y=r(76318),x=r(27970),j=r(76047),w=r(45606),_=r(10790);const __=d.__,C=u.PluginPrePublishPanel||c.PluginPrePublishPanel,A=u.PluginDocumentSettingPanel||c.PluginDocumentSettingPanel,S=C,E=A,N=h()("jetpack-ai-assistant-plugin:sidebar"),T=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-usage-panel"]?.available||!1,P=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,I=(0,g.C)("ai-title-optimization-keywords-support"),M=({placement:e,requireUpgrade:t,upgradeType:r,showUsagePanel:n,showFairUsageNotice:o})=>{const{checkoutUrl:i}=(0,s.ON)(),{productPageUrl:c}=(0,m.A)(),d=(0,v.Ul)(),p=(0,l.useSelect)((e=>e(u.store).isEditedPostEmpty()),[]),h=__("Optimize Publishing","jetpack"),g=__("Optimize Title","jetpack"),f=I?g:h;return(0,_.jsxs)(_.Fragment,{children:[o&&(0,_.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__feature-section",children:(0,_.jsx)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,_.jsx)(s.QA,{variant:"muted"})})}),p&&(0,_.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__warning-content",children:(0,_.jsx)(a.Notice,{isDismissible:!1,status:"warning",children:__("The following features require content to work.","jetpack")})}),(0,v.GB)()&&d&&(0,_.jsx)(a.PanelRow,{children:(0,_.jsxs)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:[(0,_.jsx)(a.BaseControl.VisualL
__("You have reached the limit of <strong>%d requests</strong>. <button>Upgrade to continue generating feedback.</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"})});return(0,i.jsx)("p",{children:"vip"===t?g:f})}},1661:(e,t,r)=>{"use strict";r.d(t,{S:()=>s});const s="jetpack-ai-breve"},27180:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(85985),n=r(56427),o=r(29491),a=r(47143),i=r(27723),l=r(51113),c=r(10748),u=r(51609),d=r(29526),p=r(80555),h=r(81932),m=r(36205),g=r(10790);const __=i.__,f=(0,o.compose)((0,a.withSelect)((e=>({blocks:e("core/block-editor").getBlocks(),disabledFeatures:e("jetpack/ai-breve").getDisabledFeatures()}))))((({blocks:e,disabledFeatures:t})=>{const[r,i]=(0,u.useState)(null),{toggleFeature:f,toggleProofread:b,setPopoverHover:v,setHighlightHover:k,setPopoverAnchor:y}=(0,a.useDispatch)("jetpack/ai-breve"),{tracks:x}=(0,s.st)(),j=(0,a.useSelect)((e=>e("jetpack/ai-breve").isProofreadEnabled()),[]),w=(0,u.useCallback)((()=>{if(!j)return;const t=(0,m.M)(e),r=(0,p.A)(t),s="number"==typeof r?r.toFixed(2):null;i(s)}),[e,j]),_=(0,o.useDebounce)(w,250),C=(0,u.useCallback)((e=>t=>{x.recordEvent("jetpack_ai_breve_feature_toggle",{type:e,on:t}),f(e,t)}),[x,f]),A=(0,u.useCallback)((()=>{x.recordEvent("jetpack_ai_breve_toggle",{on:!j}),b()}),[x,j,b]);return(0,u.useEffect)((()=>{_()}),[_]),(e=>{const[t,r]=(0,u.useState)(!1);t||(e(),r(!0))})(w),(0,u.useEffect)((()=>{v(!1),k(!1),y({target:null,virtual:null})}),[v,k,y,j,t]),(0,g.jsxs)("div",{className:"jetpack-ai-proofread",children:[(0,g.jsx)(n.PanelRow,{children:(0,g.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,g.jsx)(n.ToggleControl,{checked:j,onChange:A,label:__("Show issues & suggestions","jetpack"),__nextHasNoMarginBottom:!0})})}),j&&(0,g.jsx)(n.PanelRow,{children:(0,g.jsxs)(n.Card,{size:"small",className:"jetpack-ai__write-brief-card",children:[(0,g.jsx)(n.CardBody,{size:"small",children:(0,g.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,g.jsx)("div",{className:"feature-checkboxes-container",children:d.A.map((e=>(0,h.Ur)(e.config.name)&&(0,g.jsx)(n.CheckboxControl,{className:j?"":"is-disabled",disabled:!j,"data-breve-type":e.config.name,label:e.config.title,checked:!t.includes(e.config.name),onChange:C(e.config.name),__nextHasNoMarginBottom:!0},e.config.name)))})})}),(0,g.jsx)(n.CardFooter,{size:"small",className:"jetpack-ai-proofread__grade-level-container",children:null===r?(0,g.jsx)("p",{className:"jetpack-ai-proofread__help-text",children:__("Write to see your grade level.","jetpack")}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"jetpack-ai-proofread__grade-label",children:[r," ",__("Reading grade score","jetpack")]}),(0,g.jsx)(n.Tooltip,{text:__("To make it easy to read, aim for level 812","jetpack"),children:(0,g.jsx)(l.A,{icon:c.A,size:20})})]})})]})})]})}))},64949:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c,jp:()=>i,zz:()=>a});var s=r(27723),n=r(53817),o=r(80811);const __=s.__,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=new RegExp(`\\b(${Object.keys(o.A).map(n.N).join("|")})\\b`,"gi");function c(e){const t=e.matchAll(l),r=[];for(const e of t){const t=e[0].trim();r.push({text:t,suggestion:o.A[t],startIndex:e.index,endIndex:e.index+t.length})}return r}},80811:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s={"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
2025-04-25 12:30:07 +02:00
// Translators: %1$d is the number of images with alt text, %2$d is the total number of images.
2025-07-27 19:58:08 +02:00
__("Alt text added to %1$d of %2$d images","jetpack"),t.length,e.length)):v(__("Alt text added to all images","jetpack")):v("")}),[]);const x=(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,r)=>{"use strict";function s(e){return{type:"SET_BUSY",isBusy:e}}function n(e){return{type:"SET_TITLE_BUSY",isBusy:e}}function o(e){return{type:"SET_DESCRIPTION_BUSY",isBusy:e}}function a(e){return{type:"SET_IS_TOGGLING_AUTO_ENHANCE",isToggling:e}}function i(e){return{type:"SET_IS_AUTO_ENHANCE_ENABLED",isEnabled:e}}function l(e,t){return{type:"SET_IMAGE_BUSY",clientId:e,isBusy:t}}function c(e,t){return{type:"SET_IMAGE_FAILED",clientId:e,failed:t}}function u(e,t){return{type:"SET_FEATURE_ENABLED",feature:e,enabled:t}}r.r(t),r.d(t,{setBusy:()=>s,setDescriptionBusy:()=>o,setFeatureEnabled:()=>u,setImageBusy:()=>l,setImageFailed:()=>c,setIsAutoEnhanceEnabled:()=>i,setIsTogglingAutoEnhance:()=>a,setTitleBusy:()=>n})},16204:(e,t,r)=>{"use strict";r.d(t,{M:()=>d});var s=r(97999),n=r(85985),o=r(47143),a=r(4167),i=r(6363),l=r(49824),c=r(16886);let u=!1;try{if(!(0,s.isSimpleSite)()){const e=(0,o.select)(n.Ft).getJetpackModules()["seo-tools"],t=e&&"ai_seo_enhancer_enabled"in e.options;u=t&&e.options?.ai_seo_enhancer_enabled?.current_value}}catch{u=!1}const d=(0,o.createReduxStore)("jetpack/seo-enhancer",{reducer:l.A,selectors:c,actions:i,initialState:function(){const e=a.G.reduce(((e,t)=>(e[t]=!0,e)),{});try{const t=localStorage.getItem("jetpack-seo-enhancer-features"),r=t?JSON.parse(t):{};for(const t of a.G)e[t]=r[t]??!0}catch{}return{isBusy:!1,isTogglingAutoEnhance:!1,isAutoEnhanceEnabled:u,busyImages:{},failedImages:{},features:e}}()});(0,o.register)(d)},49824:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s=function(e,t){let r=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":return r={...e,features:{...e.features,[t.feature]:t.enabled}},s=r.features,localStorage.setItem("jetpack-seo-enhancer-features",JSON.stringify(s)),r;default:return e}var s}},16886:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getEnabledFeatures:()=>m,hasImageFailed:()=>d,isAnyImageBusy:()=>u,isAutoEnhanceEnabled:()=>l,isBusy:()=>n,isDescriptionBusy:()=>a,isImageAltTextFeatureEnabled:()=>g,isImageBusy:()=>c,isTitleBusy:()=>o,isTogglingAutoEnhance:()=>i});var s=r(47143);function n(e){return e.isBusy}function o(e){return e.isTitleBusy}function a(e){return e.isDescrip
2023-12-07 09:44:11 +01:00
// translators: %1$d: number of days until the next usage count reset
2025-07-27 19:58:08 +02:00
__("Requests will reset to <strong>%1$d</strong> on %2$s.","jetpack"),l,d),{strong:(0,c.jsx)("strong",{})}));const b=r/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)(s.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,r)=>{"use strict";r.d(t,{A:()=>v});var s=r(96865),n=r(3924),o=r(97999),a=r(85985),i=r(56427),l=r(38443),c=r(86087),u=r(27723),d=(r(51609),r(75956)),p=r(93471),h=r(10790);const __=u.__,m=e=>e?(0,l.gmdateI18n)("F j",e):null,g=(e,t)=>e===a._X?__("Upgrade","jetpack"):t?(0,u.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$d: an integer, the number of requests to upgrade to on the next tier
2025-07-27 19:58:08 +02:00
__("Get %1$d requests","jetpack"),t):__("Get more requests","jetpack"),f=()=>{const e=(0,n.A)("jetpack-ai-tiers-more-requests-contact"),{autosaveAndRedirect:t,isRedirecting:r}=(0,a.ZR)(e);return{contactUsURL:e,autosaveAndRedirectContactUs:t,isRedirectingContactUs:r}};function b({isOverLimit:e,requestsCount:t,requestsLimit:r,nextStart:s,planType:n,loading:o,canUpgrade:l,showContactUsCallToAction:c,nextLimit:u,contactUsURL:d,handleContactUsClick:f,checkoutUrl:b,handleUpgradeClick:v}){const k=g(n,u),y=m(s);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:r,nextResetDate:y,planType:n,loading:o}),!o&&(n===a._X||n===a.ds)&&l&&(0,h.jsxs)("div",{className:"jetpack-ai-usage-panel-upgrade-button",children:[c&&(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:d,onClick:f,children:__("Contact Us","jetpack")})]}),!c&&(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Upgrade your Jetpack AI plan","jetpack"),href:b,onClick:v,children:k})]})]})})}function v({placement:e=null}){const{checkoutUrl:t}=(0,s.ON)(),{contactUsURL:r}=f(),{tracks:n}=(0,d.A)(),i=(0,a.CP)(),{requestsCount:l,requestsLimit:u,isOverLimit:p,usagePeriod:m,currentTier:g,nextTier:v,loading:k}=(0,s.yM)(),y=(0,a.Bd)(g),x=(0,c.useCallback)((()=>{n.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:g?.slug,requests_count:l,...e?{placement:e}:{}})}),[n,g,l,e]),j=(0,c.useCallback)((()=>{n.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:g?.slug,requests_count:l,...e?{placement:e}:{}})}),[n,g,l,e]),w=(0,o.isWpcomPlatformSite)()&&y===a.ds&&!v;return(0,h.jsx)(b,{isOverLimit:p,requestsCount:l,requestsLimit:u,nextStart:m?.nextStart,nextLimit:v?.limit,planType:y,loading:k,canUpgrade:i,showContactUsCallToAction:w,contactUsURL:r,handleContactUsClick:j,checkoutUrl:t,handleUpgradeClick:x})}},56199:(e,t,r)=>{"use strict";r.d(t,{k:()=>s});const s="block_settings_sidebar"},88797:(e,t,r)=>{"use strict";var s=r(85985),n=r(23806);(0,s.vp)(n.U,n.W)},23806:(e,t,r)=>{"use strict";r.d(t,{U:()=>n,W:()=>o});var s=r(23162);const n="ai-assistant-plugin",o={render:s.A}},1176:(e,t,r)=>{"use strict";r.d(t,{N:()=>d});var s=r(96865),n=r(56427),o=r(27723),a=r(51609),i=r.n(a),l=r(2162),c=r(62402),u=r(10790);const __=o.__;function d({minWords:e=10,maxWords:t=100,disabled:r,words:o,onWordsNumberChange:a,language:d,onLanguageChange:p,tone:h,onToneChange:m}){const[g,f]=i().useState(!1);const b=d?.split(" ")[0],v=s.so[b]?.label||__("Language","jetpack"),k=s.oZ[h]?.label||__("Tone","jetpack");return(0,u.jsxs)("div",{className:"jetpack-ai-generate-excerpt-control",children:[(0,u.jsxs)(n.BaseControl,{className:"jetpack-ai-generate-excerpt-control__header",__nextHasNoMarginBottom:!0,children:[(0,u.jsx)(n.BaseControl.VisualLabel,{children:__("Settings","jetpack")}),(0,u.jsx)(n.Button,{label:__("Advanced AI options","jetpack"),icon:s.cj,onClick:function(){f((e=>!e))},"aria-pressed":g,isSmall:!0})]}),g&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(l.HU,{disabled:r,onChange:p,value:d,label:v}),(0,u.jsx)(c.hN,{disabled:r,label:k,value:h,onChange:m})]}),(0,u.jsx)(n.RangeControl,{label:__("Desired length","jetpack"),value:o,onChange:a,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:r,__next40pxDefaultSize:!0})]})}},25101:(e,t,r)=>{"use strict";var s=r(85985),n=r(47143),o=r(43656),a=r(52619),i=r(10067),l=r.n(i),c=r(54681),u=r(10821),d=r(33792);const p=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){return t!==c.name?e:(0,u.Bi)()?((0,s.vp)(d.s,d.$),p("Registered AI Excerpt plugin"),(0,(0,n.dispatch)(o.store).removeEditorPanel)("post-excerpt"
2023-09-26 10:24:36 +02:00
// Translators: %1$s is the number of words in the excerpt.
2025-07-27 19:58:08 +02:00
_n("%1$s word","%1$s words",L,"jetpack"),L),D="requesting"===N||"suggesting"===N||"done"===N&&!y,F="requesting"===N||"suggesting"===N,z=F||"done"===N;const{requireUpgrade:O,isOverLimit:U}=(0,s.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=>h({excerpt:e}),help:L?R:null,value:M,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:[T?.code&&"error_quota_exceeded"!==T.code&&(0,g.jsx)(i.Notice,{status:T.severity,isDismissible:!1,className:"jetpack-ai-assistant__error",children:T.message}),U&&(0,g.jsx)(s.Hb,{placement:"excerpt-panel"}),(0,g.jsx)(m.N,{words:v,onWordsNumberChange:e=>{k(e),x(!0)},language:j,onLanguageChange:e=>{w(e),x(!0)},tone:_,onToneChange:e=>{C(e),x(!0)},disabled:F||O}),(0,g.jsx)(i.BaseControl,{help:I?.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(){h({excerpt:e}),r.recordEvent("jetpack_ai_assistant_block_discard",{feature:"jetpack-ai-content-lens",model:B}),P()},variant:"secondary",isDestructive:!0,disabled:"done"!==N||O,children:__("Discard","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){h({excerpt:E}),r.recordEvent("jetpack_ai_assistant_block_accept",{feature:"jetpack-ai-content-lens",model:B}),P()},variant:"secondary",disabled:"done"!==N||O,children:__("Accept","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){x(!1),P();const e=[{role:"jetpack-ai",context:{type:"ai-content-lens",contentType:"post-excerpt",postId:t,words:v,language:j,tone:_,content:`Post content:\n${I}\n`}}];f(),A(e,{feature:"jetpack-ai-content-lens",model:B})},variant:"secondary",isBusy:F,disabled:D||O||!I,children:__("Generate","jetpack")})]})})]})]})}const b=()=>{if((0,l.useSelect)((e=>{const{getCurrentPostType:t}=e(c.store),r=t();return"wp_template"===r||"wp_template_part"===r||"wp_block"===r}),[]))return null;const e=e=>{const t=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,r)=>{"use strict";r.d(t,{$:()=>o,s:()=>n});var s=r(33251);const n="ai-content-lens",o={render:s.g}},31009:(e,t,r)=>{"use strict";r.d(t,{m:()=>l});var s=r(3924),n=r(85985),o=r(56427),a=r(27723),i=r(10790);const __=a.__,l=({changeStatus:e,isLoading:t,isModuleActive:r})=>{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:r||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,s.A)("jetpack-support-likes"),children:__("Learn more about Jetpack Likes.","jetpack")})})]})}},79013:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var s=r(50723),n=r(11876),o=r(56427),a=r(10790);const i=()=>(0,a.jsx)(s.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)(n.A,{width:"100%",height:30})}),(0,a.jsx)(o.FlexItem,{children:(0,a.jsx)(n.A,{width:"100%",height:90})})]})})})},24938:(e,t,r)=>{"use st
__("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"),r(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,r)=>{"use strict";r.d(t,{P:()=>a});var s=r(56427),n=r(27723),o=(r(51609),r(10790));const __=n.__,_n=n._n,a=({suggestedLimit:e,value:t,label:r,...a})=>{const i=!e||t.length<=e?(0,n.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
_n("%d character","%d characters",t.length,"jetpack"),t.length):(0,n.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
__("Its 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)(s.TextareaControl,{__nextHasNoMarginBottom:!0,label:r,help:i,value:t,...a})})}},92411:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(85985),n=r(86087),o=r(27723),a=r(99463),i=r(53189),l=r(10790);const __=o.__,c=!0===(0,s.FB)("ai-seo-enhancer")?.available;class u extends n.Component{onMessageChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props,t=__("Write a description…","jetpack"),r=__("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?r:t,suggestedLimit:156,rows:4})}}const d=(0,i.m)("advanced_seo_description")(u)},44921:(e,t,r)=>{"use strict";var s=r(85985),n=r(37802);(0,s.vp)(n.U,n.W)},37802:(e,t,r)=>{"use strict";r.d(t,{U:()=>S,W:()=>M});var s=r(97999),n=r(85985),o=r(82201),a=r(56427),i=r(3582),l=r(47143),c=r(14309),u=r(43656),d=r(86087),p=r(27723),h=r(13022),m=r(90062),g=r(89870),f=r(12430),b=r(77682),v=r(96012),k=r(76262),y=r(51626),x=r(24294),j=r(92411),w=r(5664),_=r(9411),C=r(80151),A=r(10790);const __=p.__,S="seo",E=u.PluginPrePublishPanel||c.PluginPrePublishPane,N=u.PluginPostPublishPanel||c.PluginPostPublishPanel,T="function"==typeof(0,l.select)(u.store).isPublishSidebarOpened,P=!0===(0,n.FB)("ai-seo-enhancer")?.available&&T,B=!(0,s.isSimpleSite)(),I=()=>{const{isLoadingModules:e,isChangingStatus:t,isModuleActive:r,changeStatus:c}=(0,n.q7)("seo-tools"),p=(0,l.useSelect)((e=>e(u.store).isPublishSidebarOpened?.()),[]),{updateSeoData:S,isBusy:I}=(0,v.X)(),M=(0,l.useSelect)((e=>{const t=e(u.store).getCurrentPostType(),r=e(i.store).getPostType(t);return r?.viewable}),[]),L=(0,d.useRef)(!1),{isEnabled:R,isToggling:D}=(0,b.S)(),{closePublishSidebar:F}=(0,l.useDispatch)(u.store);(0,d.useEffect)((()=>{P&&p&&!L.current&&!I&&R&&!D&&B&&T&&S({trigger:"auto"}),L.current=p}),[p,S,I,R,D]);if(!M)return null;const z=(0,n.tu)("advanced-seo"),O=(0,s.isWpcomPlatformSite)(),U=!(0,n.tu)("ai-seo-enhancer"),H={title:__("SEO","jetpack")};if(O&&!1!==z)return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(m.A,{children:(0,A.jsx)(a.PanelBody,{className:"jetpack-seo-panel",...H,initialOpen:!1,children:(0,A.jsx)(x.A,{requiredPlan:z})})})});if(!r)return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(m.A,{children:(0,A.jsx)(a.PanelBody,{className:"jetpack-seo-panel",...H,initialOpen:!1,children:e?(0,A.jsx)(y.G,{}):(0,A.jsx)(k.l,{changeStatus:c,isModuleActive:r,isLoading:t})})})});const V={icon:(0,A.jsx)(o.jt,{}),title:__("SEO","jetpack"),initialOpen:P};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.A,{children:(0,A.jsxs)(a.PanelBody,{className:"jetpack-seo-panel",...H,children:[P&&U&&(0,A.jsx)(g.k,{placement:"jetpack-sidebar",disableAutoEnhance:!B}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(C.A,{})}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(j.A,{})}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(w.A,{})})]})}),(0,A.jsx)(E,{...V,children:(0,A.jsxs)("div",{className:"jetpack-seo-panel",children:[P&&U&&(0,A.jsx)(g.k,{placement:"jetpack-prepublish-sidebar",disableAutoEnhance:!B}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(C.A,{})}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(j.A,{})}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(w.A,{})})]})}),P&&(0,A.jsx)(N,{...V,children:(0,A.jsx)("div",{className:"jetpack-seo-panel",children:(0,A.jsx)(f.A,{onEdit:async()=>{await F(),(0,_.k)()}})})})]})},M={render:()=>(0,A.jsx)(I,{})}},5664:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(56427),n=r(27723),o=(r(51609),r(53189)),a=r(10790);const __=n.__,i=(0,o.m)("jetpack_seo_noindex")((({metaValue:e,updateMetaValue:t})=>(0,a.jsx)(s.ToggleControl,{label:__("Hide page from search engines","jetpack"),help:__("If selected, a
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2025-07-27 19:58:08 +02:00
__("%s / month","jetpack"),o);case"1 year":return(0,i.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2025-07-27 19:58:08 +02:00
__("%s / year","jetpack"),o);case"one-time":return o}return(0,i.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount, plan interval
2025-07-27 19:58:08 +02:00
__("%1$s / %2$s","jetpack"),o,r)}function v({onClose:e,product:t}){const{selectedProductIds:r,setSelectedProductIds:s}=(0,h.B)(),{id:n,title:a}=t,i=r&&r.includes(n),c=i?l.A:void 0,u=t?" "+b(t):null;return(0,f.jsxs)(o.MenuItem,{icon:c,onClick:t=>{t.preventDefault();const o=i?r.filter((e=>e!==n)):[...r,n];s(o),e()},selected:i,value:n,children:[a," : ",u]})}function k({onClose:e}){const{clientId:t,productType:r}=(0,h.B)(),s=(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:s&&(0,f.jsx)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${s}#add-new-payment-plan`,children:(0,g.W)("add a new product",r)})});return(0,f.jsx)(o.MenuItem,{onClick:t=>{t.preventDefault(),n(),setTimeout((()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()}),100),e()},children:(0,g.W)("add a new product",r)})}function y(){const{products:e,productType:t,selectedProductIds:r}=(0,h.B)(),s=(0,a.useSelect)((e=>e(d.M).getSelectedProducts(r)),[r]);let i=null,l=c.A;return s.length>1?i=__("Multiple products selected","jetpack"):1===s.length&&(i=b(s[0])),s.length!=s.length&&(i=(0,g.W)("product not found",t),l=u.A),(0,f.jsx)(n.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,f.jsx)(o.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:l,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,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(94715),n=r(47143),o=r(14309),a=r(59340);function i(e){const t=(0,a.AU)(),{selectBlock:r}=(0,n.useDispatch)(s.store),{enableComplementaryArea:i}=(0,n.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,n.useDispatch)(o.store);return()=>{switch(e&&r(e),t){case a.O3:return i("core/edit-site","edit-site/block-inspector");case a.RZ:return i("core/edit-widgets","edit-widgets/block-inspector");default:l(),i("core/edit-post","edit-post/block")}}}},1990:(e,t,r)=>{"use strict";r.d(t,{G:()=>l,W:()=>a});var s=r(27723),n=r(29726);const __=s.__,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]:__("The subscribe button will be hidden from your visitors until
2023-12-07 09:44:11 +01:00
// translators: %1$s: first category name, %2$s: second category name
2025-07-27 19:58:08 +02:00
a=(0,c.sprintf)(__("%1$s and %2$s","jetpack"),...o);else{const e=o.slice(0,-1).join(`${__(",","jetpack")} `),t=o[o.length-1];a=(0,c.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$s: a comma-separated list of category names except for the last one, %2$s: the name of the last category
2025-07-27 19:58:08 +02:00
__("%1$s, and %2$s","jetpack"),e,t)}return a})(r,t),o=void 0===s?"0":s.toLocaleString();return e?(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-07-27 19:58:08 +02:00
_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).",s??0,"jetpack"),n,o):(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-07-27 19:58:08 +02:00
_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>).",s??0,"jetpack"),n,o)};function f(e,t){return(0,s.getAdminUrl)(`admin.php?page=stats#!/stats/email/opens/day/${t}/${e}`)}const b=function({accessLevel:e,prePublish:t=!1}){const r=(0,a.useSelect)((e=>e("core/block-editor").getBlocks().some((e=>e.name===u.name)))),{isScheduledPost:s,isPostOlderThanADay:b,postCategories:v,postId:k,postMeta:y}=(0,a.useSelect)((e=>{const{isCurrentPostScheduled:t,getEditedPostAttribute:r,getCurrentPost:s}=e(i.store),n=s()?.status,o=new Date(s()?.date),a=new Date(Date.now()-864e5);return{isScheduledPost:t(),isPostOlderThanADay:"publish"===n&&o<a,postCategories:r("categories"),postId:s()?.id,postMeta:r("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:r,getNewsletterCategoriesSubscriptionsCount:s,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:r(),newsletterCategorySubscriberCount:s(),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")})});const N=e===d.P2.paid_subscribers.key,T=t||s,P=(0,p.Yc)({accessLevel:e,subscribers:b?E:j,paidSubscribers:S,postHasPaywallBlock:r});let B;return B=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:r,reachCount:s})=>{const n=s.toLocaleString();return e?t&&!r?(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>.",s,"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>.",s,"jetpack"),n):t&&!r?(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>.",s,"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>.",s,"jetpack"),n)})({futureTense:T,isPaidPost:N,postHasPaywallBlock:r,reachCount:P}),(0,m.jsx)("p",{children:(0,l.createInterpolateElement)(B,{strong:(0,m.jsx)("strong",{}),link:(0,m.jsx)("a",{href:f(x,k)})})})}},64234:(e,t,r)=>{"use strict";r.d(t,{Qu:()=>l,fI:()=>c,mf:()=>u});var s=r(56427),n=r(86087),o=r(27723),a=r(37906),i=r(10790);const __=o.__,l=e=>{const t="https://wordpress.com/earn/payments/"+location.hostname;return e?t:t+"#add-tier-plan"},c=(e,t)=>"public"!==e&&t!==a.P2.everybody.key,u=()=>(0,i.jsx)(s.Notice,{status:"warning",isDismissible:!1,className:"edit-post-post-misconfiguration__warning",children:(0,n.createInterpolateElement)(__("Youll need to change the posts access to Everybody or visibility to Public.<br/><br/>Subscribers arent able to view private or password-protected posts.","jetpack"),{br:(0,i.jsx)("br",{})})})},14435:(e,t,r)=>{"use strict";var s=r(97999),n=r(85985),o=r(1455),a=r.n(o),i=r(47143),l=r(27723);r(692);const __=l.__;function c(){const e=(0,n.GE)();return window?.location&&e?(0,s.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(new URLSearchParams(window.location.search).get("plan_upgraded")){let e=null;e:try{if((0,s.isSimpleSite)())break e;const t=await a()({path:"/jetpack/v4/site"});e=JSON.parse(t.data).plan.product_name}finally{const t=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,r)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(r.p=window.Jetpack_Block_Assets_Base_Url)},59740:(e,t,r)=>{"use strict";var s=r(74997),n=r(47143),o=r(93832),a=r(27734);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)();const e=[];if(c&&c!==l){const t=`<a href="${i}">${l}</a>`;e.push((0,s.createBlock)("core/quote",{value:`<p>${c}</p>`,citation:t}))}u&&e.push((0,s.createBlock)("core/quote",{value:u,citation:d})),e.push((0,s.createBlock)("core/embed",{url:i,type:"wp-embed"})),(0,n.dispatch)("core/editor").resetEditorBlocks(e)})()},94375:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,M:()=>l});var s=r(85985),n=r(74997),o=r(52619);const a="jetpack/";function i(e,t,r=[],i=!0){const l="string"==typeof e?e:e.name,c=l.startsWith(a),u=c?l.slice(a.length):l,{available:d,details:p,unavailableReason:h}=(0,s.FB)(u),m=(0,s.aq)(h,p),g=i||c?a:"";if(!d&&!m)return!1;const f=g+u,b=(0,n.registerBlockType)("object"==typeof e?e:f,t);return m&&(0,o.addFilter)("editor.BlockListBlock",`${f}-with-has-warning-is-interactive-class-names`,(0,s.BT)(f)),r.forEach((e=>(0,n.registerBlockType)(g+e.name,e.settings))),b}function l(e,t,r,n){return i(e,{...t,icon:(0,s.Cq)(e),attributes:e.attributes||{}},r,n)}},62289:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(5573),n=r(10790);const o=(e,t=24,r=24,o="0 0 24 24")=>(0,n.jsxs)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:r,viewBox:o,children:[(0,n.jsx)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e]})},64882:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(94715),n=r(13022),o=r(10790);const a=(e,t,r,a,i,l={})=>{const{isSelected:c}=t,u=t.attributes[e];return l.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)(s.PlainText,{value:u,placeholder:r,"aria-label":r,onChange:i})]})}},21929:(e,t,r)=>{"use strict";var s=r(47143),n=r(27723);r(692);const __=n.__;if("undefined"!=typeof window&&window.location){const e=new URLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,s.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,s.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},56145:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(1455),n=r.n(s),o=r(66087);function a(e,t=o.noop){return t(!0),new Promise(((r,s)=>{n()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then((n=>{t(!1);const o=n.status?parseInt(n.status,10):null;o&&o>=400?s():r(n.url||e)}),(()=>{t(!1),s()}))}))}},26247:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(39384),n=r(97999);const o=()=>{const{isUserConnected:e}=(0,s.useConnection)();return(0,n.isSimpleSite)()||e}},89303:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(86087);const n=e=>{const t=(0,s.useRef)(void 0);return(0,s.useEffect)((()=>{t.current=e}),[e]),t.current};function o({attributes:e,disableEffects:t=!1,setAttributes:r}){const{align:o,width:a}=e,i=n(o);(0,s.useEffect)((()=>{if(t)return;i!==o&&("left"===o||"right"===o)&&a?.includes("%")&&r({width:void 0})}),[o,t,i,r,a])}},27734:(e,t,r)=>{"use strict";r.d(t,{O:()=>n});var s=r(47143);const n=async()=>new Promise((e=>{if((0,s.select)("core/editor").isCleanNewPost()||(0,s.select)("core/block-editor").getBlocks().length>0)return void e();const t=setTimeout((()=>{r(),e()}),2e3),r=(0,s.subscribe)((()=>{(0,s.select)("core/block-editor").getBlocks().length>0&&(clearTimeout(t),r(),e())}))}))},38062:(e,t,r)=>{"use strict";r.d(t,{D:()=>d,s:()=>p});var s=r(56427),n=r(86087),o=r(27723),a=r(13022),i=r(10790);const __=o.__,l=[{value:"%",label:"%",default:100},{value:"px",label
2022-12-15 17:41:53 +01:00
// translators: %s: Price
2025-07-27 19:58:08 +02:00
__("Minimum allowed price is %s.","jetpack"),(0,s.vv)(k,b)),m),void n(!1);if(!(0,c.kF)(b,v))return(0,d.S)((0,l.W)("product requires a valid price",t),m),void n(!1);try{const s=await o()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),a={id:s.id,title:s.title,interval:s.interval,price:s.price,currency:s.currency},c=m.select(u.EF).getProducts();i(p(c.concat([a]))),r([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,r)=>{"use strict";r.d(t,{EF:()=>s,JA:()=>o,an:()=>n,gI:()=>a,ky:()=>i});const s="jetpack/membership-products",n=0,o=1,a=2,i="tier"},16521:(e,t,r)=>{"use strict";r.d(t,{M:()=>c});var s=r(47143),n=r(66314),o=r(3696),a=r(91497),i=r(18410),l=r(92955);const c=(0,s.createReduxStore)(o.EF,{actions:n,reducer:a.A,resolvers:i,selectors:l,__experimentalUseThunks:!0});(0,s.register)(c)},91497:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const s={products:[],apiState:r(3696).an,connectUrl:null,siteSlug:"",connectedAccountDefaultCurrency:"",subscriberCounts:{totalSubscribers:null,socialFollowers:null,emailSubscribers:null,paidSubscribers:null},newsletterCategories:{enabled:!1,categories:[]}};function n(e=s,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}}return e}},18410:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchNewsletterCategoriesSubscriptionsCount:()=>x,getNewsletterCategories:()=>S,getNewsletterCategoriesSubscriptionsCount:()=>E,getNewsletterTierProducts:()=>w,getProducts:()=>_,getSubscriberCounts:()=>C,getTotalEmailsSentCount:()=>A});var s=r(97999),n=r(1455),o=r.n(n),a=r(43656),i=r(93832),l=r(29726),c=r(1990),u=r(56539),d=r(27574),p=r(66314),h=r(3696),m=r(34884);const g="membership-products-resolver-getProducts",f="membership-products-resolver-getSubscriberCounts",b="membership-products-resolver-getTotalEmailsSentCount",v="membership-products-resolver-getNewsletterCategories",k="membership-products-resolver-getNewsletterCategoriesSubscriptionsCount";let y=!1;const x=async e=>{const t=await o()({path:`/wpcom/v2/newsletter-categories/count?term_ids=${e.join(",")}`,method:"GET"});if(!t||"object"!=typeof t)throw new Error("Unexpected API response");const r=t?.errors&&Object.values(t.errors)?.[0]?.[0];if(r)throw new Error(r);return t},j=(e,t,r)=>{if(e.length>0)return;const s=r.getProductsNoResolver()[0]?.id;s&&t([s])},w=(e=l._$,t=[],r=()=>{})=>_(e,t,r,!1),_=(e=l._$,t=[],r=()=>{},s=!0)=>async({dispatch:n,registry:l,select:f})=>{if(await u.A.blockExecution(g),y)return void j(t,r,f);const b=u.A.acquire(g);try{const u=await(async()=>{const e=(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}),r=await o()({path:t,method:"GET"});if(!r&&"object"!=typeof r)throw new Error("Unexpected API response");const s=r?.errors&&Object.values(r.errors)?.[0]?.[0];if(s)throw new Error(s);return r})();((e,t,r)=>{const s=t.select(a.store).getCurrentPostId();r((0,p.setConnectUrl)((0,d.A)(s,e.connect_url))),