PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | _inc/blocks/editor-beta.js +6 -6 16.3 → 16.3-beta View file →
@@ -61,14 +61,14 @@
61 61 _n("visitor","visitors",parseInt(A),"jetpack",0),T=/* Translators: Number of views */
62 62 _n("hit","hits",parseInt(A),"jetpack",0);return(0,h.jsxs)("div",{...C,children:[(0,h.jsx)(a.InspectorControls,{children:(0,h.jsx)(d.z,{attributes:e,setAttributes:n})}),(0,h.jsx)("div",{className:t,children:s||null===y?(0,h.jsx)("p",{className:"jetpack-blog-stats__loading",children:__("Loading stats…","jetpack")}):(0,h.jsxs)("p",{children:[(0,h.jsxs)("span",{children:[(0,o.ZV)(A)," "]}),(0,h.jsx)(a.RichText,{tagName:"span",placeholder:"visitors"===b?E:T,value:f,allowedFormats:["core/bold","core/italic","core/link"],onChange:e=>n({label:e})})]})})]})};n.d(t,["A",0,m])},95184(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(35116),i=n(33955);n(5955);(0,o.M)(s,{edit:i.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,r.createBlock)("core/heading",{content:e.raw.title,level:3}):null,n=(0,r.createBlock)("jetpack/blog-stats",{label:e.raw.hits});return t?[t,n]:n}}]}})},26584(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(56427),i=n(27723),a=n(57273),c=n(35116),l=n(10790);const __=i.__;n.d(t,["k",0,({className:e,isLoading:t,changeStatus:n})=>{const i=(0,r.isWoASite)()?"https://wordpress.com/support/stats/":"https://jetpack.com/support/jetpack-stats/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(s.Placeholder,{icon:(0,o.sh)(c),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:c.title,children:[(0,l.jsx)(s.Button,{disabled:t,isBusy:t,onClick:()=>n(!0),variant:"secondary",children:t?__("Activating Stats","jetpack"):__("Activate Stats","jetpack",0)}),(0,l.jsx)("div",{children:(0,l.jsx)(a.N,{openInNewTab:!0,href:i,children:__("Learn more about the Stats module.","jetpack")})})]})})}])},29091(e,t,n){"use strict";var r=n(1455),o=n.n(r),s=n(94715),i=n(56427),a=n(47143),c=n(86087),l=n(27723),u=n(93832),d=n(13022),p=(n(23227),n(54919)),h=n(9075),m=n(10790);const __=l.__,_x=l._x;const g=(0,i.withNotices)(function({attributes:e,noticeOperations:t,noticeUI:n,setAttributes:r}){const g=(0,c.useRef)(!1),{answersLink:f,answersLinkText:b,gravatars:v,promptFetched:y,promptId:k,promptLabel:w,promptText:x,showLabel:_,showResponses:j,tagsAdded:C,isBloganuary:A}=e,S=(0,s.useBlockProps)({className:"jetpack-blogging-prompt"});(0,h.J)(k,C,e=>r({tagsAdded:e}));const E=(0,a.useSelect)(e=>{const{getEntityRecord:t,hasFinishedResolution:n}=e("core"),r=t("root","site")?.language||"en_US";return n("getEntityRecord",["root","site"])?r:null},[]);(0,c.useEffect)(()=>{if(!E||g.current||y)return;const e=()=>{r({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};let n="/wpcom/v3/blogging-prompts";if(k)n+="/"+encodeURIComponent(k);else{const e=new Date;n+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}n=(0,u.addQueryArgs)(n,{_locale:E,force_year:(new Date)?.getFullYear()}),g.current=!0,o()({path:n}).then(e=>{const t=k?e:e[0],n=(0,p.i)(E);r({answersLink:t.answered_link+`?locale=${n}`,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(n=>{r({promptFetched:!0});const o="rest_post_invalid_id"===n.code&&k?(s=k,(0,m.jsxs)(m.Fragment,{children:[(0,l.sprintf)(/* translators: %d is the prompt id. */
63 63 __("Prompt with id %d not found.","jetpack"),s)," ",(0,m.jsx)(i.Button,{variant:"link",onClick:e,children:__("Reset prompt","jetpack")})]})):(t=>(0,m.jsxs)(m.Fragment,{children:[(0,l.sprintf)(/* translators: %s is the error message. */
64 64 __("Error while fetching prompt: %s","jetpack"),t)," ",(0,m.jsx)(i.Button,{variant:"link",onClick:e,children:__("Retry","jetpack")})]}))(n.message);var s;t.removeAllNotices(),t.createErrorNotice(o)})},[g,t,y,k,r,E]);const T=e=>{r({showLabel:e})},N=e=>{r({showResponses:e})},P=(0,d.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":A});return(0,m.jsxs)("div",{...S,children:[n,(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(s.InspectorControls,{children:(0,m.jsxs)(i.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack"),children:[(0,m.jsx)(i.ToggleControl,{label:__("Show prompt label","jetpack"),checked:_,onChange:T,__nextHasNoMarginBottom:!0}),(0,m.jsx)(i.ToggleControl,{label:__("Show other responses","jetpack"),checked:j,onChange:N,__nextHasNoMarginBottom:!0})]})})}),y?(0,m.jsxs)(m.Fragment,{children:[_&&(0,m.jsx)("div",{className:P,children:w}),(0,m.jsx)("div",{className:"jetpack-blogging-prompt__text",children:x}),j&&k&&(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)(i.Spinner,{})})]})});n.d(t,["A",0,g])},87888(e,t,n){"use strict";var r=n(74997),o=n(47143),s=n(27723),i=n(94375),a=n(30552),c=n(32442),l=n(29091),u=n(63757),d=n(94530),p=n(86239),h=n(95444);n(23227),n(75279);const __=s.__,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:l.A,save:h.A,example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View 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,i.M)(c,v);async function y(e){await(0,a.O)();(0,r.getBlockType)("jetpack/blogging-prompt")||await new Promise(e=>{(0,i.M)(c,v),setTimeout(e,0)});const{insertBlocks:t}=(0,o.dispatch)("core/block-editor");t([(0,r.createBlock)("jetpack/blogging-prompt",{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void 0,!1)}g&&b&&y(b)},95444(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(10790);const i=function({attributes:e}){const{answersLink:t,answersLinkText:n,gravatars:i,promptId:a,promptLabel:c,promptText:l,showLabel:u,showResponses:d,isBloganuary:p}=e,h=r.useBlockProps.save({className:"jetpack-blogging-prompt"}),m=(0,o.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":p});return(0,s.jsxs)("div",{...h,children:[u&&(0,s.jsx)("div",{className:m,children:c}),(0,s.jsx)("div",{className:"jetpack-blogging-prompt__text",children:l}),d&&a&&(0,s.jsxs)("div",{className:"jetpack-blogging-prompt__answers",children:[i.map(({url:e})=>e&&(0,s.jsx)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:e},e)),(0,s.jsx)("a",{className:"jetpack-blogging-prompt__answers-link",href:t,target:"_blank",rel:"external noreferrer noopener",children:n})]})]})};n.d(t,["A",0,i])},9075(e,t,n){"use strict";n.d(t,{J:()=>l});var r=n(1455),o=n.n(r),s=n(47143),i=n(86087),a=n(89877);function c(e){const t=(0,a.escapeHTML)(e);return o()({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 l(e,t,n){const{editPost:r}=(0,s.useDispatch)("core/editor"),o=(0,i.useRef)("not-started"),{getEditedPostAttribute:a}=(0,s.useSelect)(e=>e("core/editor"),[]),l=(0,s.useSelect)(e=>e("core/editor").getEditedPostAttribute("type"),[]),u=(0,s.useSelect)(e=>e("core/editor").getEditedPostAttribute("tags")||[],[]),d=(0,s.useSelect)(e=>e("core").getPostType("post")?.taxonomies?.includes("post_tag"),[]),p=(0,i.useMemo)(()=>0===u.length?null:{_fields:"id,name",context:"view",include:u.join(","),per_page:-1},[u]),h=(0,s.useSelect)(e=>0===u.length?[]:e("core").getEntityRecords("taxonomy","post_tag",p)||[],[p,u.length]),m=(0,s.useSelect)(e=>0===u.length||e("core").hasFinishedResolution("getEntityRecords",["taxonomy","post_tag",p]),[p,u.length]);(0,i.useEffect)(()=>{"post"===l&&d&&!t&&m&&e&&Array.isArray(h)&&("not-started"===o.current&&(h.some(e=>e.name&&"dailyprompt"===e.name)&&h.some(t=>t.name&&t.name===`dailyprompt-${e}`)?o.current="fulfilled":(o.current="pending",Promise.all([c("dailyprompt"),c(`dailyprompt-${e}`)]).then(e=>{const t=e.map(e=>e.id),n=a("tags")||[];r({tags:[...n,...t]}),o.current="fulfilled"}).catch(e=>{console.error(e),o.current="rejected"}))),"fulfilled"===o.current&&n(!0))},[r,d,l,e,o,n,h,u,t,m,a])}},59914(e,t,n){"use strict";const r=[n(46186)];n.d(t,["A",0,r])},67805(e,t,n){"use strict";const r={id:{type:"string"},name:{type:"string"},icon:{type:"string",default:n(84954)},is_non_wpcom_site:{type:"boolean",default:!1},url:{type:"string"},description:{type:"string"}};n.d(t,["A",0,r])},46186(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>s.A,supports:()=>i.A});var r=n(94715),o=n(10790),s=n(67805),i=n(13896);n.d(t,["save",0,()=>(0,o.jsx)(r.InnerBlocks.Content,{})])},13896(e,t,n){"use strict";n.d(t,["A",0,{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0,inserter:!1}])},74216(e,t,n){"use strict";var r=n(94715),o=n(56427),s=(n(7738),n(27723)),i=n(10790);const __=s.__;const a=function({className:e,attributes:t,setAttributes:n}){const{icon:s,name:a,description:c}=t,l=(0,r.useBlockProps)({className:e});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("hr",{className:"wp-block-separator jetpack-blogroll-item-divider"}),(0,i.jsxs)("div",{...l,children:[(0,i.jsx)(r.MediaUpload,{multiple:!1,onSelect:e=>{n({icon:e.url})},render:({open:e})=>(0,i.jsx)(o.Button,{variant:"link",onClick:e,style:{padding:0},children:(0,i.jsx)("figure",{children:(0,i.jsx)("img",{className:"blogroll-item-image",onError:e=>{e.target.parentNode.classList.add("empty-site-icon")},src:s,alt:a})})})}),(0,i.jsxs)("div",{className:"jetpack-blogroll-item-content",children:[(0,i.jsx)("a",{children:(0,i.jsx)(r.RichText,{className:"jetpack-blogroll-item-title",value:a,tagName:"p",allowedFormats:["core/italic"],onChange:e=>{n({name:e})},placeholder:__("Enter site title","jetpack")})}),(0,i.jsx)(r.RichText,{className:"jetpack-blogroll-item-description",value:c,onChange:e=>{n({description:e})},placeholder:__("Enter site description","jetpack")})]})]})]})};n.d(t,["A",0,a])},12256(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=(0,o.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,o.jsx)(r.Path,{d:"M12 12.75H21V11.25H12V12.75Z"}),(0,o.jsx)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3 12C3 10.3431 4.34315 9 6 9C7.65685 9 9 10.3431 9 12C9 13.6569 7.65685 15 6 15C4.34315 15 3 13.6569 3 12ZM3.77743 10.8857C4.08602 10.2714 4.64181 9.80266 5.31427 9.61008C5.15499 9.79493 5.01798 10.0132 4.90612 10.2532C4.81521 10.4483 4.73949 10.6605 4.68112 10.8857H3.77743ZM3.58718 11.4C3.53956 11.5922 3.51429 11.7931 3.51429 12C3.51429 12.2069 3.53956 12.4078 3.58718 12.6H4.58166C4.55616 12.4057 4.54286 12.205 4.54286 12C4.54286 11.7949 4.55616 11.5942 4.58166 11.4H3.58718ZM5.10094 11.4C5.0724 11.5917 5.05714 11.7926 5.05714 12C5.05714 12.2074 5.0724 12.4083 5.10094 12.6H6.89907C6.92761 12.4083 6.94286 12.2074 6.94286 12C6.94286 11.7926 6.92761 11.5917 6.89906 11.4H5.10094ZM7.41834 11.4C7.44384 11.5942 7.45714 11.7949 7.45714 12C7.45714 12.2051 7.44384 12.4058 7.41835 12.6H8.41282C8.46044 12.4078 8.48571 12.2069 8.48571 12C8.48571 11.7931 8.46044 11.5922 8.41282 11.4H7.41834ZM8.22257 10.8857H7.31888C7.26051 10.6605 7.18479 10.4483 7.09388 10.2532C6.98202 10.0132 6.845 9.79493 6.68571 9.61007C7.35817 9.80265 7.91398 10.2714 8.22257 10.8857ZM6.78494 10.8857H5.21506C5.25946 10.7382 5.31227 10.5992 5.37226 10.4705C5.5421 10.1061 5.76275 9.83732 5.99999 9.67974C6.23724 9.83732 6.45789 10.1061 6.62775 10.4705C6.68773 10.5992 6.74054 10.7382 6.78494 10.8857ZM3.77743 13.1143H4.68112C4.74269 13.3519 4.82356 13.5749 4.92121 13.7787C5.0301 14.0059 5.16199 14.2132 5.31431 14.3899C4.64184 14.1974 4.08603 13.7286 3.77743 13.1143ZM6.78495 13.1143H5.21506C5.26258 13.2722 5.31973 13.4203 5.38498 13.5564C5.5534 13.9078 5.76894 14.1668 6.00003 14.3203C6.23726 14.1627 6.45791 13.8939 6.62775 13.5295C6.68773 13.4008 6.74054 13.2618 6.78495 13.1143ZM7.09388 13.7468C7.18479 13.5517 7.26052 13.3395 7.31889 13.1143H8.22257C7.91398 13.7286 7.35819 14.1973 6.68574 14.3899C6.84501 14.2051 6.98203 13.9868 7.09388 13.7468Z",strokeWidth:"0.1"})]});n.d(t,["A",0,s])},74618(e,t,n){"use strict";var r=n(94715),o=n(27723),s=n(84954),i=n(59914),a=n(74216),c=n(12256),l=(n(7738),n(10790));const __=o.__,u={apiVersion:3,title:__("Blogroll Item","jetpack"),description:__("Blogroll Item","jetpack"),icon:{src:c.A},category:"grow",parent:["jetpack/blogroll"],keywords:[],supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0,inserter:!1},edit:a.A,attributes:{id:{type:"string"},name:{type:"string"},icon:{type:"string",default:s},is_non_wpcom_site:{type:"boolean",default:!1},url:{type:"string"},description:{type:"string"}},save:()=>{const e=r.useBlockProps.save();return(0,l.jsx)("div",{...e,children:(0,l.jsx)(r.InnerBlocks.Content,{})})},example:{attributes:{}},deprecated:i.A};n.d(t,["UU",0,"blogroll-item","W0",0,u])},25904(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(3582),o=n(27723),s=(n(3010),n(10790));const __=o.__;function i({results:e,onSelect:t,searchInput:n,isLoading:i}){const[a]=(0,r.useEntityProp)("root","site","Blogroll Recommendations");if(i)return(0,s.jsx)("div",{className:"jetpack-blogroll__appender-results",children:(0,s.jsx)("div",{role:"status",children:__("Loading…","jetpack")})});const c=!n?.trim();return(0,s.jsxs)("div",{className:"jetpack-blogroll__appender-results",children:[c&&(0,s.jsx)("div",{"aria-autocomplete":"list",className:"jetpack-blogroll__appender-result-list-header-text",children:__("Suggestions","jetpack")}),0===e.length&&!c&&(0,s.jsxs)("div",{role:"status",className:"jetpack-blogroll__appender-no-results-message",children:[(0,s.jsx)("span",{className:"jetpack-blogroll__appender-no-results-message-main-text",children:__("No results","jetpack")}),(0,s.jsx)("span",{className:"jetpack-blogroll__appender-no-results-message-secondary-text",children:(0,o.sprintf)(/* translators: %s is search query. */
65 -__("No sites found for %s.","jetpack"),n)})]}),e.length>0&&(0,s.jsx)("ul",{"aria-live":"polite",children:e.map((e,n)=>{const r=a?.some?.(t=>t?.id===e?.blog_id)||!1;return(0,s.jsx)("li",{className:"jetpack-blogroll__appender-result-container",children:(0,s.jsxs)("button",{className:"jetpack-blogroll__appender-result-title",disabled:r,onClick:()=>t(e),children:[(0,s.jsx)("div",{className:"jetpack-blogroll__appender-result-image",children:e.site_icon&&(0,s.jsx)("img",{src:e.site_icon,alt:e.name,onError:e=>{e.target.parentNode.classList.add("empty-site-icon")}})}),(0,s.jsxs)("div",{className:"jetpack-blogroll__appender-result-text",children:[(0,s.jsx)("span",{className:"jetpack-blogroll__appender-result-title",children:e.name}),(0,s.jsx)("span",{className:"jetpack-blogroll__appender-result-description",children:e.description})]})]})},`${e.blog_id}-${n}`)})})]})}},10962(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(27723),s=(n(6988),n(10790));const __=o.__;function i({value:e,onChange:t}){return(0,s.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,s.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Search for sites to add","jetpack"),hideLabelFromVision:!0,placeholder:__("Search…","jetpack"),value:e,onChange:e=>t(e)})})}},30413(e,t,n){"use strict";n.d(t,{A:()=>h});var r=n(56427),o=n(47143),s=n(86087),i=n(27723),a=n(60167),c=n(92507),l=n(85101),u=n(25904),d=n(10962),p=(n(22597),n(10790));const __=i.__;function h({isLoading:e,subscriptions:t,clientId:n}){const[i,h]=(0,s.useState)(!1),[m,g]=(0,s.useState)(),[f,b]=(0,s.useState)(""),{insertBlock:v}=(0,o.dispatch)("core/block-editor"),{siteDetails:y,isLoading:k}=(0,c.A)({siteURL:f,subscriptions:t,enabled:f});return e?(0,p.jsx)(r.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.Button,{className:"block-editor-button-blogroll-block-appender",ref:g,icon:a.A,label:__("Add Blogroll Item","jetpack"),onClick:()=>{h(e=>!e)}}),i&&(0,p.jsxs)(r.Popover,{anchor:m,className:"jetpack-blogroll__appender",children:[(0,p.jsx)(d.A,{value:f,onChange:b}),(0,p.jsx)(u.A,{results:y,onSelect:e=>{v((0,l.FN)(e),void 0,n),h(!1)},searchInput:f,isLoading:k})]})]})}},93538(e,t,n){"use strict";var r=n(94715),o=n(74997),s=n(56427),i=n(47143),a=n(86087),c=n(27723),l=n(13022),u=n(2274),d=n(26247),p=n(30413),h=n(32130),m=n(46542),g=n(25688),f=n(85101),b=(n(8400),n(10790));const __=c.__;const v=function({className:e,attributes:t,setAttributes:n,clientId:c}){const{show_avatar:v,show_description:y,open_links_new_window:k,ignore_user_blogs:w,load_placeholders:x}=t,_=(0,d.A)(),{isLoading:j,recommendations:C,errorMessage:A}=(0,h.A)(x),{isLoading:S,subscriptions:E,errorMessage:T}=(0,g.A)({ignore_user_blogs:w});(0,m.b)({clientId:c});const{replaceInnerBlocks:N}=(0,i.dispatch)("core/block-editor");(0,a.useEffect)(()=>{if(x&&C.length){n({load_placeholders:!1});const e=[(0,o.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];N(c,e)}},[C,x,n,c,N]);const P=(0,r.useBlockProps)({className:(0,l.A)(e,{"hide-avatar":!v,"hide-description":!y})});if(!_)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||T;return(0,b.jsxs)("div",{...P,children:[(0,b.jsx)(r.InnerBlocks,{template:[["core/heading",{content:__("Blogroll","jetpack"),level:3}]],allowedBlocks:["jetpack/blogroll-item"],renderAppender:()=>!j&&(0,b.jsx)(p.A,{isLoading:S,subscriptions:E,clientId:c})}),B&&(0,b.jsx)(s.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:B})}),x&&j&&(0,b.jsx)(s.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(s.Spinner,{})}),(0,b.jsx)(r.InspectorControls,{children:(0,b.jsxs)(s.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(s.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>n({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Show description","jetpack"),checked:!!y,onChange:()=>n({show_description:!y}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Open links in a new window","jetpack"),checked:!!k,onChange:()=>n({open_links_new_window:!k}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Hide my own sites","jetpack"),checked:!!w,onChange:()=>n({ignore_user_blogs:!w}),__nextHasNoMarginBottom:!0})]})})]})};n.d(t,["A",0,v])},22475(e,t,n){"use strict";var r=n(94375),o=n(52829),s=n(74618),i=n(93538),a=n(84169);n(8400);(0,r.M)(o,{edit:i.A,save:a.A},[{name:s.UU,settings:s.W0}])},84169(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(10790);const i=function({attributes:{show_avatar:e,show_description:t},className:n}){const i=r.useBlockProps.save({className:(0,o.A)(n,{"hide-avatar":!e,"hide-description":!t})});return(0,s.jsx)("div",{...i,children:(0,s.jsx)(r.InnerBlocks.Content,{})})};n.d(t,["A",0,i])},13818(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(86087),o=n(85101);function s(e,t=!0){const[n,s]=(0,r.useState)(null),[i,a]=(0,r.useState)(null),[c,l]=(0,r.useState)(!1),u=function(e,t=100){const[n,o]=(0,r.useState)(e);return(0,r.useEffect)(()=>{const n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}((0,o.l$)(e),500);return(0,r.useEffect)(()=>{if(l(Boolean(t&&u)),t&&u){const e=new AbortController;return fetch(`https://public-api.wordpress.com/rest/v1.1/sites/${encodeURIComponent(u)}?force=wpcom`,{cache:"force-cache",signal:e.signal}).then(e=>{if(200===e.status)return e.json();e.status}).then(e=>{s(e),l(!1)}).catch(e=>{"AbortError"!==e.name&&a(e)}),()=>e.abort()}},[u,t]),{response:n,error:i,isLoading:c}}},92507(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13818),o=n(85101);function s({siteURL:e,subscriptions:t,enabled:n=!1}){const s=(0,o.l$)(e),{response:i,isLoading:a}=(0,r.Z)(s,Boolean(n)),c=[...i?[{blog_id:i?.ID.toString(),description:i?.description,URL:i?.URL,site_icon:(0,o.ZE)(i?.logo?.url),name:i?.name}]:[],...t].filter(t=>`${t.name}${t.URL}`.match(new RegExp(e,"i")));return 0===c.length&&s&&c.unshift({blog_id:s,description:"",URL:s,site_icon:(0,o.ZE)(null),name:s,is_non_wpcom_site:!0}),{isLoading:a,siteDetails:c}}},32130(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1455),o=n.n(r),s=n(86087),i=n(27723);const __=i.__;function a(e=!1){const[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null),[a,c]=(0,s.useState)([]),l=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{e?(n(!0),i(null),l.current&&l.current.abort(),l.current="undefined"==typeof AbortController?void 0:new AbortController,o()({path:"/wpcom/v2/following/recommendations",global:!0,method:"GET",signal:l.current?.signal}).then(e=>{e.length||i(__("No subscriptions found. You need to follow some sites in order to see results.","jetpack")),c(e)}).catch(e=>{"AbortError"!==e.name&&(e.message?i(e.message):i(__("Whoops, we have encountered an error. Please try again later.","jetpack")))}).finally(()=>{l.current=null,n(!1)})):n(!1)},[e]),{isLoading:t,errorMessage:r,recommendations:a}}},46542(e,t,n){"use strict";var r=n(3582),o=n(47143),s=n(86087),i=n(85101);n.d(t,["b",0,({clientId:e})=>{const[t,n]=(0,s.useState)(!1),{insertBlocks:a}=(0,o.useDispatch)("core/block-editor"),[c,l]=(0,r.useEntityProp)("root","site","Blogroll Recommendations"),u=(0,o.useSelect)(t=>t("core/block-editor").getBlock(e).innerBlocks.filter(({name:e})=>"jetpack/blogroll-item"===e).map(({attributes:e})=>e),[e]);(0,s.useEffect)(()=>{if(!t&&c){const t=c.filter(e=>!u.some(t=>t.id===e.id));if(t.length){const n=t.map(i.dy);a(n,void 0,e)}n(!0)}},[e,c,u,t,a]),(0,s.useEffect)(()=>{void 0!==c&&l(u)},[u])}])},25688(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(1455),o=n.n(r),s=n(86087),i=n(27723),a=n(93832),c=n(85101);const __=i.__;function l({ignore_user_blogs:e}){const[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null),[l,u]=(0,s.useState)([]),d=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{n(!0),i(null),d.current&&d.current.abort(),d.current="undefined"==typeof AbortController?void 0:new AbortController,o()({path:(0,a.addQueryArgs)("/wpcom/v2/following/mine",{ignore_user_blogs:e}),global:!0,method:"GET",signal:d.current?.signal}).then(e=>{e.length||i(__("No subscriptions found. You need to follow some sites in order to see results.","jetpack")),e=e.map(e=>(e.site_icon=(0,c.ZE)(e.site_icon),e)),u(e)}).catch(e=>{"AbortError"!==e.name&&(e.message?i(e.message):i(__("Whoops, we have encountered an error. Please try again later.","jetpack")))}).finally(()=>{d.current=null,n(!1)})},[e]),{isLoading:t,errorMessage:r,subscriptions:l}}},85101(e,t,n){"use strict";n.d(t,{FN:()=>i,ZE:()=>c,dy:()=>s,l$:()=>a});var r=n(74997),o=n(84954);function s(e){let t;try{t=new URL(e?.url)?.host.replace(/^www\./,"")}catch{t=e?.URL}return(0,r.createBlock)("jetpack/blogroll-item",{...e,...!e.name&&{name:t}})}function i(e){const{blog_id:t,site_icon:n,URL:r,name:o,description:i,is_non_wpcom_site:a}=e;return s({id:t,icon:n,url:r,name:o,description:i,is_non_wpcom_site:a})}function a(e){if(!e)return null;const t=new RegExp("^([a-zA-Z]+:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])?)\\.)+[a-z]{2,})","i");try{return new URL(e)?.host}catch{return e.match(t)?.[2]??null}}function c(e){return e||o}},98765(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(13022),a=n(66087),c=n(10790);const __=s.__,l="09:00",u="17:00";class d extends o.Component{renderInterval=(e,t)=>{const{day:n}=this.props,{opening:s,closing:a}=e;return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsxs)("div",{className:"business-hours__row",children:[(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__day"),children:0===t&&this.renderDayToggle()}),(0,c.jsxs)("div",{className:(0,i.A)(n.name,"business-hours__hours"),children:[(0,c.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"time",label:__("Opening","jetpack"),value:s,className:"business-hours__open",placeholder:l,onChange:e=>{this.setHour(e,"opening",t)}}),(0,c.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"time",label:__("Closing","jetpack"),value:a,className:"business-hours__close",placeholder:u,onChange:e=>{this.setHour(e,"closing",t)}})]}),(0,c.jsx)("div",{className:"business-hours__remove",children:n.hours.length>1&&(0,c.jsx)(r.Button,{isSmall:!0,variant:"link",icon:"trash",label:__("Remove Hours","jetpack"),onClick:()=>{this.removeInterval(t)}})})]}),t===n.hours.length-1&&(0,c.jsxs)("div",{className:"business-hours__row business-hours-row__add",children:[(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__day"),children:" "}),(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__hours"),children:(0,c.jsx)(r.Button,{variant:"link",label:__("Add Hours","jetpack"),onClick:this.addInterval,children:__("Add Hours","jetpack")})}),(0,c.jsx)("div",{className:"business-hours__remove",children:" "})]})]},t)};setHour=(e,t,n)=>{const{day:r,attributes:o,setAttributes:s}=this.props,{days:i}=o;s({days:i.map(o=>o.name===r.name?{...o,hours:o.hours.map((r,o)=>o===n?{...r,[t]:e}:r)}:o)})};toggleClosed=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:o}=n;r({days:o.map(n=>{if(n.name===t.name){const t=e?[{opening:l,closing:u}]:[];return{...n,hours:t}}return n})})};addInterval=()=>{const{day:e,attributes:t,setAttributes:n}=this.props,{days:r}=t;e.hours.push({opening:"",closing:""}),n({days:r.map(t=>t.name===e.name?{...t,hours:e.hours}:t)})};removeInterval=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:o}=n;r({days:o.map(n=>t.name===n.name?{...n,hours:n.hours.filter((t,n)=>e!==n)}:n)})};isClosed(){const{day:e}=this.props;return(0,a.isEmpty)(e.hours)}renderDayToggle(){const{day:e,localization:t}=this.props;return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsx)("span",{className:"business-hours__day-name",children:t.days[e.name]}),(0,c.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:this.isClosed()?__("Closed","jetpack"):__("Open","jetpack"),checked:!this.isClosed(),onChange:this.toggleClosed})]})}renderClosed(){const{day:e}=this.props;return(0,c.jsxs)("div",{className:"business-hours__row business-hours-row__closed",children:[(0,c.jsx)("div",{className:(0,i.A)(e.name,"business-hours__day"),children:this.renderDayToggle()}),(0,c.jsx)("div",{className:(0,i.A)(e.name,"closed","business-hours__hours"),children:" "}),(0,c.jsx)("div",{className:"business-hours__remove",children:" "})]})}render(){const{day:e}=this.props;return this.isClosed()?this.renderClosed():e.hours.map(this.renderInterval)}}const p=d;n.d(t,["A",0,p])},32557(e,t,n){"use strict";var r=n(86087),o=n(27723),s=n(66087),i=n(10790);const _x=o._x,a="undefined"!=typeof window&&window.navigator?.language||"en",c=Intl?.DateTimeFormat?new Intl.DateTimeFormat(a,{hour:"numeric",minute:"numeric",hour12:!0}):null;class l extends r.Component{formatTime(e){const[t,n]=e.split(":");if(!t||!n)return!1;const r=new Date;return r.setHours(t),r.setMinutes(n),c?c.format(r):e}renderInterval=(e,t)=>{const{day:n}=this.props,r=n.hours;return(0,i.jsxs)("span",{children:[(0,o.sprintf)("%1$s - %2$s",this.formatTime(e.opening),this.formatTime(e.closing)),r.length>1+t&&(0,i.jsx)("span",{children:", "})]},t)};render(){const{day:e,localization:t}=this.props,n=e.hours.filter(e=>this.formatTime(e.opening)&&this.formatTime(e.closing));return(0,i.jsxs)("div",{className:"jetpack-business-hours__item",children:[(0,i.jsx)("dt",{className:e.name,children:t.days[e.name]}),(0,i.jsxs)("dd",{children:[(0,s.isEmpty)(n)?_x("Closed","business is closed on a full day","jetpack"):n.map(this.renderInterval),(0,i.jsx)("br",{})]})]})}}const u=l;n.d(t,["A",0,u])},52097(e,t,n){"use strict";var r=n(85985),o=n(1455),s=n.n(o),i=n(94715),a=n(56427),c=n(38443),l=n(86087),u=n(27723),d=n(9050),p=n(98765),h=n(32557),m=n(10790);const __=u.__,g=(0,r.sh)(d),f={days:{Sun:__("Sunday","jetpack"),Mon:__("Monday","jetpack"),Tue:__("Tuesday","jetpack"),Wed:__("Wednesday","jetpack"),Thu:__("Thursday","jetpack"),Fri:__("Friday","jetpack"),Sat:__("Saturday","jetpack")},startOfWeek:0},b=e=>{const{attributes:t,isSelected:n}=e,r=(0,i.useBlockProps)(),[o,u]=(0,l.useState)(f),[d,b]=(0,l.useState)(!1),{days:v}=t,{startOfWeek:y}=o,k=v.concat(v.slice(0,y)).slice(y);let w;if((0,l.useEffect)(()=>{s()({path:"/wpcom/v2/business-hours/localized-week"}).then(e=>{u(e),b(!0)},()=>{u(f),b(!0)})},[]),d)if(n)w=(0,m.jsx)("div",{className:"is-edit",children:k.map((t,n)=>(0,m.jsx)(p.A,{day:t,localization:o,...e},n))});else{const e=(0,c.getSettings)(),{formats:{time:t}}=e;w=(0,m.jsx)("dl",{className:"jetpack-business-hours",children:k.map((e,n)=>(0,m.jsx)(h.A,{day:e,localization:o,timeFormat:t},n))})}else w=(0,m.jsx)(a.Placeholder,{icon:g,label:__("Loading business hours","jetpack")});return(0,m.jsx)("div",{...r,children:w})};n.d(t,["A",0,b])},14990(e,t,n){"use strict";var r=n(94375),o=n(9050),s=n(52097),i=(n(18681),n(82805),n(10790));(0,r.M)(o,{edit:e=>(0,i.jsx)(s.A,{...e}),save:()=>null})},28310(e,t,n){"use strict";var r=n(98329);const o={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string",role:"content"},placeholder:{type:"string",role:"content"},url:{type:"string",role:"content"},textColor:{type:"string"},customTextColor:{type:"string",validator:r.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:r.A},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"},customVariant:{type:"string"},metaName:{type:"string"}};n.d(t,["A",0,o])},41695(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(56427),o=n(86087),s=n(27723),i=(n(8746),n(10790));const __=s.__;function a({borderRadius:e="",setAttributes:t}){const n=(0,o.useCallback)(e=>t({borderRadius:e}),[t]);return(0,i.jsx)(r.PanelBody,{title:__("Border Settings","jetpack"),children:(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,allowReset:!0,initialPosition:5,label:__("Border radius","jetpack"),max:50,min:0,onChange:n,value:e})})}},42929(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(27723),s=n(10790);const __=o.__;function i({isGradientAvailable:e,backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,gradientValue:i,setBackgroundColor:a,setGradient:c,setTextColor:l,textColor:u}){const d=(0,s.jsx)(r.ContrastChecker,{backgroundColor:t.color,fallbackBackgroundColor:n,fallbackTextColor:o,isLargeText:!1,textColor:u.color});return e?(0,s.jsx)(r.__experimentalPanelColorGradientSettings,{settings:[{colorValue:u.color,label:__("Text Color","jetpack"),onColorChange:l},{colorValue:t.color,gradientValue:i,label:__("Background","jetpack"),onColorChange:a,onGradientChange:c}],title:__("Background & Text Color","jetpack"),children:d}):(0,s.jsx)(r.PanelColorSettings,{colorSettings:[{value:u.color,onChange:l,label:__("Text Color","jetpack")},{value:t.color,onChange:a,label:__("Background","jetpack")}],title:__("Background & Text Color","jetpack"),children:d})}},8746(e,t,n){"use strict";var r=n(94715);const o=!!r.__experimentalUseGradient;n.d(t,["U",0,o])},57667(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(47143),o=n(68210),s=n(41695),i=n(42929),a=n(10790);function c({attributes:e,backgroundColor:t,clientId:n,context:c,fallbackBackgroundColor:l,fallbackTextColor:u,setAttributes:d,setBackgroundColor:p,setTextColor:h,textColor:m,gradientValue:g,setGradient:f,isGradientAvailable:b}){const{align:v,borderRadius:y}=e,k="jetpack/parentBlockWidth"in c,w=k?c["jetpack/parentBlockWidth"]:e.width,x=(0,r.useSelect)(e=>{const{getBlock:t,getBlockRootClientId:r}=e("core/block-editor");return t(r(n))}),{updateBlockAttributes:_}=(0,r.useDispatch)("core/block-editor");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.A,{backgroundColor:t,fallbackBackgroundColor:l,fallbackTextColor:u,gradientValue:g,setBackgroundColor:p,setGradient:f,setTextColor:h,textColor:m,isGradientAvailable:b}),(0,a.jsx)(s.A,{borderRadius:y,setAttributes:d}),(0,a.jsx)(o.D,{align:v,width:w,onChange:e=>{k?_(x.clientId,{width:e}):d({width:e})}})]})}},49061(e,t,n){"use strict";var r=n(94715),o=n(29491),s=n(47143),i=n(86087),a=n(27723),c=n(13022),l=n(8746),u=n(57667),d=n(7528),p=n(81177),h=(n(28769),n(10790));const __=a.__;const m=(0,o.compose)((0,r.withColors)({backgroundColor:"background-color"},{textColor:"color"}))(function(e){const{attributes:t,backgroundColor:n,className:o,clientId:a,setAttributes:m,textColor:g}=e,{borderRadius:f,element:b,placeholder:v,text:y,width:k,fontSize:w,customVariant:x,metaName:_}=t;(0,p.A)({attributes:t,clientId:a,setAttributes:m});const{metadata:j}=(0,s.useSelect)(e=>{const{getBlockAttributes:t}=e(r.store);return{metadata:t(a)?.metadata}},[a]),{updateBlockAttributes:C,__unstableMarkNextChangeAsNotPersistent:A}=(0,s.useDispatch)("core/block-editor"),{gradientClass:S,gradientValue:E,setGradient:T}=l.U?(0,r.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},N=(0,r.useBlockProps)({className:(0,c.A)("wp-block-button",o),style:{width:k}}),[P,B]=(0,d.A)(),M=(0,r.__experimentalUseBorderProps)(t),I=(0,c.A)("wp-block-button__link",M.className,{"has-background":n.color||E,[n.class]:!E&&n.class,"has-text-color":g.color,[g.class]:g.class,[S]:S,"no-border-radius":0===f,[`has-${w}-font-size`]:!!w,"has-custom-font-size":!!w,[`is-${x}`]:!!x});(0,i.useEffect)(()=>{a&&_&&j?.name!==_&&(A(),C(a,{metadata:{...j,name:_}}))},[_,j,C,a,A]);const R={...!n.color&&E?{background:E}:{backgroundColor:n.color},fontSize:t.style?.typography?.fontSize,color:g.color,borderRadius:f?f+"px":void 0,...M.style};return(0,h.jsxs)("div",{...N,children:[(0,h.jsx)(r.RichText,{allowedFormats:"input"===b?[]:void 0,className:I,disableLineBreaks:"input"===b,onChange:e=>m({text:e}),placeholder:v||__("Add text…","jetpack"),ref:B,style:R,value:y,withoutInteractiveFormatting:!0}),(0,h.jsx)(r.InspectorControls,{children:(0,h.jsx)(u.A,{gradientValue:E,setGradient:T,isGradientAvailable:l.U,...P,...e})})]})});n.d(t,["A",0,m])},45878(e,t,n){"use strict";var r=n(94375),o=n(5383);(0,r.A)("button",o.W)},61138(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"})});n.d(t,["A",0,s])},5383(e,t,n){"use strict";var r=n(27723),o=n(97969),s=n(28310),i=n(49061),a=n(61138),c=n(62270);const __=r.__,l={apiVersion:3,title:__("Button","jetpack"),icon:a.A,category:(0,o.A)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"],typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},styles:[{name:"fill",label:__("Fill","jetpack"),isDefault:!0},{name:"outline",label:__("Outline","jetpack")}],selectors:{border:".wp-block-jetpack-button .wp-block-button__link"},attributes:s.A,edit:i.A,save:c.A,usesContext:["jetpack/parentBlockWidth"]};n.d(t,["W",0,l])},62270(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(13022),s=n(8746),i=n(10790);function a({attributes:e,blockName:t,uniqueId:n}){const{backgroundColor:a,borderRadius:c,className:l,customBackgroundColor:u,customGradient:d,customTextColor:p,gradient:h,saveInPostContent:m,text:g,textColor:f,url:b,width:v,fontSize:y}=e;if(!m)return null;const k=r.useBlockProps.save(),w=(0,r.__experimentalGetBorderClassesAndStyles)(e),x=(0,r.getColorClassName)("background-color",a),_=s.U?(0,r.__experimentalGetGradientClass)(h):void 0,j=(0,r.getColorClassName)("color",f),C=(0,o.A)("wp-block-button","jetpack-submit-button",l,k?.className,w.className,{[`wp-block-jetpack-${t}`]:t}),A=(0,o.A)("wp-block-button__link",{"has-text-color":f||p,[j]:j,"has-background":a||h||u||d,[x]:x,[_]:_,"no-border-radius":0===c,"has-custom-width":!!v,[`has-${y}-font-size`]:!!y,"has-custom-font-size":!!y}),S={background:d||void 0,backgroundColor:x||d||h?void 0:u,fontSize:e.style?.typography?.fontSize,color:j?void 0:p,borderRadius:c?c+"px":void 0,width:v,...w.style};return(0,i.jsx)("div",{...k,className:C,children:(0,i.jsx)(r.RichText.Content,{className:A,"data-id-attr":n||"placeholder",href:b,id:n,rel:"noopener noreferrer",role:"button",style:S,tagName:"a",target:"_blank",value:g})})}},7528(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(29491),o=n(86087);function s(){const[e,t]=(0,o.useState)(),n=(0,r.useRefEffect)(n=>{const r=()=>{const r=getComputedStyle(n),o=r.backgroundColor,s=r.color;o===e?.fallbackBackgroundColor&&s===e?.fallbackTextColor||t({fallbackBackgroundColor:o,fallbackTextColor:s})},o=new MutationObserver(r);return o.observe(n,{attributeFilter:["style","class"]}),r(),()=>{o.disconnect()}},[]);return[e,n]}},81177(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(47143),o=n(86087),s=n(66087);function i({attributes:e,clientId:t,setAttributes:n}){const{passthroughAttributes:i}=e,a=(0,r.useSelect)(n=>{const r=n("core/block-editor"),o=r.getBlockRootClientId(t),s=r.getBlockAttributes(o)||{};if(!o||!i)return{};let a=!1;const c={};return Object.entries(i).forEach(([t,n])=>{const r=s[n];r!==e[t]&&(a=!0,c[t]=r)}),a?c:{}},[t,i,e]);(0,o.useEffect)(()=>{(0,s.isEmpty)(a)||n(a)},[a,n])}},95816(e,t,n){"use strict";n.d(t,["a",0,"https://calendly.com/wpcom/jetpack-block-example","s",0,["calendly.com"]])},10137(e,t,n){"use strict";var r=n(97999),o=n(94715),s=n(56427),i=n(27723),a=n(39968),c=n(57273),l=n(24971),u=n(10790);const __=i.__,_x=i._x,d=({onEditClick:e})=>(0,u.jsx)(s.ToolbarGroup,{children:(0,u.jsx)(s.ToolbarButton,{onClick:()=>e(!0),children:__("Edit","jetpack")})}),p=()=>{const e=(0,r.isWpcomPlatformSite)()?"https://wordpress.com/support/wordpress-editor/blocks/calendly-block/#customize-the-calendly-block":"https://jetpack.com/support/jetpack-blocks/calendly-block/#customizing-a-calendly-block";return(0,u.jsx)(a.E,{render:(0,u.jsx)("div",{}),children:(0,u.jsx)(c.N,{openInNewTab:!0,href:e,children:__("Explore customization options","jetpack")})})},h=e=>{const{attributes:{hideEventTypeDetails:t},defaultClassName:n,embedCode:r,parseEmbedCode:o,setAttributes:i,setEmbedCode:a}=e;return(0,u.jsxs)(s.PanelBody,{title:__("Calendar settings","jetpack"),initialOpen:!1,children:[(0,u.jsxs)("form",{onSubmit:o,className:`${n}-embed-form-sidebar`,children:[(0,u.jsx)(s.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:__("Calendly web address or embed code","jetpack"),id:"embedCode",onChange:a,placeholder:__("Calendly web address or embed code…","jetpack"),value:r||""}),(0,u.jsx)(s.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]}),(0,u.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Hide event type details","jetpack"),checked:t,onChange:()=>i({hideEventTypeDetails:!t})})]})},m=e=>{const{attributes:t,isEditingUrl:n,setAttributes:r,setIsEditingUrl:s}=e,{style:i,url:a}=t,c=[{value:"inline",label:__("Inline","jetpack")},{value:"link",label:__("Link","jetpack")}];return(0,u.jsxs)(u.Fragment,{children:[a&&!n&&(0,u.jsx)(o.BlockControls,{children:(0,u.jsx)(d,{onEditClick:s})}),a&&(0,u.jsx)(l.A,{styleOptions:c,onSelectStyle:r,activeStyle:i,children:(0,u.jsx)(p,{})}),(0,u.jsx)(o.InspectorControls,{children:(0,u.jsx)(h,{...e})})]})};n.d(t,["Ay",0,m])},88471(e,t,n){"use strict";var r=n(74997),o=n(27723),s=n(98329),i=n(10790);const __=o.__,a={attributes:{backgroundColor:{type:"string",default:"ffffff",validator:s.A},submitButtonText:{type:"string",default:__("Schedule time with me","jetpack")},submitButtonTextColor:{type:"string"},submitButtonBackgroundColor:{type:"string"},submitButtonClasses:{type:"string"},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:s.A},textColor:{type:"string",default:"4D5055",validator:s.A},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string",validator:s.A},customTextButtonColor:{type:"string",validator:s.A}},migrate:e=>{const{submitButtonText:t,submitButtonTextColor:n,submitButtonBackgroundColor:o,submitButtonClasses:s,backgroundButtonColor:i,textButtonColor:a,customBackgroundButtonColor:c,customTextButtonColor:l,...u}=e,d={text:(p=e).submitButtonText||__("Schedule time with me","jetpack"),textColor:p.submitButtonTextColor||p.textButtonColor,customTextColor:p.customTextButtonColor,backgroundColor:p.submitButtonBackgroundColor||p.backgroundButtonColor,customBackgroundColor:p.customBackgroundButtonColor,url:p.url};var p;return[u,[(0,r.createBlock)("jetpack/button",{element:"a",uniqueId:"calendly-widget-id",...d})]]},save:({attributes:{url:e}})=>(0,i.jsx)("a",{href:e,children:e})};n.d(t,["A",0,a])},9659(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(74997),i=n(56427),a=n(47143),c=n(86087),l=n(27723),u=n(57273),d=n(13022),p=n(66087),h=n(78218),m=n(98212),g=n(56145),f=n(13248),b=n(95816),v=n(10137),y=n(38028),k=(n(78215),n(61095),n(10790));const __=l.__,_x=l._x,w="jetpack/button",x={element:"a",text:__("Schedule time with me","jetpack"),uniqueId:"calendly-widget-id",url:b.a},_=(0,r.sh)(f);const j=(0,i.withNotices)(function(e){const{attributes:t,clientId:n,isSelected:r,name:l,noticeOperations:j,noticeUI:C,setAttributes:A}=e,S=(0,s.getBlockDefaultClassName)(l),E=(0,h.y)(f.attributes,t);(0,p.isEqual)(E,t)||A(E);const{backgroundColor:T,hideEventTypeDetails:N,primaryColor:P,textColor:B,style:M,url:I}=E,R=(0,m.A)(I,b.s),L=(0,y.DO)(I),[D,F]=(0,c.useState)(I),[O,z]=(0,c.useState)(!1),[U,H]=(0,c.useState)(!1),[$,V]=(0,c.useState)({}),[q,G]=(0,c.useState)(!1),W=(0,o.useBlockProps)();(0,c.useEffect)(()=>{!r&&q&&G(!1)},[q,r]);const Z=()=>{j.removeAllNotices(),j.createErrorNotice(__("Your calendar couldn't be embedded. Please double check your URL or code.","jetpack"))};(0,c.useEffect)(()=>{if(I&&b.a!==I&&"link"!==M)return R?void(0,g.A)(I,H).catch(()=>{A({url:void 0}),Z()}):(A({url:void 0}),void Z())},[]);const J=e=>{if(!e)return void Z();e.preventDefault();const t=(0,y.a9)(D);if(t&&(0,m.A)(t.url,b.s)){if(t.buttonAttributes&&"link"===t.style){const e=(0,a.select)("core/editor").getBlocksByClientId(n);e.length&&e[0].innerBlocks.forEach(e=>{(0,a.dispatch)("core/editor").updateBlockAttributes(e.clientId,t.buttonAttributes)}),V(t.buttonAttributes)}(0,g.A)(t.url,H).then(()=>{const e=(0,h.y)(f.attributes,t);A(e),z(!1),j.removeAllNotices()}).catch(()=>{A({url:void 0}),Z()})}else Z()},K=(0,k.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,k.jsx)(i.Spinner,{}),(0,k.jsx)("p",{children:__("Embedding…","jetpack")})]}),Y=(0,k.jsxs)(i.Placeholder,{label:__("Calendly","jetpack"),instructions:__("Enter your Calendly web address or embed code below.","jetpack"),icon:_,notices:C,children:[(0,k.jsxs)("form",{onSubmit:J,children:[(0,k.jsx)("input",{type:"text",id:"embedCode",onChange:e=>F(e.target.value),placeholder:__("Calendly web address or embed code…","jetpack"),value:D||"",className:"components-placeholder__input"}),(0,k.jsx)("div",{children:(0,k.jsx)(i.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]}),(0,k.jsx)("div",{className:`${S}-learn-more`,children:(0,k.jsx)(u.N,{openInNewTab:!0,href:"https://help.calendly.com/hc/en-us/articles/223147027-Embed-options-overview",children:__("Need help finding your embed code?","jetpack")})})]}),Q=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("iframe",{src:(()=>{const e=new URLSearchParams({embed_domain:"wordpress.com",embed_type:"Inline",hide_event_type_details:N?1:0,background_color:T,primary_color:P,text_color:B});return`${L}?${e}`})(),width:"100%",height:"100%",frameBorder:"0","data-origwidth":"100%","data-origheight":"100%",title:"Calendly"}),!q&&(0,k.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:()=>G(!0)})]}),X=(0,k.jsx)(o.InnerBlocks,{template:[[w,{...x,...$,passthroughAttributes:{url:"url"}}]],templateLock:"all"});return U?K:(0,k.jsxs)("div",{...W,className:(0,d.A)(W.className,{[`calendly-style-${M}`]:L&&R&&!O}),children:[(0,k.jsx)(v.Ay,{...e,defaultClassName:S,embedCode:D,isEditingUrl:O,parseEmbedCode:J,setEmbedCode:F,setIsEditingUrl:z}),L&&R&&!O?(ee=M,"inline"===ee?Q:X):Y]});var ee});n.d(t,["A",0,j])},60312(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(13248),i=n(88471),a=n(9659),c=n(34844),l=n(38028);n(78215);(0,o.M)(s,{edit:a.A,save:c.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&l.QL.test(e.textContent),transform:e=>{const t=(0,l.a9)(e.textContent);return(0,r.createBlock)("jetpack/calendly",t)}}]},deprecated:[i.A]})},34844(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},38028(e,t,n){"use strict";n.d(t,{DO:()=>o});const r=/(^|\/\/)(calendly\.com[^"']*)/i;function o(e){try{const t=new URL(e);if(!["http:","https:"].includes(t.protocol)||"calendly.com"!==t.hostname||t.username||t.password||t.port)return;return t.protocol="https:",t.toString()}catch{return}}n.d(t,["QL",0,r,"a9",0,e=>{if(!e)return;const t=(e=>{const t=e.match(r);if(t)return o("https://"+t[2])})(e);if(!t)return;const n=(e=>{const t={},n=new URL(e);if(t.url=n.origin+n.pathname,!n.search)return t;const r=new URLSearchParams(n.search),o=r.get("background_color"),s=r.get("primary_color"),i=r.get("text_color"),a=/^[A-Za-z0-9]{6}$/;return r.get("hide_event_type_details")&&(t.hideEventTypeDetails=r.get("hide_event_type_details")),o&&o.match(a)&&(t.backgroundColor=o),s&&s.match(a)&&(t.primaryColor=s),i&&i.match(a)&&(t.textColor=i),t})(t),s=(e=>e.indexOf("data-url")>0?"inline":e.indexOf("initPopupWidget")>0||e.indexOf("initBadgeWidget")>0?"link":void 0)(e);if(s&&(n.style=s),"link"===s){n.buttonAttributes={};const t=(e=>{let t=e.match(/false;">([^<]+)<\//);return t?t[1]:(t=e.match(/text: '([^']*?)'/),t?t[1]:void 0)})(e);t&&(n.buttonAttributes.text=t);const r=(e=>{const t=e.match(/textColor: '([^']*?)'/);if(t)return t[1]})(e);r&&(n.buttonAttributes.textColor=void 0,n.buttonAttributes.customTextColor=r);const o=(e=>{const t=e.match(/color: '([^']*?)'/);if(t)return t[1]})(e);o&&(n.buttonAttributes.backgroundColor=void 0,n.buttonAttributes.customBackgroundColor=o)}return n}])},98169(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(13022),c=n(58842),l=n(10790);const __=i.__,u=e=>{const{attributes:{address:t,addressLine2:n,addressLine3:i,city:u,region:d,postal:p,country:h,linkToGoogleMaps:m},isSelected:g,setAttributes:f}=e,b=[t,n,i,u,d,p,h].some(e=>""!==e),v=(0,a.A)({"jetpack-address-block":!0,"is-selected":g}),y=(0,s.useCallback)(e=>{"Enter"===e.key&&e.preventDefault()},[]),k=(0,r.useBlockProps)({className:v}),w=(0,l.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Link address to Google Maps","jetpack"),checked:m,onChange:e=>f({linkToGoogleMaps:e})});return(0,l.jsxs)("div",{...k,children:[!g&&b&&(0,c.A)(e),(g||!b)&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(r.PlainText,{value:t,placeholder:__("Street Address","jetpack"),"aria-label":__("Street Address","jetpack"),onChange:e=>f({address:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:n,placeholder:__("Address Line 2","jetpack"),"aria-label":__("Address Line 2","jetpack"),onChange:e=>f({addressLine2:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:i,placeholder:__("Address Line 3","jetpack"),"aria-label":__("Address Line 3","jetpack"),onChange:e=>f({addressLine3:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:u,placeholder:__("City","jetpack"),"aria-label":__("City","jetpack"),onChange:e=>f({city:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:d,placeholder:__("State/Province/Region","jetpack"),"aria-label":__("State/Province/Region","jetpack"),onChange:e=>f({region:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:p,placeholder:__("Postal/Zip Code","jetpack"),"aria-label":__("Postal/Zip Code","jetpack"),onChange:e=>f({postal:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:h,placeholder:__("Country","jetpack"),"aria-label":__("Country","jetpack"),onChange:e=>f({country:e}),onKeyDown:y}),w]})]})};n.d(t,["A",0,u])},36569(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(98169),i=n(58842),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Address","jetpack"),description:__("Lets you add a physical address with Schema markup.","jetpack"),keywords:[_x("location","block search term","jetpack"),_x("direction","block search term","jetpack"),_x("place","block search term","jetpack")],icon:(0,a.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsx)(o.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),(0,a.jsx)(o.Circle,{cx:"12",cy:"9",r:"2.5"})]}),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:s.A,save:i.A};n.d(t,["U",0,"address","W",0,c])},58842(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(27723),i=n(10790);const __=s.__,a=({attributes:{address:e,addressLine2:t,addressLine3:n,city:r,region:s,postal:a,country:c}})=>(0,i.jsxs)(o.Fragment,{children:[e&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address1",children:e}),t&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address2",children:t}),n&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address3",children:n}),r&&!(s||a)&&(0,i.jsx)("div",{className:"jetpack-address__city",children:r}),r&&(s||a)&&(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"jetpack-address__city",children:r}),", ",(0,i.jsx)("span",{className:"jetpack-address__region",children:s})," ",(0,i.jsx)("span",{className:"jetpack-address__postal",children:a})]}),!r&&(s||a)&&(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"jetpack-address__region",children:s})," ",(0,i.jsx)("span",{className:"jetpack-address__postal",children:a})]}),c&&(0,i.jsx)("div",{className:"jetpack-address__country",children:c})]}),c=({attributes:{address:e,addressLine2:t,addressLine3:n,city:r,region:o,postal:s,country:i}})=>{let a=o?`+${o},`:"";a=s?`${a}+${s}`:a;return`https://www.google.com/maps/search/${e?`${e},`:""}${t?`${t},`:""}${n?`${n},`:""}${r?`+${r},`:""}${a}${i?`+${i}`:""}`.replace(" ","+")},l=e=>{if(!(({address:e,addressLine2:t,addressLine3:n,city:r,region:o,postal:s,country:i})=>[e,t,n,r,o,s,i].some(e=>""!==e))(e.attributes))return null;const t=r.useBlockProps.save();return(0,i.jsxs)("div",{...t,children:[e.attributes.linkToGoogleMaps&&(0,i.jsx)("a",{href:c(e),target:"_blank",rel:"noopener noreferrer",title:__("Open address in Google Maps","jetpack"),children:(0,i.jsx)(a,{...e})}),!e.attributes.linkToGoogleMaps&&(0,i.jsx)(a,{...e})]})};n.d(t,["A",0,l])},74842(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(10790);const i=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],a=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]],c=e=>{const{className:t,isSelected:n}=e,c=(0,r.useBlockProps)({className:(0,o.A)(t,{"jetpack-contact-info-block":!0,"is-selected":n})});return(0,s.jsx)("div",{...c,children:(0,s.jsx)(r.InnerBlocks,{allowedBlocks:i,templateLock:!1,template:a})})};n.d(t,["A",0,c])},25907(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(36569),i=n(75173),a=n(74842),c=n(69933),l=n(77909),u=n(47377);n(75360),n(25378);(0,o.M)(i,{edit:a.A,save:u.A,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"widget_contact_info"===e,transform:({instance:e})=>{let t=[(0,r.createBlock)("core/heading",{content:e.raw.title}),(0,r.createBlock)("jetpack/email",{email:e.raw.email}),(0,r.createBlock)("jetpack/phone",{phone:e.raw.phone}),(0,r.createBlock)("jetpack/address",{address:e.raw.address})];return e.raw.hours&&(t=[...t,(0,r.createBlock)("core/paragraph",{content:e.raw.hours})]),e.raw.showmap&&e.raw.address&&(t=[...t,(0,r.createBlock)("jetpack/map",{address:e.raw.address})]),(0,r.createBlock)("jetpack/contact-info",{},t)}}]}},[{name:s.U,settings:s.W},{name:"email",settings:c.W},{name:"phone",settings:l.W}])},43167(e,t,n){"use strict";var r=n(94715),o=n(27723),s=n(45838),i=n(19038);const __=o.__,a=e=>{const t=(0,r.useBlockProps)(),{setAttributes:n}=e;return(0,s.A)("email",e,__("Email","jetpack"),i.A,e=>n({email:e}),t)};n.d(t,["A",0,a])},69933(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(43167),i=n(19038),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Email Address","jetpack"),description:__("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",_x("message","block search term","jetpack")],icon:(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})}),category:"grow",attributes:{email:{type:"string",default:""}},edit:s.A,save:i.A,parent:["jetpack/contact-info"]};n.d(t,["W",0,c])},19038(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(39904),i=n(10790);const a=({attributes:{email:e}})=>{if(!e)return null;const t=r.useBlockProps.save();return(0,i.jsx)("div",{...t,children:(n=e,n.split(/(\s+)/).map((e,t)=>{const n=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&(0,s.t)(n)?e===n?(0,i.jsx)("a",{href:`mailto:${e}`,children:e},t):(0,i.jsxs)(o.Fragment,{children:[(0,i.jsx)("a",{href:`mailto:${e}`,children:n},t),(0,i.jsx)(o.Fragment,{children:e.slice(-(e.length-n.length))})]},t):(0,i.jsx)(o.Fragment,{children:e},t)}))});var n};n.d(t,["A",0,a])},42711(e,t,n){"use strict";var r=n(94715),o=n(27723),s=n(45838),i=n(5926);const __=o.__,a=e=>{const t=(0,r.useBlockProps)(),{setAttributes:n}=e;return(0,s.A)("phone",e,__("Phone number","jetpack"),i.A,e=>n({phone:e}),t)};n.d(t,["A",0,a])},77909(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(42711),i=n(5926),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Phone Number","jetpack"),description:__("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[_x("mobile","block search term","jetpack"),_x("telephone","block search term","jetpack"),_x("cell","block search term","jetpack")],icon:(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})}),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:s.A,save:i.A};n.d(t,["W",0,c])},5926(e,t,n){"use strict";var r=n(94715),o=n(10790);function s(e){const t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;const n=e.indexOf(t[0]);let r=n?e.substring(n-1):e,s=n?e.substring(0,n):"",i=r.replace(/\D/g,"");/[0-9/+/(]/.test(r[0])?(s=s.slice(0,-1),"+"===r[0]&&(i="+"+i)):r=r.substring(1);return[s.trim()?(0,o.jsx)("span",{className:"phone-prefix",children:s},"phonePrefix"):null,(0,o.jsx)("a",{href:`tel:${i}`,children:r},"phoneNumber")]}const i=({attributes:{phone:e}})=>{if(!e)return null;const t=r.useBlockProps.save();return(0,o.jsx)("div",{...t,children:s(e)})};n.d(t,["A",0,i])},47377(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=()=>{const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})};n.dn(s),n.d(t,["A",0,s])},68071(e,t,n){"use strict";var r=n(27723);const __=r.__,o=(0,r.sprintf)(
65 +__("No sites found for %s.","jetpack"),n)})]}),e.length>0&&(0,s.jsx)("ul",{"aria-live":"polite",children:e.map((e,n)=>{const r=a?.some?.(t=>t?.id===e?.blog_id)||!1;return(0,s.jsx)("li",{className:"jetpack-blogroll__appender-result-container",children:(0,s.jsxs)("button",{className:"jetpack-blogroll__appender-result-title",disabled:r,onClick:()=>t(e),children:[(0,s.jsx)("div",{className:"jetpack-blogroll__appender-result-image",children:e.site_icon&&(0,s.jsx)("img",{src:e.site_icon,alt:e.name,onError:e=>{e.target.parentNode.classList.add("empty-site-icon")}})}),(0,s.jsxs)("div",{className:"jetpack-blogroll__appender-result-text",children:[(0,s.jsx)("span",{className:"jetpack-blogroll__appender-result-title",children:e.name}),(0,s.jsx)("span",{className:"jetpack-blogroll__appender-result-description",children:e.description})]})]})},`${e.blog_id}-${n}`)})})]})}},10962(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(27723),s=(n(6988),n(10790));const __=o.__;function i({value:e,onChange:t}){return(0,s.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,s.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Search for sites to add","jetpack"),hideLabelFromVision:!0,placeholder:__("Search…","jetpack"),value:e,onChange:e=>t(e)})})}},30413(e,t,n){"use strict";n.d(t,{A:()=>h});var r=n(56427),o=n(47143),s=n(86087),i=n(27723),a=n(60167),c=n(92507),l=n(85101),u=n(25904),d=n(10962),p=(n(22597),n(10790));const __=i.__;function h({isLoading:e,subscriptions:t,clientId:n}){const[i,h]=(0,s.useState)(!1),[m,g]=(0,s.useState)(),[f,b]=(0,s.useState)(""),{insertBlock:v}=(0,o.dispatch)("core/block-editor"),{siteDetails:y,isLoading:k}=(0,c.A)({siteURL:f,subscriptions:t,enabled:f});return e?(0,p.jsx)(r.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.Button,{className:"block-editor-button-blogroll-block-appender",ref:g,icon:a.A,label:__("Add Blogroll Item","jetpack"),onClick:()=>{h(e=>!e)}}),i&&(0,p.jsxs)(r.Popover,{anchor:m,className:"jetpack-blogroll__appender",children:[(0,p.jsx)(d.A,{value:f,onChange:b}),(0,p.jsx)(u.A,{results:y,onSelect:e=>{v((0,l.FN)(e),void 0,n),h(!1)},searchInput:f,isLoading:k})]})]})}},93538(e,t,n){"use strict";var r=n(94715),o=n(74997),s=n(56427),i=n(47143),a=n(86087),c=n(27723),l=n(13022),u=n(2274),d=n(26247),p=n(30413),h=n(32130),m=n(46542),g=n(25688),f=n(85101),b=(n(8400),n(10790));const __=c.__;const v=function({className:e,attributes:t,setAttributes:n,clientId:c}){const{show_avatar:v,show_description:y,open_links_new_window:k,ignore_user_blogs:w,load_placeholders:x}=t,_=(0,d.A)(),{isLoading:j,recommendations:C,errorMessage:A}=(0,h.A)(x),{isLoading:S,subscriptions:E,errorMessage:T}=(0,g.A)({ignore_user_blogs:w});(0,m.b)({clientId:c});const{replaceInnerBlocks:N}=(0,i.dispatch)("core/block-editor");(0,a.useEffect)(()=>{if(x&&C.length){n({load_placeholders:!1});const e=[(0,o.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];N(c,e)}},[C,x,n,c,N]);const P=(0,r.useBlockProps)({className:(0,l.A)(e,{"hide-avatar":!v,"hide-description":!y})});if(!_)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||T;return(0,b.jsxs)("div",{...P,children:[(0,b.jsx)(r.InnerBlocks,{template:[["core/heading",{content:__("Blogroll","jetpack"),level:3}]],allowedBlocks:["jetpack/blogroll-item"],renderAppender:()=>!j&&(0,b.jsx)(p.A,{isLoading:S,subscriptions:E,clientId:c})}),B&&(0,b.jsx)(s.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:B})}),x&&j&&(0,b.jsx)(s.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(s.Spinner,{})}),(0,b.jsx)(r.InspectorControls,{children:(0,b.jsxs)(s.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(s.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>n({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Show description","jetpack"),checked:!!y,onChange:()=>n({show_description:!y}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Open links in a new window","jetpack"),checked:!!k,onChange:()=>n({open_links_new_window:!k}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(s.ToggleControl,{label:__("Hide my own sites","jetpack"),checked:!!w,onChange:()=>n({ignore_user_blogs:!w}),__nextHasNoMarginBottom:!0})]})})]})};n.d(t,["A",0,v])},22475(e,t,n){"use strict";var r=n(94375),o=n(52829),s=n(74618),i=n(93538),a=n(84169);n(8400);(0,r.M)(o,{edit:i.A,save:a.A},[{name:s.UU,settings:s.W0}])},84169(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(10790);const i=function({attributes:{show_avatar:e,show_description:t},className:n}){const i=r.useBlockProps.save({className:(0,o.A)(n,{"hide-avatar":!e,"hide-description":!t})});return(0,s.jsx)("div",{...i,children:(0,s.jsx)(r.InnerBlocks.Content,{})})};n.d(t,["A",0,i])},13818(e,t,n){"use strict";n.d(t,{Z:()=>s});var r=n(86087),o=n(85101);function s(e,t=!0){const[n,s]=(0,r.useState)(null),[i,a]=(0,r.useState)(null),[c,l]=(0,r.useState)(!1),u=function(e,t=100){const[n,o]=(0,r.useState)(e);return(0,r.useEffect)(()=>{const n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}((0,o.l$)(e),500);return(0,r.useEffect)(()=>{if(l(Boolean(t&&u)),t&&u){const e=new AbortController;return fetch(`https://public-api.wordpress.com/rest/v1.1/sites/${encodeURIComponent(u)}?force=wpcom`,{cache:"force-cache",signal:e.signal}).then(e=>{if(200===e.status)return e.json();e.status}).then(e=>{s(e),l(!1)}).catch(e=>{"AbortError"!==e.name&&a(e)}),()=>e.abort()}},[u,t]),{response:n,error:i,isLoading:c}}},92507(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13818),o=n(85101);function s({siteURL:e,subscriptions:t,enabled:n=!1}){const s=(0,o.l$)(e),{response:i,isLoading:a}=(0,r.Z)(s,Boolean(n)),c=[...i?[{blog_id:i?.ID.toString(),description:i?.description,URL:i?.URL,site_icon:(0,o.ZE)(i?.logo?.url),name:i?.name}]:[],...t].filter(t=>`${t.name}${t.URL}`.match(new RegExp(e,"i")));return 0===c.length&&s&&c.unshift({blog_id:s,description:"",URL:s,site_icon:(0,o.ZE)(null),name:s,is_non_wpcom_site:!0}),{isLoading:a,siteDetails:c}}},32130(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1455),o=n.n(r),s=n(86087),i=n(27723);const __=i.__;function a(e=!1){const[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null),[a,c]=(0,s.useState)([]),l=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{e?(n(!0),i(null),l.current&&l.current.abort(),l.current="undefined"==typeof AbortController?void 0:new AbortController,o()({path:"/wpcom/v2/following/recommendations",global:!0,method:"GET",signal:l.current?.signal}).then(e=>{e.length||i(__("No subscriptions found. You need to follow some sites in order to see results.","jetpack")),c(e)}).catch(e=>{"AbortError"!==e.name&&(e.message?i(e.message):i(__("Whoops, we have encountered an error. Please try again later.","jetpack")))}).finally(()=>{l.current=null,n(!1)})):n(!1)},[e]),{isLoading:t,errorMessage:r,recommendations:a}}},46542(e,t,n){"use strict";var r=n(3582),o=n(47143),s=n(86087),i=n(85101);n.d(t,["b",0,({clientId:e})=>{const[t,n]=(0,s.useState)(!1),{insertBlocks:a}=(0,o.useDispatch)("core/block-editor"),[c,l]=(0,r.useEntityProp)("root","site","Blogroll Recommendations"),u=(0,o.useSelect)(t=>t("core/block-editor").getBlock(e).innerBlocks.filter(({name:e})=>"jetpack/blogroll-item"===e).map(({attributes:e})=>e),[e]);(0,s.useEffect)(()=>{if(!t&&c){const t=c.filter(e=>!u.some(t=>t.id===e.id));if(t.length){const n=t.map(i.dy);a(n,void 0,e)}n(!0)}},[e,c,u,t,a]),(0,s.useEffect)(()=>{void 0!==c&&l(u)},[u])}])},25688(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(1455),o=n.n(r),s=n(86087),i=n(27723),a=n(93832),c=n(85101);const __=i.__;function l({ignore_user_blogs:e}){const[t,n]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null),[l,u]=(0,s.useState)([]),d=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{n(!0),i(null),d.current&&d.current.abort(),d.current="undefined"==typeof AbortController?void 0:new AbortController,o()({path:(0,a.addQueryArgs)("/wpcom/v2/following/mine",{ignore_user_blogs:e}),global:!0,method:"GET",signal:d.current?.signal}).then(e=>{e.length||i(__("No subscriptions found. You need to follow some sites in order to see results.","jetpack")),e=e.map(e=>(e.site_icon=(0,c.ZE)(e.site_icon),e)),u(e)}).catch(e=>{"AbortError"!==e.name&&(e.message?i(e.message):i(__("Whoops, we have encountered an error. Please try again later.","jetpack")))}).finally(()=>{d.current=null,n(!1)})},[e]),{isLoading:t,errorMessage:r,subscriptions:l}}},85101(e,t,n){"use strict";n.d(t,{FN:()=>i,ZE:()=>c,dy:()=>s,l$:()=>a});var r=n(74997),o=n(84954);function s(e){let t;try{t=new URL(e?.url)?.host.replace(/^www\./,"")}catch{t=e?.URL}return(0,r.createBlock)("jetpack/blogroll-item",{...e,...!e.name&&{name:t}})}function i(e){const{blog_id:t,site_icon:n,URL:r,name:o,description:i,is_non_wpcom_site:a}=e;return s({id:t,icon:n,url:r,name:o,description:i,is_non_wpcom_site:a})}function a(e){if(!e)return null;const t=new RegExp("^([a-zA-Z]+:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])?)\\.)+[a-z]{2,})","i");try{return new URL(e)?.host}catch{return e.match(t)?.[2]??null}}function c(e){return e||o}},98765(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(13022),a=n(66087),c=n(10790);const __=s.__,l="09:00",u="17:00";class d extends o.Component{renderInterval=(e,t)=>{const{day:n}=this.props,{opening:s,closing:a}=e;return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsxs)("div",{className:"business-hours__row",children:[(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__day"),children:0===t&&this.renderDayToggle()}),(0,c.jsxs)("div",{className:(0,i.A)(n.name,"business-hours__hours"),children:[(0,c.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"time",label:__("Opening","jetpack"),value:s,className:"business-hours__open",placeholder:l,onChange:e=>{this.setHour(e,"opening",t)}}),(0,c.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"time",label:__("Closing","jetpack"),value:a,className:"business-hours__close",placeholder:u,onChange:e=>{this.setHour(e,"closing",t)}})]}),(0,c.jsx)("div",{className:"business-hours__remove",children:n.hours.length>1&&(0,c.jsx)(r.Button,{isSmall:!0,variant:"link",icon:"trash",label:__("Remove Hours","jetpack"),onClick:()=>{this.removeInterval(t)}})})]}),t===n.hours.length-1&&(0,c.jsxs)("div",{className:"business-hours__row business-hours-row__add",children:[(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__day"),children:" "}),(0,c.jsx)("div",{className:(0,i.A)(n.name,"business-hours__hours"),children:(0,c.jsx)(r.Button,{variant:"link",label:__("Add Hours","jetpack"),onClick:this.addInterval,children:__("Add Hours","jetpack")})}),(0,c.jsx)("div",{className:"business-hours__remove",children:" "})]})]},t)};setHour=(e,t,n)=>{const{day:r,attributes:o,setAttributes:s}=this.props,{days:i}=o;s({days:i.map(o=>o.name===r.name?{...o,hours:o.hours.map((r,o)=>o===n?{...r,[t]:e}:r)}:o)})};toggleClosed=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:o}=n;r({days:o.map(n=>{if(n.name===t.name){const t=e?[{opening:l,closing:u}]:[];return{...n,hours:t}}return n})})};addInterval=()=>{const{day:e,attributes:t,setAttributes:n}=this.props,{days:r}=t;e.hours.push({opening:"",closing:""}),n({days:r.map(t=>t.name===e.name?{...t,hours:e.hours}:t)})};removeInterval=e=>{const{day:t,attributes:n,setAttributes:r}=this.props,{days:o}=n;r({days:o.map(n=>t.name===n.name?{...n,hours:n.hours.filter((t,n)=>e!==n)}:n)})};isClosed(){const{day:e}=this.props;return(0,a.isEmpty)(e.hours)}renderDayToggle(){const{day:e,localization:t}=this.props;return(0,c.jsxs)(o.Fragment,{children:[(0,c.jsx)("span",{className:"business-hours__day-name",children:t.days[e.name]}),(0,c.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:this.isClosed()?__("Closed","jetpack"):__("Open","jetpack"),checked:!this.isClosed(),onChange:this.toggleClosed})]})}renderClosed(){const{day:e}=this.props;return(0,c.jsxs)("div",{className:"business-hours__row business-hours-row__closed",children:[(0,c.jsx)("div",{className:(0,i.A)(e.name,"business-hours__day"),children:this.renderDayToggle()}),(0,c.jsx)("div",{className:(0,i.A)(e.name,"closed","business-hours__hours"),children:" "}),(0,c.jsx)("div",{className:"business-hours__remove",children:" "})]})}render(){const{day:e}=this.props;return this.isClosed()?this.renderClosed():e.hours.map(this.renderInterval)}}const p=d;n.d(t,["A",0,p])},32557(e,t,n){"use strict";var r=n(86087),o=n(27723),s=n(66087),i=n(10790);const _x=o._x,a="undefined"!=typeof window&&window.navigator?.language||"en",c=Intl?.DateTimeFormat?new Intl.DateTimeFormat(a,{hour:"numeric",minute:"numeric",hour12:!0}):null;class l extends r.Component{formatTime(e){const[t,n]=e.split(":");if(!t||!n)return!1;const r=new Date;return r.setHours(t),r.setMinutes(n),c?c.format(r):e}renderInterval=(e,t)=>{const{day:n}=this.props,r=n.hours;return(0,i.jsxs)("span",{children:[(0,o.sprintf)("%1$s - %2$s",this.formatTime(e.opening),this.formatTime(e.closing)),r.length>1+t&&(0,i.jsx)("span",{children:", "})]},t)};render(){const{day:e,localization:t}=this.props,n=e.hours.filter(e=>this.formatTime(e.opening)&&this.formatTime(e.closing));return(0,i.jsxs)("div",{className:"jetpack-business-hours__item",children:[(0,i.jsx)("dt",{className:e.name,children:t.days[e.name]}),(0,i.jsxs)("dd",{children:[(0,s.isEmpty)(n)?_x("Closed","business is closed on a full day","jetpack"):n.map(this.renderInterval),(0,i.jsx)("br",{})]})]})}}const u=l;n.d(t,["A",0,u])},52097(e,t,n){"use strict";var r=n(85985),o=n(1455),s=n.n(o),i=n(94715),a=n(56427),c=n(38443),l=n(86087),u=n(27723),d=n(9050),p=n(98765),h=n(32557),m=n(10790);const __=u.__,g=(0,r.sh)(d),f={days:{Sun:__("Sunday","jetpack"),Mon:__("Monday","jetpack"),Tue:__("Tuesday","jetpack"),Wed:__("Wednesday","jetpack"),Thu:__("Thursday","jetpack"),Fri:__("Friday","jetpack"),Sat:__("Saturday","jetpack")},startOfWeek:0},b=e=>{const{attributes:t,isSelected:n}=e,r=(0,i.useBlockProps)(),[o,u]=(0,l.useState)(f),[d,b]=(0,l.useState)(!1),{days:v}=t,{startOfWeek:y}=o,k=v.concat(v.slice(0,y)).slice(y);let w;if((0,l.useEffect)(()=>{s()({path:"/wpcom/v2/business-hours/localized-week"}).then(e=>{u(e),b(!0)},()=>{u(f),b(!0)})},[]),d)if(n)w=(0,m.jsx)("div",{className:"is-edit",children:k.map((t,n)=>(0,m.jsx)(p.A,{day:t,localization:o,...e},n))});else{const e=(0,c.getSettings)(),{formats:{time:t}}=e;w=(0,m.jsx)("dl",{className:"jetpack-business-hours",children:k.map((e,n)=>(0,m.jsx)(h.A,{day:e,localization:o,timeFormat:t},n))})}else w=(0,m.jsx)(a.Placeholder,{icon:g,label:__("Loading business hours","jetpack")});return(0,m.jsx)("div",{...r,children:w})};n.d(t,["A",0,b])},14990(e,t,n){"use strict";var r=n(94375),o=n(9050),s=n(52097),i=(n(18681),n(82805),n(10790));(0,r.M)(o,{edit:e=>(0,i.jsx)(s.A,{...e}),save:()=>null})},28310(e,t,n){"use strict";var r=n(98329);const o={element:{type:"string",enum:["a","button","input"]},saveInPostContent:{type:"boolean",default:!1},uniqueId:{type:"string"},passthroughAttributes:{type:"object"},text:{type:"string",role:"content"},placeholder:{type:"string",role:"content"},url:{type:"string",role:"content"},textColor:{type:"string"},customTextColor:{type:"string",validator:r.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:r.A},gradient:{type:"string"},customGradient:{type:"string"},borderRadius:{type:"number"},width:{type:"string"},customVariant:{type:"string"},metaName:{type:"string"}};n.d(t,["A",0,o])},41695(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(56427),o=n(86087),s=n(27723),i=(n(8746),n(10790));const __=s.__;function a({borderRadius:e="",setAttributes:t}){const n=(0,o.useCallback)(e=>t({borderRadius:e}),[t]);return(0,i.jsx)(r.PanelBody,{title:__("Border Settings","jetpack"),children:(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,allowReset:!0,initialPosition:5,label:__("Border radius","jetpack"),max:50,min:0,onChange:n,value:e})})}},42929(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(27723),s=n(10790);const __=o.__;function i({isGradientAvailable:e,backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,gradientValue:i,setBackgroundColor:a,setGradient:c,setTextColor:l,textColor:u}){const d=(0,s.jsx)(r.ContrastChecker,{backgroundColor:t.color,fallbackBackgroundColor:n,fallbackTextColor:o,isLargeText:!1,textColor:u.color});return e?(0,s.jsx)(r.__experimentalPanelColorGradientSettings,{settings:[{colorValue:u.color,label:__("Text Color","jetpack"),onColorChange:l},{colorValue:t.color,gradientValue:i,label:__("Background","jetpack"),onColorChange:a,onGradientChange:c}],title:__("Background & Text Color","jetpack"),children:d}):(0,s.jsx)(r.PanelColorSettings,{colorSettings:[{value:u.color,onChange:l,label:__("Text Color","jetpack")},{value:t.color,onChange:a,label:__("Background","jetpack")}],title:__("Background & Text Color","jetpack"),children:d})}},8746(e,t,n){"use strict";var r=n(94715);const o=!!r.__experimentalUseGradient;n.d(t,["U",0,o])},57667(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(47143),o=n(68210),s=n(41695),i=n(42929),a=n(10790);function c({attributes:e,backgroundColor:t,clientId:n,context:c,fallbackBackgroundColor:l,fallbackTextColor:u,setAttributes:d,setBackgroundColor:p,setTextColor:h,textColor:m,gradientValue:g,setGradient:f,isGradientAvailable:b}){const{align:v,borderRadius:y}=e,k="jetpack/parentBlockWidth"in c,w=k?c["jetpack/parentBlockWidth"]:e.width,x=(0,r.useSelect)(e=>{const{getBlock:t,getBlockRootClientId:r}=e("core/block-editor");return t(r(n))}),{updateBlockAttributes:_}=(0,r.useDispatch)("core/block-editor");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.A,{backgroundColor:t,fallbackBackgroundColor:l,fallbackTextColor:u,gradientValue:g,setBackgroundColor:p,setGradient:f,setTextColor:h,textColor:m,isGradientAvailable:b}),(0,a.jsx)(s.A,{borderRadius:y,setAttributes:d}),(0,a.jsx)(o.D,{align:v,width:w,onChange:e=>{k?_(x.clientId,{width:e}):d({width:e})}})]})}},49061(e,t,n){"use strict";var r=n(94715),o=n(29491),s=n(47143),i=n(86087),a=n(27723),c=n(13022),l=n(8746),u=n(57667),d=n(7528),p=n(81177),h=(n(28769),n(10790));const __=a.__;const m=(0,o.compose)((0,r.withColors)({backgroundColor:"background-color"},{textColor:"color"}))(function(e){const{attributes:t,backgroundColor:n,className:o,clientId:a,setAttributes:m,textColor:g}=e,{borderRadius:f,element:b,placeholder:v,text:y,width:k,fontSize:w,customVariant:x,metaName:_}=t;(0,p.A)({attributes:t,clientId:a,setAttributes:m});const{metadata:j}=(0,s.useSelect)(e=>{const{getBlockAttributes:t}=e(r.store);return{metadata:t(a)?.metadata}},[a]),{updateBlockAttributes:C,__unstableMarkNextChangeAsNotPersistent:A}=(0,s.useDispatch)("core/block-editor"),{gradientClass:S,gradientValue:E,setGradient:T}=l.U?(0,r.__experimentalUseGradient)({gradientAttribute:"gradient",customGradientAttribute:"customGradient"}):{},N=(0,r.useBlockProps)({className:(0,c.A)("wp-block-button",o),style:{width:k}}),[P,B]=(0,d.A)(),M=(0,r.__experimentalUseBorderProps)(t),I=(0,c.A)("wp-block-button__link",M.className,{"has-background":n.color||E,[n.class]:!E&&n.class,"has-text-color":g.color,[g.class]:g.class,[S]:S,"no-border-radius":0===f,[`has-${w}-font-size`]:!!w,"has-custom-font-size":!!w,[`is-${x}`]:!!x});(0,i.useEffect)(()=>{a&&_&&j?.name!==_&&(A(),C(a,{metadata:{...j,name:_}}))},[_,j,C,a,A]);const R={...!n.color&&E?{background:E}:{backgroundColor:n.color},fontSize:t.style?.typography?.fontSize,color:g.color,borderRadius:f?f+"px":void 0,...M.style};return(0,h.jsxs)("div",{...N,children:[(0,h.jsx)(r.RichText,{allowedFormats:"input"===b?[]:void 0,className:I,disableLineBreaks:"input"===b,onChange:e=>m({text:e}),placeholder:v||__("Add text…","jetpack"),ref:B,style:R,value:y,withoutInteractiveFormatting:!0}),(0,h.jsx)(r.InspectorControls,{children:(0,h.jsx)(u.A,{gradientValue:E,setGradient:T,isGradientAvailable:l.U,...P,...e})})]})});n.d(t,["A",0,m])},45878(e,t,n){"use strict";var r=n(94375),o=n(5383);(0,r.A)("button",o.W)},61138(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z"})});n.d(t,["A",0,s])},5383(e,t,n){"use strict";var r=n(27723),o=n(97969),s=n(28310),i=n(49061),a=n(61138),c=n(62270);const __=r.__,l={apiVersion:3,title:__("Button","jetpack"),icon:a.A,category:(0,o.A)("design","layout"),keywords:[],supports:{html:!1,inserter:!1,align:["left","center","right"],typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}}},styles:[{name:"fill",label:__("Fill","jetpack"),isDefault:!0},{name:"outline",label:__("Outline","jetpack")}],selectors:{border:".wp-block-jetpack-button .wp-block-button__link"},attributes:s.A,edit:i.A,save:c.A,usesContext:["jetpack/parentBlockWidth"]};n.d(t,["W",0,l])},62270(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(13022),s=n(8746),i=n(10790);function a({attributes:e,blockName:t,uniqueId:n}){const{backgroundColor:a,borderRadius:c,className:l,customBackgroundColor:u,customGradient:d,customTextColor:p,gradient:h,saveInPostContent:m,text:g,textColor:f,url:b,width:v,fontSize:y}=e;if(!m)return null;const k=r.useBlockProps.save(),w=(0,r.__experimentalGetBorderClassesAndStyles)(e),x=(0,r.getColorClassName)("background-color",a),_=s.U?(0,r.__experimentalGetGradientClass)(h):void 0,j=(0,r.getColorClassName)("color",f),C=(0,o.A)("wp-block-button","jetpack-submit-button",l,k?.className,w.className,{[`wp-block-jetpack-${t}`]:t}),A=(0,o.A)("wp-block-button__link",{"has-text-color":f||p,[j]:j,"has-background":a||h||u||d,[x]:x,[_]:_,"no-border-radius":0===c,"has-custom-width":!!v,[`has-${y}-font-size`]:!!y,"has-custom-font-size":!!y}),S={background:d||void 0,backgroundColor:x||d||h?void 0:u,fontSize:e.style?.typography?.fontSize,color:j?void 0:p,borderRadius:c?c+"px":void 0,width:v,...w.style};return(0,i.jsx)("div",{...k,className:C,children:(0,i.jsx)(r.RichText.Content,{className:A,"data-id-attr":n||"placeholder",href:b,id:n,rel:"noopener noreferrer",role:"button",style:S,tagName:"a",target:"_blank",value:g})})}},7528(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(29491),o=n(86087);function s(){const[e,t]=(0,o.useState)(),n=(0,r.useRefEffect)(n=>{const r=()=>{const r=getComputedStyle(n),o=r.backgroundColor,s=r.color;o===e?.fallbackBackgroundColor&&s===e?.fallbackTextColor||t({fallbackBackgroundColor:o,fallbackTextColor:s})},o=new MutationObserver(r);return o.observe(n,{attributeFilter:["style","class"]}),r(),()=>{o.disconnect()}},[]);return[e,n]}},81177(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(47143),o=n(86087),s=n(66087);function i({attributes:e,clientId:t,setAttributes:n}){const{passthroughAttributes:i}=e,a=(0,r.useSelect)(n=>{const r=n("core/block-editor"),o=r.getBlockRootClientId(t),s=r.getBlockAttributes(o)||{};if(!o||!i)return{};let a=!1;const c={};return Object.entries(i).forEach(([t,n])=>{const r=s[n];r!==e[t]&&(a=!0,c[t]=r)}),a?c:{}},[t,i,e]);(0,o.useEffect)(()=>{(0,s.isEmpty)(a)||n(a)},[a,n])}},95816(e,t,n){"use strict";n.d(t,["a",0,"https://calendly.com/wpcom/jetpack-block-example"])},10137(e,t,n){"use strict";var r=n(97999),o=n(94715),s=n(56427),i=n(27723),a=n(39968),c=n(57273),l=n(24971),u=n(10790);const __=i.__,_x=i._x,d=({onEditClick:e})=>(0,u.jsx)(s.ToolbarGroup,{children:(0,u.jsx)(s.ToolbarButton,{onClick:()=>e(!0),children:__("Edit","jetpack")})}),p=()=>{const e=(0,r.isWpcomPlatformSite)()?"https://wordpress.com/support/wordpress-editor/blocks/calendly-block/#customize-the-calendly-block":"https://jetpack.com/support/jetpack-blocks/calendly-block/#customizing-a-calendly-block";return(0,u.jsx)(a.E,{render:(0,u.jsx)("div",{}),children:(0,u.jsx)(c.N,{openInNewTab:!0,href:e,children:__("Explore customization options","jetpack")})})},h=e=>{const{attributes:{hideEventTypeDetails:t},defaultClassName:n,embedCode:r,parseEmbedCode:o,setAttributes:i,setEmbedCode:a}=e;return(0,u.jsxs)(s.PanelBody,{title:__("Calendar settings","jetpack"),initialOpen:!1,children:[(0,u.jsxs)("form",{onSubmit:o,className:`${n}-embed-form-sidebar`,children:[(0,u.jsx)(s.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:__("Calendly web address or embed code","jetpack"),id:"embedCode",onChange:a,placeholder:__("Calendly web address or embed code…","jetpack"),value:r||""}),(0,u.jsx)(s.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]}),(0,u.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Hide event type details","jetpack"),checked:t,onChange:()=>i({hideEventTypeDetails:!t})})]})},m=e=>{const{attributes:t,isEditingUrl:n,setAttributes:r,setIsEditingUrl:s}=e,{style:i,url:a}=t,c=[{value:"inline",label:__("Inline","jetpack")},{value:"link",label:__("Link","jetpack")}];return(0,u.jsxs)(u.Fragment,{children:[a&&!n&&(0,u.jsx)(o.BlockControls,{children:(0,u.jsx)(d,{onEditClick:s})}),a&&(0,u.jsx)(l.A,{styleOptions:c,onSelectStyle:r,activeStyle:i,children:(0,u.jsx)(p,{})}),(0,u.jsx)(o.InspectorControls,{children:(0,u.jsx)(h,{...e})})]})};n.d(t,["Ay",0,m])},88471(e,t,n){"use strict";var r=n(74997),o=n(27723),s=n(98329),i=n(10790);const __=o.__,a={attributes:{backgroundColor:{type:"string",default:"ffffff",validator:s.A},submitButtonText:{type:"string",default:__("Schedule time with me","jetpack")},submitButtonTextColor:{type:"string"},submitButtonBackgroundColor:{type:"string"},submitButtonClasses:{type:"string"},hideEventTypeDetails:{type:"boolean",default:!1},primaryColor:{type:"string",default:"00A2FF",validator:s.A},textColor:{type:"string",default:"4D5055",validator:s.A},style:{type:"string",default:"inline",validValues:["inline","link"]},url:{type:"string",validator:e=>!e||e.startsWith("https://calendly.com/")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},customBackgroundButtonColor:{type:"string",validator:s.A},customTextButtonColor:{type:"string",validator:s.A}},migrate:e=>{const{submitButtonText:t,submitButtonTextColor:n,submitButtonBackgroundColor:o,submitButtonClasses:s,backgroundButtonColor:i,textButtonColor:a,customBackgroundButtonColor:c,customTextButtonColor:l,...u}=e,d={text:(p=e).submitButtonText||__("Schedule time with me","jetpack"),textColor:p.submitButtonTextColor||p.textButtonColor,customTextColor:p.customTextButtonColor,backgroundColor:p.submitButtonBackgroundColor||p.backgroundButtonColor,customBackgroundColor:p.customBackgroundButtonColor,url:p.url};var p;return[u,[(0,r.createBlock)("jetpack/button",{element:"a",uniqueId:"calendly-widget-id",...d})]]},save:({attributes:{url:e}})=>(0,i.jsx)("a",{href:e,children:e})};n.d(t,["A",0,a])},9659(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(74997),i=n(56427),a=n(47143),c=n(86087),l=n(27723),u=n(57273),d=n(13022),p=n(66087),h=n(78218),m=n(56145),g=n(13248),f=n(95816),b=n(10137),v=n(38028),y=(n(78215),n(61095),n(10790));const __=l.__,_x=l._x,k="jetpack/button",w={element:"a",text:__("Schedule time with me","jetpack"),uniqueId:"calendly-widget-id",url:f.a},x=(0,r.sh)(g);const _=(0,i.withNotices)(function(e){const{attributes:t,clientId:n,isSelected:r,name:l,noticeOperations:_,noticeUI:j,setAttributes:C}=e,A=(0,s.getBlockDefaultClassName)(l),S=(0,h.y)(g.attributes,t);(0,p.isEqual)(S,t)||C(S);const{backgroundColor:E,hideEventTypeDetails:T,primaryColor:N,textColor:P,style:B,url:M}=S,I=(0,v.DO)(M),[R,L]=(0,c.useState)(M),[D,F]=(0,c.useState)(!1),[O,z]=(0,c.useState)(!1),[U,H]=(0,c.useState)({}),[$,V]=(0,c.useState)(!1),q=(0,o.useBlockProps)();(0,c.useEffect)(()=>{!r&&$&&V(!1)},[$,r]);const G=()=>{_.removeAllNotices(),_.createErrorNotice(__("Your calendar couldn't be embedded. Please double check your URL or code.","jetpack"))};(0,c.useEffect)(()=>{M&&f.a!==M&&"link"!==B&&(0,m.A)(M,z).catch(()=>{C({url:void 0}),G()})},[]);const W=e=>{if(!e)return void G();e.preventDefault();const t=(0,v.a9)(R);if(t){if(t.buttonAttributes&&"link"===t.style){const e=(0,a.select)("core/editor").getBlocksByClientId(n);e.length&&e[0].innerBlocks.forEach(e=>{(0,a.dispatch)("core/editor").updateBlockAttributes(e.clientId,t.buttonAttributes)}),H(t.buttonAttributes)}(0,m.A)(t.url,z).then(()=>{const e=(0,h.y)(g.attributes,t);C(e),F(!1),_.removeAllNotices()}).catch(()=>{C({url:void 0}),G()})}else G()},Z=(0,y.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,y.jsx)(i.Spinner,{}),(0,y.jsx)("p",{children:__("Embedding…","jetpack")})]}),J=(0,y.jsxs)(i.Placeholder,{label:__("Calendly","jetpack"),instructions:__("Enter your Calendly web address or embed code below.","jetpack"),icon:x,notices:j,children:[(0,y.jsxs)("form",{onSubmit:W,children:[(0,y.jsx)("input",{type:"text",id:"embedCode",onChange:e=>L(e.target.value),placeholder:__("Calendly web address or embed code…","jetpack"),value:R||"",className:"components-placeholder__input"}),(0,y.jsx)("div",{children:(0,y.jsx)(i.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]}),(0,y.jsx)("div",{className:`${A}-learn-more`,children:(0,y.jsx)(u.N,{openInNewTab:!0,href:"https://help.calendly.com/hc/en-us/articles/223147027-Embed-options-overview",children:__("Need help finding your embed code?","jetpack")})})]}),K=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("iframe",{src:(()=>{const e=new URLSearchParams({embed_domain:"wordpress.com",embed_type:"Inline",hide_event_type_details:T?1:0,background_color:E,primary_color:N,text_color:P});return`${I}?${e}`})(),width:"100%",height:"100%",frameBorder:"0","data-origwidth":"100%","data-origheight":"100%",title:"Calendly"}),!$&&(0,y.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:()=>V(!0)})]}),Y=(0,y.jsx)(o.InnerBlocks,{template:[[k,{...w,...U,passthroughAttributes:{url:"url"}}]],templateLock:"all"});return O?Z:(0,y.jsxs)("div",{...q,className:(0,d.A)(q.className,{[`calendly-style-${B}`]:I&&!D}),children:[(0,y.jsx)(b.Ay,{...e,defaultClassName:A,embedCode:R,isEditingUrl:D,parseEmbedCode:W,setEmbedCode:L,setIsEditingUrl:F}),I&&!D?(Q=B,"inline"===Q?K:Y):J]});var Q});n.d(t,["A",0,_])},60312(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(13248),i=n(88471),a=n(9659),c=n(34844),l=n(38028);n(78215);(0,o.M)(s,{edit:a.A,save:c.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&l.QL.test(e.textContent),transform:e=>{const t=(0,l.a9)(e.textContent);return(0,r.createBlock)("jetpack/calendly",t)}}]},deprecated:[i.A]})},34844(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},38028(e,t,n){"use strict";n.d(t,{DO:()=>o});const r=/(^|\/\/)(calendly\.com[^"']*)/i;function o(e){try{const t=new URL(e);if(!["http:","https:"].includes(t.protocol)||"calendly.com"!==t.hostname||t.username||t.password||t.port)return;return t.protocol="https:",t.toString()}catch{return}}n.d(t,["QL",0,r,"a9",0,e=>{if(!e)return;const t=(e=>{const t=e.match(r);if(t)return o("https://"+t[2])})(e);if(!t)return;const n=(e=>{const t={},n=new URL(e);if(t.url=n.origin+n.pathname,!n.search)return t;const r=new URLSearchParams(n.search),o=r.get("background_color"),s=r.get("primary_color"),i=r.get("text_color"),a=/^[A-Za-z0-9]{6}$/;return r.get("hide_event_type_details")&&(t.hideEventTypeDetails=r.get("hide_event_type_details")),o&&o.match(a)&&(t.backgroundColor=o),s&&s.match(a)&&(t.primaryColor=s),i&&i.match(a)&&(t.textColor=i),t})(t),s=(e=>e.indexOf("data-url")>0?"inline":e.indexOf("initPopupWidget")>0||e.indexOf("initBadgeWidget")>0?"link":void 0)(e);if(s&&(n.style=s),"link"===s){n.buttonAttributes={};const t=(e=>{let t=e.match(/false;">([^<]+)<\//);return t?t[1]:(t=e.match(/text: '([^']*?)'/),t?t[1]:void 0)})(e);t&&(n.buttonAttributes.text=t);const r=(e=>{const t=e.match(/textColor: '([^']*?)'/);if(t)return t[1]})(e);r&&(n.buttonAttributes.textColor=void 0,n.buttonAttributes.customTextColor=r);const o=(e=>{const t=e.match(/color: '([^']*?)'/);if(t)return t[1]})(e);o&&(n.buttonAttributes.backgroundColor=void 0,n.buttonAttributes.customBackgroundColor=o)}return n}])},98169(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(13022),c=n(58842),l=n(10790);const __=i.__,u=e=>{const{attributes:{address:t,addressLine2:n,addressLine3:i,city:u,region:d,postal:p,country:h,linkToGoogleMaps:m},isSelected:g,setAttributes:f}=e,b=[t,n,i,u,d,p,h].some(e=>""!==e),v=(0,a.A)({"jetpack-address-block":!0,"is-selected":g}),y=(0,s.useCallback)(e=>{"Enter"===e.key&&e.preventDefault()},[]),k=(0,r.useBlockProps)({className:v}),w=(0,l.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Link address to Google Maps","jetpack"),checked:m,onChange:e=>f({linkToGoogleMaps:e})});return(0,l.jsxs)("div",{...k,children:[!g&&b&&(0,c.A)(e),(g||!b)&&(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(r.PlainText,{value:t,placeholder:__("Street Address","jetpack"),"aria-label":__("Street Address","jetpack"),onChange:e=>f({address:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:n,placeholder:__("Address Line 2","jetpack"),"aria-label":__("Address Line 2","jetpack"),onChange:e=>f({addressLine2:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:i,placeholder:__("Address Line 3","jetpack"),"aria-label":__("Address Line 3","jetpack"),onChange:e=>f({addressLine3:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:u,placeholder:__("City","jetpack"),"aria-label":__("City","jetpack"),onChange:e=>f({city:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:d,placeholder:__("State/Province/Region","jetpack"),"aria-label":__("State/Province/Region","jetpack"),onChange:e=>f({region:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:p,placeholder:__("Postal/Zip Code","jetpack"),"aria-label":__("Postal/Zip Code","jetpack"),onChange:e=>f({postal:e}),onKeyDown:y}),(0,l.jsx)(r.PlainText,{value:h,placeholder:__("Country","jetpack"),"aria-label":__("Country","jetpack"),onChange:e=>f({country:e}),onKeyDown:y}),w]})]})};n.d(t,["A",0,u])},36569(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(98169),i=n(58842),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Address","jetpack"),description:__("Lets you add a physical address with Schema markup.","jetpack"),keywords:[_x("location","block search term","jetpack"),_x("direction","block search term","jetpack"),_x("place","block search term","jetpack")],icon:(0,a.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,a.jsx)(o.Path,{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"}),(0,a.jsx)(o.Circle,{cx:"12",cy:"9",r:"2.5"})]}),category:"grow",attributes:{address:{type:"string",default:""},addressLine2:{type:"string",default:""},addressLine3:{type:"string",default:""},city:{type:"string",default:""},region:{type:"string",default:""},postal:{type:"string",default:""},country:{type:"string",default:""},linkToGoogleMaps:{type:"boolean",default:!1}},parent:["jetpack/contact-info"],edit:s.A,save:i.A};n.d(t,["U",0,"address","W",0,c])},58842(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(27723),i=n(10790);const __=s.__,a=({attributes:{address:e,addressLine2:t,addressLine3:n,city:r,region:s,postal:a,country:c}})=>(0,i.jsxs)(o.Fragment,{children:[e&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address1",children:e}),t&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address2",children:t}),n&&(0,i.jsx)("div",{className:"jetpack-address__address jetpack-address__address3",children:n}),r&&!(s||a)&&(0,i.jsx)("div",{className:"jetpack-address__city",children:r}),r&&(s||a)&&(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"jetpack-address__city",children:r}),", ",(0,i.jsx)("span",{className:"jetpack-address__region",children:s})," ",(0,i.jsx)("span",{className:"jetpack-address__postal",children:a})]}),!r&&(s||a)&&(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"jetpack-address__region",children:s})," ",(0,i.jsx)("span",{className:"jetpack-address__postal",children:a})]}),c&&(0,i.jsx)("div",{className:"jetpack-address__country",children:c})]}),c=({attributes:{address:e,addressLine2:t,addressLine3:n,city:r,region:o,postal:s,country:i}})=>{let a=o?`+${o},`:"";a=s?`${a}+${s}`:a;return`https://www.google.com/maps/search/${e?`${e},`:""}${t?`${t},`:""}${n?`${n},`:""}${r?`+${r},`:""}${a}${i?`+${i}`:""}`.replace(" ","+")},l=e=>{if(!(({address:e,addressLine2:t,addressLine3:n,city:r,region:o,postal:s,country:i})=>[e,t,n,r,o,s,i].some(e=>""!==e))(e.attributes))return null;const t=r.useBlockProps.save();return(0,i.jsxs)("div",{...t,children:[e.attributes.linkToGoogleMaps&&(0,i.jsx)("a",{href:c(e),target:"_blank",rel:"noopener noreferrer",title:__("Open address in Google Maps","jetpack"),children:(0,i.jsx)(a,{...e})}),!e.attributes.linkToGoogleMaps&&(0,i.jsx)(a,{...e})]})};n.d(t,["A",0,l])},74842(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(10790);const i=["jetpack/markdown","jetpack/address","jetpack/email","jetpack/phone","jetpack/map","jetpack/business-hours","core/paragraph","core/image","core/heading","core/gallery","core/list","core/quote","core/shortcode","core/audio","core/code","core/cover","core/html","core/separator","core/spacer","core/subhead","core/video"],a=[["jetpack/email"],["jetpack/phone"],["jetpack/address"]],c=e=>{const{className:t,isSelected:n}=e,c=(0,r.useBlockProps)({className:(0,o.A)(t,{"jetpack-contact-info-block":!0,"is-selected":n})});return(0,s.jsx)("div",{...c,children:(0,s.jsx)(r.InnerBlocks,{allowedBlocks:i,templateLock:!1,template:a})})};n.d(t,["A",0,c])},25907(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(36569),i=n(75173),a=n(74842),c=n(69933),l=n(77909),u=n(47377);n(75360),n(25378);(0,o.M)(i,{edit:a.A,save:u.A,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"widget_contact_info"===e,transform:({instance:e})=>{let t=[(0,r.createBlock)("core/heading",{content:e.raw.title}),(0,r.createBlock)("jetpack/email",{email:e.raw.email}),(0,r.createBlock)("jetpack/phone",{phone:e.raw.phone}),(0,r.createBlock)("jetpack/address",{address:e.raw.address})];return e.raw.hours&&(t=[...t,(0,r.createBlock)("core/paragraph",{content:e.raw.hours})]),e.raw.showmap&&e.raw.address&&(t=[...t,(0,r.createBlock)("jetpack/map",{address:e.raw.address})]),(0,r.createBlock)("jetpack/contact-info",{},t)}}]}},[{name:s.U,settings:s.W},{name:"email",settings:c.W},{name:"phone",settings:l.W}])},43167(e,t,n){"use strict";var r=n(94715),o=n(27723),s=n(45838),i=n(19038);const __=o.__,a=e=>{const t=(0,r.useBlockProps)(),{setAttributes:n}=e;return(0,s.A)("email",e,__("Email","jetpack"),i.A,e=>n({email:e}),t)};n.d(t,["A",0,a])},69933(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(43167),i=n(19038),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Email Address","jetpack"),description:__("Lets you add an email address with an automatically generated click-to-email link.","jetpack"),keywords:["e-mail","email",_x("message","block search term","jetpack")],icon:(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"})}),category:"grow",attributes:{email:{type:"string",default:""}},edit:s.A,save:i.A,parent:["jetpack/contact-info"]};n.d(t,["W",0,c])},19038(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(39904),i=n(10790);const a=({attributes:{email:e}})=>{if(!e)return null;const t=r.useBlockProps.save();return(0,i.jsx)("div",{...t,children:(n=e,n.split(/(\s+)/).map((e,t)=>{const n=e.replace(/([.,/#!$%^&*;:{}=\-_`~()\][])+$/g,"");return e.indexOf("@")&&(0,s.t)(n)?e===n?(0,i.jsx)("a",{href:`mailto:${e}`,children:e},t):(0,i.jsxs)(o.Fragment,{children:[(0,i.jsx)("a",{href:`mailto:${e}`,children:n},t),(0,i.jsx)(o.Fragment,{children:e.slice(-(e.length-n.length))})]},t):(0,i.jsx)(o.Fragment,{children:e},t)}))});var n};n.d(t,["A",0,a])},42711(e,t,n){"use strict";var r=n(94715),o=n(27723),s=n(45838),i=n(5926);const __=o.__,a=e=>{const t=(0,r.useBlockProps)(),{setAttributes:n}=e;return(0,s.A)("phone",e,__("Phone number","jetpack"),i.A,e=>n({phone:e}),t)};n.d(t,["A",0,a])},77909(e,t,n){"use strict";var r=n(27723),o=n(5573),s=n(42711),i=n(5926),a=n(10790);const __=r.__,_x=r._x,c={apiVersion:3,title:__("Phone Number","jetpack"),description:__("Lets you add a phone number with an automatically generated click-to-call link.","jetpack"),keywords:[_x("mobile","block search term","jetpack"),_x("telephone","block search term","jetpack"),_x("cell","block search term","jetpack")],icon:(0,a.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(o.Path,{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z"})}),category:"grow",attributes:{phone:{type:"string",default:""}},parent:["jetpack/contact-info"],edit:s.A,save:i.A};n.d(t,["W",0,c])},5926(e,t,n){"use strict";var r=n(94715),o=n(10790);function s(e){const t=e.match(/\d+\.\d+|\d+\b|\d+(?=\w)/g);if(!t)return e;const n=e.indexOf(t[0]);let r=n?e.substring(n-1):e,s=n?e.substring(0,n):"",i=r.replace(/\D/g,"");/[0-9/+/(]/.test(r[0])?(s=s.slice(0,-1),"+"===r[0]&&(i="+"+i)):r=r.substring(1);return[s.trim()?(0,o.jsx)("span",{className:"phone-prefix",children:s},"phonePrefix"):null,(0,o.jsx)("a",{href:`tel:${i}`,children:r},"phoneNumber")]}const i=({attributes:{phone:e}})=>{if(!e)return null;const t=r.useBlockProps.save();return(0,o.jsx)("div",{...t,children:s(e)})};n.d(t,["A",0,i])},47377(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=()=>{const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})};n.dn(s),n.d(t,["A",0,s])},68071(e,t,n){"use strict";var r=n(27723);const __=r.__,o=(0,r.sprintf)(
66 66 // translators: %s is a link to the cookie policy.
67 67 __("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>`);n.d(t,["a",0,o])},70024(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(27723),i=(n(57378),n(68071)),a=n(34839),c=n(10790);const __=s.__;const l=function({clientId:e,attributes:t,setAttributes:n}){const{consentExpiryDays:l,align:u,text:d=i.a}=t;(0,a.w)(e);const p=(0,r.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${u}`});return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.InspectorControls,{children:(0,c.jsxs)(o.PanelBody,{title:__("Block Settings","jetpack"),children:[(0,c.jsx)(o.SelectControl,{label:__("Alignment","jetpack"),value:u,options:[{label:(0,s.isRTL)()?__("Right","jetpack"):__("Left","jetpack"),value:"left"},{label:__("Full","jetpack"),value:"full"},{label:__("Wide","jetpack"),value:"wide"},{label:(0,s.isRTL)()?__("Left","jetpack"):__("Right","jetpack"),value:"right"}],onChange:e=>function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,c.jsx)(o.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:l,type:"number",min:"1",max:"365",onChange:e=>n({consentExpiryDays:parseInt(e)}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,c.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,c.jsxs)("div",{...p,style:p.style,children:[(0,c.jsx)(r.RichText,{tagName:"p",value:d,onChange:e=>n({text:e})}),(0,c.jsx)(r.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})]})]})};n.d(t,["A",0,l])},78165(e,t,n){"use strict";var r=n(94375),o=n(74095),s=n(70024),i=n(54175);n(57378);(0,r.M)(o,{edit:s.A,save:i.A})},54175(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(68071),s=n(10790);function i({attributes:e}){const t=r.useBlockProps.save(),{text:n=o.a,consentExpiryDays:i}=e;return(0,s.jsxs)("div",{...t,style:t.style,role:"dialog","aria-modal":"true",children:[(0,s.jsx)(r.RichText.Content,{tagName:"p",value:n}),(0,s.jsx)(r.InnerBlocks.Content,{}),(0,s.jsx)("span",{children:i})]})}},34839(e,t,n){"use strict";n.d(t,{w:()=>c});var r=n(74997),o=n(29491),s=n(3582),i=n(47143),a=n(86087);function c(e){const t=(0,i.useSelect)(e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:n}=e("core/editor");return t()||n()},[]),n=!(!(0,o.usePrevious)(t)||t),[,c]=(0,s.useEntityProp)("root","site","cookie_consent_template"),{saveEditedEntityRecord:l}=(0,i.useDispatch)(s.store),[u,d]=(0,a.useState)(!1),p=(0,i.useSelect)(e=>{const{getBlock:t}=e("core/block-editor");return t}),h=(0,a.useCallback)(e=>{d(!0),c(e),l("root","site",void 0,{cookie_consent_template:e}).finally(()=>{d(!1)})},[d,c,l]);(0,a.useEffect)(()=>()=>{p(e)||h(null)},[]),(0,a.useEffect)(()=>{n&&!u&&h((0,r.serialize)([p(e)]))},[n,u,h,p,e])}},91376(e,t,n){"use strict";var r=n(4567),o=n(26356),s=n(94715),i=n(86087),a=n(13022),c=n(72730),l=n(10790);const u=({className:e=null,currency:t=null,defaultValue:n=null,disabled:u=!1,label:d="",onChange:p=null,value:h=""})=>{const[m,g]=(0,i.useState)((0,r.Ay)(h,t,{symbol:""})),[f,b]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),k=(0,i.useRef)(null),w=(0,i.useCallback)((e,n)=>{g(r=>{if(e!==r){const r=(0,c.C_)(e,t);r&&r>=(0,c.dv)(t)?(y(!1),n&&p?.(r)):y(!0)}return e})},[t,p]),x=()=>{k.current&&(k.current.focus(),b(!0))};return(0,i.useEffect)(()=>{if(!k.current)return;const e=k.current,o=()=>{b(!1),m||w((0,r.Ay)(n,t,{symbol:""}))};return e.addEventListener("blur",o),()=>{e.removeEventListener("blur",o)}},[t,n,m,k,w]),(0,i.useEffect)(()=>{f||v||g((0,r.Ay)(h,t,{symbol:""}))},[t,f,v,h]),(0,i.useEffect)(()=>{w((0,r.Ay)(h,t,{symbol:""}))},[t,h]),(0,l.jsxs)("div",{className:(0,a.A)("donations__amount",e,{"has-focus":f,"has-error":v}),role:"button",tabIndex:0,onClick:x,onKeyDown:x,children:[o.y[t].symbol,u?(0,l.jsx)("div",{className:"donations__amount-value",children:(0,r.Ay)(h||n,t,{symbol:""})}):(0,l.jsx)(s.RichText,{allowedFormats:[],"aria-label":d,onChange:e=>w(e,!0),placeholder:(0,r.Ay)(n,t,{symbol:""}),ref:k,value:m,withoutInteractiveFormatting:!0})]})};n.d(t,["A",0,u])},22883(e,t,n){"use strict";const r=["left","center","right","full"],o=(e,t="border")=>{if(!e||"object"!=typeof e)return[];const n=[],r=["top","right","bottom","left"];return r.some(t=>e[t])?r.forEach(r=>{const o=e[r];o&&(o.color&&n.push(`${t}-${r}-color:${o.color}`),o.style&&n.push(`${t}-${r}-style:${o.style}`),o.width&&n.push(`${t}-${r}-width:${o.width}`))}):(e.color&&n.push(`${t}-color:${e.color}`),e.style&&n.push(`${t}-style:${e.style}`),e.width&&n.push(`${t}-width:${e.width}`)),n},s=e=>{if(!e)return[];if("string"==typeof e)return[`border-radius:${e}`];if("object"==typeof e){const t={topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"};return Object.entries(t).filter(([t])=>e[t]).map(([t,n])=>`${n}:${e[t]}`)}return[]},i=(e,t)=>{const{activeTabBackgroundColor:n,activeTabTextColor:i,inactiveTabBackgroundColor:a,inactiveTabTextColor:c,selectedAmountBackgroundColor:l,selectedAmountTextColor:u,selectedAmountOutlineColor:d,tabBorderColor:p,tabFontSize:h,tabPadding:m,amountFontSize:g,amountBorder:f,amountBorderRadius:b,buttonFontSize:v,buttonPadding:y,buttonAlignment:k,buttonBorderRadius:w,contentAlignment:x,blockBorder:_,blockBorderRadius:j,displayMode:C}=e,A=[];if(["left","center","right"].includes(x)){A.push(`${t} .donations__content{text-align:${x}}`);const e={left:"flex-start",center:"center",right:"flex-end"};A.push(`${t} .donations__amounts{justify-content:${e[x]}}`)}if(p&&A.push(`${t} .donations__nav,${t} .donations__nav-item,${t} .donations__nav-item.is-active{border-color:${p}}`),w){const e=s(w);e.length&&A.push(`${t} .donations__donate-button{${e.join(";")}}`)}const S=[];g&&S.push(`font-size:${g}`),S.push(...o(f)),S.push(...s(b)),S.length&&A.push(`${t} .donations__amount{${S.join(";")}}`);const E=[];h&&E.push(`font-size:${h}`),m&&["top","right","bottom","left"].forEach(e=>{m[e]&&E.push(`padding-${e}:${m[e]}`)}),E.length&&A.push(`${t} .donations__nav-item{${E.join(";")}}`);const T=[];n&&T.push(`background:${n}`),i&&T.push(`color:${i}`),T.length&&A.push(`${t} .donations__nav-item.is-active{${T.join(";")}}`);const N=[];a&&N.push(`background:${a}`),c&&N.push(`color:${c}`),N.length&&A.push(`${t} .donations__nav-item:not(.is-active){${N.join(";")}}`);const P=[];l&&P.push(`background-color:${l}`),u&&P.push(`color:${u}`),d&&P.push(`box-shadow:0 0 0 1px #fff,0 0 0 3px ${d}`),P.length&&A.push(`${t} .donations__amount.is-selected{${P.join(";")}}`);const B=[];if(v&&B.push(`font-size:${v}`),y&&["top","right","bottom","left"].forEach(e=>{y[e]&&B.push(`padding-${e}:${y[e]}`)}),B.length&&A.push(`${t} .donations__donate-button{${B.join(";")}}`),r.includes(k)&&("full"===k?A.push(`${t} .donations__donate-button-wrapper{display:block;width:100%}${t} .donations__donate-button{display:block;width:100%;box-sizing:border-box;text-align:center}`):A.push(`${t} .donations__donate-button-wrapper{text-align:${k}}`)),"modal"!==C){const e=[...o(_),...s(j)];e.length&&A.push(`.wp-block-jetpack-donations${t}{${e.join(";")}}`)}return"modal"===C&&["left","center","right"].includes(x)&&A.push(`${t}{text-align:${x}}`),A.join("")};n.d(t,["A",0,i])},54806(e,t,n){"use strict";var r=n(4567),o=n(26356),s=n(3924),i=n(85985),a=n(94715),c=n(56427),l=n(47143),u=n(86087),d=n(27723),p=n(48558),h=n(72730),m=n(16521),g=n(62060),f=n(75703),b=n(10790);const __=d.__,v={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"},y=e=>{const{attributes:t,setAttributes:n,clientId:y}=e,{tracks:k}=(0,i.st)(),w=(0,u.useRef)({}),x=!(0,l.useSelect)(e=>e(m.M).getConnectUrl()||"",[]),_=(0,u.useCallback)((e,t)=>{k.recordEvent("jetpack_donations_setting_changed",{feature:"donations",surface:"block_editor",setting_name:e,setting_value:t,stripe_connected:x})},[k,x]),j=(0,u.useCallback)((e,t)=>{w.current[e]&&clearTimeout(w.current[e]),w.current[e]=setTimeout(()=>{_(e,t),delete w.current[e]},800)},[_]),{currency:C,oneTimeDonation:A,monthlyDonation:S,annualDonation:E,showCustomAmount:T,contentAlignment:N,defaultInterval:P,customAmountPlaceholder:B,minimumAmount:M,maximumAmount:I,displayMode:R,triggerButtonText:L,triggerIcon:D,triggerSticky:F,blockBorder:O,blockBorderRadius:z}=t,U=(0,h.dv)(C),H=B??100*U,$=!1!==A.show,V=!!S.show,q=!!E.show,G=($?1:0)+(V?1:0)+(q?1:0),W=__("At least one frequency must be enabled.","jetpack"),Z=(0,f.fq)($,V,q)??"one-time",J="one-time"===P&&$||"1 month"===P&&V||"1 year"===P&&q?P:Z,K={"one-time":"show_one_time","1 month":"show_monthly","1 year":"show_yearly"},Y=(e,r)=>{const o=v[e],s=t[o],i={[o]:{...s,show:r}};if(!r&&J===e){const t={oneTime:"one-time"!==e&&$,monthly:"1 month"!==e&&V,annual:"1 year"!==e&&q},n=(0,f.fq)(t.oneTime,t.monthly,t.annual);n&&(i.defaultInterval=n)}n(i),_(K[e],r)},Q={"one-time":__("One-Time","jetpack"),"1 month":__("Monthly","jetpack"),"1 year":__("Yearly","jetpack")},X=[...$?[{value:"one-time",label:Q["one-time"]}]:[],...V?[{value:"1 month",label:Q["1 month"]}]:[],...q?[{value:"1 year",label:Q["1 year"]}]:[]],ee=e=>[{value:"",label:__("None","jetpack")},...(e||[]).map((e,t)=>({value:String(t),label:(0,r.Ay)(e,C)}))],te=e=>void 0!==e.defaultAmountIndex?String(e.defaultAmountIndex):"",ne={"one-time":"default_amount_one_time","1 month":"default_amount_monthly","1 year":"default_amount_yearly"},re=e=>r=>{const o=""===r?void 0:parseInt(r,10);((e,r,o)=>{const s=v[e];n({[s]:{...t[s],[r]:o}})})(e,"defaultAmountIndex",o),_(ne[e],o??null)},oe=(0,u.useCallback)(e=>n({contentAlignment:e||""}),[n]);let se;void 0!==M&&void 0!==I&&I<M?se=__("Maximum must be greater than the minimum amount.","jetpack"):void 0!==I&&I<U&&(se=(0,d.sprintf)(/* translators: %s: minimum donation amount formatted with currency symbol */
68 68 __("Maximum must be at least %s, the minimum amount Stripe can process.","jetpack"),(0,r.Ay)(U,C)));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(a.BlockControls,{children:[(0,b.jsx)(a.AlignmentControl,{value:N,onChange:oe}),(0,b.jsx)(c.ToolbarGroup,{children:(0,b.jsx)(c.ToolbarItem,{children:()=>(0,b.jsx)(c.Dropdown,{contentClassName:"jetpack-donations__currency-popover",renderToggle:({onToggle:e,isOpen:t})=>(0,b.jsx)(c.ToolbarButton,{className:"jetpack-donations__currency-toggle",icon:(0,b.jsxs)(b.Fragment,{children:[C+" - "+o.y[C].symbol,(0,b.jsx)(c.Dashicon,{icon:"arrow-down"})]}),label:__("Change currency","jetpack"),onClick:e,onKeyDown:n=>{t||n.keyCode!==p.DOWN||(n.preventDefault(),n.stopPropagation(),e())}}),renderContent:({onClose:e})=>(0,b.jsx)(c.MenuGroup,{children:Object.keys(h.VK).map(t=>(0,b.jsx)(c.MenuItem,{isSelected:t===C,icon:t===C?"yes":"",onClick:()=>{(e=>{const t=(0,h.Xj)(e);n({currency:e,oneTimeDonation:{...A,amounts:t},monthlyDonation:{...S,amounts:t},annualDonation:{...E,amounts:t},customAmountPlaceholder:void 0}),_("currency",e)})(t),e()},children:t+" - "+o.y[t].symbol},`jetpack-donations-currency-${t}`))})})})})]}),(0,b.jsxs)(a.InspectorControls,{children:[(0,b.jsxs)(c.PanelBody,{title:__("Display","jetpack"),children:[(0,b.jsxs)(c.__experimentalToggleGroupControl,{label:__("Display mode","jetpack"),value:R,onChange:e=>n({displayMode:e}),isBlock:!0,__nextHasNoMarginBottom:!0,children:[(0,b.jsx)(c.__experimentalToggleGroupControlOption,{value:"inline",label:__("In-page","jetpack")}),(0,b.jsx)(c.__experimentalToggleGroupControlOption,{value:"modal",label:__("Pop-up","jetpack")})]}),"modal"===R&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c.ToggleControl,{label:__("Sticky","jetpack"),help:__("Fix the button to the bottom right corner of the page.","jetpack"),checked:!!F,onChange:e=>n({triggerSticky:e}),style:{marginTop:16},__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.TextControl,{label:__("Button text","jetpack"),value:L??"",placeholder:__("Donate","jetpack"),onChange:e=>n({triggerButtonText:e||void 0}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.ToggleControl,{label:__("Show icon","jetpack"),checked:"none"!==D,onChange:e=>n({triggerIcon:e?"heart":"none"}),style:{marginTop:16},__nextHasNoMarginBottom:!0}),"none"!==D&&(0,b.jsx)("div",{className:"jetpack-donations__icon-picker",children:g.Sh.map(({key:e,label:t,icon:r})=>(0,b.jsx)(c.Tooltip,{text:t,children:(0,b.jsx)(c.Button,{className:"jetpack-donations__icon-option",onClick:()=>n({triggerIcon:e}),"aria-label":t,isPressed:D===e,children:(0,b.jsx)(c.Icon,{icon:r,size:20})})},e))})]})]}),(0,b.jsxs)(c.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(c.ToggleControl,{checked:$,onChange:e=>Y("one-time",e),disabled:$&&1===G,help:$&&1===G?W:void 0,label:__("Show one-time donations","jetpack"),__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.ToggleControl,{checked:V,onChange:e=>Y("1 month",e),disabled:V&&1===G,help:V&&1===G?W:void 0,label:__("Show monthly donations","jetpack"),__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.ToggleControl,{checked:q,onChange:e=>Y("1 year",e),disabled:q&&1===G,help:q&&1===G?W:void 0,label:__("Show annual donations","jetpack"),__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.ToggleControl,{checked:T,onChange:e=>{n({showCustomAmount:e}),_("show_custom_amount",e)},label:__("Show custom amount option","jetpack"),__nextHasNoMarginBottom:!0}),(0,b.jsx)("h3",{className:"jp-donations-defaults-heading",style:{margin:"24px 0 8px",fontSize:13,fontWeight:600,textTransform:"none"},children:__("Defaults","jetpack")}),(0,b.jsx)(c.SelectControl,{label:__("Frequency","jetpack"),value:J,options:X,onChange:e=>{n({defaultInterval:e}),_("default_frequency",e)},__nextHasNoMarginBottom:!0}),(0,b.jsx)("h4",{className:"jp-donations-defaults-subheading",style:{margin:"16px 0 8px",fontSize:11,fontWeight:500,textTransform:"uppercase"},children:__("Amounts","jetpack")}),$&&(0,b.jsxs)(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:8},children:[(0,b.jsx)(c.FlexItem,{style:{minWidth:80},children:__("One-Time","jetpack")}),(0,b.jsx)(c.FlexBlock,{children:(0,b.jsx)(c.SelectControl,{hideLabelFromVision:!0,label:__("Default amount for One-Time","jetpack"),value:te(A),options:ee(A.amounts),onChange:re("one-time"),__nextHasNoMarginBottom:!0})})]}),V&&(0,b.jsxs)(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:8},children:[(0,b.jsx)(c.FlexItem,{style:{minWidth:80},children:__("Monthly","jetpack")}),(0,b.jsx)(c.FlexBlock,{children:(0,b.jsx)(c.SelectControl,{hideLabelFromVision:!0,label:__("Default amount for Monthly","jetpack"),value:te(S),options:ee(S.amounts),onChange:re("1 month"),__nextHasNoMarginBottom:!0})})]}),q&&(0,b.jsxs)(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:8},children:[(0,b.jsx)(c.FlexItem,{style:{minWidth:80},children:__("Annual","jetpack")}),(0,b.jsx)(c.FlexBlock,{children:(0,b.jsx)(c.SelectControl,{hideLabelFromVision:!0,label:__("Default amount for Annual","jetpack"),value:te(E),options:ee(E.amounts),onChange:re("1 year"),__nextHasNoMarginBottom:!0})})]}),T&&(0,b.jsxs)(c.Flex,{justify:"space-between",align:"center",style:{marginBottom:8},children:[(0,b.jsx)(c.FlexItem,{style:{minWidth:80},children:__("Custom","jetpack")}),(0,b.jsx)(c.FlexBlock,{children:(0,b.jsx)(c.TextControl,{type:"number",hideLabelFromVision:!0,label:__("Suggested custom amount","jetpack"),value:H,onChange:e=>{const t=""===e||void 0===e?void 0:Number(e);n({customAmountPlaceholder:t}),j("custom_amount_placeholder",t??null)},min:(0,h.dv)(C),step:.01,__nextHasNoMarginBottom:!0})})]}),(0,b.jsx)("p",{style:{marginTop:24},children:(0,b.jsx)(c.ExternalLink,{href:`https://wordpress.com/earn/${(0,i.GE)()}`,children:__("View donation earnings","jetpack")})}),(0,b.jsx)("p",{children:(0,b.jsx)(c.ExternalLink,{href:(0,s.A)("jetpack-support-donation-block-stripe-reqs"),children:__("View Stripe requirements","jetpack")})})]}),(0,b.jsxs)(c.PanelBody,{title:__("Security","jetpack"),initialOpen:!1,children:[(0,b.jsx)("p",{style:{marginTop:0,marginBottom:16,fontSize:13},children:__("Setting minimum and maximum donation amounts can help prevent fraudulent transactions.","jetpack")}),(0,b.jsx)(c.TextControl,{type:"number",label:__("Minimum amount","jetpack"),value:M??"",onChange:e=>{const t=""===e?void 0:Number(e);n({minimumAmount:t}),j("minimum_amount",t??null)},min:U,step:.01,__nextHasNoMarginBottom:!0}),(0,b.jsx)(c.TextControl,{type:"number",label:__("Maximum amount","jetpack"),value:I??"",onChange:e=>{const t=""===e?void 0:Number(e);n({maximumAmount:t}),j("maximum_amount",t??null)},min:M??U,step:.01,help:se,__nextHasNoMarginBottom:!0})]})]}),"modal"!==R&&(0,b.jsx)(a.InspectorControls,{group:"border",children:(0,b.jsxs)(c.__experimentalToolsPanel,{label:__("Border","jetpack"),resetAll:()=>n({blockBorder:void 0,blockBorderRadius:void 0}),panelId:y,children:[(0,b.jsx)(c.__experimentalToolsPanelItem,{label:__("Border","jetpack"),hasValue:()=>!!O,onDeselect:()=>n({blockBorder:void 0}),isShownByDefault:!0,panelId:y,children:(0,b.jsx)(c.BorderBoxControl,{label:__("Border","jetpack"),value:O,onChange:e=>n({blockBorder:e}),enableAlpha:!0,enableStyle:!0,__next40pxDefaultSize:!0})}),(0,b.jsx)(c.__experimentalToolsPanelItem,{label:__("Radius","jetpack"),hasValue:()=>!!z,onDeselect:()=>n({blockBorderRadius:void 0}),isShownByDefault:!0,panelId:y,children:(0,b.jsx)(a.__experimentalBorderRadiusControl,{values:z,onChange:e=>n({blockBorderRadius:e})})})]})})]})};n.d(t,["A",0,y])},77994(e,t,n){"use strict";var r=n(4567),o=n(26356),s=n(94715),i=n(27723),a=n(72730),c=n(10790);const __=i.__,l={attributes:{currency:{type:"string",default:"USD"},oneTimeDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a one-time donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate","jetpack")}},monthlyDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a monthly donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate monthly","jetpack")}},annualDonation:{type:"object",default:{show:!0,planId:null,amounts:[5,15,100],heading:__("Make a yearly donation","jetpack"),extraText:__("Your contribution is appreciated.","jetpack"),buttonText:__("Donate yearly","jetpack")}},showCustomAmount:{type:"boolean",default:!0},chooseAmountText:{type:"string",default:__("Choose an amount","jetpack")},customAmountText:{type:"string",default:__("Or enter a custom amount","jetpack")}},supports:{html:!1},save:({attributes:e})=>{const{currency:t,oneTimeDonation:n,monthlyDonation:i,annualDonation:l,showCustomAmount:u,chooseAmountText:d,customAmountText:p}=e;if(!n||!n.show||-1===n.planId)return null;const h={"one-time":{title:__("One-Time","jetpack")},...i.show&&{"1 month":{title:__("Monthly","jetpack")}},...l.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"donations__container",children:[Object.keys(h).length>1&&(0,c.jsx)("div",{className:"donations__nav",children:Object.entries(h).map(([e,{title:t}])=>(0,c.jsx)("div",{role:"button",tabIndex:0,className:"donations__nav-item","data-interval":e,children:t},`jetpack-donations-nav-item-${e} `))}),(0,c.jsx)("div",{className:"donations__content",children:(0,c.jsxs)("div",{className:"donations__tab",children:[(0,c.jsx)(s.RichText.Content,{tagName:"h4",className:"donations__one-time-item",value:n.heading}),i.show&&(0,c.jsx)(s.RichText.Content,{tagName:"h4",className:"donations__monthly-item",value:i.heading}),l.show&&(0,c.jsx)(s.RichText.Content,{tagName:"h4",className:"donations__annual-item",value:l.heading}),(0,c.jsx)(s.RichText.Content,{tagName:"p",value:d}),(0,c.jsx)("div",{className:"donations__amounts donations__one-time-item",children:n.amounts.map(e=>(0,c.jsx)("div",{className:"donations__amount","data-amount":e,children:(0,r.Ay)(e,t)},e))}),i.show&&(0,c.jsx)("div",{className:"donations__amounts donations__monthly-item",children:i.amounts.map(e=>(0,c.jsx)("div",{className:"donations__amount","data-amount":e,children:(0,r.Ay)(e,t)},e))}),l.show&&(0,c.jsx)("div",{className:"donations__amounts donations__annual-item",children:l.amounts.map(e=>(0,c.jsx)("div",{className:"donations__amount","data-amount":e,children:(0,r.Ay)(e,t)},e))}),u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.RichText.Content,{tagName:"p",value:p}),(0,c.jsxs)("div",{className:"donations__amount donations__custom-amount",children:[o.y[t].symbol,(0,c.jsx)("div",{className:"donations__amount-value","data-currency":t,"data-empty-text":(0,r.Ay)(100*(0,a.dv)(t),t,{symbol:""})})]})]}),(0,c.jsx)("div",{className:"donations__separator",children:"——"}),(0,c.jsx)(s.RichText.Content,{tagName:"p",className:"donations__one-time-item",value:n.extraText}),i.show&&(0,c.jsx)(s.RichText.Content,{tagName:"p",className:"donations__monthly-item",value:i.extraText}),l.show&&(0,c.jsx)(s.RichText.Content,{tagName:"p",className:"donations__annual-item",value:l.extraText}),(0,c.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper donations__one-time-item",children:(0,c.jsx)(s.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__one-time-item",value:n.buttonText})}),i.show&&(0,c.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper donations__monthly-item",children:(0,c.jsx)(s.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__monthly-item",value:i.buttonText})}),l.show&&(0,c.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper donations__annual-item",children:(0,c.jsx)(s.RichText.Content,{tagName:"a",className:"wp-block-button__link donations__donate-button donations__annual-item",value:l.buttonText})})]})})]})})}};n.d(t,["A",0,l])},97448(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(29491),a=n(47143),c=n(86087),l=n(27723),u=n(2274),d=n(53796),p=n(72730),h=n(27574),m=n(26247),g=n(16521),f=n(3696),b=n(22883),v=n(54806),y=n(70975),k=n(93033),w=n(62060),x=n(79551),_=n(26334),j=n(52244),C=n(10790);const __=l.__,A=new Set,S=e=>{const{attributes:t,setAttributes:n,clientId:l}=e,{currency:E,tabsAppearance:T,className:N,displayMode:P,triggerButtonText:B,triggerIcon:M,triggerSticky:I}=t,{tracks:R}=(0,r.st)();(0,c.useEffect)(()=>{if("string"==typeof N&&N.split(" ").includes("is-style-buttons")){const e=N.split(" ").filter(e=>"is-style-buttons"!==e).join(" ").trim();n({tabsAppearance:"buttons",className:e||void 0})}},[N,n]);const L=(0,i.useInstanceId)(S,"jp-donations"),D=(0,b.A)(t,`.${L}`),F=[L,"buttons"===T&&"is-style-buttons","modal"===P&&"is-display-modal","modal"===P&&I&&"is-sticky"].filter(Boolean).join(" "),O=(0,o.useBlockProps)({className:F}),[z,U]=(0,c.useState)(""),[H,$]=(0,c.useState)([]),V=(0,m.A)(),q=(0,a.useSelect)(e=>e(o.store).getSettings().isPreviewMode,[]),{lockPostSaving:G,unlockPostSaving:W}=(0,a.useDispatch)("core/editor"),Z=(0,a.useSelect)(e=>e("core/editor").getCurrentPost(),[]),J=(0,a.useSelect)(e=>e("core/editor").isPostSavingLocked(),[]),K=(0,a.useSelect)(e=>e(g.M).getConnectUrl()||"",[]),{setConnectUrl:Y,setConnectedAccountDefaultCurrency:Q}=(0,a.useDispatch)(f.E),X=(0,a.useSelect)(e=>e(f.E).getConnectedAccountDefaultCurrency());(0,c.useEffect)(()=>{if(q||!l||A.has(l))return;V&&!K&&!X||(A.add(l),R.recordEvent("jetpack_donations_block_loaded",{feature:"donations",surface:"block_editor",is_user_connected:!!V,stripe_connected:V?!K:null}))},[l,V,K,X,R,q]),(0,c.useEffect)(()=>{if(!E&&X&&!J){const e=X.toUpperCase(),t=!!p.VK[e];n(t?{currency:e}:{currency:"USD"})}},[E,X,J,n]);const ee=e=>{U(e)};(0,c.useEffect)(()=>{if(q)return;G("donations");const e=e=>e.reduce((e,{id:t,currency:n,type:r,interval:o})=>(n===E&&"donation"===r&&(e[o]=t),e),{});(0,k.A)("donation").then(t=>{if(!t&&"object"!=typeof t||t.errors)return W("donations"),void U(__("Could not load data from WordPress.com.","jetpack"));Y((0,h.A)(Z.id,t.connect_url)),Q(t?.connected_account_default_currency?.toUpperCase());const n=e(t.products);return(e=>{const t=Object.keys(e);return t.includes("one-time")&&t.includes("1 month")&&t.includes("1 year")})(n)?($(n),void W("donations")):t.connect_url?($({"one-time":-1,"1 month":-1,"1 year":-1}),void W("donations")):(E&&(0,y.A)(E).then(t=>{$(e(t)),W("donations")},ee),void W("donations"))},ee)},[G,E,Z.id,Y,Q,W,q]);const te=q?{"one-time":-1,"1 month":-1,"1 year":-1}:H,ne=q&&!E?{...e,attributes:{...t,currency:"USD"}}:e;let re;if(q||V)if(!q&&z)re=(0,C.jsx)(x.A,{error:z});else if(!q&&K)re=(0,C.jsx)(d.V,{blockName:"donations"});else if(q||E)if("modal"===P){const t=w.Sh.find(({key:e})=>e===M),n=B||__("Donate","jetpack");re=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(v.A,{...e}),(0,C.jsxs)("button",{className:"donations__trigger-button wp-block-button__link",tabIndex:-1,"aria-hidden":"true",children:[t&&"none"!==M&&(0,C.jsx)(s.Icon,{className:"donations__trigger-icon",icon:t.icon,size:20}),n]})]})}else re=(0,C.jsx)(j.A,{...ne,products:te});else re=(0,C.jsx)(s.Spinner,{});else re=(0,C.jsx)(u.A,{block:"Donations Form",explanation:__("Connect your WordPress.com account to enable donations.","jetpack")});return(0,C.jsxs)("div",{...O,children:[(0,C.jsx)(_.A,{attributes:t,setAttributes:n}),D&&(0,C.jsx)("style",{children:D}),re]})},E=S;n.d(t,["A",0,E])},46197(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(87325),i=n(77994),a=n(97448),c=n(75743),l=n(30746);n(45318);(0,o.M)(s,{edit:a.A,save:c.A,deprecated:[i.A]}),(0,r.registerBlockVariation)("jetpack/donations",l.Ay)},70975(e,t,n){"use strict";var r=n(1455),o=n.n(r);const s=async e=>{try{return await o()({path:"/wpcom/v2/memberships/products",method:"POST",data:{type:"donation",currency:e,is_editable:!1}})}catch(e){return Promise.reject(e.message)}};n.d(t,["A",0,s])},93033(e,t,n){"use strict";var r=n(1455),o=n.n(r),s=n(93832);const i=async(e=null)=>{const t=new URLSearchParams(window.location.search),n=(0,s.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===t.get("origin")?"gutenberg-wpcom":"gutenberg",...e&&{type:e},is_editable:!1});try{return await o()({path:n,method:"GET"})}catch(e){return Promise.reject(e.message)}};n.d(t,["A",0,i])},62060(e,t,n){"use strict";var r=n(27723),o=n(42005),s=n(5573),i=n(10790);const __=r.__,a=(0,i.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M16.5 4.5c2.206 0 4 1.794 4 4 0 4.67-5.543 8.94-8.5 11.023C9.043 17.44 3.5 13.17 3.5 8.5c0-2.206 1.794-4 4-4 1.298 0 2.522.638 3.273 1.706L12 7.953l1.227-1.746c.75-1.07 1.975-1.707 3.273-1.707m0-1.5c-1.862 0-3.505.928-4.5 2.344C11.005 3.928 9.362 3 7.5 3 4.462 3 2 5.462 2 8.5c0 5.72 6.5 10.438 10 12.85 3.5-2.412 10-7.13 10-12.85C22 5.462 19.538 3 16.5 3z"})}),c=(0,i.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5 14.67 11 15.5 11zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"})}),l=(0,i.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(s.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 5h11v3.25h1a2 2 0 010 4H17.5v1.25a3 3 0 01-3 3H9.5a3 3 0 01-3-3V5zm1.5 1.5v7.25a1.5 1.5 0 001.5 1.5h5a1.5 1.5 0 001.5-1.5V6.5h-8zm10 2.5H17.5v2h.5a1 1 0 000-2zM5 20h14V18.5H5z"})}),u=[{key:"heart",label:__("Heart","jetpack"),icon:a},{key:"gift",label:__("Gift","jetpack"),icon:o.A},{key:"smiley",label:__("Smiley","jetpack"),icon:c},{key:"coffee",label:__("Cup","jetpack"),icon:l}];n.d(t,["$f",0,l,"Sh",0,u])},79551(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(10790);const __=o.__,i=({error:e})=>(0,s.jsx)(r.Placeholder,{icon:"lock",label:__("Donations","jetpack"),instructions:e});n.d(t,["A",0,i])},75743(e,t,n){"use strict";var r=n(94715),o=n(75703),s=n(10790);const i=(0,o.OI)(),a=({attributes:e})=>{const{fallbackLinkUrl:t,oneTimeDonation:n,monthlyDonation:o,annualDonation:a}=e;if(!n||!n.show||!n.planId||-1===n.planId)return null;const c=r.useBlockProps.save();return(0,s.jsxs)("div",{...c,children:[(0,s.jsx)(r.RichText.Content,{tagName:"h4",value:i.oneTimeDonation?.heading}),(0,s.jsx)(r.RichText.Content,{tagName:"p",value:n.extraText??i.extraText}),(0,s.jsx)(r.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:i.oneTimeDonation?.buttonText}),o.show&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"donations__separator"}),(0,s.jsx)(r.RichText.Content,{tagName:"h4",value:i.monthlyDonation?.heading}),(0,s.jsx)(r.RichText.Content,{tagName:"p",value:o.extraText??i.extraText}),(0,s.jsx)(r.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:i.monthlyDonation?.buttonText})]}),a.show&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"donations__separator"}),(0,s.jsx)(r.RichText.Content,{tagName:"h4",value:i.annualDonation?.heading}),(0,s.jsx)(r.RichText.Content,{tagName:"p",value:a.extraText??i.extraText}),(0,s.jsx)(r.RichText.Content,{tagName:"a",className:"jetpack-donations-fallback-link",href:t,rel:"noopener noreferrer noamphtml",target:"_blank",value:i.annualDonation?.buttonText})]})]})};n.d(t,["A",0,a])},26334(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(10790);const __=i.__,c={placement:"left-start",offset:36},l=({label:e,settings:t})=>{const n=(0,s.useCallback)(()=>t.some(e=>!!e.value),[t]),i=(0,s.useCallback)(()=>t.forEach(e=>e.onChange()),[t]),l=(0,s.useCallback)(({isOpen:n,onToggle:r})=>(0,a.jsx)(o.Button,{onClick:r,"aria-expanded":n,"aria-label":e,__next40pxDefaultSize:!0,children:(0,a.jsxs)(o.__experimentalHStack,{justify:"flex-start",children:[(0,a.jsx)(o.__experimentalZStack,{isLayered:!1,offset:-8,children:t.map((e,t)=>(0,a.jsx)(o.Flex,{expanded:!1,children:(0,a.jsx)(o.ColorIndicator,{colorValue:e.value})},t))}),(0,a.jsx)(o.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:e})]})}),[e,t]),u=(0,s.useCallback)(()=>{if(1===t.length)return(0,a.jsx)(o.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,a.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,a.jsx)(r.__experimentalColorGradientControl,{label:t[0].label,colorValue:t[0].value,onColorChange:t[0].onChange})})});const e=t.map(e=>({name:e.label.toLowerCase().replace(/\s+/g,"-"),title:e.label}));return(0,a.jsx)(o.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,a.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,a.jsx)(o.TabPanel,{tabs:e,children:e=>{const n=t.find(t=>t.label.toLowerCase().replace(/\s+/g,"-")===e.name);return(0,a.jsx)(r.__experimentalColorGradientControl,{label:n.label,colorValue:n.value,onColorChange:n.onChange,showTitle:!1})}})})})},[t]);return(0,a.jsx)(o.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",label:e,hasValue:n,onDeselect:i,isShownByDefault:!0,children:(0,a.jsx)(o.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:l,renderContent:u})})},u=({attributes:e,setAttributes:t})=>{const{activeTabBackgroundColor:n,activeTabTextColor:i,inactiveTabBackgroundColor:c,inactiveTabTextColor:u,selectedAmountBackgroundColor:d,selectedAmountTextColor:p,selectedAmountOutlineColor:h,tabsAppearance:m,tabBorderColor:g,tabFontSize:f,tabPadding:b,buttonFontSize:v,buttonPadding:y,buttonAlignment:k,buttonBorderRadius:w,amountFontSize:x,amountBorder:_,amountBorderRadius:j}=e,C=(0,s.useMemo)(()=>{const e=e=>n=>t({[e]:n});return{tabsAppearance:e("tabsAppearance"),activeTabBackgroundColor:e("activeTabBackgroundColor"),activeTabTextColor:e("activeTabTextColor"),inactiveTabBackgroundColor:e("inactiveTabBackgroundColor"),inactiveTabTextColor:e("inactiveTabTextColor"),tabBorderColor:e("tabBorderColor"),tabFontSize:e("tabFontSize"),tabPadding:e("tabPadding"),selectedAmountBackgroundColor:e("selectedAmountBackgroundColor"),selectedAmountTextColor:e("selectedAmountTextColor"),selectedAmountOutlineColor:e("selectedAmountOutlineColor"),amountFontSize:e("amountFontSize"),amountBorder:e("amountBorder"),amountBorderRadius:e("amountBorderRadius"),buttonFontSize:e("buttonFontSize"),buttonPadding:e("buttonPadding"),buttonAlignment:e=>t({buttonAlignment:e||""}),buttonBorderRadius:e("buttonBorderRadius")}},[t]),A=(0,s.useMemo)(()=>[{label:__("Text","jetpack"),value:i,onChange:C.activeTabTextColor},{label:__("Background","jetpack"),value:n,onChange:C.activeTabBackgroundColor}],[n,i,C]),S=(0,s.useMemo)(()=>[{label:__("Text","jetpack"),value:u,onChange:C.inactiveTabTextColor},{label:__("Background","jetpack"),value:c,onChange:C.inactiveTabBackgroundColor}],[c,u,C]),E=(0,s.useMemo)(()=>[{label:__("Tab border","jetpack"),value:g,onChange:C.tabBorderColor}],[g,C]),T=(0,s.useMemo)(()=>[{label:__("Text","jetpack"),value:p,onChange:C.selectedAmountTextColor},{label:__("Background","jetpack"),value:d,onChange:C.selectedAmountBackgroundColor},{label:__("Outline","jetpack"),value:h,onChange:C.selectedAmountOutlineColor}],[d,p,h,C]),N=(0,s.useCallback)(()=>{},[]),P=(0,s.useCallback)(()=>{C.tabsAppearance("tabs"),C.activeTabBackgroundColor(),C.activeTabTextColor(),C.inactiveTabBackgroundColor(),C.inactiveTabTextColor(),C.tabBorderColor(),C.tabFontSize(),C.tabPadding()},[C]),B=(0,s.useCallback)(()=>{C.selectedAmountBackgroundColor(),C.selectedAmountTextColor(),C.selectedAmountOutlineColor(),C.amountFontSize(),C.amountBorder(),C.amountBorderRadius()},[C]),M=(0,s.useCallback)(()=>{C.buttonFontSize(),C.buttonPadding(),C.buttonBorderRadius(),C.buttonAlignment("")},[C]),I=(0,s.useMemo)(()=>({tabsAppearance:()=>"buttons"===m,tabFontSize:()=>!!f,tabPadding:()=>!!b,amountFontSize:()=>!!x,amountBorder:()=>!!_,amountBorderRadius:()=>!!j,buttonFontSize:()=>!!v,buttonPadding:()=>!!y,buttonAlignment:()=>!!k,buttonBorderRadius:()=>!!w}),[m,f,b,x,_,j,v,y,k,w]),R=(0,s.useMemo)(()=>({tabsAppearance:()=>C.tabsAppearance("tabs"),buttonAlignment:()=>C.buttonAlignment("")}),[C]);return(0,a.jsxs)(r.InspectorControls,{group:"styles",children:[(0,a.jsxs)(o.PanelBody,{title:__("Tabs","jetpack"),initialOpen:!1,className:"jp-donations-style-panel",children:[(0,a.jsx)(o.__experimentalToolsPanel,{label:__("Tab appearance","jetpack"),resetAll:N,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Appearance","jetpack"),hasValue:I.tabsAppearance,onDeselect:R.tabsAppearance,isShownByDefault:!0,children:(0,a.jsxs)(o.__experimentalToggleGroupControl,{label:__("Appearance","jetpack"),value:m||"tabs",onChange:C.tabsAppearance,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"tabs",label:__("Tabs","jetpack")}),(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"buttons",label:__("Buttons","jetpack")})]})})}),(0,a.jsx)(o.__experimentalToolsPanel,{className:"color-block-support-panel",label:__("Colors","jetpack"),resetAll:N,hasInnerWrapper:!0,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,a.jsxs)("div",{className:"color-block-support-panel__inner-wrapper",children:[(0,a.jsx)(l,{label:__("Active Tab","jetpack"),settings:A}),(0,a.jsx)(l,{label:__("Inactive Tab","jetpack"),settings:S}),(0,a.jsx)(l,{label:__("Tab Border","jetpack"),settings:E})]})}),(0,a.jsx)(r.ContrastChecker,{backgroundColor:n,textColor:i}),(0,a.jsx)(r.ContrastChecker,{backgroundColor:c,textColor:u}),(0,a.jsxs)(o.__experimentalToolsPanel,{label:__("Tab dimensions","jetpack"),resetAll:N,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Font size","jetpack"),hasValue:I.tabFontSize,onDeselect:C.tabFontSize,isShownByDefault:!0,children:(0,a.jsx)(r.FontSizePicker,{value:f,onChange:C.tabFontSize,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Padding","jetpack"),hasValue:I.tabPadding,onDeselect:C.tabPadding,isShownByDefault:!0,children:(0,a.jsx)(o.BoxControl,{label:__("Padding","jetpack"),values:b,onChange:C.tabPadding,allowReset:!1,__next40pxDefaultSize:!0})})]}),(0,a.jsx)(o.PanelRow,{children:(0,a.jsx)(o.Button,{variant:"secondary",onClick:P,children:__("Reset","jetpack")})})]}),(0,a.jsxs)(o.PanelBody,{title:__("Amounts","jetpack"),initialOpen:!1,className:"jp-donations-style-panel",children:[(0,a.jsx)(o.__experimentalToolsPanel,{className:"color-block-support-panel",label:__("Colors","jetpack"),resetAll:N,hasInnerWrapper:!0,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,a.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:(0,a.jsx)(l,{label:__("Selected Amount","jetpack"),settings:T})})}),(0,a.jsx)(r.ContrastChecker,{backgroundColor:d,textColor:p}),(0,a.jsxs)(o.__experimentalToolsPanel,{label:__("Amount settings","jetpack"),resetAll:N,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Font size","jetpack"),hasValue:I.amountFontSize,onDeselect:C.amountFontSize,isShownByDefault:!0,children:(0,a.jsx)(r.FontSizePicker,{value:x,onChange:C.amountFontSize,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Border","jetpack"),hasValue:I.amountBorder,onDeselect:C.amountBorder,isShownByDefault:!0,children:(0,a.jsx)(o.BorderBoxControl,{label:__("Border","jetpack"),value:_,onChange:C.amountBorder,enableAlpha:!0,enableStyle:!0,__next40pxDefaultSize:!0})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Border radius","jetpack"),hasValue:I.amountBorderRadius,onDeselect:C.amountBorderRadius,isShownByDefault:!0,children:(0,a.jsx)(r.__experimentalBorderRadiusControl,{values:j,onChange:C.amountBorderRadius})})]}),(0,a.jsx)(o.PanelRow,{children:(0,a.jsx)(o.Button,{variant:"secondary",onClick:B,children:__("Reset","jetpack")})})]}),(0,a.jsxs)(o.PanelBody,{title:__("Donate button","jetpack"),initialOpen:!1,className:"jp-donations-style-panel",children:[(0,a.jsxs)(o.__experimentalToolsPanel,{label:__("Button settings","jetpack"),resetAll:N,headingLevel:3,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Font size","jetpack"),hasValue:I.buttonFontSize,onDeselect:C.buttonFontSize,isShownByDefault:!0,children:(0,a.jsx)(r.FontSizePicker,{value:v,onChange:C.buttonFontSize,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Padding","jetpack"),hasValue:I.buttonPadding,onDeselect:C.buttonPadding,isShownByDefault:!0,children:(0,a.jsx)(o.BoxControl,{label:__("Padding","jetpack"),values:y,onChange:C.buttonPadding,allowReset:!1,__next40pxDefaultSize:!0})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Radius","jetpack"),hasValue:I.buttonBorderRadius,onDeselect:C.buttonBorderRadius,isShownByDefault:!0,children:(0,a.jsx)(r.__experimentalBorderRadiusControl,{values:w,onChange:C.buttonBorderRadius})}),(0,a.jsx)(o.__experimentalToolsPanelItem,{label:__("Alignment","jetpack"),hasValue:I.buttonAlignment,onDeselect:R.buttonAlignment,isShownByDefault:!0,children:(0,a.jsxs)(o.__experimentalToggleGroupControl,{label:__("Alignment","jetpack"),value:k||"",onChange:C.buttonAlignment,isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"left",label:__("Left","jetpack")}),(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"center",label:__("Center","jetpack")}),(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"right",label:__("Right","jetpack")}),(0,a.jsx)(o.__experimentalToggleGroupControlOption,{value:"full",label:__("Full width","jetpack")})]})})]}),(0,a.jsx)(o.PanelRow,{children:(0,a.jsx)(o.Button,{variant:"secondary",onClick:M,children:__("Reset","jetpack")})})]})]})};n.d(t,["A",0,u])},32299(e,t,n){"use strict";var r=n(94715),o=n(47143),s=n(27723),i=n(72730),a=n(91376),c=n(75703),l=n(10790);const __=s.__,u=(0,c.OI)(),d=({activeTab:e,attributes:t,setAttributes:n})=>{const{currency:c,oneTimeDonation:d,monthlyDonation:p,annualDonation:h,showCustomAmount:m,customAmountPlaceholder:g,chooseAmountText:f=u.chooseAmountText,customAmountText:b=u.customAmountText}=t,v={"one-time":"oneTimeDonation","1 month":"monthlyDonation","1 year":"annualDonation"}[e],y=e=>t[v][e],k=(e,r)=>{const o=t[v];n({[v]:{...o,[e]:r}})},w=(0,i.Xj)(c),x=y("amounts"),_=(0,o.useSelect)(e=>e("core/rich-text").getFormatTypes(),[]).map(e=>e.name).filter(e=>"core/link"!==e);return(0,l.jsxs)("div",{className:"donations__tab",children:[(0,l.jsx)(r.RichText,{tagName:"h4",placeholder:__("Write a message…","jetpack"),value:y("heading")??u[v]?.heading,onChange:e=>k("heading",e)}),(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>n({chooseAmountText:e})}),(0,l.jsx)("div",{className:"donations__amounts",children:x.map((e,t)=>(0,l.jsx)(a.A,{currency:c,defaultValue:w[t],label:(0,s.sprintf)(
69 69 // translators: %d: Tier level e.g: "1", "2", "3"
70 -__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{const n=[...x];n[t]=e,k("amounts",n)})(e,t),value:e},`jetpack-donations-amount-${t}`))}),m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:b,onChange:e=>n({customAmountText:e})}),(0,l.jsx)(a.A,{currency:c,label:__("Custom amount","jetpack"),defaultValue:g??100*(0,i.dv)(c),className:"donations__custom-amount",disabled:!0})]}),(0,l.jsx)("hr",{className:"donations__separator"}),(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:y("extraText")??u.extraText,onChange:e=>k("extraText",e)}),(0,l.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper",children:(0,l.jsx)(r.RichText,{className:"wp-block-button__link wp-element-button donations__donate-button",placeholder:__("Write a message…","jetpack"),value:y("buttonText")??u[v]?.buttonText,onChange:e=>{return t=e,void n({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});var t},allowedFormats:_})})]})};n.d(t,["A",0,d])},52244(e,t,n){"use strict";var r=n(86087),o=n(27723),s=n(13022),i=n(54806),a=n(32299),c=n(75703),l=n(10790);const __=o.__,u=e=>{const{attributes:t,products:n,setAttributes:o}=e,{oneTimeDonation:u,monthlyDonation:d,annualDonation:p,defaultInterval:h}=t,m=!1!==u.show,g=(0,c.fq)(m,d.show,p.show)??"one-time",f="one-time"===h&&m||"1 month"===h&&d.show||"1 year"===h&&p.show?h:g,[b,v]=(0,r.useState)(f),y=(0,r.useCallback)(e=>b===e,[b]),k={...m&&{"one-time":{title:__("One-Time","jetpack")}},...d.show&&{"1 month":{title:__("Monthly","jetpack")}},...p.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,r.useEffect)(()=>{u.planId===n["one-time"]&&d.planId===n["1 month"]&&p.planId===n["1 year"]||o({...n["one-time"]&&{oneTimeDonation:{...u,planId:n["one-time"]}},...n["1 month"]&&{monthlyDonation:{...d,planId:n["1 month"]}},...n["1 year"]&&{annualDonation:{...p,planId:n["1 year"]}}})},[u,d,p,o,n]),(0,r.useEffect)(()=>{const e=(0,c.fq)(m,d.show,p.show);null!==e&&(!m&&y("one-time")&&v(e),!d.show&&y("1 month")&&v(e),!p.show&&y("1 year")&&v(e))},[m,d,p,v,y]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"donations__container",children:[Object.keys(k).length>1&&(0,l.jsx)("div",{className:"donations__nav",children:Object.entries(k).map(([e,{title:t}])=>(0,l.jsx)("div",{role:"button",tabIndex:0,className:(0,s.A)("donations__nav-item",{"is-active":y(e)}),onClick:()=>v(e),onKeyDown:()=>v(e),children:t},`jetpack-donations-nav-item-${e} `))}),(0,l.jsx)("div",{className:"donations__content",children:(0,l.jsx)(a.A,{activeTab:b,attributes:t,setAttributes:o})})]}),(0,l.jsx)(i.A,{...e})]})};n.d(t,["A",0,u])},30746(e,t,n){"use strict";var r=n(27723),o=n(62060);const __=r.__,s="tips",i={variationName:s,displayMode:"modal",triggerSticky:!1,triggerButtonText:"Buy me a coffee",triggerIcon:"coffee",contentAlignment:"center",buttonAlignment:"full",tabsAppearance:"buttons",showCustomAmount:!1,chooseAmountText:"",annualDonation:{show:!1,planId:null,amounts:[3,5,8]},oneTimeDonation:{show:!0,planId:null,amounts:[3,5,8],defaultAmountIndex:0,heading:"",buttonText:"Buy coffee",extraText:"Thanks for your generosity!"},monthlyDonation:{show:!0,planId:null,amounts:[3,5,8],defaultAmountIndex:0,heading:"",buttonText:"Buy coffee",extraText:"Thanks for your generosity!"}},a={name:s,title:__("Tips","jetpack"),description:__("Get financial support from friends and followers.","jetpack"),icon:o.$f,isDefault:!1,attributes:i,scope:["inserter"],isActive:e=>e.variationName===s,keywords:[__("tips","jetpack"),__("coffee","jetpack"),__("support","jetpack"),__("buy me a coffee","jetpack")]};n.d(t,["Ay",0,a])},75703(e,t,n){"use strict";function r(e,t,n){return e?"one-time":t?"1 month":n?"1 year":null}function o(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}n.d(t,{OI:()=>o,fq:()=>r})},36850(e,t,n){"use strict";n.d(t,["GY",0,/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,"_t",0,/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,"gQ",0,"https://www.eventbrite.com/e/test-event-tickets-123456789"])},79979(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(24971),i=n(10790);const __=o.__,_x=o._x,a=[{value:"inline",label:__("In-page Embed","jetpack")},{value:"modal",label:__("Button & Modal","jetpack")}];n.d(t,["o",0,({setEditingUrl:e})=>(0,i.jsx)(r.ToolbarGroup,{children:(0,i.jsx)(r.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),"s",0,({attributes:e,setAttributes:t})=>(0,i.jsx)(s.A,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),styleOptions:a,onSelectStyle:t,activeStyle:e.style})])},77629(e,t,n){"use strict";const r=[n(84109).A];n.d(t,["A",0,r])},84109(e,t,n){"use strict";var r=n(94715),o=n(74997),s=n(27723),i=n(13022),a=n(66087),c=n(10790);const _x=s._x,l=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];const u={attributes:{url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:_x("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:e=>{const{className:t,style:n}=e;let r=n;r||(r=e.useModal?"modal":"inline");const s={...Object.fromEntries(Object.entries(e).filter(([e])=>"useModal"!==e&&!l.includes(e))),className:t&&t.replace("is-style-outline",""),style:r},i=(0,a.pick)(e,l);return[s,[(0,o.createBlock)("jetpack/button",{element:"a",text:i.text||_x("Register","verb: e.g. register for an event.","jetpack"),...i,uniqueId:"eventbrite-widget-id",className:t&&-1!==t.indexOf("is-style-outline")?"is-style-outline":""})]]},save:function({attributes:e}){const{eventId:t,useModal:n,url:o,style:s}=e;if(t)return n||"modal"===s?function(e){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:s,eventId:a,text:l,textColor:u,url:d}=e,p=(0,r.getColorClassName)("color",u),h=(0,r.getColorClassName)("background-color",t),m=(0,i.A)("wp-block-button__link",{"has-text-color":u||s,[p]:p,"has-background":t||o,[h]:h,"no-border-radius":0===n}),g={backgroundColor:h?void 0:o,color:p?void 0:s,borderRadius:n?n+"px":void 0};return(0,c.jsx)("div",{className:"wp-block-button",children:(0,c.jsx)(r.RichText.Content,{className:m,href:d,id:`eventbrite-widget-${a}`,rel:"noopener noreferrer",role:"button",style:g,tagName:"a",target:"_blank",value:l})})}(e):o&&(0,c.jsx)("a",{className:"eventbrite__direct-link",href:o,children:o})},isEligible:(e,t)=>("modal"===e.style||e.useModal)&&((0,a.isEmpty)(t)||Object.entries(e).some(([e,t])=>t&&l.includes(e)))};n.d(t,["A",0,u])},90397(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(78218),c=n(56145),l=n(82306),u=n(36850),d=n(79979),p=n(51228),h=n(54492),m=n(87965),g=n(17158),f=(n(59357),n(10790));const __=i.__,_x=i._x,b={name:"jetpack/button",attributes:{element:"a",text:_x("Register","verb: e.g. register for an event.","jetpack"),uniqueId:"eventbrite-widget-id"}},v=(0,o.withNotices)(e=>{const{attributes:t,noticeOperations:n,onReplace:i,setAttributes:v}=e,{url:y,style:k}=t,w=(0,r.useBlockProps)(),[x,_]=(0,s.useState)(!1),[j,C]=(0,s.useState)(t.url||""),[A,S]=(0,s.useState)(!1),E=!A&&y&&!u._t.test(y),T=(0,s.useCallback)(()=>{n.removeAllNotices(),n.createErrorNotice((0,f.jsxs)(f.Fragment,{children:[__("Sorry, this content could not be embedded.","jetpack")," ",(0,f.jsx)(o.Button,{variant:"link",onClick:()=>(0,g.pG)(j,i),children:_x("Convert block to link","button label","jetpack")})]}))},[n,i,j]),N=(0,s.useCallback)(e=>{if(!e||u.gQ===e||"modal"===k)return;const t=(0,g.HE)(e);if(t){const r={eventId:t,url:e};(0,c.A)(r.url,S).then(e=>{const t=(0,a.y)(l.attributes,{...r,url:e});v(t),C(e),n.removeAllNotices()}).catch(()=>{v({eventId:void 0,url:void 0}),T()})}else T()},[k,n,T,v,C,S]);let P;return(0,s.useEffect)(()=>{N(y)},[y,N]),P=A?(0,f.jsx)(h.A,{}):x||!y||E?(0,f.jsx)(p.A,{...e,editedUrl:j,onChange:e=>C(e.target.value),onSubmit:e=>{e&&e.preventDefault(),N((0,g.pJ)(j)),_(!1)}}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.s,{...e}),(0,f.jsx)(r.BlockControls,{children:(0,f.jsx)(d.o,{setEditingUrl:_})}),"modal"===k?(0,f.jsx)(r.InnerBlocks,{template:[[b.name,b.attributes]],templateLock:"all"}):(0,f.jsx)(m.A,{...e})]}),(0,f.jsx)("div",{...w,children:P})});n.d(t,["A",0,v])},34590(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(82306),i=n(36850),a=n(77629),c=n(90397),l=n(41958);(0,o.M)(s,{edit:c.A,save:l.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&(i._t.test(e.textContent)||i.GY.test(e.textContent)),transform:e=>(0,r.createBlock)("jetpack/eventbrite",{url:e.textContent.trim()})}]},deprecated:a.A})},51228(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(56427),i=n(27723),a=n(57273),c=n(82306),l=(n(17158),n(10790));const __=i.__,_x=i._x,u=(0,o.sh)(c),d=({className:e,noticeUI:t,editedUrl:n,onChange:o,onSubmit:i})=>{const c=(0,r.isWpcomPlatformSite)()?"http://support.wordpress.com/wordpress-editor/blocks/eventbrite-block/":"https://jetpack.com/support/jetpack-blocks/eventbrite-block/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(s.Placeholder,{label:__("Eventbrite Checkout","jetpack"),instructions:__("Paste a link to an Eventbrite event to embed ticket checkout.","jetpack"),icon:u,notices:t,children:[(0,l.jsxs)("form",{onSubmit:i,children:[(0,l.jsx)("input",{type:"url",value:n,className:"components-placeholder__input","aria-label":__("Eventbrite URL","jetpack"),placeholder:__("Enter an event URL to embed here…","jetpack"),onChange:o}),(0,l.jsx)(s.Button,{variant:"secondary",type:"submit",children:_x("Embed","submit button label","jetpack")})]}),(0,l.jsx)("div",{className:"components-placeholder__learn-more",children:(0,l.jsx)(a.N,{openInNewTab:!0,href:c,children:__("Learn more about Eventbrite embeds","jetpack")})})]})})};n.d(t,["A",0,d])},54492(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(10790);const __=o.__,i=()=>(0,s.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,s.jsx)(r.Spinner,{}),(0,s.jsx)("p",{children:__("Embedding…","jetpack")})]});n.d(t,["A",0,i])},87965(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=({className:e,attributes:t})=>{const{eventId:n}=t;if(!n)return;const s=`eventbrite-widget-${n}`,i=`\n\t\t\t<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"><\/script>\n\t\t\t<style>\n\t\t\t\t/* Prevent scrollbar on the embed preview */\n\t\t\t\tbody {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t}\n\t\t\t\t/* Eventbrite embeds have a CSS height transition on loading, which causes <Sandbox>\n\t\t\t\tto not recognise the resizing. We need to disable that transition. */\n\t\t\t\t* {\n\t\t\t\t\ttransition: none !important;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<script>\n\t\t\t\twindow.EBWidgets.createWidget({\n\t\t\t\t\twidgetType: 'checkout',\n\t\t\t\t\teventId: ${n},\n\t\t\t\t\tiframeContainerId: '${s}',\n\t\t\t\t});\n\t\t\t<\/script>\n\t\t\t<div id="${s}"></div>\n\t\t`;return(0,o.jsxs)("div",{className:e,children:[(0,o.jsx)(r.SandBox,{html:i}),(0,o.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};n.d(t,["A",0,s])},41958(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s({attributes:e}){const{eventId:t,style:n,url:s}=e;if(!t)return;let i;"modal"===n?i=(0,o.jsx)(r.InnerBlocks.Content,{}):s&&(i=(0,o.jsx)("a",{className:"eventbrite__direct-link",href:s,children:s}));const a=r.useBlockProps.save();return(0,o.jsx)("div",{...a,children:i})}},17158(e,t,n){"use strict";n.d(t,{HE:()=>a,pG:()=>i,pJ:()=>c});var r=n(74997),o=n(86087),s=n(10790);function i(e,t){const n=(0,s.jsx)("a",{href:e,children:e});t((0,r.createBlock)("core/paragraph",{content:(0,o.renderToString)(n)}))}function a(e){if(!e)return null;const t=e.match(/(\d+)\/?(?:\?[^/]*)?\s*$/);return t&&t[1]?parseInt(t[1],10):null}function c(e=""){return e&&"string"==typeof e?e.trim():null}},10167(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(10790);const __=s.__;const a=(0,o.forwardRef)(function({onSubmit:e,onChange:t,value:n=""},o){return(0,i.jsxs)("form",{className:"wp-block-jetpack-gif_input-container",onSubmit:e,children:[(0,i.jsx)("input",{type:"text",className:"wp-block-jetpack-gif_input components-placeholder__input",placeholder:__("Enter search terms, e.g. cat…","jetpack"),value:n,onChange:t,ref:o,"aria-labelledby":"wp-block-jetpack-gif_search-button"}),(0,i.jsx)(r.Button,{id:"wp-block-jetpack-gif_search-button",variant:"secondary",type:"submit",children:__("Search","jetpack")})]})});n.d(t,["A",0,a])},83690(e,t,n){"use strict";n.d(t,["T",0,"t1PkR1Vq0mzHueIFBvZSZErgFs9NBmYW","t",0,["giphy.com"]])},89635(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(56427),s=n(10790);function i(){return(0,s.jsx)(r.InspectorControls,{children:(0,s.jsx)(o.PanelBody,{className:"components-panel__body-gif-branding",children:(0,s.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 202 22",children:[(0,s.jsx)(o.Path,{d:"M4.6 5.9H0v10h1.6v-3.1h3c4.8 0 4.8-6.9 0-6.9zm0 5.4h-3v-4h3c2.6.1 2.6 4 0 4zM51.2 12.3c2-.3 2.7-1.7 2.7-3.1 0-1.7-1.2-3.3-3.5-3.3h-4.6v10h1.6v-3.4h2.1l3 3.4h1.9l-.2-.3-3-3.3zM47.4 11V7.4h3c1.3 0 1.9.9 1.9 1.8s-.6 1.8-1.9 1.8h-3zM30.6 13.6L28 5.9h-1.1l-2.5 7.7-2.6-7.7H20l3.7 10H25l1.4-3.5L27.5 9l1.1 3.4 1.3 3.5h1.4l3.5-10h-1.7z"}),(0,s.jsx)(o.Path,{d:"M14.4 5.7c-3 0-5.1 2.2-5.1 5.2 0 2.6 1.6 5.1 5.1 5.1 3.5 0 5.1-2.5 5.1-5.2-.1-2.6-1.7-5.1-5.1-5.1zm-.1 8.9c-2.5 0-3.5-1.9-3.5-3.7 0-2.2 1.2-3.8 3.5-3.8 2.4 0 3.5 2 3.5 3.8.1 2-1 3.7-3.5 3.7zM57.7 11.6h5.5v-1.5h-5.5V7.4h5.7V5.9h-7.3v10h7.3v-1.6h-5.7zM38 14.3v-2.7h5.5v-1.5H38V7.4h5.7V5.9h-7.3v10h7.3v-1.6zM93 10.3l-2.7-4.4h-1.9V6l3.8 5.8v4.1h1.6v-4.1l4-5.8v-.1h-2zM69.3 5.9h-3.8v10h3.8c3.5 0 5.1-2.5 5-5.1-.1-2.5-1.6-4.9-5-4.9zm0 8.4h-2.2V7.4h2.2c2.3 0 3.4 1.7 3.4 3.4s-1 3.5-3.4 3.5zM86.3 10.7c.9-.4 1.4-1.1 1.4-2 0-2-1.5-2.8-3.4-2.8h-4.6v10h4.6c2 0 3.7-.7 3.7-2.8 0-.8-.5-2-1.7-2.4zm-5-3.4h3c1.2 0 1.8.7 1.8 1.4 0 .8-.6 1.3-1.8 1.3h-3V7.3zm3 7.1h-3v-2.9h3c.9 0 2.1.5 2.1 1.6 0 1-1.2 1.3-2.1 1.3zM113.9 13.3h5.3V16c-1.2.9-2.9 1.1-4 1.1-4.2 0-5.6-3.3-5.6-6 0-4.1 2.2-6.1 5.6-6.1 1.4 0 3.2.4 4.8 1.8l3.4-3.4C120.7.6 118.1 0 115.2 0c-7.8 0-11.4 5.6-11.4 11s3.1 10.9 11.4 10.9c4 0 7.6-1.4 8.9-4.1V8.6h-10.2v4.7zM171.9 8.5h-7.4V.6h-5.9v20.8h5.9v-7.8h7.4v7.8h5.9V.6h-5.9zM195.1.6l-4.5 7.1-4.3-7.1h-6.6v.2l7.9 12.3v8.3h5.9v-8.3L201.8.9V.6zM127.4.6h5.9v20.8h-5.9zM147.6.6h-10.1v20.8h5.9v-5.6h4.2c5.6-.1 8.3-3.4 8.3-7.6.1-4.1-2.7-7.6-8.3-7.6zm0 10.2h-4.2V5.6h4.2c1.6 0 2.5 1.2 2.5 2.6 0 1.4-.9 2.6-2.5 2.6z"})]})})})}},41221(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(86087),a=n(27723),c=n(13022),l=n(98212),u=n(5564),d=n(10167),p=n(83690),h=n(89635),m=n(65465),g=n(38770),f=n(10790);const __=a.__,b=(0,r.sh)(u);const v=function({attributes:e,setAttributes:t,isSelected:n}){const{align:r,caption:a,giphyUrl:v,searchText:y,paddingTop:k}=e,[w,x]=(0,i.useState)(!1),_=(0,i.createRef)(),{isFetching:j,giphyData:C,fetchGiphyData:A}=(0,m.A)(),S=(0,o.useBlockProps)(),E=(0,l.A)(v,p.t),T=()=>{_.current.focus(),x(!1)};(0,i.useEffect)(()=>{!v&&C&&C[0]&&t((0,g.Er)(C[0]))},[v,C,t]);const N=async t=>{if(t.preventDefault(),!e.searchText||j)return;const n=await(0,g.ID)(e.searchText);n&&A(n)},P=e=>t({searchText:e.target.value});return(0,f.jsxs)("div",{...S,className:(0,c.A)(S.className,`align${r}`),children:[(0,f.jsx)(h.A,{}),E?(0,f.jsxs)("figure",{children:[n&&(0,f.jsx)(d.A,{onSubmit:N,onChange:P,value:y,ref:_}),n&&C&&C.length>1&&(0,f.jsx)("div",{className:"wp-block-jetpack-gif_thumbnails-container",children:C.map(e=>{const n={backgroundImage:`url(${e.images.downsized_still.url})`};return(0,f.jsx)("button",{className:"wp-block-jetpack-gif_thumbnail-container",onClick:n=>{n.preventDefault(),(e=>{t((0,g.Er)(e))})(e)},style:n},e.id)})}),(0,f.jsxs)("div",{className:"wp-block-jetpack-gif-wrapper",style:{paddingTop:k},children:[(0,f.jsx)("div",{className:"wp-block-jetpack-gif_cover",onClick:T,onKeyDown:T,role:"button",tabIndex:"0"}),(0,f.jsx)("iframe",{src:v,title:y})]}),(!o.RichText.isEmpty(a)||n)&&!!v&&(0,f.jsx)(o.RichText,{className:"wp-block-jetpack-gif-caption gallery-caption",inlineToolbar:!0,isSelected:w,onFocus:()=>x(!1),onChange:e=>t({caption:e}),placeholder:__("Write caption…","jetpack"),tagName:"figcaption",value:a})]}):(0,f.jsx)(s.Placeholder,{className:"wp-block-jetpack-gif_placeholder",icon:b,label:u.title,instructions:__("Search for a term or paste a Giphy URL","jetpack"),children:(0,f.jsx)(d.A,{onSubmit:N,onChange:P,value:y,ref:_})})]})};n.d(t,["A",0,v])},55734(e,t,n){"use strict";var r=n(94375),o=n(5564),s=n(41221);n(27453),n(88561);(0,r.M)(o,{edit:s.A,save:()=>null})},65465(e,t,n){"use strict";var r=n(86087);const o=(e=[])=>{const[t,n]=(0,r.useState)(!1),[o,s]=(0,r.useState)(e),[i,a]=(0,r.useState)("");return(0,r.useEffect)(()=>{if(!i)return;(async()=>{n(!0);const e=await fetch(i).then(e=>!!e.ok&&e).catch(()=>!1);if(e){const t=await e.json(),n=void 0!==t.data.images?[t.data]:t.data;n[0].images&&s(n)}n(!1)})()},[i]),{isFetching:t,giphyData:o,fetchGiphyData:a}};n.d(t,["A",0,o])},38770(e,t,n){"use strict";var r=n(56145),o=n(83690);const s=e=>`https://api.giphy.com/v1/gifs/search?q=${encodeURIComponent(e)}&api_key=${encodeURIComponent(o.T)}&limit=10`,i=e=>`https://api.giphy.com/v1/gifs/${encodeURIComponent(e)}?api_key=${encodeURIComponent(o.T)}`,a=(e="",t)=>{const n=e.split(t);return n[n.length-1]},c=e=>`${Math.floor(e.images.original.height/e.images.original.width*100)}%`,l=e=>e?.embed_url;n.d(t,["Er",0,e=>({giphyUrl:l(e),paddingTop:c(e)}),"ID",0,(e="")=>new Promise(t=>{let n=null;if((e=e.trim()).match(/^https:\/\/gph\.is\/(?:[a-zA-Z0-9]+\/)?[a-zA-Z0-9]+$/i))(0,r.A)(e).then(r=>{r.startsWith("https://giphy.com/gifs/")?(n=a(r,"-"),t(i(n))):t(s(e))}).catch(()=>t(s(e)));else{const r=/^https?:\/\/(media\.|i\.)?giphy\.com\/(embed|gifs|media)?\/?([-\w]*)(\/giphy)?(\.gif)?$/,o=e.match(r);o&&o[3]&&(n=a(o[3],"-")),n&&t(i(n)),t(s(e))}})])},31987(e,t,n){"use strict";n.d(t,{e:()=>c,u:()=>l});var r=n(56427),o=n(27723),s=n(30178),i=n(10790);const __=o.__,a=({attributes:e,setAttributes:t})=>{const{showCover:n,showAuthor:o,showTitle:s,showRating:a,showReview:c,showTags:l}=e;return(0,i.jsxs)(r.PanelBody,{PanelBody:!0,title:__("Display Settings","jetpack"),initialOpen:!0,children:[(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show cover","jetpack"),checked:n,onChange:()=>t({showCover:!n})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show author","jetpack"),checked:o,onChange:()=>t({showAuthor:!o})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show title","jetpack"),checked:s,onChange:()=>t({showTitle:!s})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show rating","jetpack"),checked:a,onChange:()=>t({showRating:!a})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show review","jetpack"),checked:c,onChange:()=>t({showReview:!c})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show tags","jetpack"),checked:l,onChange:()=>t({showTags:!l})})]})};function c({attributes:e,setAttributes:t}){const{style:n,shelfOption:o,bookNumber:c,orderOption:l,customTitle:u,sortOption:d}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{PanelBody:!0,title:__("Block Settings","jetpack"),initialOpen:!0,children:[(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Shelf","jetpack"),value:o,onChange:e=>t({shelfOption:e}),options:s.TG}),(0,i.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Title","jetpack"),value:u||s.wK,onChange:e=>t({customTitle:e})}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Sort by","jetpack"),value:d,onChange:e=>t({sortOption:e}),options:s.dV}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Order","jetpack"),value:l,onChange:e=>t({orderOption:e}),options:s.ne}),(0,i.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of books","jetpack"),type:"number",inputMode:"numeric",min:"1",max:"grid"===n?200:100,value:c||5,onChange:e=>t({bookNumber:e})})]}),"default"===n&&a({attributes:e,setAttributes:t})]})}function l({attributes:e,setAttributes:t}){const{style:n}=e,o=[{icon:"list-view",title:__("Default view","jetpack"),onClick:()=>t({style:"default"}),isActive:"default"===n},{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({style:"grid"}),isActive:"grid"===n}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.ToolbarButton,{label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>t({goodreadsId:""})}),(0,i.jsx)(r.ToolbarGroup,{controls:o})]})}},21973(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(86087),a=n(89877),c=n(27723),l=n(98212),u=n(24360),d=n(31987),p=n(21342),h=n(30178),m=n(10790);const __=c.__,_x=c._x,g=(0,s.withNotices)(e=>{const{attributes:t,className:n,noticeOperations:c,noticeUI:g,setAttributes:f}=e,[b,v]=(0,i.useState)(""),[y,k]=(0,i.useState)(""),[w,x]=(0,i.useState)(!1),_=(0,o.useBlockProps)(),{isFetchingData:j,goodreadsUserId:C,isError:A}=(0,p.A)(y),{goodreadsId:S,widgetId:E,link:T,style:N}=t,P=(0,i.useRef)(!1),B=(0,l.h)(T,h.aN);(0,i.useEffect)(()=>{j&&x(!0),j||(x(!1),A&&(f({widgetId:void 0,goodreadsId:void 0,link:void 0}),M()),C&&!A&&f({goodreadsId:C}))},[C,j,w,A,f]),(0,i.useEffect)(()=>{if(!S)return;if(!P.current&&E&&T)return void(P.current=!0);P.current=!0;const e=Math.floor(9999999*Math.random());f({widgetId:e,id:("grid"===N?"gr_grid_widget_":"gr_custom_widget_")+e,link:(0,h._9)({attributes:{...t,widgetId:e}})})},[S,N,t.shelfOption,t.bookNumber,t.orderOption,t.customTitle,t.sortOption,t.showAuthor,t.showCover,t.showRating,t.showReview,t.showTags,t.showTitle,f]);const M=()=>{c.removeAllNotices(),c.createErrorNotice((0,m.jsx)(m.Fragment,{children:__("Sorry, this content could not be embedded.","jetpack")}))},I=e=>{e&&e.preventDefault(),k(b),x(!0)},R=()=>(0,m.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,m.jsx)(s.Spinner,{}),(0,m.jsx)("p",{children:__("Embedding…","jetpack")})]}),L=()=>{const{id:e}=t,r=`\n\t\t<style> [class^=gr_custom_container_] { border: 1px solid gray; border-radius: 10px; margin: auto; padding: 0 5px 10px 5px; background-color: #fff; color: #000; width: 300px; } [class^=gr_custom_header_] { border-bottom: 1px solid gray; width: 100%; padding: 10px 0; margin: auto; text-align: center; font-size: 120%; } [class^=gr_custom_each_container_] { width: 100%; clear: both; margin: auto; overflow: auto; padding-bottom: 4px; border-bottom: 1px solid #aaa; } [class^=gr_custom_each_container_] { width: 100%; clear: both; margin-bottom: 10px; overflow: auto; padding-bottom: 4px; border-bottom: 1px solid #aaa; } [class^=gr_custom_book_container_] { overflow: hidden; height: 60px; float: left; margin-right: 6px; width: 39px; } [class^=gr_custom_author_] { font-size: 10px; } [class^=gr_custom_tags_] { font-size: 10px; color: gray; } [class^=gr_custom_rating_] { float: right; } [class^=gr_grid_book_container] { float: left; width: 98px; height: 160px; padding: 0 0; overflow: hidden; } [class^=gr_grid_book_container] img { height: 100%; width: 100%; } a { text-decoration: none; } a:hover { text-decoration: underline; } img { max-width: 100%; }</style>\n\t\t<script src="${B}"><\/script>\n \t<div id="${(0,a.escapeAttribute)(e??"")}"></div>\n \t`;return(0,m.jsxs)("div",{className:n,children:[(0,m.jsx)(s.SandBox,{title:"Goodreads",html:r}),(0,m.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};let D;return D=w||S&&!T?R():S&&B?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(o.InspectorControls,{children:(0,m.jsx)(d.e,{attributes:t,setAttributes:f})}),(0,m.jsx)(o.BlockControls,{children:(0,m.jsx)(d.u,{attributes:t,setAttributes:f})}),L()]}):(0,m.jsx)("div",{className:n,children:(0,m.jsx)(s.Placeholder,{label:__("Goodreads","jetpack"),instructions:__("Paste a link to a Goodreads profile.","jetpack"),icon:(0,r.sh)(u),notices:g,children:(0,m.jsxs)("form",{onSubmit:I,children:[(0,m.jsx)("input",{type:"url",value:b,className:"components-placeholder__input","aria-label":__("Goodreads profile URL","jetpack"),placeholder:__("Enter a Goodreads profile URL to embed here…","jetpack"),onChange:e=>v(e.target.value)}),(0,m.jsx)(s.Button,{variant:"secondary",type:"submit",children:_x("Embed","submit button label","jetpack")})]})})}),(0,m.jsx)("div",{..._,children:D})});n.d(t,["A",0,g])},80838(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(24360),i=n(21973),a=n(59982);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"wpcom-goodreads"===e,transform:({instance:e})=>(0,r.createBlock)("jetpack/goodreads",{customTitle:e.raw.title,goodreadsId:parseInt(e.raw.user_id),shelfOption:e.raw.shelf,showRating:!1,widgetId:Math.floor(9999999*Math.random())})}]}})},21342(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1455),o=n.n(r),s=n(86087),i=n(56145);function a(e){const[t,n]=(0,s.useState)(!1),[r,a]=(0,s.useState)(!1),[c,l]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1),p=e=>{const t=e.match(/\/(user|author)\/show\/(\d+)/);return!!t&&parseInt(t[2])};return(0,s.useEffect)(()=>{l(!1),d(!1),e.length&&!/^(https?:\/\/)?(www\.)?goodreads\.com\/.*/.test(e)&&l(!0);const t=p(e);!c&&e.length&&(a(!0),t?(async t=>{if(/\/author\//.test(e)){const e=`/wpcom/v2/goodreads/user-id?id=${t}`;await o()({path:e,method:"GET"}).then(e=>{n(e)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})}else(0,i.A)(e).then(e=>{e.endsWith("/author")&&d(!0),n(t)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})})(t):(async e=>{(0,i.A)(e).then(e=>{const t=p(e);t?n(t):d(!0)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})})(e))},[e,c]),{isFetchingData:r,goodreadsUserId:t,isError:c||u}}},59982(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},30178(e,t,n){"use strict";n.d(t,{_9:()=>c});var r=n(27723);const __=r.__,_x=r._x,o=__("My Bookshelf","jetpack"),s=[{label:_x("Read","perfect participle - eg. I read a book yesterday.","jetpack"),value:"read"},{label:__("Currently reading","jetpack"),value:"currently-reading"},{label:_x("To read","future participle - eg. I have this to read tomorrow.","jetpack"),value:"to-read"}],i=[{label:"ASIN",value:"asin"},{label:_x("Author","noun","jetpack"),value:"author"},{label:__("Average rating","jetpack"),value:"avg_rating"},{label:_x("Comments","noun","jetpack"),value:"comments"},{label:_x("Cover","noun - ie. book cover","jetpack"),value:"cover"},{label:__("Date added","jetpack"),value:"date_added"},{label:__("Date published","jetpack"),value:"date_pub"},{label:__("Date read","jetpack"),value:"date_read"},{label:__("Date started","jetpack"),value:"date_started"},{label:__("Dated updated","jetpack"),value:"date_updated"},{label:_x("Format","noun","jetpack"),value:"format"},{label:"ISBN",value:"isbn"},{label:"ISBN-13",value:"isbn13"},{label:_x("Notes","noun","jetpack"),value:"notes"},{label:__("Number of pages","jetpack"),value:"num_pages"},{label:__("Number of ratings","jetpack"),value:"num_ratings"},{label:_x("Owned","possessive - eg. I owned this book for a year","jetpack"),value:"owned"},{label:_x("Position","noun","jetpack"),value:"position"},{label:__("Random","jetpack","jetpack"),value:"random"},{label:_x("Rating","noun","jetpack"),value:"rating"},{label:__("Read count","jetpack"),value:"read_count"},{label:_x("Review","noun","jetpack"),value:"review"},{label:_x("Shelves","noun","jetpack"),value:"shelves"},{label:_x("Title","noun","jetpack"),value:"title"},{label:_x("Votes","noun","jetpack"),value:"votes"},{label:__("Year published","jetpack"),value:"year_pub"}],a=[{label:__("Ascending","jetpack"),value:"a"},{label:__("Descending","jetpack"),value:"d"}];function c({attributes:e}){const{bookNumber:t,customTitle:n=o,goodreadsId:r,orderOption:s,shelfOption:i,showAuthor:a,showCover:c,showRating:l,showReview:u,showTags:d,showTitle:p,sortOption:h,style:m,widgetId:g}=e;if(!r)return;const f=(n||o).split("/").map(e=>encodeURIComponent(e)).join("/");let b=`https://www.goodreads.com/review/custom_widget/${r}.${f}?num_books=${t}&order=${s}&shelf=${i}&show_author=${a?1:0}&show_cover=${c?1:0}&show_rating=${l?1:0}&show_review=${u?1:0}&show_tags=${d?1:0}&show_title=${p?1:0}&sort=${h}&widget_id=${g}`;return"grid"===m&&(b=`https://www.goodreads.com/review/grid_widget/${r}.${f}?cover_size=medium&num_books=${t}&order=${s}&shelf=${i}&sort=${h}&widget_id=${g}`),b}n.d(t,["TG",0,s,"aN",0,["goodreads.com"],"dV",0,i,"ne",0,a,"wK",0,o])},55777(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(10790);const __=o.__,_x=o._x,i=e=>{const{className:t,embedValue:n,onChange:o,onSubmit:i}=e;return(0,s.jsx)(r.PanelBody,{title:__("Calendar settings","jetpack"),initialOpen:!1,children:(0,s.jsxs)("form",{onSubmit:i,className:t,children:[(0,s.jsx)("textarea",{type:"text",value:n,className:"components-placeholder__input","aria-label":__("Google Calendar URL or iframe","jetpack"),placeholder:__("Enter URL or iframe to embed here…","jetpack"),onChange:o}),(0,s.jsx)(r.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]})})};n.d(t,["A",0,i])},50259(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(74997),a=n(56427),c=n(29491),l=n(86087),u=n(27723),d=n(57273),p=n(26873),h=n(98212),m=n(76862),g=n(55777),f=n(23972),b=n(10790);const __=u.__,_x=u._x,v=(0,o.sh)(m);const y=(0,c.compose)(a.withNotices,(0,p.withViewportMatch)({isMobile:"< small"}))(function(e){const{attributes:{url:t,height:n},isMobile:o,isSelected:c,name:u,noticeOperations:p,noticeUI:m,setAttributes:y}=e,k=(0,s.useBlockProps)(),[w,x]=(0,l.useState)(t||""),[_,j]=(0,l.useState)(!1),[C,A]=(0,l.useState)(!1);(0,l.useEffect)(()=>{!c&&C&&A(!1)},[c,C]);const S=()=>{A(!0)},E=e=>{e&&e.preventDefault();const t=(0,f.tW)(w.trim());if(!(0,h.h)(t.url,f.Kp))return p.removeAllNotices(),void p.createErrorNotice(__("Your calendar couldn't be embedded. Please double check your URL or Embed Code. Please note, you need to use the 'Public URL' or 'Embed Code', the 'Shareable Link' will not work.","jetpack"));y(t),j(!1),p.removeAllNotices()},T=(0,i.getBlockDefaultClassName)(u),N=o?"300":n,P=(0,h.h)(t,f.Kp),B=`<iframe src="${P}" style="border:0" scrolling="no" frameborder="0" height="${N}"></iframe>`,M=(0,b.jsx)(d.N,{openInNewTab:!0,href:"https://en.support.wordpress.com/google-calendar/",children:__("Enable Permissions for the calendar you want to share","jetpack")}),I=(0,b.jsx)(s.InspectorControls,{children:(0,b.jsx)(g.A,{className:`${T}-embed-form-sidebar`,embedValue:w,onChange:e=>x(e.target.value),onSubmit:E})});let R;if(_||!P){const e=(0,r.isWpcomPlatformSite)()?"https://en.support.wordpress.com/wordpress-editor/blocks/google-calendar/":"https://jetpack.com/support/jetpack-blocks/google-calendar/";R=(0,b.jsxs)(b.Fragment,{children:[I,(0,b.jsxs)(a.Placeholder,{label:__("Google Calendar","jetpack"),icon:v,notices:m,children:[(0,b.jsxs)("ol",{className:`${T}-placeholder-instructions`,children:[(0,b.jsx)("li",{children:M}),(0,b.jsx)("li",{children:__("Paste the embed code you copied from your Google Calendar below","jetpack")})]}),(L=`${T}-embed-form-editor`,(0,b.jsxs)("form",{onSubmit:E,className:L,children:[(0,b.jsx)("textarea",{type:"text",value:w,className:"components-placeholder__input","aria-label":__("Google Calendar URL or iframe","jetpack"),placeholder:__("Enter URL or iframe to embed here…","jetpack"),onChange:e=>x(e.target.value)}),(0,b.jsx)(a.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]})),(0,b.jsx)("div",{className:`${T}-placeholder-links`,children:(0,b.jsx)(d.N,{openInNewTab:!0,href:e,children:__("Learn more","jetpack")})})]})]})}else R=(0,b.jsxs)(b.Fragment,{children:[I,(0,b.jsxs)("div",{children:[(0,b.jsx)(a.SandBox,{html:B,onFocus:S}),!C&&(0,b.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:S})]})]});var L;return(0,b.jsx)("div",{...k,children:R})});n.d(t,["A",0,y])},29280(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(76862),i=n(50259),a=n(41700),c=n(23972);n(14647);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"shortcode",tag:"googleapps",isMatch:function(e){return"calendar"===e.named.domain},attributes:{url:{type:"string",shortcode:({named:{domain:e,dir:t,query:n}})=>`https://${e}.google.com/${t}?${n}`}}},{type:"raw",isMatch:e=>"P"===e.nodeName&&c._t.test(e.textContent),transform:e=>(0,r.createBlock)("jetpack/google-calendar",{url:e.textContent.trim()})},{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&c.fF.test(e.innerHTML),transform:e=>{const{url:t,height:n}=(0,c.HW)(e.innerHTML.trim());return(0,r.createBlock)("jetpack/google-calendar",{url:t,height:n})}}]}})},41700(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=({attributes:{url:e}})=>{const t=r.useBlockProps.save();return(0,o.jsx)("a",{...t,href:e,children:e})};n.dn(s),n.d(t,["A",0,s])},23972(e,t,n){"use strict";n.d(t,{HW:()=>l,tW:()=>u});const r="https?://calendar\\.google\\.com/calendar",o=new RegExp(`^${r}`,"i"),s=new RegExp(`<iframe((?:\\s+\\w+=(['"]).*?\\2)*)\\s+src=(["'])(${r}.*?)\\3((?:\\s+\\w+=(['"]).*?\\6)*)`,"i"),i=new RegExp(`${r}\\?cid=([-A-Za-z0-9+/]+={0,3})`,"i"),a=/\s+(\w+)=(["'])(.*?)\2/gi;function c(e){const t=i.exec(e);if(t)return"https://calendar.google.com/calendar/embed?src="+encodeURIComponent(atob(t[1]))}function l(e){const t=s.exec(e);if(!t)return;const n={};return t.forEach((e,t)=>{if(0===t)return;if(o.test(e))return void(n.url=e);let r;for(;null!==(r=a.exec(e));)n[r[1]]=r[3]}),{url:n.url,width:n.width,height:n.height}}function u(e){return s.test(e)?l(e):i.test(e)?{url:c(e)}:{url:e}}n.d(t,["Kp",0,["calendar.google.com"],"_t",0,o,"fF",0,s])},21466(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(2743),c=n(60288),l=n(10790);const __=i.__,_x=i._x,u=c.A?.find(e=>"jetpack/google-docs"===e.name),d=c.A?.find(e=>"jetpack/google-sheets"===e.name),p=c.A?.find(e=>"jetpack/google-slides"===e.name),h={type:"document",title:u?.title,icon:u.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/document\/d\/([A-Za-z0-9_-]+).*?$/i]},m={type:"spreadsheets",title:d?.title,icon:d.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/spreadsheets\/d\/([A-Za-z0-9_-]+).*?$/i]},g={type:"presentation",title:p?.title,icon:p.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/presentation\/d\/([A-Za-z0-9_-]+).*?$/i]},f=e=>{const{attributes:{aspectRatio:t},attributes:{variation:n},attributes:{url:i},setAttributes:c}=e;let u="",d="",p=[],f="";switch((0,s.useEffect)(()=>{n||c({variation:(()=>{switch(i.match(/^(http|https):\/\/(docs\.google\.com)\/(.*)\/d\//)[3]){case"document":return"google-docs";case"spreadsheets":return"google-sheets";case"presentation":return"google-slides"}return""})()})},[n,i,c]),n.replace("jetpack/","")){case"google-docs":u=h.icon,d=h.title,p=h.patterns,f=h.type;break;case"google-sheets":u=m.icon,d=m.title,p=m.patterns,f=m.type;break;case"google-slides":u=g.icon,d=g.title,p=g.patterns,f=g.type}const b=[
70 +__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{const n=[...x];n[t]=e,k("amounts",n)})(e,t),value:e},`jetpack-donations-amount-${t}`))}),m&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:b,onChange:e=>n({customAmountText:e})}),(0,l.jsx)(a.A,{currency:c,label:__("Custom amount","jetpack"),defaultValue:g??100*(0,i.dv)(c),className:"donations__custom-amount",disabled:!0})]}),(0,l.jsx)("hr",{className:"donations__separator"}),(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:y("extraText")??u.extraText,onChange:e=>k("extraText",e)}),(0,l.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper",children:(0,l.jsx)(r.RichText,{className:"wp-block-button__link wp-element-button donations__donate-button",placeholder:__("Write a message…","jetpack"),value:y("buttonText")??u[v]?.buttonText,onChange:e=>{return t=e,void n({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});var t},allowedFormats:_})})]})};n.d(t,["A",0,d])},52244(e,t,n){"use strict";var r=n(86087),o=n(27723),s=n(13022),i=n(54806),a=n(32299),c=n(75703),l=n(10790);const __=o.__,u=e=>{const{attributes:t,products:n,setAttributes:o}=e,{oneTimeDonation:u,monthlyDonation:d,annualDonation:p,defaultInterval:h}=t,m=!1!==u.show,g=(0,c.fq)(m,d.show,p.show)??"one-time",f="one-time"===h&&m||"1 month"===h&&d.show||"1 year"===h&&p.show?h:g,[b,v]=(0,r.useState)(f),y=(0,r.useCallback)(e=>b===e,[b]),k={...m&&{"one-time":{title:__("One-Time","jetpack")}},...d.show&&{"1 month":{title:__("Monthly","jetpack")}},...p.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,r.useEffect)(()=>{u.planId===n["one-time"]&&d.planId===n["1 month"]&&p.planId===n["1 year"]||o({...n["one-time"]&&{oneTimeDonation:{...u,planId:n["one-time"]}},...n["1 month"]&&{monthlyDonation:{...d,planId:n["1 month"]}},...n["1 year"]&&{annualDonation:{...p,planId:n["1 year"]}}})},[u,d,p,o,n]),(0,r.useEffect)(()=>{const e=(0,c.fq)(m,d.show,p.show);null!==e&&(!m&&y("one-time")&&v(e),!d.show&&y("1 month")&&v(e),!p.show&&y("1 year")&&v(e))},[m,d,p,v,y]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"donations__container",children:[Object.keys(k).length>1&&(0,l.jsx)("div",{className:"donations__nav",children:Object.entries(k).map(([e,{title:t}])=>(0,l.jsx)("div",{role:"button",tabIndex:0,className:(0,s.A)("donations__nav-item",{"is-active":y(e)}),onClick:()=>v(e),onKeyDown:()=>v(e),children:t},`jetpack-donations-nav-item-${e} `))}),(0,l.jsx)("div",{className:"donations__content",children:(0,l.jsx)(a.A,{activeTab:b,attributes:t,setAttributes:o})})]}),(0,l.jsx)(i.A,{...e})]})};n.d(t,["A",0,u])},30746(e,t,n){"use strict";var r=n(27723),o=n(62060);const __=r.__,s="tips",i={variationName:s,displayMode:"modal",triggerSticky:!1,triggerButtonText:"Buy me a coffee",triggerIcon:"coffee",contentAlignment:"center",buttonAlignment:"full",tabsAppearance:"buttons",showCustomAmount:!1,chooseAmountText:"",annualDonation:{show:!1,planId:null,amounts:[3,5,8]},oneTimeDonation:{show:!0,planId:null,amounts:[3,5,8],defaultAmountIndex:0,heading:"",buttonText:"Buy coffee",extraText:"Thanks for your generosity!"},monthlyDonation:{show:!0,planId:null,amounts:[3,5,8],defaultAmountIndex:0,heading:"",buttonText:"Buy coffee",extraText:"Thanks for your generosity!"}},a={name:s,title:__("Tips","jetpack"),description:__("Get financial support from friends and followers.","jetpack"),icon:o.$f,isDefault:!1,attributes:i,scope:["inserter"],isActive:e=>e.variationName===s,keywords:[__("tips","jetpack"),__("coffee","jetpack"),__("support","jetpack"),__("buy me a coffee","jetpack")]};n.d(t,["Ay",0,a])},75703(e,t,n){"use strict";function r(e,t,n){return e?"one-time":t?"1 month":n?"1 year":null}function o(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}n.d(t,{OI:()=>o,fq:()=>r})},36850(e,t,n){"use strict";n.d(t,["GY",0,/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,"_t",0,/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,"gQ",0,"https://www.eventbrite.com/e/test-event-tickets-123456789"])},79979(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(24971),i=n(10790);const __=o.__,_x=o._x,a=[{value:"inline",label:__("In-page Embed","jetpack")},{value:"modal",label:__("Button & Modal","jetpack")}];n.d(t,["o",0,({setEditingUrl:e})=>(0,i.jsx)(r.ToolbarGroup,{children:(0,i.jsx)(r.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),"s",0,({attributes:e,setAttributes:t})=>(0,i.jsx)(s.A,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),styleOptions:a,onSelectStyle:t,activeStyle:e.style})])},77629(e,t,n){"use strict";const r=[n(84109).A];n.d(t,["A",0,r])},84109(e,t,n){"use strict";var r=n(94715),o=n(74997),s=n(27723),i=n(13022),a=n(66087),c=n(10790);const _x=s._x,l=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];const u={attributes:{url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:_x("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:e=>{const{className:t,style:n}=e;let r=n;r||(r=e.useModal?"modal":"inline");const s={...Object.fromEntries(Object.entries(e).filter(([e])=>"useModal"!==e&&!l.includes(e))),className:t&&t.replace("is-style-outline",""),style:r},i=(0,a.pick)(e,l);return[s,[(0,o.createBlock)("jetpack/button",{element:"a",text:i.text||_x("Register","verb: e.g. register for an event.","jetpack"),...i,uniqueId:"eventbrite-widget-id",className:t&&-1!==t.indexOf("is-style-outline")?"is-style-outline":""})]]},save:function({attributes:e}){const{eventId:t,useModal:n,url:o,style:s}=e;if(t)return n||"modal"===s?function(e){const{backgroundColor:t,borderRadius:n,customBackgroundColor:o,customTextColor:s,eventId:a,text:l,textColor:u,url:d}=e,p=(0,r.getColorClassName)("color",u),h=(0,r.getColorClassName)("background-color",t),m=(0,i.A)("wp-block-button__link",{"has-text-color":u||s,[p]:p,"has-background":t||o,[h]:h,"no-border-radius":0===n}),g={backgroundColor:h?void 0:o,color:p?void 0:s,borderRadius:n?n+"px":void 0};return(0,c.jsx)("div",{className:"wp-block-button",children:(0,c.jsx)(r.RichText.Content,{className:m,href:d,id:`eventbrite-widget-${a}`,rel:"noopener noreferrer",role:"button",style:g,tagName:"a",target:"_blank",value:l})})}(e):o&&(0,c.jsx)("a",{className:"eventbrite__direct-link",href:o,children:o})},isEligible:(e,t)=>("modal"===e.style||e.useModal)&&((0,a.isEmpty)(t)||Object.entries(e).some(([e,t])=>t&&l.includes(e)))};n.d(t,["A",0,u])},90397(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(78218),c=n(56145),l=n(82306),u=n(36850),d=n(79979),p=n(51228),h=n(54492),m=n(87965),g=n(17158),f=(n(59357),n(10790));const __=i.__,_x=i._x,b={name:"jetpack/button",attributes:{element:"a",text:_x("Register","verb: e.g. register for an event.","jetpack"),uniqueId:"eventbrite-widget-id"}},v=(0,o.withNotices)(e=>{const{attributes:t,noticeOperations:n,onReplace:i,setAttributes:v}=e,{url:y,style:k}=t,w=(0,r.useBlockProps)(),[x,_]=(0,s.useState)(!1),[j,C]=(0,s.useState)(t.url||""),[A,S]=(0,s.useState)(!1),E=!A&&y&&!u._t.test(y),T=(0,s.useCallback)(()=>{n.removeAllNotices(),n.createErrorNotice((0,f.jsxs)(f.Fragment,{children:[__("Sorry, this content could not be embedded.","jetpack")," ",(0,f.jsx)(o.Button,{variant:"link",onClick:()=>(0,g.pG)(j,i),children:_x("Convert block to link","button label","jetpack")})]}))},[n,i,j]),N=(0,s.useCallback)(e=>{if(!e||u.gQ===e||"modal"===k)return;const t=(0,g.HE)(e);if(t){const r={eventId:t,url:e};(0,c.A)(r.url,S).then(e=>{const t=(0,a.y)(l.attributes,{...r,url:e});v(t),C(e),n.removeAllNotices()}).catch(()=>{v({eventId:void 0,url:void 0}),T()})}else T()},[k,n,T,v,C,S]);let P;return(0,s.useEffect)(()=>{N(y)},[y,N]),P=A?(0,f.jsx)(h.A,{}):x||!y||E?(0,f.jsx)(p.A,{...e,editedUrl:j,onChange:e=>C(e.target.value),onSubmit:e=>{e&&e.preventDefault(),N((0,g.pJ)(j)),_(!1)}}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.s,{...e}),(0,f.jsx)(r.BlockControls,{children:(0,f.jsx)(d.o,{setEditingUrl:_})}),"modal"===k?(0,f.jsx)(r.InnerBlocks,{template:[[b.name,b.attributes]],templateLock:"all"}):(0,f.jsx)(m.A,{...e})]}),(0,f.jsx)("div",{...w,children:P})});n.d(t,["A",0,v])},34590(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(82306),i=n(36850),a=n(77629),c=n(90397),l=n(41958);(0,o.M)(s,{edit:c.A,save:l.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&(i._t.test(e.textContent)||i.GY.test(e.textContent)),transform:e=>(0,r.createBlock)("jetpack/eventbrite",{url:e.textContent.trim()})}]},deprecated:a.A})},51228(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(56427),i=n(27723),a=n(57273),c=n(82306),l=(n(17158),n(10790));const __=i.__,_x=i._x,u=(0,o.sh)(c),d=({className:e,noticeUI:t,editedUrl:n,onChange:o,onSubmit:i})=>{const c=(0,r.isWpcomPlatformSite)()?"http://support.wordpress.com/wordpress-editor/blocks/eventbrite-block/":"https://jetpack.com/support/jetpack-blocks/eventbrite-block/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(s.Placeholder,{label:__("Eventbrite Checkout","jetpack"),instructions:__("Paste a link to an Eventbrite event to embed ticket checkout.","jetpack"),icon:u,notices:t,children:[(0,l.jsxs)("form",{onSubmit:i,children:[(0,l.jsx)("input",{type:"url",value:n,className:"components-placeholder__input","aria-label":__("Eventbrite URL","jetpack"),placeholder:__("Enter an event URL to embed here…","jetpack"),onChange:o}),(0,l.jsx)(s.Button,{variant:"secondary",type:"submit",children:_x("Embed","submit button label","jetpack")})]}),(0,l.jsx)("div",{className:"components-placeholder__learn-more",children:(0,l.jsx)(a.N,{openInNewTab:!0,href:c,children:__("Learn more about Eventbrite embeds","jetpack")})})]})})};n.d(t,["A",0,d])},54492(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(10790);const __=o.__,i=()=>(0,s.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,s.jsx)(r.Spinner,{}),(0,s.jsx)("p",{children:__("Embedding…","jetpack")})]});n.d(t,["A",0,i])},87965(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=({className:e,attributes:t})=>{const{eventId:n}=t;if(!n)return;const s=`eventbrite-widget-${n}`,i=`\n\t\t\t<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"><\/script>\n\t\t\t<style>\n\t\t\t\t/* Prevent scrollbar on the embed preview */\n\t\t\t\tbody {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t}\n\t\t\t\t/* Eventbrite embeds have a CSS height transition on loading, which causes <Sandbox>\n\t\t\t\tto not recognise the resizing. We need to disable that transition. */\n\t\t\t\t* {\n\t\t\t\t\ttransition: none !important;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<script>\n\t\t\t\twindow.EBWidgets.createWidget({\n\t\t\t\t\twidgetType: 'checkout',\n\t\t\t\t\teventId: ${n},\n\t\t\t\t\tiframeContainerId: '${s}',\n\t\t\t\t});\n\t\t\t<\/script>\n\t\t\t<div id="${s}"></div>\n\t\t`;return(0,o.jsxs)("div",{className:e,children:[(0,o.jsx)(r.SandBox,{html:i}),(0,o.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};n.d(t,["A",0,s])},41958(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s({attributes:e}){const{eventId:t,style:n,url:s}=e;if(!t)return;let i;"modal"===n?i=(0,o.jsx)(r.InnerBlocks.Content,{}):s&&(i=(0,o.jsx)("a",{className:"eventbrite__direct-link",href:s,children:s}));const a=r.useBlockProps.save();return(0,o.jsx)("div",{...a,children:i})}},17158(e,t,n){"use strict";n.d(t,{HE:()=>a,pG:()=>i,pJ:()=>c});var r=n(74997),o=n(86087),s=n(10790);function i(e,t){const n=(0,s.jsx)("a",{href:e,children:e});t((0,r.createBlock)("core/paragraph",{content:(0,o.renderToString)(n)}))}function a(e){if(!e)return null;const t=e.match(/(\d+)\/?(?:\?[^/]*)?\s*$/);return t&&t[1]?parseInt(t[1],10):null}function c(e=""){return e&&"string"==typeof e?e.trim():null}},10167(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(10790);const __=s.__;const a=(0,o.forwardRef)(function({onSubmit:e,onChange:t,value:n=""},o){return(0,i.jsxs)("form",{className:"wp-block-jetpack-gif_input-container",onSubmit:e,children:[(0,i.jsx)("input",{type:"text",className:"wp-block-jetpack-gif_input components-placeholder__input",placeholder:__("Enter search terms, e.g. cat…","jetpack"),value:n,onChange:t,ref:o,"aria-labelledby":"wp-block-jetpack-gif_search-button"}),(0,i.jsx)(r.Button,{id:"wp-block-jetpack-gif_search-button",variant:"secondary",type:"submit",children:__("Search","jetpack")})]})});n.d(t,["A",0,a])},83690(e,t,n){"use strict";n.d(t,["T",0,"t1PkR1Vq0mzHueIFBvZSZErgFs9NBmYW"])},89635(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(56427),s=n(10790);function i(){return(0,s.jsx)(r.InspectorControls,{children:(0,s.jsx)(o.PanelBody,{className:"components-panel__body-gif-branding",children:(0,s.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 202 22",children:[(0,s.jsx)(o.Path,{d:"M4.6 5.9H0v10h1.6v-3.1h3c4.8 0 4.8-6.9 0-6.9zm0 5.4h-3v-4h3c2.6.1 2.6 4 0 4zM51.2 12.3c2-.3 2.7-1.7 2.7-3.1 0-1.7-1.2-3.3-3.5-3.3h-4.6v10h1.6v-3.4h2.1l3 3.4h1.9l-.2-.3-3-3.3zM47.4 11V7.4h3c1.3 0 1.9.9 1.9 1.8s-.6 1.8-1.9 1.8h-3zM30.6 13.6L28 5.9h-1.1l-2.5 7.7-2.6-7.7H20l3.7 10H25l1.4-3.5L27.5 9l1.1 3.4 1.3 3.5h1.4l3.5-10h-1.7z"}),(0,s.jsx)(o.Path,{d:"M14.4 5.7c-3 0-5.1 2.2-5.1 5.2 0 2.6 1.6 5.1 5.1 5.1 3.5 0 5.1-2.5 5.1-5.2-.1-2.6-1.7-5.1-5.1-5.1zm-.1 8.9c-2.5 0-3.5-1.9-3.5-3.7 0-2.2 1.2-3.8 3.5-3.8 2.4 0 3.5 2 3.5 3.8.1 2-1 3.7-3.5 3.7zM57.7 11.6h5.5v-1.5h-5.5V7.4h5.7V5.9h-7.3v10h7.3v-1.6h-5.7zM38 14.3v-2.7h5.5v-1.5H38V7.4h5.7V5.9h-7.3v10h7.3v-1.6zM93 10.3l-2.7-4.4h-1.9V6l3.8 5.8v4.1h1.6v-4.1l4-5.8v-.1h-2zM69.3 5.9h-3.8v10h3.8c3.5 0 5.1-2.5 5-5.1-.1-2.5-1.6-4.9-5-4.9zm0 8.4h-2.2V7.4h2.2c2.3 0 3.4 1.7 3.4 3.4s-1 3.5-3.4 3.5zM86.3 10.7c.9-.4 1.4-1.1 1.4-2 0-2-1.5-2.8-3.4-2.8h-4.6v10h4.6c2 0 3.7-.7 3.7-2.8 0-.8-.5-2-1.7-2.4zm-5-3.4h3c1.2 0 1.8.7 1.8 1.4 0 .8-.6 1.3-1.8 1.3h-3V7.3zm3 7.1h-3v-2.9h3c.9 0 2.1.5 2.1 1.6 0 1-1.2 1.3-2.1 1.3zM113.9 13.3h5.3V16c-1.2.9-2.9 1.1-4 1.1-4.2 0-5.6-3.3-5.6-6 0-4.1 2.2-6.1 5.6-6.1 1.4 0 3.2.4 4.8 1.8l3.4-3.4C120.7.6 118.1 0 115.2 0c-7.8 0-11.4 5.6-11.4 11s3.1 10.9 11.4 10.9c4 0 7.6-1.4 8.9-4.1V8.6h-10.2v4.7zM171.9 8.5h-7.4V.6h-5.9v20.8h5.9v-7.8h7.4v7.8h5.9V.6h-5.9zM195.1.6l-4.5 7.1-4.3-7.1h-6.6v.2l7.9 12.3v8.3h5.9v-8.3L201.8.9V.6zM127.4.6h5.9v20.8h-5.9zM147.6.6h-10.1v20.8h5.9v-5.6h4.2c5.6-.1 8.3-3.4 8.3-7.6.1-4.1-2.7-7.6-8.3-7.6zm0 10.2h-4.2V5.6h4.2c1.6 0 2.5 1.2 2.5 2.6 0 1.4-.9 2.6-2.5 2.6z"})]})})})}},41221(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(86087),a=n(27723),c=n(13022),l=n(5564),u=n(10167),d=n(89635),p=n(65465),h=n(38770),m=n(10790);const __=a.__,g=(0,r.sh)(l);const f=function({attributes:e,setAttributes:t,isSelected:n}){const{align:r,caption:a,giphyUrl:f,searchText:b,paddingTop:v}=e,[y,k]=(0,i.useState)(!1),w=(0,i.createRef)(),{isFetching:x,giphyData:_,fetchGiphyData:j}=(0,p.A)(),C=(0,o.useBlockProps)(),A=()=>{w.current.focus(),k(!1)};(0,i.useEffect)(()=>{!f&&_&&_[0]&&t((0,h.Er)(_[0]))},[f,_,t]);const S=async t=>{if(t.preventDefault(),!e.searchText||x)return;const n=await(0,h.ID)(e.searchText);n&&j(n)},E=e=>t({searchText:e.target.value});return(0,m.jsxs)("div",{...C,className:(0,c.A)(C.className,`align${r}`),children:[(0,m.jsx)(d.A,{}),f?(0,m.jsxs)("figure",{children:[n&&(0,m.jsx)(u.A,{onSubmit:S,onChange:E,value:b,ref:w}),n&&_&&_.length>1&&(0,m.jsx)("div",{className:"wp-block-jetpack-gif_thumbnails-container",children:_.map(e=>{const n={backgroundImage:`url(${e.images.downsized_still.url})`};return(0,m.jsx)("button",{className:"wp-block-jetpack-gif_thumbnail-container",onClick:n=>{n.preventDefault(),(e=>{t((0,h.Er)(e))})(e)},style:n},e.id)})}),(0,m.jsxs)("div",{className:"wp-block-jetpack-gif-wrapper",style:{paddingTop:v},children:[(0,m.jsx)("div",{className:"wp-block-jetpack-gif_cover",onClick:A,onKeyDown:A,role:"button",tabIndex:"0"}),(0,m.jsx)("iframe",{src:f,title:b})]}),(!o.RichText.isEmpty(a)||n)&&!!f&&(0,m.jsx)(o.RichText,{className:"wp-block-jetpack-gif-caption gallery-caption",inlineToolbar:!0,isSelected:y,onFocus:()=>k(!1),onChange:e=>t({caption:e}),placeholder:__("Write caption…","jetpack"),tagName:"figcaption",value:a})]}):(0,m.jsx)(s.Placeholder,{className:"wp-block-jetpack-gif_placeholder",icon:g,label:l.title,instructions:__("Search for a term or paste a Giphy URL","jetpack"),children:(0,m.jsx)(u.A,{onSubmit:S,onChange:E,value:b,ref:w})})]})};n.d(t,["A",0,f])},55734(e,t,n){"use strict";var r=n(94375),o=n(5564),s=n(41221);n(27453),n(88561);(0,r.M)(o,{edit:s.A,save:()=>null})},65465(e,t,n){"use strict";var r=n(86087);const o=(e=[])=>{const[t,n]=(0,r.useState)(!1),[o,s]=(0,r.useState)(e),[i,a]=(0,r.useState)("");return(0,r.useEffect)(()=>{if(!i)return;(async()=>{n(!0);const e=await fetch(i).then(e=>!!e.ok&&e).catch(()=>!1);if(e){const t=await e.json(),n=void 0!==t.data.images?[t.data]:t.data;n[0].images&&s(n)}n(!1)})()},[i]),{isFetching:t,giphyData:o,fetchGiphyData:a}};n.d(t,["A",0,o])},38770(e,t,n){"use strict";var r=n(56145),o=n(83690);const s=e=>`https://api.giphy.com/v1/gifs/search?q=${encodeURIComponent(e)}&api_key=${encodeURIComponent(o.T)}&limit=10`,i=e=>`https://api.giphy.com/v1/gifs/${encodeURIComponent(e)}?api_key=${encodeURIComponent(o.T)}`,a=(e="",t)=>{const n=e.split(t);return n[n.length-1]},c=e=>`${Math.floor(e.images.original.height/e.images.original.width*100)}%`,l=e=>e?.embed_url;n.d(t,["Er",0,e=>({giphyUrl:l(e),paddingTop:c(e)}),"ID",0,(e="")=>new Promise(t=>{let n=null;if((e=e.trim()).match(/^https:\/\/gph\.is\/(?:[a-zA-Z0-9]+\/)?[a-zA-Z0-9]+$/i))(0,r.A)(e).then(r=>{r.startsWith("https://giphy.com/gifs/")?(n=a(r,"-"),t(i(n))):t(s(e))}).catch(()=>t(s(e)));else{const r=/^https?:\/\/(media\.|i\.)?giphy\.com\/(embed|gifs|media)?\/?([-\w]*)(\/giphy)?(\.gif)?$/,o=e.match(r);o&&o[3]&&(n=a(o[3],"-")),n&&t(i(n)),t(s(e))}})])},31987(e,t,n){"use strict";n.d(t,{e:()=>c,u:()=>l});var r=n(56427),o=n(27723),s=n(30178),i=n(10790);const __=o.__,a=({attributes:e,setAttributes:t})=>{const{showCover:n,showAuthor:o,showTitle:s,showRating:a,showReview:c,showTags:l}=e;return(0,i.jsxs)(r.PanelBody,{PanelBody:!0,title:__("Display Settings","jetpack"),initialOpen:!0,children:[(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show cover","jetpack"),checked:n,onChange:()=>t({showCover:!n})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show author","jetpack"),checked:o,onChange:()=>t({showAuthor:!o})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show title","jetpack"),checked:s,onChange:()=>t({showTitle:!s})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show rating","jetpack"),checked:a,onChange:()=>t({showRating:!a})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show review","jetpack"),checked:c,onChange:()=>t({showReview:!c})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show tags","jetpack"),checked:l,onChange:()=>t({showTags:!l})})]})};function c({attributes:e,setAttributes:t}){const{style:n,shelfOption:o,bookNumber:c,orderOption:l,customTitle:u,sortOption:d}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{PanelBody:!0,title:__("Block Settings","jetpack"),initialOpen:!0,children:[(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Shelf","jetpack"),value:o,onChange:e=>t({shelfOption:e}),options:s.TG}),(0,i.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Title","jetpack"),value:u||s.wK,onChange:e=>t({customTitle:e})}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Sort by","jetpack"),value:d,onChange:e=>t({sortOption:e}),options:s.dV}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Order","jetpack"),value:l,onChange:e=>t({orderOption:e}),options:s.ne}),(0,i.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of books","jetpack"),type:"number",inputMode:"numeric",min:"1",max:"grid"===n?200:100,value:c||5,onChange:e=>t({bookNumber:e})})]}),"default"===n&&a({attributes:e,setAttributes:t})]})}function l({attributes:e,setAttributes:t}){const{style:n}=e,o=[{icon:"list-view",title:__("Default view","jetpack"),onClick:()=>t({style:"default"}),isActive:"default"===n},{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({style:"grid"}),isActive:"grid"===n}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.ToolbarButton,{label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>t({goodreadsId:""})}),(0,i.jsx)(r.ToolbarGroup,{controls:o})]})}},21973(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(86087),a=n(27723),c=n(24360),l=n(31987),u=n(21342),d=n(30178),p=n(10790);const __=a.__,_x=a._x,h=(0,s.withNotices)(e=>{const{attributes:t,className:n,noticeOperations:a,noticeUI:h,setAttributes:m}=e,[g,f]=(0,i.useState)(""),[b,v]=(0,i.useState)(""),[y,k]=(0,i.useState)(!1),w=(0,o.useBlockProps)(),{isFetchingData:x,goodreadsUserId:_,isError:j}=(0,u.A)(b),{goodreadsId:C,widgetId:A,link:S,style:E}=t,T=(0,i.useRef)(!1);(0,i.useEffect)(()=>{x&&k(!0),x||(k(!1),j&&(m({widgetId:void 0,goodreadsId:void 0,link:void 0}),N()),_&&!j&&m({goodreadsId:_}))},[_,x,y,j,m]),(0,i.useEffect)(()=>{if(!C)return;if(!T.current&&A&&S)return void(T.current=!0);T.current=!0;const e=Math.floor(9999999*Math.random());m({widgetId:e,id:("grid"===E?"gr_grid_widget_":"gr_custom_widget_")+e,link:(0,d._9)({attributes:{...t,widgetId:e}})})},[C,E,t.shelfOption,t.bookNumber,t.orderOption,t.customTitle,t.sortOption,t.showAuthor,t.showCover,t.showRating,t.showReview,t.showTags,t.showTitle,m]);const N=()=>{a.removeAllNotices(),a.createErrorNotice((0,p.jsx)(p.Fragment,{children:__("Sorry, this content could not be embedded.","jetpack")}))},P=e=>{e&&e.preventDefault(),v(g),k(!0)},B=()=>{const{id:e}=t,r=`\n\t\t<style> [class^=gr_custom_container_] { border: 1px solid gray; border-radius: 10px; margin: auto; padding: 0 5px 10px 5px; background-color: #fff; color: #000; width: 300px; } [class^=gr_custom_header_] { border-bottom: 1px solid gray; width: 100%; padding: 10px 0; margin: auto; text-align: center; font-size: 120%; } [class^=gr_custom_each_container_] { width: 100%; clear: both; margin: auto; overflow: auto; padding-bottom: 4px; border-bottom: 1px solid #aaa; } [class^=gr_custom_each_container_] { width: 100%; clear: both; margin-bottom: 10px; overflow: auto; padding-bottom: 4px; border-bottom: 1px solid #aaa; } [class^=gr_custom_book_container_] { overflow: hidden; height: 60px; float: left; margin-right: 6px; width: 39px; } [class^=gr_custom_author_] { font-size: 10px; } [class^=gr_custom_tags_] { font-size: 10px; color: gray; } [class^=gr_custom_rating_] { float: right; } [class^=gr_grid_book_container] { float: left; width: 98px; height: 160px; padding: 0 0; overflow: hidden; } [class^=gr_grid_book_container] img { height: 100%; width: 100%; } a { text-decoration: none; } a:hover { text-decoration: underline; } img { max-width: 100%; }</style>\n\t\t<script src="${S}"><\/script>\n \t<div id="${e}"></div>\n \t`;return(0,p.jsxs)("div",{className:n,children:[(0,p.jsx)(s.SandBox,{title:"Goodreads",html:r}),(0,p.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};let M;return M=y?(0,p.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,p.jsx)(s.Spinner,{}),(0,p.jsx)("p",{children:__("Embedding…","jetpack")})]}):t.goodreadsId?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.InspectorControls,{children:(0,p.jsx)(l.e,{attributes:t,setAttributes:m})}),(0,p.jsx)(o.BlockControls,{children:(0,p.jsx)(l.u,{attributes:t,setAttributes:m})}),B()]}):(0,p.jsx)("div",{className:n,children:(0,p.jsx)(s.Placeholder,{label:__("Goodreads","jetpack"),instructions:__("Paste a link to a Goodreads profile.","jetpack"),icon:(0,r.sh)(c),notices:h,children:(0,p.jsxs)("form",{onSubmit:P,children:[(0,p.jsx)("input",{type:"url",value:g,className:"components-placeholder__input","aria-label":__("Goodreads profile URL","jetpack"),placeholder:__("Enter a Goodreads profile URL to embed here…","jetpack"),onChange:e=>f(e.target.value)}),(0,p.jsx)(s.Button,{variant:"secondary",type:"submit",children:_x("Embed","submit button label","jetpack")})]})})}),(0,p.jsx)("div",{...w,children:M})});n.d(t,["A",0,h])},80838(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(24360),i=n(21973),a=n(59982);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"wpcom-goodreads"===e,transform:({instance:e})=>(0,r.createBlock)("jetpack/goodreads",{customTitle:e.raw.title,goodreadsId:parseInt(e.raw.user_id),shelfOption:e.raw.shelf,showRating:!1,widgetId:Math.floor(9999999*Math.random())})}]}})},21342(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1455),o=n.n(r),s=n(86087),i=n(56145);function a(e){const[t,n]=(0,s.useState)(!1),[r,a]=(0,s.useState)(!1),[c,l]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1),p=e=>{const t=e.match(/\/(user|author)\/show\/(\d+)/);return!!t&&parseInt(t[2])};return(0,s.useEffect)(()=>{l(!1),d(!1),e.length&&!/^(https?:\/\/)?(www\.)?goodreads\.com\/.*/.test(e)&&l(!0);const t=p(e);!c&&e.length&&(a(!0),t?(async t=>{if(/\/author\//.test(e)){const e=`/wpcom/v2/goodreads/user-id?id=${t}`;await o()({path:e,method:"GET"}).then(e=>{n(e)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})}else(0,i.A)(e).then(e=>{e.endsWith("/author")&&d(!0),n(t)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})})(t):(async e=>{(0,i.A)(e).then(e=>{const t=p(e);t?n(t):d(!0)}).catch(()=>{d(!0)}).finally(()=>{a(!1)})})(e))},[e,c]),{isFetchingData:r,goodreadsUserId:t,isError:c||u}}},59982(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},30178(e,t,n){"use strict";n.d(t,{_9:()=>c});var r=n(27723);const __=r.__,_x=r._x,o=__("My Bookshelf","jetpack"),s=[{label:_x("Read","perfect participle - eg. I read a book yesterday.","jetpack"),value:"read"},{label:__("Currently reading","jetpack"),value:"currently-reading"},{label:_x("To read","future participle - eg. I have this to read tomorrow.","jetpack"),value:"to-read"}],i=[{label:"ASIN",value:"asin"},{label:_x("Author","noun","jetpack"),value:"author"},{label:__("Average rating","jetpack"),value:"avg_rating"},{label:_x("Comments","noun","jetpack"),value:"comments"},{label:_x("Cover","noun - ie. book cover","jetpack"),value:"cover"},{label:__("Date added","jetpack"),value:"date_added"},{label:__("Date published","jetpack"),value:"date_pub"},{label:__("Date read","jetpack"),value:"date_read"},{label:__("Date started","jetpack"),value:"date_started"},{label:__("Dated updated","jetpack"),value:"date_updated"},{label:_x("Format","noun","jetpack"),value:"format"},{label:"ISBN",value:"isbn"},{label:"ISBN-13",value:"isbn13"},{label:_x("Notes","noun","jetpack"),value:"notes"},{label:__("Number of pages","jetpack"),value:"num_pages"},{label:__("Number of ratings","jetpack"),value:"num_ratings"},{label:_x("Owned","possessive - eg. I owned this book for a year","jetpack"),value:"owned"},{label:_x("Position","noun","jetpack"),value:"position"},{label:__("Random","jetpack","jetpack"),value:"random"},{label:_x("Rating","noun","jetpack"),value:"rating"},{label:__("Read count","jetpack"),value:"read_count"},{label:_x("Review","noun","jetpack"),value:"review"},{label:_x("Shelves","noun","jetpack"),value:"shelves"},{label:_x("Title","noun","jetpack"),value:"title"},{label:_x("Votes","noun","jetpack"),value:"votes"},{label:__("Year published","jetpack"),value:"year_pub"}],a=[{label:__("Ascending","jetpack"),value:"a"},{label:__("Descending","jetpack"),value:"d"}];function c({attributes:e}){const{bookNumber:t,customTitle:n=o,goodreadsId:r,orderOption:s,shelfOption:i,showAuthor:a,showCover:c,showRating:l,showReview:u,showTags:d,showTitle:p,sortOption:h,style:m,widgetId:g}=e;if(!r)return;const f=(n||o).split("/").map(e=>encodeURIComponent(e)).join("/");let b=`https://www.goodreads.com/review/custom_widget/${r}.${f}?num_books=${t}&order=${s}&shelf=${i}&show_author=${a?1:0}&show_cover=${c?1:0}&show_rating=${l?1:0}&show_review=${u?1:0}&show_tags=${d?1:0}&show_title=${p?1:0}&sort=${h}&widget_id=${g}`;return"grid"===m&&(b=`https://www.goodreads.com/review/grid_widget/${r}.${f}?cover_size=medium&num_books=${t}&order=${s}&shelf=${i}&sort=${h}&widget_id=${g}`),b}n.d(t,["TG",0,s,"dV",0,i,"ne",0,a,"wK",0,o])},55777(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(10790);const __=o.__,_x=o._x,i=e=>{const{className:t,embedValue:n,onChange:o,onSubmit:i}=e;return(0,s.jsx)(r.PanelBody,{title:__("Calendar settings","jetpack"),initialOpen:!1,children:(0,s.jsxs)("form",{onSubmit:i,className:t,children:[(0,s.jsx)("textarea",{type:"text",value:n,className:"components-placeholder__input","aria-label":__("Google Calendar URL or iframe","jetpack"),placeholder:__("Enter URL or iframe to embed here…","jetpack"),onChange:o}),(0,s.jsx)(r.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]})})};n.d(t,["A",0,i])},50259(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(74997),a=n(56427),c=n(29491),l=n(86087),u=n(27723),d=n(57273),p=n(26873),h=n(76862),m=n(55777),g=n(23972),f=n(10790);const __=u.__,_x=u._x,b=(0,o.sh)(h);const v=(0,c.compose)(a.withNotices,(0,p.withViewportMatch)({isMobile:"< small"}))(function(e){const{attributes:{url:t,height:n},isMobile:o,isSelected:c,name:u,noticeOperations:p,noticeUI:h,setAttributes:v}=e,y=(0,s.useBlockProps)(),[k,w]=(0,l.useState)(t||""),[x,_]=(0,l.useState)(!1),[j,C]=(0,l.useState)(!1);(0,l.useEffect)(()=>{!c&&j&&C(!1)},[c,j]);const A=()=>{C(!0)},S=e=>{e&&e.preventDefault();const t=(0,g.tW)(k.trim());if(!g._t.test(t.url))return p.removeAllNotices(),void p.createErrorNotice(__("Your calendar couldn't be embedded. Please double check your URL or Embed Code. Please note, you need to use the 'Public URL' or 'Embed Code', the 'Shareable Link' will not work.","jetpack"));v(t),_(!1),p.removeAllNotices()},E=(0,i.getBlockDefaultClassName)(u),T=`<iframe src="${t}" style="border:0" scrolling="no" frameborder="0" height="${o?"300":n}"></iframe>`,N=(0,f.jsx)(d.N,{openInNewTab:!0,href:"https://en.support.wordpress.com/google-calendar/",children:__("Enable Permissions for the calendar you want to share","jetpack")}),P=(0,f.jsx)(s.InspectorControls,{children:(0,f.jsx)(m.A,{className:`${E}-embed-form-sidebar`,embedValue:k,onChange:e=>w(e.target.value),onSubmit:S})});let B;if(x||!t){const e=(0,r.isWpcomPlatformSite)()?"https://en.support.wordpress.com/wordpress-editor/blocks/google-calendar/":"https://jetpack.com/support/jetpack-blocks/google-calendar/";B=(0,f.jsxs)(f.Fragment,{children:[P,(0,f.jsxs)(a.Placeholder,{label:__("Google Calendar","jetpack"),icon:b,notices:h,children:[(0,f.jsxs)("ol",{className:`${E}-placeholder-instructions`,children:[(0,f.jsx)("li",{children:N}),(0,f.jsx)("li",{children:__("Paste the embed code you copied from your Google Calendar below","jetpack")})]}),(M=`${E}-embed-form-editor`,(0,f.jsxs)("form",{onSubmit:S,className:M,children:[(0,f.jsx)("textarea",{type:"text",value:k,className:"components-placeholder__input","aria-label":__("Google Calendar URL or iframe","jetpack"),placeholder:__("Enter URL or iframe to embed here…","jetpack"),onChange:e=>w(e.target.value)}),(0,f.jsx)(a.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]})),(0,f.jsx)("div",{className:`${E}-placeholder-links`,children:(0,f.jsx)(d.N,{openInNewTab:!0,href:e,children:__("Learn more","jetpack")})})]})]})}else B=(0,f.jsxs)(f.Fragment,{children:[P,(0,f.jsxs)("div",{children:[(0,f.jsx)(a.SandBox,{html:T,onFocus:A}),!j&&(0,f.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:A})]})]});var M;return(0,f.jsx)("div",{...y,children:B})});n.d(t,["A",0,v])},29280(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(76862),i=n(50259),a=n(41700),c=n(23972);n(14647);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"shortcode",tag:"googleapps",isMatch:function(e){return"calendar"===e.named.domain},attributes:{url:{type:"string",shortcode:({named:{domain:e,dir:t,query:n}})=>`https://${e}.google.com/${t}?${n}`}}},{type:"raw",isMatch:e=>"P"===e.nodeName&&c._t.test(e.textContent),transform:e=>(0,r.createBlock)("jetpack/google-calendar",{url:e.textContent.trim()})},{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&c.fF.test(e.innerHTML),transform:e=>{const{url:t,height:n}=(0,c.HW)(e.innerHTML.trim());return(0,r.createBlock)("jetpack/google-calendar",{url:t,height:n})}}]}})},41700(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=({attributes:{url:e}})=>{const t=r.useBlockProps.save();return(0,o.jsx)("a",{...t,href:e,children:e})};n.dn(s),n.d(t,["A",0,s])},23972(e,t,n){"use strict";n.d(t,{HW:()=>l,tW:()=>u});const r="https?://calendar\\.google\\.com/calendar",o=new RegExp(`^${r}`,"i"),s=new RegExp(`<iframe((?:\\s+\\w+=(['"]).*?\\2)*)\\s+src=(["'])(${r}.*?)\\3((?:\\s+\\w+=(['"]).*?\\6)*)`,"i"),i=new RegExp(`${r}\\?cid=([-A-Za-z0-9+/]+={0,3})`,"i"),a=/\s+(\w+)=(["'])(.*?)\2/gi;function c(e){const t=i.exec(e);if(t)return"https://calendar.google.com/calendar/embed?src="+encodeURIComponent(atob(t[1]))}function l(e){const t=s.exec(e);if(!t)return;const n={};return t.forEach((e,t)=>{if(0===t)return;if(o.test(e))return void(n.url=e);let r;for(;null!==(r=a.exec(e));)n[r[1]]=r[3]}),{url:n.url,width:n.width,height:n.height}}function u(e){return s.test(e)?l(e):i.test(e)?{url:c(e)}:{url:e}}n.d(t,["_t",0,o,"fF",0,s])},21466(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(2743),c=n(60288),l=n(10790);const __=i.__,_x=i._x,u=c.A?.find(e=>"jetpack/google-docs"===e.name),d=c.A?.find(e=>"jetpack/google-sheets"===e.name),p=c.A?.find(e=>"jetpack/google-slides"===e.name),h={type:"document",title:u?.title,icon:u.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/document\/d\/([A-Za-z0-9_-]+).*?$/i]},m={type:"spreadsheets",title:d?.title,icon:d.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/spreadsheets\/d\/([A-Za-z0-9_-]+).*?$/i]},g={type:"presentation",title:p?.title,icon:p.icon,patterns:[/^(http|https):\/\/(docs\.google.com)\/presentation\/d\/([A-Za-z0-9_-]+).*?$/i]},f=e=>{const{attributes:{aspectRatio:t},attributes:{variation:n},attributes:{url:i},setAttributes:c}=e;let u="",d="",p=[],f="";switch((0,s.useEffect)(()=>{n||c({variation:(()=>{switch(i.match(/^(http|https):\/\/(docs\.google\.com)\/(.*)\/d\//)[3]){case"document":return"google-docs";case"spreadsheets":return"google-sheets";case"presentation":return"google-slides"}return""})()})},[n,i,c]),n.replace("jetpack/","")){case"google-docs":u=h.icon,d=h.title,p=h.patterns,f=h.type;break;case"google-sheets":u=m.icon,d=m.title,p=m.patterns,f=m.type;break;case"google-slides":u=g.icon,d=g.title,p=g.patterns,f=g.type}const b=[
71 71 // translators: default aspect ratio for the embedded Google document.
72 72 {label:__("Default","jetpack"),value:""},
73 73 // translators: aspect ratio for the embedded Google document.
74 74 {label:__("100% - Show the whole document","jetpack"),value:"ar-100"},
@@ -73,13 +73,13 @@
73 73 // translators: aspect ratio for the embedded Google document.
74 74 {label:__("100% - Show the whole document","jetpack"),value:"ar-100"},
75 75 // translators: aspect ratio for the embedded Google document.
76 76 {label:__("50% - Show half of the document","jetpack"),value:"ar-50"}];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Fragment,{children:(0,l.jsx)(a.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 i;const e=i.match(p[0]);return null===e||void 0===e[1]||void 0===e[2]||void 0===e[3]?i:`${e[1]}://${e[2]}/${f}/d/${e[3]}/preview`},mismatchErrorMessage:__("The document couldn’t be embedded. To embed a document, use the link in your browser address bar when editing the document.","jetpack"),checkGoogleDocVisibility:!0,...e})}),(0,l.jsx)(s.Fragment,{children:(0,l.jsx)(r.InspectorControls,{children:(0,l.jsxs)(o.PanelBody,{children:[(0,l.jsx)("p",{children:__("Select a different aspect-ratio to show more (or less) of your embedded document.","jetpack")}),(0,l.jsx)(o.SelectControl,{label:__("Aspect Ratio","jetpack"),value:t,options:b,onChange:e=>c({aspectRatio:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})})})]})};n.d(t,["A",0,f])},85779(e,t,n){"use strict";var r=n(94375),o=n(94575),s=n(21466),i=n(99889),a=n(36417),c=n(60288);n(31624);(0,r.M)(o,{edit:s.A,save:i.A,transforms:(0,a.A)(o.name),variations:c.A})},4991(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(13022),i=n(10790);const _x=o._x,a=({className:e,icon:t,instructions:n,label:o,notices:a,url:c,onSubmit:l,placeholder:u,updateUrl:d})=>(0,i.jsx)("div",{className:(0,s.A)("wp-block-jetpack-google-docs-embed-editmode",e),children:(0,i.jsx)(r.Placeholder,{icon:t,label:o,instructions:n,notices:a,children:(0,i.jsxs)("form",{onSubmit:l,children:[(0,i.jsx)("input",{type:"url",value:c||"",className:"components-placeholder__input",placeholder:u,onChange:e=>d(e.target.value)}),(0,i.jsx)(r.Button,{variant:"primary",type:"submit",children:_x("Embed","button label","jetpack")})]})})});n.d(t,["A",0,a])},2743(e,t,n){"use strict";var r=n(1455),o=n.n(r),s=n(94715),i=n(74997),a=n(56427),c=n(29491),l=n(86087),u=n(27723),d=n(33196),p=n(4991),h=n(61816),m=n(10790);const __=u.__,_x=u._x,g=({children:e,mapUrl:t,url:n,className:r,interactive:s,toggleInteractive:i,noticeUI:a=null,noticeOperations:c={},checkGoogleDocVisibility:u=!1})=>{if((0,l.useEffect)(()=>{u&&o()({path:`/wpcom/v2/checkGoogleDocVisibility?url=${n}`}).catch(()=>{c.removeAllNotices(),c.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")})})},[n,u,c]),e)return e;let d=!1;return a&&(d=!0),(0,m.jsxs)(m.Fragment,{children:[a,(0,m.jsx)(h.A,{url:t(n),className:r,interactive:s,toggleInteractive:i,isPrivateURL:d})]})},f=(0,c.compose)(a.withNotices)(e=>{const{attributes:t,className:n,isSelected:r,setAttributes:o,icon:c="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:y=e=>e,noticeOperations:k,noticeUI:w,patterns:x,placeholder:_=__("Enter URL to embed here…","jetpack"),children:j,onSubmitUrl:C=()=>{},checkGoogleDocVisibility:A=!1}=e,{url:S}=t,[E,T]=(0,l.useState)(!1),[N,P]=(0,l.useState)(!1),[B,M]=(0,l.useState)(S);f&&!E&&T(!0);(0,l.useEffect)(()=>{!r&&N&&P(!1)},[r]);const I=(0,l.useRef)(null),R=(0,s.useBlockProps)({className:"wp-block-jetpack-google-docs-embed",ref:I}),{title:L}=(0,i.getBlockType)(e.name),D=(0,u.sprintf)(/* translators: %s is replaced with the name of the embed provider */
77 -_x("%s URL","placeholder label","jetpack"),L);return(0,m.jsxs)("div",{...R,children:[(0,m.jsx)(s.BlockControls,{children:(0,m.jsx)(a.ToolbarGroup,{children:!E&&(0,m.jsx)(a.ToolbarButton,{icon:d.A,label:__("Edit URL","jetpack"),isActive:E,onClick:()=>{k.removeAllNotices(),T(!E)}})})}),E||!S?(0,m.jsx)(p.A,{className:n,icon:c,instructions:h,label:v||D,url:B,notices:w,placeholder:_,onSubmit:e=>{if(e&&e.preventDefault(),!x[0].test(B))return k.removeAllNotices(),void k.createErrorNotice(b);k.removeAllNotices(),T(!1),o({url:B}),C(B)},updateUrl:M}):(0,m.jsx)(g,{children:j,mapUrl:y,url:B,className:n,interactive:N,toggleInteractive:P,noticeUI:w,noticeOperations:k,checkGoogleDocVisibility:A})]})});n.d(t,["A",0,f])},61816(e,t,n){"use strict";var r=n(27723),o=n(57273),s=n(98212),i=n(10790);const __=r.__,a=e=>{const{allowFullScreen:t=!0,isPrivateURL:n=!1,interactive:r,toggleInteractive:a,title:c=__("Embed URL","jetpack"),url:l}=e;return(0,s.A)(l,["google.com"])?(0,i.jsxs)("figure",{children:[n?(0,i.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper wp-block-jetpack-google-docs-embed__wrapper--error",children:(0,i.jsxs)("p",{className:"wp-block-jetpack-google-docs-embed__error-msg",children:[__("This Google Document is private.","jetpack"),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(o.N,{openInNewTab:!0,href:l,children:__("Click here to open this document.","jetpack")})]})}):(0,i.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper",children:(0,i.jsx)("iframe",{src:l,allowFullScreen:t,title:c,height:"450"})}),!r&&(0,i.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__interactive-overlay",onMouseUp:()=>a(!0)})]}):(0,i.jsx)("figure",{children:(0,i.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper wp-block-jetpack-google-docs-embed__wrapper--error",children:(0,i.jsx)("p",{className:"wp-block-jetpack-google-docs-embed__error-msg",children:__("This embed URL is not supported.","jetpack")})})})};n.d(t,["A",0,a])},99889(e,t,n){"use strict";var r=n(10790);const o=e=>{const{attributes:t}=e;return(0,r.jsx)("figure",{children:(0,r.jsx)("div",{className:"embed__wrapper",children:`\n${t.url}\n`})})};n.d(t,["A",0,o])},36417(e,t,n){"use strict";var r=n(74997),o=n(86087),s=n(10790);const i=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,r.createBlock)(e,{url:t.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e})=>{const t=(0,s.jsx)("a",{href:e,children:e});return(0,r.createBlock)("core/paragraph",{content:(0,o.renderToString)(t)})}}]}};n.d(t,["A",0,i])},60288(e,t,n){"use strict";var r=n(85985),o=n(27723);const __=o.__,s=[{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='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M12,34.5v28h40v-28H12z M47,57.5H17v-18h30V57.5z' /></svg>",keywords:[__("slide","jetpack"),__("presentation","jetpack"),__("deck","jetpack")],attributes:{variation:"jetpack/google-slides"},isActive:["variation"]}].map(e=>({...e,icon:(0,r.Cq)(e)}));n.d(t,["A",0,s])},11050(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(27723),s=n(10790);const __=o.__;function i({attributes:e,setAttributes:t}){const{orientation:n}=e;return(0,s.jsx)(r.PanelBody,{title:__("Orientation","jetpack"),children:(0,s.jsx)(r.RadioControl,{selected:n||"horizontal",options:[{label:__("Side by side","jetpack"),value:"horizontal"},{label:__("Above and below","jetpack"),value:"vertical"}],onChange:e=>t({orientation:e})})})}},6012(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(29491),i=n(86087),a=n(27723),c=n(90256),l=n(11050),u=n(33569),d=n(1149),p=(n(56262),n(91505),n(10790));const __=a.__,h=({attributes:e,clientId:t,isSelected:n,setAttributes:a})=>{const{align:h,imageBefore:m,imageAfter:g,caption:f,orientation:b}=e,v=(0,r.useBlockProps)(),y=(0,i.useRef)(void 0),[k,w]=(0,i.useState)(0),x=(0,s.useResizeObserver)(e=>{const t=e[0]?.contentRect.width;t&&w(t)},{box:"border-box"});(0,d.A)(e=>{e>0&&"undefined"!=typeof juxtapose&&juxtapose.sliders&&juxtapose.sliders.forEach(n=>{n.wrapper.id===t&&n.optimizeWrapper(e)})},200,k);const _=m&&m.url&&g&&g.url?"image-compare__comparison juxtapose":"image-compare__placeholder";return(0,i.useLayoutEffect)(()=>{m.url&&g.url&&"undefined"!=typeof juxtapose&&y.current&&(x(y.current),juxtapose.makeSlider(y?.current))},[h,m,g,b,x]),(0,p.jsxs)("figure",{...v,children:[(0,p.jsx)(r.InspectorControls,{children:(0,p.jsx)(l.A,{attributes:e,setAttributes:a})},"controls"),(0,p.jsx)("div",{ref:y,id:t,className:_,"data-mode":b||"horizontal",children:(0,p.jsxs)(o.Placeholder,{label:null,children:[(0,p.jsx)("div",{className:"image-compare__image-before",children:(0,p.jsx)(u.A,{image:{id:m.id,url:m.url,alt:m.alt},placeHolderLabel:__("Image before","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){const{src:t}=(0,c.AW)(e),{alt:n,id:r,media_details:o}=e,s=o?.width??e.width,i=o?.height??e.height;a({imageBefore:{id:r,url:t||e.url,alt:n,width:s,height:i}})}}})}),(0,p.jsx)("div",{className:"image-compare__image-after",children:(0,p.jsx)(u.A,{image:{id:g.id,url:g.url,alt:g.alt},placeHolderLabel:__("Image after","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){const{src:t}=(0,c.AW)(e),{alt:n,id:r,media_details:o}=e,s=o?.width??e.width,i=o?.height??e.height;a({imageAfter:{id:r,url:t||e.url,alt:n,width:s,height:i}})}}})})]})}),(!r.RichText.isEmpty(f)||n&&m.url&&g.url)&&(0,p.jsx)(r.RichText,{tagName:"figcaption",placeholder:__("Write caption","jetpack"),value:f,onChange:e=>a({caption:e}),inlineToolbar:!0})]})};n.d(t,["A",0,h])},33129(e,t,n){"use strict";var r=n(27723),o=n(94375),s=n(88285),i=n(6012),a=n(94739),c=n(93220),l=n(35067);const __=r.__;(0,o.M)(s,{edit:i.A,save:l.A,example:{attributes:{imageBefore:{id:1,url:c,alt:__("Before","jetpack")},imageAfter:{id:2,url:a,alt:__("After","jetpack")},caption:__("Example image","jetpack")}}})},33569(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(29491),i=n(86087),a=n(10790);const c=(0,s.compose)([o.withNotices])(e=>{const{image:t,noticeOperations:n,noticeUI:o,onChange:s,placeHolderLabel:c}=e,l=(0,a.jsx)("img",{id:t.id,src:t.url,alt:t.alt}),u=(0,a.jsx)(i.Fragment,{children:(0,a.jsx)(r.MediaPlaceholder,{labels:{title:c},accept:"image/*",allowedTypes:["image"],onSelect:s,onError:e=>n.createErrorNotice(e),notices:o})});return t&&t.url?l:u});n.d(t,["A",0,c])},35067(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=({attributes:e})=>{const t=r.useBlockProps.save(),{imageBefore:n,imageAfter:s,caption:i,orientation:a}=e;return(0,o.jsxs)("figure",{...t,children:[(0,o.jsxs)("div",{className:"juxtapose","data-mode":a||"horizontal",children:[(0,o.jsx)("img",{id:n.id,src:n.url,alt:n.alt,width:n.width,height:n.height,className:"image-compare__image-before"}),(0,o.jsx)("img",{id:s.id,src:s.url,alt:s.alt,width:s.width,height:s.height,className:"image-compare__image-after"})]}),!r.RichText.isEmpty(i)&&(0,o.jsx)(r.RichText.Content,{tagName:"figcaption",value:i})]})};n.d(t,["A",0,s])},1149(e,t,n){"use strict";var r=n(86087);const o=(e,t,n)=>{(0,r.useEffect)(()=>{const r=setTimeout(()=>e(n),t);return()=>clearTimeout(r)},[n,e,t])};n.d(t,["A",0,o])},91505(e,t,n){"use strict";var r=n(98490),o=n.n(r);n(65742);o()(function(){const e={sliders:[],OPTIMIZATION_ACCEPTED:1,OPTIMIZATION_WAS_CONSTRAINED:2};function t(e,t){const n=this;this.image=new Image,this.loaded=!1,this.image.onload=function(){n.loaded=!0,t._onLoaded()},this.image.src=e.src,this.image.alt=e.alt||"",this.label=e.label||!1}function n(e,t){e&&e.classList.add(t)}function r(e,t){e&&e.classList.remove(t)}function o(e){return{width:parseInt(window.getComputedStyle(e).width,10),height:parseInt(window.getComputedStyle(e).height,10)}}function s(e,t){let n;if("string"==typeof t||"number"==typeof t)n=parseInt(t,10);else{const r=e.getBoundingClientRect(),o={top:r.top+document.body.scrollTop+document.documentElement.scrollTop,left:r.left+document.body.scrollLeft+document.documentElement.scrollLeft},s=e.offsetWidth;n=(function(e){let t;return t=e.pageX?e.pageX:e.touches?e.touches[0].pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t}(t)-o.left)/s*100}return n}function i(e,t,n){let r;if("string"==typeof t||"number"==typeof t)r=parseInt(t,10);else{const o=e.getBoundingClientRect(),s={top:o.top+n.body.scrollTop+n.documentElement.scrollTop,left:o.left+n.body.scrollLeft+n.documentElement.scrollLeft},i=e.offsetHeight;r=(function(e){let t;return t=e.pageY?e.pageY:e.touches?e.touches[0].pageY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop,t}(t)-s.top)/i*100}return r}const a={animate:!0,showLabels:!0,makeResponsive:!0};function c(e){return"string"!=typeof e?Boolean(e):!("false"===e||""===e)}function l(e,n,r){let o;for(o in this.element=e,this.options={animate:!0,showLabels:!0,makeResponsive:!0,startingPosition:"50%",mode:"horizontal",callback:null},this.options)o in r&&(this.options[o]=o in a?c(r[o]):r[o]);2===n.length&&(this.imgBefore=new t(n[0],this),this.imgAfter=new t(n[1],this))}l.prototype={updateSlider:function(e,t){let o;o="vertical"===this.options.mode?i(this.slider,e,this.sliderParentDocument):s(this.slider,e),o=o.toFixed(2)+"%";const a=parseFloat(o),c=100-a+"%";a>0&&a<100&&(r(this.handle,"transition"),r(this.rightImage,"transition"),r(this.leftImage,"transition"),this.options.animate&&t&&(n(this.handle,"transition"),n(this.leftImage,"transition"),n(this.rightImage,"transition")),"vertical"===this.options.mode?(this.handle.style.top=o,this.leftImage.style.height=o,this.rightImage.style.height=c):(this.handle.style.left=o,this.leftImage.style.width=o,this.rightImage.style.width=c),this.sliderPosition=o)},getPosition:function(){return this.sliderPosition},displayLabel:function(e,t){const n=document.createElement("div");n.className="jx-label",n.setAttribute("tabindex",0),function(e,t){document.body.textContent?e.textContent=t:e.innerText=t}(n,t),e.appendChild(n)},setStartingPosition:function(e){this.options.startingPosition=e},calculateDims:function(e,t){const n=(r=this.imgBefore.image,{width:r.naturalWidth,height:r.naturalHeight,aspect:function(){return this.width/this.height}}).aspect();var r;return e?t=e/n:t&&(e=t*n),{width:e,height:t,ratio:n}},responsivizeIframe:function(e){return e.height<window.innerHeight?e.ratio>=1&&(this.wrapper.style.paddingTop=parseInt((window.innerHeight-e.height)/2)+"px"):e.height>window.innerHeight&&(e=this.calculateDims(0,window.innerHeight),this.wrapper.style.paddingLeft=parseInt((window.innerWidth-e.width)/2)+"px"),e},setWrapperDimensions:function(){const e=o(this.wrapper.parentNode).width,t=o(this.wrapper.parentNode).height;let n=this.calculateDims(e,t);window.location===window.parent.location||this.options.makeResponsive||(n=this.responsivizeIframe(n)),this.wrapper.style.height=parseInt(n.height)+"px",this.wrapper.style.width=parseInt(n.width)+"px"},optimizeWrapper:function(t){let n=e.OPTIMIZATION_ACCEPTED;return this.imgBefore.image.naturalWidth>=t&&this.imgAfter.image.naturalWidth>=t?(this.wrapper.style.width=t+"px",n=e.OPTIMIZATION_WAS_CONSTRAINED):this.imgAfter.image.naturalWidth<t?this.wrapper.style.width=this.imgAfter.image.naturalWidth+"px":this.wrapper.style.width=this.imgBefore.image.naturalWidth+"px",this.setWrapperDimensions(),n},_onLoaded:function(){if(this.imgBefore&&!0===this.imgBefore.loaded&&this.imgAfter&&!0===this.imgAfter.loaded){if(this.wrapper=this.element,!this.wrapper||this.wrapper.querySelector(".jx-slider"))return;n(this.wrapper,"juxtapose"),this.wrapper.style.width=this.imgBefore.image.naturalWidth,this.setWrapperDimensions(),this.slider=document.createElement("div"),this.slider.className="jx-slider",this.wrapper.appendChild(this.slider),this.sliderParentDocument=this.wrapper.ownerDocument,"horizontal"!==this.options.mode&&n(this.slider,this.options.mode),this.handle=document.createElement("div"),this.handle.className="jx-handle",this.rightImage=document.createElement("div"),this.rightImage.className="jx-image jx-right",this.rightImage.appendChild(this.imgAfter.image),this.leftImage=document.createElement("div"),this.leftImage.className="jx-image jx-left",this.leftImage.appendChild(this.imgBefore.image),this.slider.appendChild(this.handle),this.slider.appendChild(this.leftImage),this.slider.appendChild(this.rightImage),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.control=document.createElement("div"),this.controller=document.createElement("div"),this.leftArrow.className="jx-arrow jx-left",this.rightArrow.className="jx-arrow jx-right",this.control.className="jx-control",this.controller.className="jx-controller",this.controller.setAttribute("tabindex",0),this.controller.setAttribute("role","slider"),this.controller.setAttribute("aria-valuenow",50),this.controller.setAttribute("aria-valuemin",0),this.controller.setAttribute("aria-valuemax",100),this.controller.setAttribute("aria-label",window.imageCompareHandle?.msg||"Slide to compare images"),this.handle.appendChild(this.leftArrow),this.handle.appendChild(this.control),this.handle.appendChild(this.rightArrow),this.control.appendChild(this.controller),this._init()}},_init:function(){this.updateSlider(this.options.startingPosition,!1),!0===this.options.showLabels&&(this.imgBefore.label&&this.displayLabel(this.leftImage,this.imgBefore.label),this.imgAfter.label&&this.displayLabel(this.rightImage,this.imgAfter.label));const t=this;window.addEventListener("resize",function(){t.setWrapperDimensions()}),this.slider.addEventListener("mousedown",function(e){e.preventDefault(),t.updateSlider(e,!0);let n=!0;this.addEventListener("mousemove",function(e){e.preventDefault(),n&&t.updateSlider(e,!1)}),this.addEventListener("mouseup",function(e){e.preventDefault(),e.stopPropagation(),n=!1})}),this.slider.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!0),this.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!1)})}),this.handle.addEventListener("keydown",function(e){const n=e.which||e.keyCode;let r=parseFloat(this.style.left);if(37===n){r-=1;const e=parseFloat(this.style.left)-1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",r)}if(39===n){r+=1;const e=parseFloat(this.style.left)+1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",r)}}),this.leftImage.addEventListener("keydown",function(e){const n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("90%",!0),t.controller.setAttribute("aria-valuenow",91))}),this.rightImage.addEventListener("keydown",function(e){const n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("10%",!0),t.controller.setAttribute("aria-valuenow",10))}),e.sliders.push(this),this.options.callback&&"function"==typeof this.options.callback&&this.options.callback(this)}},e.makeSlider=function(t,r){void 0===r&&(r=e.sliders.length);const o=t,s=o.querySelectorAll("img");if(s.length<2)return;const i={};o.getAttribute("data-animate")&&(i.animate=o.getAttribute("data-animate")),o.getAttribute("data-showlabels")&&(i.showLabels=o.getAttribute("data-showlabels")),o.getAttribute("data-startingposition")&&(i.startingPosition=o.getAttribute("data-startingposition")),o.getAttribute("data-mode")&&(i.mode=o.getAttribute("data-mode")),o.getAttribute("data-makeresponsive")&&(i.mode=o.getAttribute("data-makeresponsive"));return n(t,"juxtapose-"+r),o.innerHTML?o.innerHTML="":o.innerText="",new e.JXSlider(t,[{src:s[0].src,label:s[0].getAttribute("data-label"),alt:s[0].alt},{src:s[1].src,label:s[1].getAttribute("data-label"),alt:s[1].alt}],i)},e.scanPage=function(){const t=document.querySelectorAll(".juxtapose");for(let n=0;n<t.length;n++)e.makeSlider(t[n],n)},e.JXSlider=l,window.juxtapose=e,e.scanPage()})},80427(e,t,n){"use strict";n.d(t,["B",0,"jetpack-new-instagram-connection"])},64874(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(56427),o=n(27723),s=n(57273),i=n(10790);const __=o.__,_n=o._n;function a({accountImageTotal:e,attributes:t,currentUserConnected:n,disconnectFromService:a,shouldRenderSidebarNotice:c,setAttributes:l}){const{accessToken:u,columns:d,count:p,instagramUser:h,isStackedOnMobile:m,spacing:g}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{title:__("Account Settings","jetpack"),children:[(0,i.jsxs)(r.PanelRow,{children:[(0,i.jsx)("span",{children:__("Account","jetpack")}),(0,i.jsxs)(s.N,{openInNewTab:!0,href:`https://www.instagram.com/${h}/`,children:["@",h]})]}),n&&(0,i.jsx)(r.PanelRow,{children:(0,i.jsx)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>a(u),children:__("Disconnect your account","jetpack")})})]}),(0,i.jsxs)(r.PanelBody,{title:__("Display Settings","jetpack"),children:[c?(()=>{const t=e?(0,o.sprintf)(/* translators: %s: the number of posts. */
77 +_x("%s URL","placeholder label","jetpack"),L);return(0,m.jsxs)("div",{...R,children:[(0,m.jsx)(s.BlockControls,{children:(0,m.jsx)(a.ToolbarGroup,{children:!E&&(0,m.jsx)(a.ToolbarButton,{icon:d.A,label:__("Edit URL","jetpack"),isActive:E,onClick:()=>{k.removeAllNotices(),T(!E)}})})}),E||!S?(0,m.jsx)(p.A,{className:n,icon:c,instructions:h,label:v||D,url:B,notices:w,placeholder:_,onSubmit:e=>{if(e&&e.preventDefault(),!x[0].test(B))return k.removeAllNotices(),void k.createErrorNotice(b);k.removeAllNotices(),T(!1),o({url:B}),C(B)},updateUrl:M}):(0,m.jsx)(g,{children:j,mapUrl:y,url:B,className:n,interactive:N,toggleInteractive:P,noticeUI:w,noticeOperations:k,checkGoogleDocVisibility:A})]})});n.d(t,["A",0,f])},61816(e,t,n){"use strict";var r=n(27723),o=n(57273),s=n(10790);const __=r.__,i=e=>{const{allowFullScreen:t=!0,isPrivateURL:n=!1,interactive:r,toggleInteractive:i,title:a=__("Embed URL","jetpack"),url:c}=e;return(0,s.jsxs)("figure",{children:[n?(0,s.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper wp-block-jetpack-google-docs-embed__wrapper--error",children:(0,s.jsxs)("p",{className:"wp-block-jetpack-google-docs-embed__error-msg",children:[__("This Google Document is private.","jetpack"),(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)(o.N,{openInNewTab:!0,href:c,children:__("Click here to open this document.","jetpack")})]})}):(0,s.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__wrapper",children:(0,s.jsx)("iframe",{src:c,allowFullScreen:t,title:a,height:"450"})}),!r&&(0,s.jsx)("div",{className:"wp-block-jetpack-google-docs-embed__interactive-overlay",onMouseUp:()=>i(!0)})]})};n.d(t,["A",0,i])},99889(e,t,n){"use strict";var r=n(10790);const o=e=>{const{attributes:t}=e;return(0,r.jsx)("figure",{children:(0,r.jsx)("div",{className:"embed__wrapper",children:`\n${t.url}\n`})})};n.d(t,["A",0,o])},36417(e,t,n){"use strict";var r=n(74997),o=n(86087),s=n(10790);const i=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,r.createBlock)(e,{url:t.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e})=>{const t=(0,s.jsx)("a",{href:e,children:e});return(0,r.createBlock)("core/paragraph",{content:(0,o.renderToString)(t)})}}]}};n.d(t,["A",0,i])},60288(e,t,n){"use strict";var r=n(85985),o=n(27723);const __=o.__,s=[{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='M42,0l22,22H42V0z' /><path fill='#FDFFFF' d='M12,34.5v28h40v-28H12z M47,57.5H17v-18h30V57.5z' /></svg>",keywords:[__("slide","jetpack"),__("presentation","jetpack"),__("deck","jetpack")],attributes:{variation:"jetpack/google-slides"},isActive:["variation"]}].map(e=>({...e,icon:(0,r.Cq)(e)}));n.d(t,["A",0,s])},11050(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(27723),s=n(10790);const __=o.__;function i({attributes:e,setAttributes:t}){const{orientation:n}=e;return(0,s.jsx)(r.PanelBody,{title:__("Orientation","jetpack"),children:(0,s.jsx)(r.RadioControl,{selected:n||"horizontal",options:[{label:__("Side by side","jetpack"),value:"horizontal"},{label:__("Above and below","jetpack"),value:"vertical"}],onChange:e=>t({orientation:e})})})}},6012(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(29491),i=n(86087),a=n(27723),c=n(90256),l=n(11050),u=n(33569),d=n(1149),p=(n(56262),n(91505),n(10790));const __=a.__,h=({attributes:e,clientId:t,isSelected:n,setAttributes:a})=>{const{align:h,imageBefore:m,imageAfter:g,caption:f,orientation:b}=e,v=(0,r.useBlockProps)(),y=(0,i.useRef)(void 0),[k,w]=(0,i.useState)(0),x=(0,s.useResizeObserver)(e=>{const t=e[0]?.contentRect.width;t&&w(t)},{box:"border-box"});(0,d.A)(e=>{e>0&&"undefined"!=typeof juxtapose&&juxtapose.sliders&&juxtapose.sliders.forEach(n=>{n.wrapper.id===t&&n.optimizeWrapper(e)})},200,k);const _=m&&m.url&&g&&g.url?"image-compare__comparison juxtapose":"image-compare__placeholder";return(0,i.useLayoutEffect)(()=>{m.url&&g.url&&"undefined"!=typeof juxtapose&&y.current&&(x(y.current),juxtapose.makeSlider(y?.current))},[h,m,g,b,x]),(0,p.jsxs)("figure",{...v,children:[(0,p.jsx)(r.InspectorControls,{children:(0,p.jsx)(l.A,{attributes:e,setAttributes:a})},"controls"),(0,p.jsx)("div",{ref:y,id:t,className:_,"data-mode":b||"horizontal",children:(0,p.jsxs)(o.Placeholder,{label:null,children:[(0,p.jsx)("div",{className:"image-compare__image-before",children:(0,p.jsx)(u.A,{image:{id:m.id,url:m.url,alt:m.alt},placeHolderLabel:__("Image before","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){const{src:t}=(0,c.AW)(e),{alt:n,id:r,media_details:o}=e,s=o?.width??e.width,i=o?.height??e.height;a({imageBefore:{id:r,url:t||e.url,alt:n,width:s,height:i}})}}})}),(0,p.jsx)("div",{className:"image-compare__image-after",children:(0,p.jsx)(u.A,{image:{id:g.id,url:g.url,alt:g.alt},placeHolderLabel:__("Image after","jetpack"),onChange:e=>{if("image"===e.media_type||"image"===e.type){const{src:t}=(0,c.AW)(e),{alt:n,id:r,media_details:o}=e,s=o?.width??e.width,i=o?.height??e.height;a({imageAfter:{id:r,url:t||e.url,alt:n,width:s,height:i}})}}})})]})}),(!r.RichText.isEmpty(f)||n&&m.url&&g.url)&&(0,p.jsx)(r.RichText,{tagName:"figcaption",placeholder:__("Write caption","jetpack"),value:f,onChange:e=>a({caption:e}),inlineToolbar:!0})]})};n.d(t,["A",0,h])},33129(e,t,n){"use strict";var r=n(27723),o=n(94375),s=n(88285),i=n(6012),a=n(94739),c=n(93220),l=n(35067);const __=r.__;(0,o.M)(s,{edit:i.A,save:l.A,example:{attributes:{imageBefore:{id:1,url:c,alt:__("Before","jetpack")},imageAfter:{id:2,url:a,alt:__("After","jetpack")},caption:__("Example image","jetpack")}}})},33569(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(29491),i=n(86087),a=n(10790);const c=(0,s.compose)([o.withNotices])(e=>{const{image:t,noticeOperations:n,noticeUI:o,onChange:s,placeHolderLabel:c}=e,l=(0,a.jsx)("img",{id:t.id,src:t.url,alt:t.alt}),u=(0,a.jsx)(i.Fragment,{children:(0,a.jsx)(r.MediaPlaceholder,{labels:{title:c},accept:"image/*",allowedTypes:["image"],onSelect:s,onError:e=>n.createErrorNotice(e),notices:o})});return t&&t.url?l:u});n.d(t,["A",0,c])},35067(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=({attributes:e})=>{const t=r.useBlockProps.save(),{imageBefore:n,imageAfter:s,caption:i,orientation:a}=e;return(0,o.jsxs)("figure",{...t,children:[(0,o.jsxs)("div",{className:"juxtapose","data-mode":a||"horizontal",children:[(0,o.jsx)("img",{id:n.id,src:n.url,alt:n.alt,width:n.width,height:n.height,className:"image-compare__image-before"}),(0,o.jsx)("img",{id:s.id,src:s.url,alt:s.alt,width:s.width,height:s.height,className:"image-compare__image-after"})]}),!r.RichText.isEmpty(i)&&(0,o.jsx)(r.RichText.Content,{tagName:"figcaption",value:i})]})};n.d(t,["A",0,s])},1149(e,t,n){"use strict";var r=n(86087);const o=(e,t,n)=>{(0,r.useEffect)(()=>{const r=setTimeout(()=>e(n),t);return()=>clearTimeout(r)},[n,e,t])};n.d(t,["A",0,o])},91505(e,t,n){"use strict";var r=n(98490),o=n.n(r);n(65742);o()(function(){const e={sliders:[],OPTIMIZATION_ACCEPTED:1,OPTIMIZATION_WAS_CONSTRAINED:2};function t(e,t){const n=this;this.image=new Image,this.loaded=!1,this.image.onload=function(){n.loaded=!0,t._onLoaded()},this.image.src=e.src,this.image.alt=e.alt||"",this.label=e.label||!1}function n(e,t){e&&e.classList.add(t)}function r(e,t){e&&e.classList.remove(t)}function o(e){return{width:parseInt(window.getComputedStyle(e).width,10),height:parseInt(window.getComputedStyle(e).height,10)}}function s(e,t){let n;if("string"==typeof t||"number"==typeof t)n=parseInt(t,10);else{const r=e.getBoundingClientRect(),o={top:r.top+document.body.scrollTop+document.documentElement.scrollTop,left:r.left+document.body.scrollLeft+document.documentElement.scrollLeft},s=e.offsetWidth;n=(function(e){let t;return t=e.pageX?e.pageX:e.touches?e.touches[0].pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t}(t)-o.left)/s*100}return n}function i(e,t,n){let r;if("string"==typeof t||"number"==typeof t)r=parseInt(t,10);else{const o=e.getBoundingClientRect(),s={top:o.top+n.body.scrollTop+n.documentElement.scrollTop,left:o.left+n.body.scrollLeft+n.documentElement.scrollLeft},i=e.offsetHeight;r=(function(e){let t;return t=e.pageY?e.pageY:e.touches?e.touches[0].pageY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop,t}(t)-s.top)/i*100}return r}const a={animate:!0,showLabels:!0,makeResponsive:!0};function c(e){return"string"!=typeof e?Boolean(e):!("false"===e||""===e)}function l(e,n,r){let o;for(o in this.element=e,this.options={animate:!0,showLabels:!0,makeResponsive:!0,startingPosition:"50%",mode:"horizontal",callback:null},this.options)o in r&&(this.options[o]=o in a?c(r[o]):r[o]);2===n.length&&(this.imgBefore=new t(n[0],this),this.imgAfter=new t(n[1],this))}l.prototype={updateSlider:function(e,t){let o;o="vertical"===this.options.mode?i(this.slider,e,this.sliderParentDocument):s(this.slider,e),o=o.toFixed(2)+"%";const a=parseFloat(o),c=100-a+"%";a>0&&a<100&&(r(this.handle,"transition"),r(this.rightImage,"transition"),r(this.leftImage,"transition"),this.options.animate&&t&&(n(this.handle,"transition"),n(this.leftImage,"transition"),n(this.rightImage,"transition")),"vertical"===this.options.mode?(this.handle.style.top=o,this.leftImage.style.height=o,this.rightImage.style.height=c):(this.handle.style.left=o,this.leftImage.style.width=o,this.rightImage.style.width=c),this.sliderPosition=o)},getPosition:function(){return this.sliderPosition},displayLabel:function(e,t){const n=document.createElement("div");n.className="jx-label",n.setAttribute("tabindex",0),function(e,t){document.body.textContent?e.textContent=t:e.innerText=t}(n,t),e.appendChild(n)},setStartingPosition:function(e){this.options.startingPosition=e},calculateDims:function(e,t){const n=(r=this.imgBefore.image,{width:r.naturalWidth,height:r.naturalHeight,aspect:function(){return this.width/this.height}}).aspect();var r;return e?t=e/n:t&&(e=t*n),{width:e,height:t,ratio:n}},responsivizeIframe:function(e){return e.height<window.innerHeight?e.ratio>=1&&(this.wrapper.style.paddingTop=parseInt((window.innerHeight-e.height)/2)+"px"):e.height>window.innerHeight&&(e=this.calculateDims(0,window.innerHeight),this.wrapper.style.paddingLeft=parseInt((window.innerWidth-e.width)/2)+"px"),e},setWrapperDimensions:function(){const e=o(this.wrapper.parentNode).width,t=o(this.wrapper.parentNode).height;let n=this.calculateDims(e,t);window.location===window.parent.location||this.options.makeResponsive||(n=this.responsivizeIframe(n)),this.wrapper.style.height=parseInt(n.height)+"px",this.wrapper.style.width=parseInt(n.width)+"px"},optimizeWrapper:function(t){let n=e.OPTIMIZATION_ACCEPTED;return this.imgBefore.image.naturalWidth>=t&&this.imgAfter.image.naturalWidth>=t?(this.wrapper.style.width=t+"px",n=e.OPTIMIZATION_WAS_CONSTRAINED):this.imgAfter.image.naturalWidth<t?this.wrapper.style.width=this.imgAfter.image.naturalWidth+"px":this.wrapper.style.width=this.imgBefore.image.naturalWidth+"px",this.setWrapperDimensions(),n},_onLoaded:function(){if(this.imgBefore&&!0===this.imgBefore.loaded&&this.imgAfter&&!0===this.imgAfter.loaded){if(this.wrapper=this.element,!this.wrapper||this.wrapper.querySelector(".jx-slider"))return;n(this.wrapper,"juxtapose"),this.wrapper.style.width=this.imgBefore.image.naturalWidth,this.setWrapperDimensions(),this.slider=document.createElement("div"),this.slider.className="jx-slider",this.wrapper.appendChild(this.slider),this.sliderParentDocument=this.wrapper.ownerDocument,"horizontal"!==this.options.mode&&n(this.slider,this.options.mode),this.handle=document.createElement("div"),this.handle.className="jx-handle",this.rightImage=document.createElement("div"),this.rightImage.className="jx-image jx-right",this.rightImage.appendChild(this.imgAfter.image),this.leftImage=document.createElement("div"),this.leftImage.className="jx-image jx-left",this.leftImage.appendChild(this.imgBefore.image),this.slider.appendChild(this.handle),this.slider.appendChild(this.leftImage),this.slider.appendChild(this.rightImage),this.leftArrow=document.createElement("div"),this.rightArrow=document.createElement("div"),this.control=document.createElement("div"),this.controller=document.createElement("div"),this.leftArrow.className="jx-arrow jx-left",this.rightArrow.className="jx-arrow jx-right",this.control.className="jx-control",this.controller.className="jx-controller",this.controller.setAttribute("tabindex",0),this.controller.setAttribute("role","slider"),this.controller.setAttribute("aria-valuenow",50),this.controller.setAttribute("aria-valuemin",0),this.controller.setAttribute("aria-valuemax",100),this.controller.setAttribute("aria-label",window.imageCompareHandle?.msg||"Slide to compare images"),this.handle.appendChild(this.leftArrow),this.handle.appendChild(this.control),this.handle.appendChild(this.rightArrow),this.control.appendChild(this.controller),this._init()}},_init:function(){this.updateSlider(this.options.startingPosition,!1),!0===this.options.showLabels&&(this.imgBefore.label&&this.displayLabel(this.leftImage,this.imgBefore.label),this.imgAfter.label&&this.displayLabel(this.rightImage,this.imgAfter.label));const t=this;window.addEventListener("resize",function(){t.setWrapperDimensions()}),this.slider.addEventListener("mousedown",function(e){e.preventDefault(),t.updateSlider(e,!0);let n=!0;this.addEventListener("mousemove",function(e){e.preventDefault(),n&&t.updateSlider(e,!1)}),this.addEventListener("mouseup",function(e){e.preventDefault(),e.stopPropagation(),n=!1})}),this.slider.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!0),this.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation(),t.updateSlider(e,!1)})}),this.handle.addEventListener("keydown",function(e){const n=e.which||e.keyCode;let r=parseFloat(this.style.left);if(37===n){r-=1;const e=parseFloat(this.style.left)-1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",r)}if(39===n){r+=1;const e=parseFloat(this.style.left)+1;t.updateSlider(e,!1),t.controller.setAttribute("aria-valuenow",r)}}),this.leftImage.addEventListener("keydown",function(e){const n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("90%",!0),t.controller.setAttribute("aria-valuenow",91))}),this.rightImage.addEventListener("keydown",function(e){const n=e.which||e.keyCode;13!==n&&32!==n||(t.updateSlider("10%",!0),t.controller.setAttribute("aria-valuenow",10))}),e.sliders.push(this),this.options.callback&&"function"==typeof this.options.callback&&this.options.callback(this)}},e.makeSlider=function(t,r){void 0===r&&(r=e.sliders.length);const o=t,s=o.querySelectorAll("img");if(s.length<2)return;const i={};o.getAttribute("data-animate")&&(i.animate=o.getAttribute("data-animate")),o.getAttribute("data-showlabels")&&(i.showLabels=o.getAttribute("data-showlabels")),o.getAttribute("data-startingposition")&&(i.startingPosition=o.getAttribute("data-startingposition")),o.getAttribute("data-mode")&&(i.mode=o.getAttribute("data-mode")),o.getAttribute("data-makeresponsive")&&(i.mode=o.getAttribute("data-makeresponsive"));return n(t,"juxtapose-"+r),o.innerHTML?o.innerHTML="":o.innerText="",new e.JXSlider(t,[{src:s[0].src,label:s[0].getAttribute("data-label"),alt:s[0].alt},{src:s[1].src,label:s[1].getAttribute("data-label"),alt:s[1].alt}],i)},e.scanPage=function(){const t=document.querySelectorAll(".juxtapose");for(let n=0;n<t.length;n++)e.makeSlider(t[n],n)},e.JXSlider=l,window.juxtapose=e,e.scanPage()})},80427(e,t,n){"use strict";n.d(t,["B",0,"jetpack-new-instagram-connection"])},64874(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(56427),o=n(27723),s=n(57273),i=n(10790);const __=o.__,_n=o._n;function a({accountImageTotal:e,attributes:t,currentUserConnected:n,disconnectFromService:a,shouldRenderSidebarNotice:c,setAttributes:l}){const{accessToken:u,columns:d,count:p,instagramUser:h,isStackedOnMobile:m,spacing:g}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{title:__("Account Settings","jetpack"),children:[(0,i.jsxs)(r.PanelRow,{children:[(0,i.jsx)("span",{children:__("Account","jetpack")}),(0,i.jsxs)(s.N,{openInNewTab:!0,href:`https://www.instagram.com/${h}/`,children:["@",h]})]}),n&&(0,i.jsx)(r.PanelRow,{children:(0,i.jsx)(r.Button,{isDestructive:!0,variant:"link",onClick:()=>a(u),children:__("Disconnect your account","jetpack")})})]}),(0,i.jsxs)(r.PanelBody,{title:__("Display Settings","jetpack"),children:[c?(()=>{const t=e?(0,o.sprintf)(/* translators: %s: the number of posts. */
78 78 _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,i.jsx)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice",children:(0,i.jsx)(r.Notice,{isDismissible:!1,status:"info",children:t})})})():null,(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Posts","jetpack"),value:p,onChange:e=>l({count:e}),min:1,max:30}),(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>l({columns:e}),min:1,max:6}),(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>l({spacing:e}),min:0,max:50}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:m,onChange:()=>l({isStackedOnMobile:!m})})]})]})}},17084(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(56427),i=n(86087),a=n(27723),c=n(13022),l=n(66087),u=n(78218),d=n(89525),p=n(80427),h=n(64874),m=n(37765),g=n(49783),f=n(53495),b=n(80619),v=(n(93726),n(10790));const __=a.__,y=(0,s.withNotices)(e=>{const t=(0,o.useBlockProps)(),{attributes:n,isSelected:a,noticeOperations:y,noticeUI:k,setAttributes:w}=e,{accessToken:x,align:_,columns:j,count:C,isStackedOnMobile:A,spacing:S}=n;(0,i.useEffect)(()=>{const e=(0,u.y)(d.attributes,n);(0,l.isEqual)(e,n)||w(e)},[n,w]);const[E,T]=(0,i.useState)(x),{isRequestingWpcomConnectUrl:N,wpcomConnectUrl:P}=(0,f.A)(),{images:B,isLoadingGallery:M,setImages:I}=(0,b.A)({accessToken:x,noticeOperations:y,setAttributes:w,setSelectedAccount:T}),{connectToService:R,disconnectFromService:L,isConnecting:D,isRequestingUserConnections:F,userConnections:O}=(0,g.A)({accessToken:x,noticeOperations:y,selectedAccount:E,setAttributes:w,setImages:I,setSelectedAccount:T}),z=(0,r.gB)(),U=C>B.length?B.length:C,H=!M&&(!x||(0,l.isEmpty)(B)),$=!H,V=x&&M&&(0,l.isEmpty)(B),q=!H&&!V,G=(0,c.A)(t.className,{[`align${_}`]:_}),W=(0,c.A)("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${j}`,{"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:n,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?w({accessToken:E,instagramUser:O.find(e=>e.token===E).username}):R()};return(0,v.jsxs)("div",{...t,className:G,children:[H&&(0,v.jsx)(s.Placeholder,{icon:"instagram",instructions:z?F||O.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:k,children:z?(()=>{const e=O.length>0,t=[...O.map(e=>({label:`@${e.username}`,value:e.token})),{label:__("Add a new account","jetpack"),value:p.B}],n=D||F||e&&!E;return(0,v.jsxs)("div",{children:[e&&(0,v.jsx)(s.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>T(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)(s.Button,{disabled:n,variant:"primary",onClick:Y,children:[D&&__("Connecting…","jetpack"),F&&__("Loading your connections…","jetpack"),!D&&!F&&__("Connect to Instagram","jetpack")]})]})})():(0,v.jsx)(s.Button,{disabled:N||!P,href:P,variant:"secondary",children:__("Connect to WordPress.com","jetpack")})}),V&&(0,v.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,v.jsx)(s.Spinner,{}),(0,v.jsx)("p",{children:__("Embedding…","jetpack")})]}),q&&(0,v.jsx)("div",{className:W,style:Z,children:Array.from(Array(a?C:U),(e,t)=>(0,v.jsx)("span",{className:(0,c.A)("wp-block-jetpack-instagram-gallery__grid-post"),style:J,children:K(t)},t))}),$&&(0,v.jsx)(o.InspectorControls,{children:(0,v.jsx)(h.A,{accountImageTotal:B.length,attributes:n,currentUserConnected:z,disconnectFromService:L,shouldRenderSidebarNotice:$&&!V&&B.length<C,setAttributes:w})})]})});n.d(t,["A",0,y])},92585(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(89525),i=n(17084),a=n(90235);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"wpcom_instagram_widget"===e,transform:({instance:e})=>(0,r.createBlock)("jetpack/instagram-gallery",{columns:e.raw.columns,count:e.raw.count,accessToken:e.raw.token_id})}]}})},37765(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(86087),o=n(13022),s=n(10790);function i({src:e,alt:t,spacing:n}){const[i,a]=(0,r.useState)(!1),[c,l]=(0,r.useState)("auto"),u=(0,r.useRef)(void 0),d=()=>{a(!0),l("auto")};(0,r.useEffect)(()=>{const t=e;if(t){const e=new window.Image;e.src=t,e.onload=d}u.current&&l(u.current.parentNode.getBoundingClientRect().width)},[e]);const p=-1*n,h=(0,o.A)("wp-block-jetpack-instagram-gallery__placeholder",{"is-loaded":i}),m=i?{margin:p}:{margin:p,height:c},g=(0,o.A)({"is-loaded":i});return(0,s.jsx)("span",{style:m,className:h,children:(0,s.jsx)("img",{alt:t,className:g,ref:u,src:e})})}},90235(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=({attributes:{instagramUser:e}})=>{const t=r.useBlockProps.save();return e&&(0,o.jsx)("div",{...t,children:(0,o.jsx)("a",{href:`https://www.instagram.com/${e}/`,rel:"noopener noreferrer",target:"_blank",children:`https://www.instagram.com/${e}/`})})};n.dn(s),n.d(t,["A",0,s])},49783(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(85985),o=n(51119),s=n(1455),i=n.n(s),a=n(86087),c=n(27723),l=n(80427);const __=c.__;function u({accessToken:e,noticeOperations:t,selectedAccount:n,setAttributes:s,setImages:c,setSelectedAccount:u}){const[d,p]=(0,a.useState)(!1),[h,m]=(0,a.useState)(!1),[g,f]=(0,a.useState)([]),b=(0,r.gB)();(0,a.useEffect)(()=>{!e&&b&&(m(!0),i()({path:"/wpcom/v2/instagram-gallery/connections"}).then(e=>{m(!1),f(e)}).catch(()=>{m(!1),f([])}))},[e,b]),(0,a.useEffect)(()=>{l.B===n||g.find(e=>e.token===n)||u(void 0)},[n,u,g]);return{connectToService:()=>{t.removeAllNotices(),p(!0),i()({path:"/wpcom/v2/instagram-gallery/connect-url"}).then(e=>{const t=new o.A;t.open(e,"connect-to-instagram-popup","toolbar=0,location=0,menubar=0,"+t.getScreenCenterSpecs(700,700)),t.on("message",({keyring_id:e})=>{if(p(!1),e){const t=e.toString();s({accessToken:t}),u(t)}}),t.on("close",e=>{"connect-to-instagram-popup"===e&&p(!1)})}).catch(()=>{t.createErrorNotice(__("An error occurred. Please try again later.","jetpack")),p(!1)})},disconnectFromService:()=>{t.removeAllNotices(),s({accessToken:void 0,instagramUser:void 0}),c([])},isConnecting:d,isRequestingUserConnections:h,userConnections:g}}},53495(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(85985),o=n(1455),s=n.n(o),i=n(47143),a=n(86087),c=n(93832);function l(){const{isAutoDraft:e}=(0,i.useSelect)(e=>{const{status:t}=e("core/editor").getCurrentPost();return{isAutoDraft:"auto-draft"===t}}),{savePost:t}=(0,i.useDispatch)("core/editor"),[n,o]=(0,a.useState)(),[l,u]=(0,a.useState)(!1),d=(0,r.gB)();return(0,a.useEffect)(()=>{d||n||l||(e?t():(u(!0),s()({path:(0,c.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then(e=>{o(e),u(!1)})))},[d,e,l,t,n]),{isRequestingWpcomConnectUrl:l,wpcomConnectUrl:n}}},80619(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(1455),o=n.n(r),s=n(86087),i=n(27723),a=n(93832),c=n(66087);const __=i.__;function l({accessToken:e,noticeOperations:t,setAttributes:n,setSelectedAccount:r}){const[i,l]=(0,s.useState)([]),[u,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&(t.removeAllNotices(),d(!0),o()({path:(0,a.addQueryArgs)("/wpcom/v2/instagram-gallery/gallery",{access_token:e,count:30})}).then(({external_name:e,images:o})=>{if(d(!1),!o||!Array.isArray(o))return t.createErrorNotice(__("An error occurred. Please try again later.","jetpack")),l([]),n({accessToken:void 0,instagramUser:void 0}),void r(void 0);(0,c.isEmpty)(o)&&t.createErrorNotice(__("No images were found in your Instagram account.","jetpack")),n({instagramUser:e}),l(o)}).catch(()=>{d(!1),l([]),n({accessToken:void 0,instagramUser:void 0}),r(void 0)}))},[e,n,r]),{images:i,isLoadingGallery:u,setImages:l}}},62734(e,t,n){"use strict";var r=n(97999),o=n(94715),s=n(56427),i=n(86087),a=n(27723),c=n(57273),l=n(78218),u=n(63757),d=n(94530),p=n(86239),h=n(71969),m=(n(82412),n(10790));const __=a.__;const g=function({attributes:e,setAttributes:t}){const n=(0,o.useBlockProps)(),g=(0,l.y)(h.attributes,e),{showReblogButton:f,showAvatars:b}=g,v=!(0,r.isWpcomPlatformSite)(),y=[u,d,p],k=e=>e.preventDefault();return(0,m.jsxs)("div",{...n,children:[(0,m.jsxs)(o.InspectorControls,{children:[v&&(0,m.jsx)("div",{className:"wp-block-jetpack-like__learn-more",children:(0,m.jsx)(c.N,{openInNewTab:!0,href:"https://jetpack.com/support/likes/",children:__("Learn more","jetpack")})}),(0,m.jsxs)(s.PanelBody,{title:__("Settings","jetpack"),children:[(0,r.isSimpleSite)()&&(0,m.jsx)(s.ToggleControl,{label:__("Show reblog button","jetpack"),checked:f,onChange:()=>t({showReblogButton:!f}),__nextHasNoMarginBottom:!0}),(0,m.jsx)(s.ToggleControl,{label:__("Show avatars","jetpack"),checked:b,onChange:()=>t({showAvatars:!b}),__nextHasNoMarginBottom:!0})]})]},"like-inspector"),(0,m.jsxs)("div",{className:"wpl-likebox",children:[(0,r.isSimpleSite)()&&f&&(0,m.jsx)("div",{className:"wpl-button reblog",children:(0,m.jsx)("a",{href:"#",title:__("Reblog this post on your main site.","jetpack"),className:"reblog sd-button",rel:"nofollow",children:(0,m.jsx)("span",{children:__("Reblog","jetpack")})})}),(0,m.jsx)("div",{className:"wpl-button like",children:(0,m.jsx)("a",{href:"#",className:"sd-button like",rel:"nofollow",onClick:k,children:(0,m.jsx)("span",{children:__("Like","jetpack")})})}),b&&(0,m.jsx)("ul",{className:"wpl-avatars",children:y.map((e,t)=>(0,m.jsx)("li",{className:"wp-liker-me",children:(0,m.jsx)("a",{className:"wpl-liker",href:"#",rel:"nofollow",onClick:k,children:(0,m.jsx)("img",{src:e,className:"avatar avatar-30",width:30,height:30,alt:""})})},`liker-${t}`))}),(0,m.jsx)("div",{className:"wpl-count",children:(0,m.jsx)("span",{className:"wpl-count-text",children:(0,m.jsx)("a",{href:"#",onClick:k,children:(0,i.createInterpolateElement)((0,a.sprintf)(
79 79 // translators: %1$d: Number of likes
80 80 __("<span>%1$d</span> likes","jetpack"),y.length),{span:(0,m.jsx)("span",{className:"wpl-count-number"})})})})})]})]})};n.d(t,["A",0,g])},67511(e,t,n){"use strict";var r=n(94375),o=n(71969),s=n(62734);n(82412);(0,r.M)(o,{edit:s.A,save:()=>null})},14737(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(27723),i=n(13022),a=n(54790),c=n(10790);const __=s.__,l={name:"jetpack/button",attributes:{element:"button",text:__("Join my Mailchimp audience","jetpack"),uniqueId:"mailchimp-widget-id"}},u=({attributes:e,setAttributes:t,audition:n})=>{const{emailPlaceholder:s=a.Bd,consentText:u=a.Do,processingLabel:d=a.HD,successLabel:p=a.XO,errorLabel:h=a.Ys}=e,m={[a.k1]:d,[a.EM]:p,error:h}[n];return(0,c.jsxs)("div",{className:(0,i.A)({[`${a.j7}_notication-audition`]:n}),children:[(0,c.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-label":s,className:`${a.j7}_text-input`,disabled:!0,onChange:()=>!1,placeholder:s,title:__("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),(0,c.jsx)(r.InnerBlocks,{template:[[l.name,l.attributes]],templateLock:"all"}),(0,c.jsx)(r.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),n&&(0,c.jsx)("div",{className:`${a.j7}_notification ${a.j7}_${n}`,role:"error"===n?"alert":"status",children:m})]})};n.d(t,["A",0,u])},54790(e,t,n){"use strict";var r=n(27723);const __=r.__,o=__("Enter your email","jetpack"),s=__("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"),i=__("Processing…","jetpack"),a=__("Success! You're on the list.","jetpack"),c=__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack");n.d(t,["Bd",0,o,"Do",0,s,"EM",0,"success","HD",0,i,"XO",0,a,"Ys",0,c,"j7",0,"wp-block-jetpack-mailchimp","k1",0,"processing"])},99983(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(57273),c=n(54790),l=n(22258),u=n(10790);const __=i.__,d=({auditionNotification:e,clearAudition:t,setAttributes:n,emailPlaceholder:r=c.Bd,processingLabel:s=c.HD,successLabel:i=c.XO,errorLabel:d=c.Ys,interests:p,signupFieldTag:h,signupFieldValue:m,connectURL:g})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.PanelBody,{title:__("Text Elements","jetpack"),children:(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Email Placeholder","jetpack"),value:r,onChange:e=>{n({emailPlaceholder:e}),t()}})}),(0,u.jsxs)(o.PanelBody,{title:__("Notifications","jetpack"),children:[(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Processing text","jetpack"),value:s,onChange:t=>{n({processingLabel:t}),e(c.k1)}}),(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:i,onChange:t=>{n({successLabel:t}),e(c.EM)}}),(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:d,onChange:t=>{n({errorLabel:t}),e("error")}})]}),(0,u.jsxs)(o.PanelBody,{title:__("Mailchimp Groups","jetpack"),children:[(0,u.jsx)(l.A,{interests:p,onChange:(e,t)=>{const r=[...new Set([...p,e])].filter(n=>!(n===e&&!t)&&n);n({interests:r})}}),(0,u.jsx)(a.N,{openInNewTab:!0,href:"https://mailchimp.com/help/send-groups-audience/",children:__("Learn about groups","jetpack")})]}),(0,u.jsxs)(o.PanelBody,{title:__("Signup Location Tracking","jetpack"),children:[(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Tag","jetpack"),placeholder:__("SIGNUP","jetpack"),value:h,onChange:e=>n({signupFieldTag:e})}),(0,u.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Value","jetpack"),placeholder:__("website","jetpack"),value:m,onChange:e=>n({signupFieldValue:e})}),(0,u.jsx)(a.N,{openInNewTab:!0,href:"https://mailchimp.com/help/determine-webpage-signup-location/",children:__("Learn about signup location tracking","jetpack")})]}),(0,u.jsx)(o.PanelBody,{title:__("Mailchimp Connection","jetpack"),children:(0,u.jsx)(a.N,{openInNewTab:!0,href:g,children:__("Manage Connection","jetpack")})})]});n.d(t,["o",0,({connectURL:e,attributes:t,setAttributes:n,setAudition:o})=>{const{emailPlaceholder:i=c.Bd,processingLabel:a=c.HD,successLabel:l=c.XO,errorLabel:p=c.Ys,interests:h,signupFieldTag:m,signupFieldValue:g}=t,f=(0,s.useRef)(null),b=()=>o(null);return(0,u.jsx)(r.InspectorControls,{children:(0,u.jsx)(d,{auditionNotification:e=>{o(e),f.current&&clearTimeout(f.current),f.current=setTimeout(b,3e3)},clearAudition:b,emailPlaceholder:i,processingLabel:a,successLabel:l,errorLabel:p,interests:h,setAttributes:n,signupFieldTag:m,signupFieldValue:g,connectURL:e})})}])},31491(e,t,n){"use strict";var r=n(74997),o=n(27723),s=n(66087);const __=o.__,i=["submitButtonText","backgroundButtonColor","textButtonColor","submitButtonClasses","customBackgroundButtonColor","customTextButtonColor"],a={attributes:{emailPlaceholder:{type:"string",default:__("Enter your email","jetpack")},submitButtonText:{type:"string",default:__("Join my email list","jetpack")},backgroundButtonColor:{type:"string"},textButtonColor:{type:"string"},submitButtonClasses:{type:"string"},customBackgroundButtonColor:{type:"string"},customTextButtonColor:{type:"string"},consentText:{type:"string",default:__("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")},interests:{type:"array",default:[]},processingLabel:{type:"string",default:__("Processing…","jetpack")},signupFieldTag:{type:"string"},signupFieldValue:{type:"string"},successLabel:{type:"string",default:__("Success! You're on the list.","jetpack")},errorLabel:{type:"string",default:__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},preview:{type:"boolean",default:!1}},migrate:e=>{const t=Object.fromEntries(Object.entries(e).filter(([e])=>!i.includes(e))),n={text:(o=e).submitButtonText||__("Join my email list","jetpack"),textColor:o.textButtonColor,customTextColor:o.customTextButtonColor,backgroundColor:o.backgroundButtonColor,customBackgroundColor:o.customBackgroundButtonColor};var o;return[t,[(0,r.createBlock)("jetpack/button",{element:"button",uniqueId:"mailchimp-widget-id",...n})]]},isEligible:(e,t)=>(0,s.isEmpty)(t)||Object.entries(e).some(([e,t])=>t&&i.includes(e)),save:()=>null};n.d(t,["A",0,a])},321(e,t,n){"use strict";var r=n(85985),o=n(1455),s=n.n(o),i=n(94715),a=n(56427),c=n(86087),l=n(27723),u=n(93832),d=n(37120),p=n(14737),h=(n(54790),n(99983)),m=n(61800),g=n(17527),f=n(10790);const __=l.__,b=(0,r.sh)(d),v=(0,a.withNotices)(({attributes:e,setAttributes:t,notices:n,noticeUI:o,noticeOperations:a})=>{const l=(0,i.useBlockProps)(),[d,v]=(0,c.useState)(null),[y,k]=(0,c.useState)(0),[w,x]=(0,c.useState)(null),[_,j]=(0,c.useState)(null),[C,A]=(0,c.useState)(!1),S=(0,c.useCallback)(()=>{const e=(0,r.gB)();return e?s()({path:"/wpcom/v2/mailchimp",method:"GET"}).then(({connect_url:t,code:n})=>(x(t),k("connected"===n?1:2),j(e),n),({message:t})=>{x(null),k(2),j(e),a.removeAllNotices(),a.createErrorNotice(t)}):s()({path:(0,u.addQueryArgs)("/jetpack/v4/connection/url",{from:"jetpack-block-editor",redirect:window.location.href})}).then(t=>{x(t),k(2),j(e)})},[x,k,j,a]);(0,c.useEffect)(()=>{S()},[S]);const E=(0,c.useCallback)(()=>{A(!0),a.removeAllNotices(),S().then(e=>{"not_connected"===e&&a.createNotice({status:"warning",content:__("Mailchimp is not connected yet. Connect your account and choose an audience, then check again.","jetpack")})}).finally(()=>A(!1))},[S,a]);let T;return e.preview?T=(0,f.jsx)(p.A,{attributes:e,setAttributes:t,audition:d}):0===y?T=(0,f.jsx)(m.A,{icon:b,notices:n}):2===y?T=_?(0,f.jsx)(g.W,{icon:b,notices:n,connectURL:w,onRecheck:E,isRechecking:C}):(0,f.jsx)(g.V,{icon:b,notices:n,connectURL:w}):1===y&&(T=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h.o,{connectURL:w,attributes:e,setAttributes:t,setAudition:v}),(0,f.jsx)(p.A,{attributes:e,setAttributes:t,audition:d})]})),(0,f.jsxs)("div",{...l,children:[o,T]})});n.d(t,["A",0,v])},97618(e,t,n){"use strict";var r=n(94375),o=n(37120),s=n(31491),i=n(321),a=n(55378),c=n(47638);n(31369);(0,r.M)(o,{edit:i.A,save:a.A,deprecated:[s.A],transforms:c.A})},61800(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(54790),i=n(10790);const __=o.__,a=({icon:e,notices:t})=>(0,i.jsx)(r.Placeholder,{icon:e,notices:t,className:s.j7,label:__("Mailchimp","jetpack"),children:(0,i.jsx)("div",{className:"align-center",children:(0,i.jsx)(r.Spinner,{})})});n.d(t,["A",0,a])},22258(e,t,n){"use strict";var r=n(1455),o=n.n(r),s=n(56427),i=n(86087),a=n(10790);class c extends i.Component{state={interest_categories:[]};componentDidMount(){this.retrieveGroups()}retrieveGroups=()=>{o()({method:"GET",path:"/wpcom/v2/mailchimp/groups"}).then(e=>{const{interest_categories:t}=e;this.setState({interest_categories:t})})};render=()=>{const{interest_categories:e}=this.state,{interests:t,onChange:n}=this.props;return(0,a.jsx)(i.Fragment,{children:e&&(e||[]).map(e=>e.interests.map(e=>(0,a.jsx)(s.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.name,value:e.id,checked:t.includes(e.id),onChange:t=>n(e.id,t)},e.id)))})}}const l=c;c.defaultProps={interests:[],onChange:()=>null},n.d(t,["A",0,l])},17527(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(54790),i=n(10790);const __=o.__;n.d(t,["V",0,({icon:e,notices:t,connectURL:n})=>(0,i.jsx)(r.Placeholder,{className:s.j7,icon:e,label:__("Mailchimp","jetpack"),notices:t,instructions:__("First, you'll need to connect your WordPress.com account.","jetpack"),children:(0,i.jsx)(r.Button,{variant:"secondary",href:n,children:__("Connect to WordPress.com","jetpack")})}),"W",0,({icon:e,notices:t,connectURL:n,onRecheck:o,isRechecking:a})=>(0,i.jsxs)(r.Placeholder,{className:s.j7,icon:e,label:__("Mailchimp","jetpack"),notices:t,instructions:__("You need to connect your Mailchimp account and choose an audience in order to start collecting Email subscribers.","jetpack"),children:[(0,i.jsx)(r.Button,{variant:"secondary",href:n,target:"_blank",children:(0,i.jsx)("span",{children:__("Set up Mailchimp form","jetpack")})}),(0,i.jsx)("div",{className:`${s.j7}-recheck`,children:(0,i.jsx)(r.Button,{variant:"link",onClick:o,isBusy:a,disabled:a,accessibleWhenDisabled:!0,children:(0,i.jsx)("span",{children:a?__("Checking connection…","jetpack",0):__("Re-check Connection","jetpack")})})})]})])},55378(e,t,n){"use strict";var r=n(94715),o=n(10790);const s=()=>{const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})};n.dn(s),n.d(t,["A",0,s])},47638(e,t,n){"use strict";var r=n(74997);const o={to:[{type:"block",blocks:["jetpack/subscriptions"],transform:()=>(0,r.createBlock)("jetpack/subscriptions")}]};n.d(t,["A",0,o])},4408(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(2202),a=(n(30938),n(10790));const __=s.__;class c extends o.Component{render(){const{onClose:e,onAddPoint:t,onError:n,apiKey:o,mapProvider:s}=this.props;return(0,a.jsxs)(r.Button,{className:"component__add-point",children:[__("Add marker","jetpack"),(0,a.jsxs)(r.Popover,{className:"component__add-point__popover",position:"bottom center",children:[(0,a.jsx)(r.Button,{className:"component__add-point__close",onClick:e,children:(0,a.jsx)(r.Dashicon,{icon:"no"})}),(0,a.jsx)(i.A,{onAddPoint:t,label:__("Add a location","jetpack"),apiKey:o,onError:n,mapProvider:s})]})]})}}c.defaultProps={onAddPoint:()=>{},onClose:()=>{},onError:()=>{},mapProvider:"mapbox"};const l=c;n.d(t,["A",0,l])},67613(e,t,n){"use strict";var r=n(86087),o=n(15244),s=n(40347),i=n(10790);const a=(0,r.forwardRef)((e,t)=>{if("mapkit"===e.mapProvider){const n={...e,ref:null};return(0,i.jsx)(s.A,{...n,ref:t})}return(0,i.jsx)(o.A,{...e,ref:t})});n.d(t,["A",0,a])},35977(e,t,n){"use strict";var r=n(9216),o=n(90135),s=n(10790);const i=e=>"mapkit"===e.mapProvider?(0,s.jsx)(o.A,{...e}):(0,s.jsx)(r.A,{...e});n.d(t,["A",0,i])},9216(e,t,n){"use strict";var r=n(86087),o=n(16815);class s extends r.Component{componentDidMount(){const{mapboxgl:e}=this.props;this.el=document.createElement("DIV"),this.infowindow=(0,o.BY)(e),this.infowindow.setDOMContent(this.el),this.infowindow.on("close",this.closeClick)}componentDidUpdate(e){this.props.activeMarker!==e.activeMarker&&(this.props.activeMarker?this.openWindow():this.closeWindow())}render(){return this.el?(0,r.createPortal)(this.props.children,this.el):null}closeClick=()=>{this.props.unsetActiveMarker()};openWindow(){const{map:e,activeMarker:t}=this.props;this.infowindow.setLngLat(t.getPoint()).addTo(e)}closeWindow(){this.infowindow.remove()}}s.defaultProps={unsetActiveMarker:()=>{},activeMarker:null,map:null,mapboxgl:null};const i=s;n.d(t,["A",0,i])},90135(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(5389),a=n(10790);const __=s.__,c=()=>{const{activeMarker:e,setActiveMarker:t,calloutReference:n,admin:s,points:c,setPoints:l}=(0,i.ST)(),[u,d]=(0,o.useState)(c),[p,h]=(0,o.useState)(!1),{title:m,caption:g}=u.find(t=>t.id===e?.id)||{},f=t=>{const n=c.map(n=>n.id===e.id?{...n,...t}:n);d(n),h(!0)};return(0,o.useEffect)(()=>{!e&&p&&l(u)},[e,p,u,l]),(0,o.useEffect)(()=>{d(c),h(!1)},[c]),e&&n?(0,o.createPortal)((0,a.jsxs)(o.Fragment,{children:[s&&(0,a.jsxs)(o.Fragment,{children:[(0,a.jsx)(r.TextControl,{label:__("Marker Title","jetpack"),value:m,onChange:e=>f({title:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,a.jsx)(r.TextareaControl,{className:"wp-block-jetpack-map__marker-caption",label:__("Marker Caption","jetpack"),value:g,rows:"2",tag:"textarea",onChange:e=>f({caption:e}),__nextHasNoMarginBottom:!0}),(0,a.jsxs)(r.Button,{onClick:()=>{const n=c.filter(t=>t.id!==e.id);d(n),h(!0),t(null)},className:"wp-block-jetpack-map__delete-btn",children:[(0,a.jsx)(r.Dashicon,{icon:"trash",size:"15"})," ",__("Delete Marker","jetpack")]})]}),!s&&(0,a.jsxs)(o.Fragment,{children:[(0,a.jsx)("h3",{children:m}),(0,a.jsx)("p",{children:g})]})]}),n):null};n.d(t,["A",0,c])},56099(e,t,n){"use strict";var r=n(86087),o=n(34377),s=n(16815);n(50221);class i extends r.Component{componentDidMount(){this.renderMarker()}componentWillUnmount(){this.marker&&(this.marker.remove(),this.marker=null)}componentDidUpdate(){this.renderMarker()}handleClick=()=>{const{onClick:e}=this.props;e(this)};getPoint=()=>{const{point:e}=this.props;return[e.coordinates.longitude,e.coordinates.latitude]};renderMarker(){const{map:e,point:t,mapboxgl:n,markerColor:r,mapRef:i}=this.props,{handleClick:a}=this,c=[t.coordinates.longitude,t.coordinates.latitude],{currentDoc:l}=(0,o.sG)(i.current),u=this.marker?this.marker.getElement():l.createElement("div");this.marker?this.marker.setLngLat(c):(u.className="wp-block-jetpack-map-marker",this.marker=new n.Marker(u).setLngLat(c).setOffset([0,-19]).addTo(e),this.marker.getElement().addEventListener("click",a)),(0,s.iU)(u,r)}render(){return null}}i.defaultProps={point:{},map:null,markerColor:"#000000",mapboxgl:null,onClick:()=>{}};const a=i;n.d(t,["A",0,a])},15244(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(66087),a=n(34377),c=n(55740),l=n(82063),u=n(16815),d=n(91844),p=n(35977),h=n(56099),m=n(10790);const __=s.__;class g extends o.Component{constructor(){super(...arguments),this.state={map:null,fit_to_bounds:!1,loaded:!1,mapboxgl:null},this.mapRef=(0,o.createRef)(),this.debouncedSizeMap=(0,i.debounce)(this.sizeMap,250)}render(){const{points:e,admin:t,children:n,markerColor:s}=this.props,{map:i,activeMarker:a,mapboxgl:c}=this.state,{onMarkerClick:l,deleteActiveMarker:u,updateActiveMarker:d}=this,g=a?.props?.point||{},{title:f,caption:b}=g,v=o.Children.map(n,e=>{const t=e?.props?.tagName;if("AddPoint"===t)return e}),y=i&&c&&e.map((e,t)=>(0,m.jsx)(h.A,{mapRef:this.mapRef,point:e,index:t,map:i,mapboxgl:c,markerColor:s,onClick:l},t)),k=c&&(0,m.jsxs)(p.A,{activeMarker:a,map:i,mapboxgl:c,unsetActiveMarker:()=>this.setState({activeMarker:null}),children:[a&&t&&(0,m.jsxs)(o.Fragment,{children:[(0,m.jsx)(r.TextControl,{label:__("Marker Title","jetpack"),value:f,onChange:e=>d({title:e}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,m.jsx)(r.TextareaControl,{className:"wp-block-jetpack-map__marker-caption",label:__("Marker Caption","jetpack"),value:b,rows:"2",tag:"textarea",onChange:e=>d({caption:e}),__nextHasNoMarginBottom:!0}),(0,m.jsxs)(r.Button,{onClick:u,className:"wp-block-jetpack-map__delete-btn",children:[(0,m.jsx)(r.Dashicon,{icon:"trash",size:"15"})," ",__("Delete Marker","jetpack")]})]}),a&&!t&&(0,m.jsxs)(o.Fragment,{children:[(0,m.jsx)("h3",{children:f}),(0,m.jsx)("p",{children:b})]})]});return(0,m.jsxs)(o.Fragment,{children:[(0,m.jsx)("div",{className:"wp-block-jetpack-map__gm-container",ref:this.mapRef,children:y}),k,v]})}componentDidMount(){const{apiKey:e}=this.props;e&&this.loadMapLibraries()}componentWillUnmount(){this.debouncedSizeMap.cancel(),window.removeEventListener("resize",this.debouncedSizeMap)}componentDidUpdate(e){const{admin:t,apiKey:n,children:r,points:o,mapStyle:s,mapDetails:i,scrollToZoom:a,showFullscreenButton:c}=this.props,{map:l,fullscreenControl:u}=this.state;n&&n.length>0&&n!==e.apiKey&&this.loadMapLibraries(),r!==e.children&&!1!==r&&this.clearCurrentMarker(),o!==e.points&&this.setBoundsByMarkers(),o.length!==e.points.length&&this.clearCurrentMarker(),s===e.mapStyle&&i===e.mapDetails||l.setStyle(this.getMapStyle()),a!==e.scrollToZoom&&(a?l.scrollZoom.enable():l.scrollZoom.disable()),c!==e.showFullscreenButton&&(c?(l.addControl(u),t&&u._fullscreenButton&&(u._fullscreenButton.disabled=!0)):l.removeControl(u))}onMarkerClick=e=>{const{onMarkerClick:t}=this.props;this.setState({activeMarker:e}),t()};onMapClick=()=>{this.setState({activeMarker:null})};clearCurrentMarker=()=>{this.setState({activeMarker:null})};updateActiveMarker=e=>{const{points:t}=this.props,{activeMarker:n}=this.state,{index:r}=n.props,o=t.slice(0);Object.assign(o[r],e),this.props.onSetPoints(o)};deleteActiveMarker=()=>{const{points:e}=this.props,{activeMarker:t}=this.state,{index:n}=t.props,r=e.slice(0);r.splice(n,1),this.props.onSetPoints(r),this.setState({activeMarker:null})};sizeMap=()=>{const{mapHeight:e}=this.props,{map:t}=this.state,n=this.mapRef.current;(0,d.A)(n,e),t.resize(),this.setBoundsByMarkers()};updateZoom=()=>{const{zoom:e}=this.props,{map:t}=this.state;t.setZoom(e)};setBoundsByMarkers=()=>{const{admin:e,onSetMapCenter:t,onSetZoom:n,points:r,zoom:o}=this.props,{map:s,activeMarker:i,mapboxgl:a,zoomControl:c,boundsSetProgrammatically:l}=this.state;if(!s)return;if(r.length&&e?s.dragPan.disable():s.dragPan.enable(),!r.length)return;if(i)return;const d=(0,u.ES)(a,r);if(t(d.getCenter()),r.length>1){(0,u._t)(s,d),this.setState({boundsSetProgrammatically:!0});try{s.removeControl(c)}catch{}}else{if(s.setCenter(d.getCenter()),l){const e=12;s.setZoom(e),n(e)}else s.setZoom(parseInt(o,10));s.addControl(c),this.setState({boundsSetProgrammatically:!1})}};getMapStyle(){const{mapStyle:e,mapDetails:t}=this.props;return(0,l.o)(e,t)}getMapType(){const{mapStyle:e}=this.props;switch(e){case"satellite":return"HYBRID";case"terrain":return"TERRAIN";default:return"ROADMAP"}}scriptsLoaded=()=>{const{mapCenter:e,points:t}=this.props;this.setState({loaded:!0}),t.length,this.initMap(e)};loadMapLibraries(){const{apiKey:e}=this.props,{currentWindow:t}=(0,a.sG)(this.mapRef.current),n={"mapbox-gl-js":()=>{(0,a.Cu)(t,"mapboxgl").then(t=>{t.accessToken=e,this.setState({mapboxgl:t},this.scriptsLoaded)})}};(0,a.a$)(c,n,this.mapRef.current)}initMap(e){const{mapboxgl:t}=this.state,{zoom:n,onMapLoaded:r,onError:o,scrollToZoom:s,showFullscreenButton:i,admin:a}=this.props;let c=null;try{c=new t.Map({container:this.mapRef.current,style:this.getMapStyle(),center:(0,u.jF)(e),zoom:parseInt(n,10),pitchWithRotate:!1,attributionControl:!1,dragRotate:!1})}catch(e){return void o("mapbox_error",e.message)}s||c.scrollZoom.disable();const l=new t.FullscreenControl;c.on("error",e=>{o("mapbox_error",e.error.message)});const d=new t.NavigationControl({showCompass:!1,showZoom:!0});c.on("zoomend",()=>{this.props.onSetZoom(c.getZoom())}),c.on("moveend",()=>{const{onSetMapCenter:e,points:t}=this.props;t.length<1&&e(c.getCenter())}),c.getCanvas().addEventListener("click",this.onMapClick),this.setState(({map:e})=>{try{e?.remove()}catch{}return{map:c,zoomControl:d,fullscreenControl:l}},()=>{this.debouncedSizeMap(),c.addControl(d),i&&(c.addControl(l),a&&l._fullscreenButton&&(l._fullscreenButton.disabled=!0)),this.mapRef.current.addEventListener("alignmentChanged",this.debouncedSizeMap),c.resize(),r(),this.setState({loaded:!0}),window.addEventListener("resize",this.debouncedSizeMap)})}}g.defaultProps={points:[],mapStyle:"default",zoom:13,onSetZoom:()=>{},onSetMapCenter:()=>{},onMapLoaded:()=>{},onMarkerClick:()=>{},onError:()=>{},markerColor:"red",apiKey:null,mapCenter:{},address:null};const f=g;n.d(t,["A",0,f])},40347(e,t,n){"use strict";var r=n(86087),o=n(39698),s=n(5389),i=n(42470),a=n(35977),c=n(10790);const l=(0,r.forwardRef)(({admin:e,points:t=[],mapStyle:n="default",zoom:i=13,onSetZoom:l=()=>{},onSetMapCenter:d=()=>{},onMapLoaded:p=()=>{},onMarkerClick:h=()=>{},onError:m=()=>{},markerColor:g="red",mapCenter:f={},mapHeight:b=400,address:v=null,onSetPoints:y,children:k},w)=>{const{loaded:x,error:_,mapkit:j,currentDoc:C,currentWindow:A}=(0,s.PC)(w),{map:S}=(0,s.I3)(j,x,w),E=r.Children.map(k,e=>{const t=e?.props?.tagName;if("AddPoint"===t)return e}),[T,N]=(0,r.useState)(!1);(0,r.useEffect)(()=>{_&&m("mapkit_error",_)},[_,m]);return(0,r.useEffect)(()=>{const e=e=>{w.current.contains(e.target)||N(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[w]),(0,c.jsxs)(o.u,{value:{mapkit:j,map:S,loaded:x,currentDoc:C,currentWindow:A,admin:e,points:t,setPoints:y},children:[x&&j&&S?(0,c.jsx)(u,{address:v,mapCenter:f,mapStyle:n,zoom:i,onSetMapCenter:d,onSetZoom:l,onSetPoints:y,points:t,markerColor:g,onMarkerClick:h,onMapLoaded:p}):null,(0,c.jsxs)("div",{style:{height:b?`${b}px`:"400px",position:"relative"},className:"wp-block-jetpack-map__mapkit-wrapper",ref:w,onClick:()=>{N(!0)},children:[!T&&(0,c.jsx)("div",{className:"wp-block-jetpack-map__select-overlay"}),(0,c.jsx)("div",{className:"wp-block-jetpack-map__gm-container",style:{height:`${b}px`,position:"absolute",pointerEvents:T?"auto":"none"}})]}),E,(0,c.jsx)(a.A,{mapProvider:"mapkit"})]})}),u=(0,r.memo)(({address:e=null,mapCenter:t={},mapStyle:n="default",zoom:o=13,onSetMapCenter:a=()=>{},onSetZoom:c=()=>{},onSetPoints:l=()=>{},points:u=[],markerColor:d="red",onMarkerClick:p=()=>{},onMapLoaded:h=()=>{}})=>{const{map:m,mapkit:g,setActiveMarker:f,setPreviousCenter:b,setCalloutReference:v,currentDoc:y}=(0,s.ST)(),k=(0,r.useRef)(p),w=(0,r.useRef)(l),x=(0,r.useCallback)(e=>{f(e),b(m.center),k.current&&k.current(e),m.setCenterAnimated(new g.Coordinate(e.coordinates.latitude,e.coordinates.longitude))},[m,g,f,b,k]);return(0,s.FN)(t,a),(0,s.y7)(n),(0,s.LR)(o,c),(0,s.$H)(u,d,(0,i.K5)(y,v),x),(0,s.bY)(h),(0,s.wB)(e=>{f(null),e&&m.setCenterAnimated(e)}),(0,s.mA)(e,w),null}),d=l;n.d(t,["A",0,d])},5171(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(27723),i=n(57273),a=n(20104),c=n(10790);const __=s.__,l=(0,c.jsx)(o.SVG,{width:"14",height:"20",viewBox:"0 0 14 20",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(o.G,{id:"Page-1",fill:"none",fillRule:"evenodd",children:(0,c.jsxs)(o.G,{id:"outline-add_location-24px",transform:"translate(-5 -2)",children:[(0,c.jsx)(o.Polygon,{id:"Shape",points:"0 0 24 0 24 24 0 24"}),(0,c.jsx)(o.Path,{d:"M12,2 C8.14,2 5,5.14 5,9 C5,14.25 12,22 12,22 C12,22 19,14.25 19,9 C19,5.14 15.86,2 12,2 Z M7,9 C7,6.24 9.24,4 12,4 C14.76,4 17,6.24 17,9 C17,11.88 14.12,16.19 12,18.88 C9.92,16.21 7,11.85 7,9 Z M13,6 L11,6 L11,8 L9,8 L9,10 L11,10 L11,12 L13,12 L13,10 L15,10 L15,8 L13,8 L13,6 Z",id:"Shape",fill:"#000",fillRule:"nonzero"})]})})}),u=({attributes:e,setAttributes:t,apiKey:n,apiKeySource:s,apiKeyControl:u,onKeyChange:d,context:p,mapRef:h,minHeight:m,removeAPIKey:g,updateAPIKey:f,setPointVisibility:b,mapProvider:v})=>"toolbar"===p?(0,c.jsx)(o.ToolbarGroup,{children:(0,c.jsx)(o.ToolbarButton,{icon:l,label:__("Add a marker","jetpack"),onClick:b})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.PanelColorSettings,{title:__("Colors","jetpack"),initialOpen:!0,colorSettings:[{value:e.markerColor,onChange:e=>t({markerColor:e}),label:__("Marker","jetpack")}]}),(0,c.jsxs)(o.PanelBody,{title:__("Settings","jetpack"),children:[(0,c.jsx)(o.__experimentalNumberControl,{label:__("Height in pixels","jetpack"),value:e.mapHeight||"",min:m,onChange:e=>{t({mapHeight:e})},size:"__unstable-large",step:10}),(0,c.jsx)(o.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Zoom level","jetpack"),help:e.points.length>1&&__("The default zoom level cannot be changed when there are two or more markers on the map.","jetpack"),disabled:e.points.length>1,value:Math.round(e.zoom),onChange:e=>{t({zoom:e}),h.current&&h.current.updateZoom&&setTimeout(h.current.updateZoom,0)},min:0,max:22}),"mapbox"===v?(0,c.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show labels","jetpack"),checked:e.mapDetails,onChange:e=>t({mapDetails:e})}):null,(0,c.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Scroll to zoom","jetpack"),help:__("Allow the map to capture scrolling, and zoom in or out.","jetpack"),checked:e.scrollToZoom,onChange:e=>t({scrollToZoom:e})}),"mapbox"===v?(0,c.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show Fullscreen Button","jetpack"),help:__("Allow your visitors to display the map in fullscreen.","jetpack"),checked:e.showFullscreenButton,onChange:e=>t({showFullscreenButton:e})}):null]}),e.points.length?(0,c.jsx)(o.PanelBody,{title:__("Markers","jetpack"),initialOpen:!1,children:(0,c.jsx)(a.A,{points:e.points,onChange:e=>{t({points:e})}})}):null,"mapbox"===v?(0,c.jsxs)(o.PanelBody,{title:__("Mapbox Access Token","jetpack"),initialOpen:!1,children:[(0,c.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,help:"wpcom"===s&&(0,c.jsxs)(c.Fragment,{children:[__("You can optionally enter your own access token.","jetpack")," ",(0,c.jsx)(i.N,{openInNewTab:!0,href:"https://account.mapbox.com/access-tokens/",children:__("Find it on Mapbox","jetpack")})]}),label:__("Mapbox Access Token","jetpack"),value:u,onChange:d}),(0,c.jsx)("div",{className:"jetpack-map-token-settings",children:(0,c.jsxs)(o.__experimentalToggleGroupControl,{isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[(0,c.jsx)(o.__experimentalToggleGroupControlOption,{className:"components-button jetpack-update-token-button",label:__("Update Token","jetpack"),value:"update",onClick:f,disabled:!u||u===n}),(0,c.jsx)(o.__experimentalToggleGroupControlOption,{className:"components-button is-secondary",label:__("Remove Token","jetpack"),value:"remove",onClick:g,disabled:"wpcom"===s})]})})]}):null]});n.dn(u),n.d(t,["A",0,u])},1807(e,t,n){"use strict";const r={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"}},migrate:e=>{const t=((e.className||"").replace(/is-style-[^ ]+/,"")+` is-style-${e.mapStyle}`).replace(/\s+/g," ").trim(),{mapStyle:n,...r}=e;return{...r,showFullscreenButton:!0,className:t}},save:n(37670).A};n.d(t,["A",0,r])},37670(e,t,n){"use strict";var r=n(86087),o=n(10790);class s extends r.Component{render(){const{attributes:e}=this.props,{align:t,mapStyle:n,mapDetails:r,points:s,zoom:i,mapCenter:a,markerColor:c,scrollToZoom:l,mapHeight:u}=e,d=s.map((e,t)=>{const{longitude:n,latitude:r}=e.coordinates,s="https://www.google.com/maps/search/?api=1&query="+r+","+n;return(0,o.jsx)("li",{children:(0,o.jsx)("a",{href:s,children:e.title})},t)}),p=t?`align${t}`:null;return(0,o.jsx)("div",{className:p,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(s),"data-zoom":i,"data-map-center":JSON.stringify(a),"data-marker-color":c,"data-scroll-to-zoom":l||null,"data-map-height":u||null,children:s.length>0&&(0,o.jsx)("ul",{children:d})})}}const i=s;n.d(t,["A",0,i])},43402(e,t,n){"use strict";const r={attributes:{align:{type:"string"},points:{type:"array",default:[]},mapDetails:{type:"boolean",default:!0},zoom:{type:"integer",default:13},mapCenter:{type:"object",default:{longitude:-122.41941550000001,latitude:37.7749295}},mapStyle:{type:"string",default:"default"},markerColor:{type:"string",default:"red"},scrollToZoom:{type:"boolean",default:!1},mapHeight:{type:"integer"},showFullscreenButton:{type:"boolean",default:!0}},migrate:e=>{const t=((e.className||"").replace(/is-style-[^ ]+/,"")+` is-style-${e.mapStyle}`).replace(/\s+/g," ").trim(),{mapStyle:n,...r}=e;return{...r,className:t}},save:n(47083).A};n.d(t,["A",0,r])},47083(e,t,n){"use strict";var r=n(86087),o=n(10790);class s extends r.Component{render(){const{attributes:e}=this.props,{align:t,mapStyle:n,mapDetails:r,points:s,zoom:i,mapCenter:a,markerColor:c,scrollToZoom:l,mapHeight:u,showFullscreenButton:d}=e,p=s.map((e,t)=>{const{longitude:n,latitude:r}=e.coordinates,s="https://www.google.com/maps/search/?api=1&query="+r+","+n;return(0,o.jsx)("li",{children:(0,o.jsx)("a",{href:s,children:e.title})},t)}),h=t?`align${t}`:null;return(0,o.jsx)("div",{className:h,"data-map-style":n,"data-map-details":r,"data-points":JSON.stringify(s),"data-zoom":i,"data-map-center":JSON.stringify(a),"data-marker-color":c,"data-scroll-to-zoom":l||null,"data-map-height":u||null,"data-show-fullscreen-button":d||null,children:s.length>0&&(0,o.jsx)("ul",{children:p})})}}const i=s;n.d(t,["A",0,i])},34549(e,t,n){"use strict";var r=n(85985),o=n(1455),s=n.n(o),i=n(94715),a=n(56427),c=n(29491),l=n(47143),u=n(86087),d=n(27723),p=n(57273),h=n(90907),m=n(4408),g=n(6852),f=n(67613),b=n(5171),v=n(2905),y=n(25836),k=n(62393),w=n(44950),x=n(10790);const __=d.__,_=(0,r.sh)(g),j={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},C=(0,c.compose)(a.withNotices)(({setAttributes:e,attributes:t,noticeUI:n,notices:r,isSelected:o,noticeOperations:c})=>{const{address:d,align:g,mapDetails:C,points:A,zoom:S,mapCenter:E,markerColor:T,mapHeight:N,showFullscreenButton:P}=t,{toggleSelection:B}=(0,l.useDispatch)("core/block-editor"),{isPreviewMode:M}=(0,l.useSelect)(e=>{const{getSettings:t}=e(i.store);return{isPreviewMode:t().isPreviewMode}},[]),[I,R]=(0,u.useState)(!1),[L,D]=(0,u.useState)(0),[F,O]=(0,u.useState)(null),[z,U]=(0,u.useState)(null),[H,$]=(0,u.useState)(null),[V,q]=(0,u.useState)(null),G=(0,u.useRef)(null),W=(0,i.useBlockProps)(),{className:Z}=W,J=(0,h.D)(k.A,Z),K=(0,w.A)({mapStyle:J}),Y=()=>{d&&F&&"mapkit"!==K&&(0,v.I)(d,F).then(t=>{if(t.features?.length){const n=t.features[0],r=[{title:n.text,placeTitle:n.text,caption:n.place_name,id:n.id,coordinates:{latitude:n.center[1],longitude:n.center[0]}}];e({points:r})}else ne(null,__("Could not find the coordinates of the provided address. Displaying default location. Feel free to add the location manually.","jetpack"))}).catch(e=>ne(null,e.message))},Q=(e=null,t="GET")=>new Promise((n,r)=>{const o="/wpcom/v2/service-api-keys/mapbox",i=e?{path:o,method:t,data:{service_api_key:e}}:{path:o,method:t};q(!0),s()(i).then(({service_api_key:e,service_api_key_source:t})=>{c.removeAllNotices(),D(e?2:1),O(e),U("wpcom"===t?"":e),$(t),q(!1),n()},({message:e})=>{ne(null,e),D(1),q(!1),r()})}),X=t=>{if(A.some(e=>e.id===t.id))return;const n=A.slice(0);n.push(t),e({points:n}),R(!1)},ee=()=>{c.removeAllNotices(),z&&Q(z,"POST")},te=()=>Q(null,"DELETE"),ne=(e,t)=>{c.removeAllNotices(),c.createErrorNotice(t)},re=(t,n,r,o)=>{B(!0);const s=G?.current?.mapRef??G;if(s){const t=parseInt(s.current.offsetHeight+o.height,10);e({mapHeight:t}),s.current.sizeMap&&setTimeout(s.current.sizeMap,0)}};let oe;if((0,u.useEffect)(()=>{"mapbox"===K?Q().then(Y):D(2)},[]),(0,u.useEffect)(()=>{if(!G.current?.sizeMap)return;const e=setTimeout(G.current.sizeMap,0);return()=>clearTimeout(e)},[g]),(0,u.useEffect)(Y,[d]),(0,u.useEffect)(()=>{Z&&!F&&(D(0),Q())},[Z]),M){const e=k.A.find(e=>e.name===J);oe=(0,x.jsx)("div",{children:(0,x.jsx)("img",{alt:__("Map Preview","jetpack"),src:e?e.preview:y,style:{width:"100%",height:N||"400px",objectFit:"cover"}})})}else if(0===L)oe=(0,x.jsx)(a.Placeholder,{icon:_,children:(0,x.jsx)(a.Spinner,{})});else if(1===L)oe=(0,x.jsx)(a.Placeholder,{icon:_,label:__("Map","jetpack"),notices:r,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("p",{className:"components-placeholder__instructions",children:[__("To use the map block, you need an Access Token.","jetpack"),(0,x.jsx)("br",{}),(0,x.jsx)(p.N,{openInNewTab:!0,href:"https://www.mapbox.com",children:__("Create an account or log in to Mapbox.","jetpack")}),(0,x.jsx)("br",{}),__("Locate and copy the default access token. Then, paste it into the field below.","jetpack")]}),(0,x.jsxs)("form",{children:[(0,x.jsx)("input",{type:"text",className:"components-placeholder__input",disabled:V,placeholder:__("Paste Token Here","jetpack"),value:z,onChange:e=>U(e.target.value)}),(0,x.jsx)(a.Button,{variant:"secondary",disabled:V||!z||z.length<1,onClick:ee,children:__("Set Token","jetpack")})]})]})});else if(2===L){const n=e=>U(e),r=o&&A.length<=1;oe=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i.BlockControls,{children:(0,x.jsx)(b.A,{attributes:t,setAttributes:e,apiKey:F,apiKeySource:H,apiKeyControl:z,onKeyChange:n,setPointVisibility:()=>R(!0),context:"toolbar",mapProvider:K})}),(0,x.jsx)(i.InspectorControls,{children:(0,x.jsx)(b.A,{attributes:t,setAttributes:e,apiKey:F,apiKeySource:H,apiKeyControl:z,onKeyChange:n,mapRef:G,minHeight:400,removeAPIKey:te,updateAPIKey:ee,mapProvider:K})}),(0,x.jsx)(a.ResizableBox,{size:{height:N||"auto",width:"100%"},grid:[10,10],showHandle:o,minHeight:400,enable:j,onResizeStart:()=>B(!1),onResizeStop:re,children:(0,x.jsx)("div",{className:"wp-block-jetpack-map__map_wrapper",children:(0,x.jsx)(f.A,{ref:G,address:d,scrollToZoom:r,showFullscreenButton:P,mapStyle:J||"default",mapDetails:C,mapHeight:N,points:A,zoom:S,mapCenter:E,markerColor:T,onSetZoom:t=>{e({zoom:t})},admin:!0,apiKey:F,onSetPoints:t=>e({points:t}),onSetMapCenter:t=>e({mapCenter:t}),onMapLoaded:()=>R(!A.length),onMarkerClick:()=>R(!1),onError:ne,mapProvider:K,children:o&&I&&(0,x.jsx)(m.A,{onAddPoint:X,onClose:()=>R(!1),apiKey:F,onError:ne,tagName:"AddPoint",mapProvider:K})})})})]})}return(0,x.jsxs)("div",{...W,children:[n,oe]})});n.d(t,["A",0,C])},12742(e,t,n){"use strict";var r=n(94375),o=n(6852),s=n(1807),i=n(43402),a=n(34549),c=n(20974),l=n(62393);n(64525),n(2753);(0,r.M)(o,{edit:a.A,save:c.A,styles:l.A,deprecated:[i.A,s.A]})},2905(e,t,n){"use strict";function r(e,t){return fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(e)}.json?access_token=${encodeURIComponent(t)}`).then(e=>e.json())}n.d(t,{I:()=>r})},2202(e,t,n){"use strict";var r=n(64597),o=n(3094),s=n(10790);const i=e=>{const t="mapbox"===e.mapProvider?r.A:o.A;return(0,s.jsx)(t,{...e})};n.d(t,["A",0,i])},64597(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(97602),a=n(10790);const c=(0,s.__)("Add a marker…","jetpack");class l extends o.Component{constructor(){super(...arguments),this.textRef=(0,o.createRef)(),this.containerRef=(0,o.createRef)(),this.state={isEmpty:!0},this.autocompleter={name:"placeSearch",options:this.search,isDebounced:!0,getOptionLabel:e=>(0,a.jsx)("span",{children:e.place_name}),getOptionKeywords:e=>[e.place_name],getOptionCompletion:this.getOptionCompletion}}componentDidMount(){setTimeout(()=>{this.containerRef.current.querySelector("input").focus()},50)}getOptionCompletion=e=>{const{value:t}=e,n={placeTitle:t.text,title:t.text,caption:t.place_name,id:t.id,coordinates:{longitude:t.geometry.coordinates[0],latitude:t.geometry.coordinates[1]}};return this.props.onAddPoint(n),t.text};search=e=>{const{apiKey:t,onError:n}=this.props,r="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURI(e)+".json?access_token="+t;return new Promise(function(e,t){const o=new XMLHttpRequest;o.open("GET",r),o.onload=function(){if(200===o.status){const t=JSON.parse(o.responseText);e(t.features)}else{const e=JSON.parse(o.responseText);n(e.statusText,e.responseJSON.message),t(new Error("Mapbox Places Error"))}},o.send()})};onReset=()=>{this.textRef.current.value=null};render(){const{label:e}=this.props;return(0,a.jsx)("div",{ref:this.containerRef,children:(0,a.jsx)("div",{className:"components-location-search",children:(0,a.jsx)(i.A,{completer:this.autocompleter,onReset:this.onReset,children:({isExpanded:t,listBoxId:n,activeId:o,onChange:s,onKeyDown:i})=>(0,a.jsx)(r.TextControl,{label:e,placeholder:c,ref:this.textRef,onChange:s,"aria-expanded":t,"aria-owns":n,"aria-activedescendant":o,onKeyDown:i,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})})})}}l.defaultProps={onError:()=>{}};const u=l;n.d(t,["A",0,u])},3094(e,t,n){"use strict";var r=n(56427),o=n(86087),s=n(27723),i=n(97602),a=n(5389),c=n(10790);const l=(0,s.__)("Add a marker…","jetpack"),u=({label:e,onAddPoint:t})=>{const n=(0,o.useRef)(void 0),s=(0,o.useRef)(void 0),{mapkit:u}=(0,a.ST)(),d=new u.Search({includePointsOfInterest:!1}),p={name:"placeSearch",options:async e=>new Promise(function(t,n){d.autocomplete(e,(e,r)=>{if(e)return void n(e);const o=(r?.results.filter(e=>e.coordinate)??[]).map(e=>({...e,placeName:e.displayLines?.join(", "),original:e}));t(o)})}),isDebounced:!0,getOptionLabel:e=>(0,c.jsx)("span",{children:e.placeName}),getOptionKeywords:e=>[e.placeName],getOptionCompletion:e=>{const{value:n}=e,r={placeTitle:n.placeName,title:n.placeName,caption:n.placeName,coordinates:{longitude:n.coordinate.longitude,latitude:n.coordinate.latitude},id:`${n.placeName} ${Number(n.coordinate.latitude).toFixed(2)} ${Number(n.coordinate.longitude).toFixed(2)}`};return d.search(n.original,(e,n)=>{if(!e){const{places:e}=n;if(e.length>0){const t=e[0];r.coordinates={longitude:t.coordinate.longitude,latitude:t.coordinate.latitude}}}t(r)}),n.placeName}};return(0,o.useEffect)(()=>{setTimeout(()=>{n.current.querySelector("input").focus()},50)},[]),(0,c.jsx)("div",{ref:n,children:(0,c.jsx)("div",{className:"components-location-search",children:(0,c.jsx)(i.A,{completer:p,onReset:()=>{s.current.value=""},children:({isExpanded:t,listBoxId:n,activeId:o,onChange:i,onKeyDown:a})=>(0,c.jsx)(r.TextControl,{label:e,placeholder:l,ref:s,onChange:i,"aria-expanded":t,"aria-owns":n,"aria-activedescendant":o,onKeyDown:a,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})})})};n.d(t,["A",0,u])},20104(e,t,n){"use strict";var r=n(56427),o=n(86087),s=(n(52918),n(10790));class i extends o.Component{constructor(){super(...arguments),this.state={selectedCell:null}}onDeletePoint=e=>{const t=parseInt(e.target.getAttribute("data-id")),{points:n,onChange:r}=this.props,o=n.slice(0);o.splice(t,1),r(o)};setMarkerField(e,t,n){const{points:r,onChange:o}=this.props,s=r.slice(0);s[n][e]=t,o(s)}render(){const{points:e}=this.props,t=e.map((e,t)=>(0,s.jsxs)(r.PanelBody,{title:e.placeTitle,initialOpen:!1,children:[(0,s.jsx)(r.TextControl,{label:"Marker Title",value:e.title,onChange:e=>this.setMarkerField("title",e,t),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,s.jsx)(r.TextareaControl,{label:"Marker Caption",value:e.caption,rows:"3",onChange:e=>this.setMarkerField("caption",e,t),__nextHasNoMarginBottom:!0}),(0,s.jsxs)(r.Button,{"data-id":t,onClick:this.onDeletePoint,className:"component__locations__delete-btn",children:[(0,s.jsx)(r.Dashicon,{icon:"trash",size:"15"})," Delete Marker"]})]},e.id));return(0,s.jsx)("div",{className:"component__locations",children:(0,s.jsx)(r.Panel,{className:"component__locations__panel",children:t})})}}i.defaultProps={points:Object.freeze([]),onChange:()=>{}};const a=i;n.d(t,["A",0,a])},97602(e,t,n){"use strict";var r=n(56427),o=n(29491),s=n(86087),i=n(27723),a=n(48558),c=n(13022),l=n(66087),u=n(10790);const __=i.__,_n=i._n;function d(e=[],t=10){const n=[];for(let r=0;r<e.length;r++){const o=e[r];if(n.push(o),n.length===t)break}return n}class p extends s.Component{static getInitialState(){return{selectedIndex:0,query:void 0,filteredOptions:[],isOpen:!1}}constructor(){super(...arguments),this.debouncedLoadOptions=(0,l.debounce)(this.loadOptions,250),this.state=this.constructor.getInitialState()}componentWillUnmount(){this.debouncedLoadOptions.cancel()}select=e=>{const{completer:t}=this.props;(t.getOptionCompletion||{})(e),this.reset()};reset=()=>{this.setState(this.constructor.getInitialState())};handleFocusOutside(){this.reset()}loadOptions(e,t){const{options:n}=e,r=this.activePromise=Promise.resolve("function"==typeof n?n(t):n).then(t=>{if(r!==this.activePromise)return;const n=t.map((t,n)=>({key:`${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[]})),o=d(n),s=o.length===this.state.filteredOptions.length?this.state.selectedIndex:0;this.setState({options:n,filteredOptions:o,selectedIndex:s,isOpen:o.length>0}),this.announce(o)})}onChange=e=>{const{completer:t}=this.props,{options:n}=this.state;if(!e)return void this.reset();t&&(t.isDebounced?this.debouncedLoadOptions(t,e):this.loadOptions(t,e));const r=t?d(n):[];t&&this.setState({selectedIndex:0,filteredOptions:r,query:e})};onKeyDown=e=>{const{isOpen:t,selectedIndex:n,filteredOptions:r}=this.state;if(!t)return;let o;switch(e.keyCode){case a.UP:o=(0===n?r.length:n)-1,this.setState({selectedIndex:o});break;case a.DOWN:o=(n+1)%r.length,this.setState({selectedIndex:o});break;case a.ENTER:this.select(r[n]);break;case a.LEFT:case a.RIGHT:case a.ESCAPE:return void this.reset();default:return}e.preventDefault(),e.stopPropagation()};announce(e){const{debouncedSpeak:t}=this.props;t&&(e.length?t((0,i.sprintf)(/* translators: %d: the number of results. */
81 -_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:n,instanceId:o,completer:s}=this.props,{selectedIndex:i,filteredOptions:a}=this.state,{key:l=""}=a[i]||{},{className:d}=s,p=a.length>0,h=p?`components-autocomplete-listbox-${o}`:null,m=p?`components-autocomplete-item-${o}-${l}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[n({isExpanded:p,listBoxId:h,activeId:m,onChange:e,onKeyDown:t}),p&&(0,u.jsx)(r.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:h,role:"listbox",className:"components-autocomplete__results",children:a.map((e,t)=>(0,u.jsx)(r.Button,{id:`components-autocomplete-item-${o}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:(0,c.A)("components-autocomplete__result",d,{"is-selected":t===i}),onClick:()=>this.select(e),children:e.label},e.key))})})]})}}const h=(0,o.compose)([r.withSpokenMessages,o.withInstanceId,r.withFocusOutside])(p);n.d(t,["A",0,h])},82063(e,t,n){"use strict";function r(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"]}n.d(t,{o:()=>r})},16815(e,t,n){"use strict";n.d(t,{BY:()=>i,ES:()=>r,_t:()=>o,iU:()=>s});function r(e,t){const n=new e.LngLatBounds;return t.forEach(e=>{n.extend([e.coordinates.longitude,e.coordinates.latitude])}),n}function o(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}function s(e,t){e.innerHTML='\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg">\n\t\t\t<path d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z"/>\n\t\t</svg>\n\t',e.querySelector("path").setAttribute("fill",CSS.supports("color",t)?t:"red")}function i(e){return new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}n.d(t,["jF",0,e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0}])},42470(e,t,n){"use strict";n.d(t,{IR:()=>u,K5:()=>c,Sm:()=>i,Yc:()=>l,c6:()=>s,nQ:()=>a});var r=n(34377);function o(e){return Math.abs(6371e3*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function s(e,t){return 512/Math.pow(2,e)*.5*o(t)}function i(e,t){const n=e/o(t);return Math.log2(512/(n/.5))}function a(e,t){if(0===t.length)return null;const n=new e.Coordinate(-90,180),r=new e.Coordinate(90,-180);t.forEach(e=>{n.latitude=Math.max(n.latitude,e.coordinates.latitude),n.longitude=Math.min(n.longitude,e.coordinates.longitude),r.latitude=Math.min(r.latitude,e.coordinates.latitude),r.longitude=Math.max(r.longitude,e.coordinates.longitude)});const o=new e.Coordinate(n.latitude-.5*(n.latitude-r.latitude),n.longitude+.5*(r.longitude-n.longitude)),s=new e.CoordinateSpan(1.3*Math.abs(n.latitude-r.latitude),1.3*Math.abs(r.longitude-n.longitude));return new e.CoordinateRegion(o,s)}function c(e,t){return()=>{const n=e.createElement("div");return n.classList.add("mapkit-popup-content"),t(n),n}}function l(e,t){return new Promise(n=>{if(t.mapkitScriptIsLoading)(0,r.Cu)(t,"mapkit").then(e=>{n(e)});else{t.mapkitScriptIsLoading=!0;const o=e.createElement("script");o.addEventListener("load",async()=>{const e=await(0,r.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,n(e)},{once:!0}),o.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",o.crossOrigin="anonymous",e.head.appendChild(o)}})}function u(e,t,n){return new Promise((t,r)=>{n.mapkitIsInitialized?t():n.mapkitIsInitializing?function(e){return new Promise((t,n)=>{const r=()=>{void 0===e.mapkitIsInitializing?n():!1===e.mapkitIsInitializing?t():e.requestAnimationFrame(r)};r()})}(n).then(()=>{t()}):(n.mapkitIsInitializing=!0,n.mapkitIsInitialized=!1,e.init({authorizationCallback:async e=>{try{const o=await fetch("https://public-api.wordpress.com/wpcom/v2/mapkit");if(200===o.status){e((await o.json()).wpcom_mapkit_access_token)}else r();n.mapkitIsInitializing=!1,n.mapkitIsInitialized=!0,t()}catch{r()}}}))})}},39698(e,t,n){"use strict";var r=n(86087),o=n(10790);const s=(0,r.createContext)({map:null,mapkit:null,loaded:!1,activeMarker:null,calloutReference:null,currentDoc:null,currentWindow:null,admin:!1,setPoints:()=>{},points:[],previousCenter:null});n.d(t,["C",0,s,"u",0,({value:e,children:t})=>{const[n,i]=(0,r.useState)(null),[a,c]=(0,r.useState)(null),[l,u]=(0,r.useState)(null);return(0,o.jsx)(s.Provider,{value:{...e,activeMarker:n,setActiveMarker:i,calloutReference:a,setCalloutReference:c,previousCenter:l,setPreviousCenter:u},children:t})}])},5389(e,t,n){"use strict";var r=n(39384),o=n(47143),s=n(86087),i=n(27723),a=n(66087),c=n(34377),l=n(42470),u=n(39698);const __=i.__,d=()=>(0,s.useContext)(u.C);n.d(t,["$H",0,(e,t,n=null,r=null)=>{const{mapkit:o,map:i,loaded:a,currentWindow:c}=d(),l=(0,s.useRef)(n),u=(0,s.useRef)(r);(0,s.useEffect)(()=>{if(a){i.annotations.filter(t=>!e.find(e=>e.id===t.data.id)).forEach(e=>i.removeAnnotation(e));const n=e.map(e=>{const n=i.annotations.find(t=>t.data.id===e.id);if(n)return n.title=e.title,n.color=t,n;const r=new o.MarkerAnnotation(new o.Coordinate(e.coordinates.latitude,e.coordinates.longitude),{color:t,data:{id:e.id}});return r.calloutEnabled=!0,r.title=e.title,l.current&&(r.callout={calloutElementForAnnotation:l.current}),u.current&&r.addEventListener("select",()=>u.current(e,i)),r});i.annotations.length!==n.length&&i.showItems(new c.Array(...n))}},[e,a,i,o,t,l,u,c])},"FN",0,(e,t)=>{const{mapkit:n,map:r}=d(),o=(0,s.useRef)(e),i=(0,s.useRef)(t);(0,s.useEffect)(()=>{if(!n||!r||!o.current)return;const e=o.current?.lat??o.current?.latitude,t=o.current?.lng??o.current?.longitude;"number"==typeof e&&"number"==typeof t&&(r.center=new n.Coordinate(e,t))},[n,r,o]),(0,s.useEffect)(()=>{if(!n||!r)return;const e=()=>{if(r.center){const{latitude:e,longitude:t}=r.center;i.current({lat:e,lng:t})}};return r.addEventListener("region-change-end",(0,a.debounce)(e,1e3)),()=>{r.removeEventListener("region-change-end",e)}},[n,r,i])},"I3",0,(e,t,n)=>{const[r,o]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t&&o(new e.Map(n.current,{showsMapTypeControl:!1}))},[e,t,n]),{map:r}},"LR",0,(e,t)=>{const{mapkit:n,map:r,points:o}=d();(0,s.useEffect)(()=>{if(n&&r)if(o&&o.length<=1){const t=(0,l.c6)(13,r.center.latitude);if(e){const t=(0,l.c6)(e,r.center.latitude);t!==r.cameraDistance&&(r.cameraDistance=t)}else t!==r.cameraDistance&&(r.cameraDistance=t);r.isZoomEnabled=!0,r.isScrollEnabled=!0}else r.region=(0,l.nQ)(n,o),r.isZoomEnabled=!1,r.isScrollEnabled=!1},[n,r,e,o]),(0,s.useEffect)(()=>{const e=()=>{t((0,l.Sm)(r.cameraDistance,r.center.latitude))};return r.addEventListener("zoom-end",e),()=>{r.removeEventListener("zoom-end",e)}},[n,r,t])},"PC",0,e=>{const[t,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(!1),[u,d]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[m,g]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=(0,o.select)(r.CONNECTION_STORE_ID).getBlogId(),{currentDoc:s,currentWindow:i}=(0,c.sG)(e.current);if(e.current){h(i),g(s);const e=__("Failed to retrieve a Mapkit API token. Please try refreshing.","jetpack");i.mapkit?(d(i.mapkit),(0,l.IR)(i.mapkit,t,i).then(()=>{n(!0)},()=>{a(e)})):(0,l.Yc)(s,i).then(r=>{d(r),(0,l.IR)(r,t,i).then(()=>{n(!0)},()=>{a(e)})})}},[e]),{loaded:t,error:i,mapkit:u,currentDoc:m,currentWindow:p}},"ST",0,d,"bY",0,e=>{const{map:t,loaded:n}=d(),r=(0,s.useRef)(e);(0,s.useEffect)(()=>{n&&r.current(t)},[n,t,r])},"mA",0,(e,t)=>{const{mapkit:n,map:r}=d();(0,s.useEffect)(()=>{if(n&&r&&e?.length){(new n.Geocoder).lookup(e,(e,n)=>{if(n?.results?.length){const e=n.results[0],r=e.formattedAddress,o={placeTitle:r,title:r,caption:r,coordinates:{longitude:e.coordinate.longitude,latitude:e.coordinate.latitude},id:`${r} ${Number(e.coordinate.latitude).toFixed(2)} ${Number(e.coordinate.longitude).toFixed(2)}`};t.current([o])}})}},[n,r,e,t])},"wB",0,e=>{const{map:t,previousCenter:n,loaded:r}=d(),o=(0,s.useRef)(e);(0,s.useEffect)(()=>{r&&t.addEventListener("single-tap",()=>{o.current(n)})},[r,t,n,o])},"y7",0,e=>{const{mapkit:t,map:n}=d();(0,s.useEffect)(()=>{t&&n&&(n.mapType=(()=>{switch(e){case"satellite":return t.Map.MapTypes.Satellite;case"black_and_white":return t.Map.MapTypes.MutedStandard;case"hybrid":return t.Map.MapTypes.Hybrid;default:return t.Map.MapTypes.Standard}})())},[t,n,e])}])},20974(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(90907),i=n(62393),a=n(10790);const c=({attributes:e})=>{const{align:t,mapDetails:n,points:c,zoom:l,mapCenter:u,markerColor:d,scrollToZoom:p,mapHeight:h,showFullscreenButton:m}=e,g=r.useBlockProps.save(),{className:f}=g,b=(0,s.D)(i.A,f),v=c.map((e,t)=>{const{longitude:n,latitude:r}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+r+","+n;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:o,children:e.title})},t)});return(0,a.jsx)("div",{...g,className:(0,o.A)(f,t?`align${t}`:null),"data-map-style":b,"data-map-details":n,"data-points":JSON.stringify(c),"data-zoom":l,"data-map-center":JSON.stringify(u),"data-marker-color":d,"data-scroll-to-zoom":p||null,"data-map-height":h||null,"data-show-fullscreen-button":m||null,children:c.length>0&&(0,a.jsx)("ul",{children:v})})};n.d(t,["A",0,c])},62393(e,t,n){"use strict";var r=n(27723),o=n(93797),s=n(49364),i=n(77971),a=n(98430),c=n(27415),l=n(72386),u=n(92747),d=n(44950);const __=r.__,p=(0,d.A)(),h=[{name:"default",label:__("Basic","jetpack"),preview:"mapkit"===p?a:i,isDefault:!0},{name:"black_and_white",label:"mapkit"===p?__("Muted","jetpack",0):__("Black & White","jetpack"),preview:"mapkit"===p?s:o},{name:"satellite",label:__("Satellite","jetpack"),preview:"mapkit"===p?l:c},{name:"terrain",label:__("Terrain","jetpack"),preview:u}];n.d(t,["A",0,h])},44950(e,t,n){"use strict";const r=e=>{if(e?.mapStyle&&["terrain"].includes(e.mapStyle))return"mapbox";const t=function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()}("map_provider");return t||(window&&"string"==typeof window.Jetpack_Maps?.provider&&["mapbox","mapkit"].includes(window.Jetpack_Maps?.provider)?window.Jetpack_Maps?.provider:"mapbox")};n.d(t,["A",0,r])},91844(e,t,n){"use strict";const r=(e,t=null)=>{if(t)e.style.height=t+"px";else{const t=e.offsetWidth,n=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,r=Math.min(t*(3/4),n);e.style.height=r+"px"}};n.d(t,["A",0,r])},80178(e,t,n){"use strict";var r=n(13022),o=n(10790);const s=({className:e,label:t,isPressed:n,onClick:s})=>{const i=(0,r.A)(e,"components-button components-tab-button",{"is-pressed":n});return(0,o.jsx)("button",{className:i,onClick:s,children:(0,o.jsx)("span",{children:t})})};n.d(t,["A",0,s])},30068(e,t,n){"use strict";var r=n(94715),o=n(29491),s=n(47143),i=n(86087),a=n(27723),c=n(80178),l=n(51497),u=n(10790);const __=a.__,d="editor",p="preview",h=(0,o.compose)([(0,s.withSelect)(e=>({currentBlockId:e("core/block-editor").getSelectedBlockClientId()})),(0,s.withDispatch)((e,{currentBlockId:t})=>({removeBlock:()=>e("core/block-editor").removeBlocks(t)}))])(({attributes:e,setAttributes:t,isSelected:n,removeBlock:o})=>{const{source:s}=e,a=!s||""===s.trim(),h=(0,r.useBlockProps)(),{className:m}=h,[g,f]=(0,i.useState)(d),b=(0,i.useRef)(null),v=e=>t({source:e}),y=e=>{8===e.keyCode&&""===s&&(o(),e.preventDefault())};let k;return(0,i.useEffect)(()=>{n?g===d&&b?.current.focus():g===p&&f(d)},[n,g,f]),k=!n&&a?(0,u.jsx)("p",{className:`${m}__placeholder`,children:__("Write your _Markdown_ **here**…","jetpack")}):(0,u.jsxs)("div",{className:m,children:[(0,u.jsx)(r.BlockControls,{children:(0,u.jsxs)("div",{className:"components-toolbar",children:[(0,u.jsx)(c.A,{className:m,label:__("Markdown","jetpack"),isPressed:g===d,onClick:()=>f(d)}),(0,u.jsx)(c.A,{className:m,label:__("Preview","jetpack"),isPressed:g===p,onClick:()=>f(p)})]})}),g!==p&&n?(0,u.jsx)(r.PlainText,{className:`${m}__editor`,onChange:v,onKeyDown:y,"aria-label":__("Markdown","jetpack"),ref:b,value:s}):(0,u.jsx)(l.A,{className:`${m}__preview`,source:s})]}),(0,u.jsx)("div",{...h,children:k})});n.d(t,["A",0,h])},57809(e,t,n){"use strict";var r=n(94375),o=n(73431),s=n(30068),i=n(19235);n(1982);(0,r.M)(o,{edit:s.A,save:i.A})},51497(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(27723),i=n(97158),a=n(20305),c=n.n(a),l=n(10790);const __=s.__,u=new i.A({typographer:!0}).use(c()),d=e=>{if("A"===e.target.nodeName){window.confirm(__("Are you sure you wish to leave this page?","jetpack"))||e.preventDefault()}},p=(e={})=>{const t=(0,r.__experimentalGetSpacingClassesAndStyles)?.(e);return t?.style?t.style:{}},h=({className:e,source:t="",attributes:n})=>(0,l.jsx)(o.RawHTML,{className:e,onClick:d,style:p(n),children:t.length?u.render(t):""});n.dn(h),n.d(t,["A",0,h])},19235(e,t,n){"use strict";var r=n(94715),o=n(51497),s=n(10790);const i=({attributes:e})=>{const t=r.useBlockProps.save();return(0,s.jsx)(o.A,{...t,source:e.source,attributes:e})};n.dn(i),n.d(t,["A",0,i])},18658(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(27723),i=n(10790);const __=s.__,_x=s._x,a=e=>{const{defaultClassName:t,nextdoorShareUrl:n,onFormSubmit:r,setNextdoorShareUrl:s}=e;return(0,i.jsx)(o.PanelBody,{title:__("Embed URL","jetpack"),initialOpen:!0,children:(0,i.jsxs)("form",{onSubmit:r,className:`${t}-embed-form-sidebar`,children:[(0,i.jsx)("input",{type:"text",id:"nextdoorShareUrl",onChange:e=>s(e.target.value),placeholder:__("Nextdoor post URL","jetpack"),value:n||"",className:"components-placeholder__input"}),(0,i.jsx)("div",{children:(0,i.jsx)(o.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]})})},c=e=>(0,i.jsx)(r.InspectorControls,{children:(0,i.jsx)(a,{...e})});n.d(t,["A",0,c])},57796(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(74997),i=n(56427),a=n(86087),c=n(27723),l=(n(92610),n(66087)),u=n(78218),d=n(17195),p=n(18658),h=n(52755),m=n(10790);const __=c.__,_x=c._x,g=(0,r.sh)(d);const f=({defaultClassName:e,iframeUrl:t,clientId:n})=>{const r=`\n\t\t<script>\n\t\t\twindow.addEventListener( 'message', function ( event ) {\n\t\t\t\tif ( ! event.origin.startsWith( 'https://nextdoor' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar iframe = document.getElementById( 'nextdoor-embed-${n}' );\n\t\t\t\tif ( event.source !== iframe.contentWindow ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tiframe.setAttribute( 'height', event.data.height );\n\t\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\t\t\t\twindow.parent.postMessage( { action: 'resize', width: clientBoundingRect.width, height: clientBoundingRect.height }, '*' );\n\t\t\t} );\n\t\t<\/script>\n\t\t<iframe id="nextdoor-embed-${n}" width="100%" height="200" frameBorder="0" src="${t}" title="${__("Nextdoor","jetpack")}" />\n\t\t`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:`${e}-overlay`}),(0,m.jsx)(i.SandBox,{html:r})]})},b=(0,i.withNotices)(function({attributes:e,clientId:t,name:n,noticeOperations:r,noticeUI:c,setAttributes:b}){const v=(0,o.useBlockProps)(),y=(0,s.getBlockDefaultClassName)(n),k=(0,u.y)(d.attributes,e);(0,l.isEqual)(k,e)||b(k);const{url:w}=k,[x,_]=(0,a.useState)(w?(0,h.Dl)(w):null),[j,C]=(0,a.useState)(x),A=()=>{r.removeAllNotices(),r.createErrorNotice(__("Your Nextdoor post couldn't be embedded. Please double check the URL or code.","jetpack"))},S=e=>{if(!e)return _(null),void A();if(e.preventDefault(),!j)return _(null),void A();const t=(0,h.Dl)(j);if(!t)return _(null),void A();_(t),b({url:t})},E=(0,m.jsx)(i.Placeholder,{label:__("Nextdoor","jetpack"),instructions:__("Enter the URL of your Nextdoor post to share below.","jetpack"),icon:g,notices:c,children:(0,m.jsxs)("form",{onSubmit:S,children:[(0,m.jsx)("input",{type:"text",id:"nextdoorShareUrl",onChange:e=>C(e.target.value),placeholder:__("Nextdoor post URL","jetpack"),value:j||"",className:"components-placeholder__input"}),(0,m.jsx)("div",{children:(0,m.jsx)(i.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]})});return(0,m.jsxs)("div",{...v,children:[(0,m.jsx)(p.A,{defaultClassName:y,nextdoorShareUrl:j,onFormSubmit:S,setNextdoorShareUrl:C}),x?(0,m.jsx)(f,{defaultClassName:y,iframeUrl:x,clientId:t}):E]})});n.d(t,["A",0,b])},3361(e,t,n){"use strict";n(92610);var r=n(74997),o=n(94375),s=n(17195),i=n(57796),a=n(95571),c=n(52755);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&c.QL.test(e.textContent),transform:e=>{const t=(0,c.Dl)(e.textContent);return(0,r.createBlock)("jetpack/nextdoor",{url:t})}}]}})},95571(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},52755(e,t,n){"use strict";const r=/(^|\.)nextdoor\.[a-z]{2,3}(\.[a-z]{2})?$/i,o=/([^/]+$)/,s=e=>{let t;try{t=new URL(0===e.indexOf("https")?e:"https://"+e)}catch{return}if("https:"!==t.protocol||!r.test(t.host))return;const n=t.pathname.match(o);return n?t.origin+"/embed/"+n[1]:void 0};n.d(t,["Dl",0,e=>{if(e)return s(e)},"QL",0,/(^|\/\/|www\.)(nextdoor\.[^"']*)/i])},39103(e,t,n){"use strict";var r=n(79018),o=n(10790);const s={attributes:r.attributes,supports:{align:!0,html:!1},save:({attributes:{rid:e}})=>(0,o.jsx)(o.Fragment,{children:e.map(e=>(0,o.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},e))})};n.d(t,["A",0,s])},50260(e,t,n){"use strict";var r=n(79018),o=n(10790);const s={attributes:r.attributes,migrate:e=>{const{style:t,className:n}=e,r="standard"===t?"":`is-style-${t}`;return{...e,className:n?`${n} ${r}`:r}},isEligible:({style:e,className:t})=>!(!e||"standard"===e)&&(!t||-1===t.indexOf("is-style-")),save:({attributes:{rid:e}})=>(0,o.jsx)("div",{children:e.map(e=>(0,o.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},e))})};n.d(t,["A",0,s])},64627(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(74997),a=n(56427),c=n(86087),l=n(27723),u=n(57273),d=n(13022),p=n(66087),h=n(90907),m=n(78218),g=n(79018),f=n(82101),b=n(74739),v=n(50387),y=n(59038),k=n(84260),w=(n(79935),n(10790));const __=l.__,x=(0,o.sh)(g);const _=(0,a.withNotices)(function({attributes:e,clientId:t,isSelected:n,name:o,noticeOperations:_,noticeUI:j,setAttributes:C}){const A=(0,s.useBlockProps)(),S=(0,i.getBlockDefaultClassName)(o),E=(0,m.y)(g.attributes,e);(0,p.isEqual)(E,e)||C(E);const{align:T,rid:N,iframe:P,domain:B,lang:M,newtab:I,negativeMargin:R}=e,L=(0,p.isEmpty)(N),D=(0,h.D)((0,v.Iy)(),e.className),F=(0,h.D)((0,v.Iy)(N),e.className),O=(0,y.A)(F),z=(0,p.isEqual)(N,["1"]);(0,c.useEffect)(()=>{if(_.removeAllNotices(),!L&&!z&&"wide"===F&&"wide"!==T&&"full"!==T){const e=(0,w.jsx)(w.Fragment,{children:__('With the OpenTable block you may encounter display issues if you use its "wide" style with anything other than "wide" or "full" alignment. The wide display style may also not work well on smaller screens.',"jetpack")});_.createNotice({status:"warning",content:e})}},[z,T,L,N,F]),(0,c.useEffect)(()=>{"button"===D&&Array.isArray(N)&&N?.length>1&&C({className:"",style:""})},[N,D,C]),(0,c.useEffect)(()=>{n&&(Array.isArray(N)&&N?.length>1?(0,i.unregisterBlockStyle)("jetpack/opentable",["button"]):(0,i.registerBlockStyle)("jetpack/opentable",v.i9))},[n,N]),(0,c.useEffect)(()=>{"wide"===O&&"wide"===T&&C({align:""}),"wide"===F&&O&&F!==O&&C({align:"wide"}),C({style:F})},[T,F,O,C]);const U=(0,v.K5)(N),H=e=>N?.length>1?["multi","button"!==e?e:"standard"]:["button"===e?"button":"standard","button"===e?"standard":e],$=e=>{Array.isArray(e)?C({rid:e,style:e.length>1&&"button"===F?"standard":F}):(e=>{const t=(0,k.a9)(e);t||(_.removeAllNotices(),_.createErrorNotice((0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("strong",{children:__("We ran into an issue","jetpack")}),(0,w.jsx)("br",{}),__("Please ensure this embed matches the one from your OpenTable account","jetpack")]})));const n=(0,m.y)(g.attributes,t);C(n),_.removeAllNotices()})(e)},V=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s.InspectorAdvancedControls,{children:[(0,w.jsx)(a.ToggleControl,{label:__("Load the widget in an iFrame (Recommended)","jetpack"),checked:P,onChange:()=>C({iframe:!P}),className:"is-opentable",__nextHasNoMarginBottom:!0}),"button"===F&&(0,w.jsx)(a.ToggleControl,{label:__("Remove button margin","jetpack"),checked:R,onChange:()=>C({negativeMargin:!R}),__nextHasNoMarginBottom:!0})]}),(0,w.jsx)(s.InspectorControls,{children:(0,w.jsxs)(a.PanelBody,{title:__("Settings","jetpack"),children:[(0,w.jsx)(b.A,{rids:N,onChange:$}),(0,w.jsx)(a.SelectControl,{label:__("Language","jetpack"),value:M,onChange:e=>C({lang:e}),options:f.P,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,w.jsx)(a.ToggleControl,{label:__("Open in a new window","jetpack"),checked:I,onChange:()=>C({newtab:!I}),__nextHasNoMarginBottom:!0})]})})]}),q=(0,r.isWpcomPlatformSite)()?"https://en.support.wordpress.com/wordpress-editor/blocks/opentable-block/":"https://jetpack.com/support/jetpack-blocks/opentable-block/",G=(0,w.jsxs)(a.Placeholder,{label:__("OpenTable Reservation","jetpack"),icon:x,instructions:__("Enter your restaurants IDs, separated by comma, or paste an OpenTable Reservation Widget embed code.","jetpack"),notices:j,children:[(0,w.jsx)(b.A,{rids:N,onSubmit:$}),(0,w.jsxs)("div",{className:`${S}-placeholder-links`,children:[(0,w.jsx)(u.N,{openInNewTab:!0,href:"https://restaurant.opentable.com/get-started/",children:__("Sign up for OpenTable","jetpack")}),(0,w.jsx)(u.N,{openInNewTab:!0,href:q,children:__("Learn more","jetpack")})]})]}),W=(0,d.A)({[`is-style-${F}`]:!L&&U.includes(F),"is-placeholder":L,"is-multi":"multi"===H(F)[0],[`align${T}`]:T,"has-no-margin":R});return(0,w.jsxs)("div",{...A,children:[j,(0,w.jsxs)("div",{className:W,children:[!L&&V,L?G:(e=>{const[n,r]=H(e||F);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:`${S}-overlay`}),(0,w.jsx)("iframe",{title:(0,l.sprintf)(/* translators: %s: a unique ID. */
81 +_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:n,instanceId:o,completer:s}=this.props,{selectedIndex:i,filteredOptions:a}=this.state,{key:l=""}=a[i]||{},{className:d}=s,p=a.length>0,h=p?`components-autocomplete-listbox-${o}`:null,m=p?`components-autocomplete-item-${o}-${l}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[n({isExpanded:p,listBoxId:h,activeId:m,onChange:e,onKeyDown:t}),p&&(0,u.jsx)(r.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:h,role:"listbox",className:"components-autocomplete__results",children:a.map((e,t)=>(0,u.jsx)(r.Button,{id:`components-autocomplete-item-${o}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:(0,c.A)("components-autocomplete__result",d,{"is-selected":t===i}),onClick:()=>this.select(e),children:e.label},e.key))})})]})}}const h=(0,o.compose)([r.withSpokenMessages,o.withInstanceId,r.withFocusOutside])(p);n.d(t,["A",0,h])},82063(e,t,n){"use strict";function r(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"]}n.d(t,{o:()=>r})},16815(e,t,n){"use strict";n.d(t,{BY:()=>i,ES:()=>r,_t:()=>o,iU:()=>s});function r(e,t){const n=new e.LngLatBounds;return t.forEach(e=>{n.extend([e.coordinates.longitude,e.coordinates.latitude])}),n}function o(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}function s(e,t){e.innerHTML='\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg">\n\t\t\t<path d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z"/>\n\t\t</svg>\n\t',e.querySelector("path").setAttribute("fill",CSS.supports("color",t)?t:"red")}function i(e){return new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}n.d(t,["jF",0,e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0}])},42470(e,t,n){"use strict";n.d(t,{IR:()=>u,K5:()=>c,Sm:()=>i,Yc:()=>l,c6:()=>s,nQ:()=>a});var r=n(34377);function o(e){return Math.abs(6371e3*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function s(e,t){return 512/Math.pow(2,e)*.5*o(t)}function i(e,t){const n=e/o(t);return Math.log2(512/(n/.5))}function a(e,t){if(0===t.length)return null;const n=new e.Coordinate(-90,180),r=new e.Coordinate(90,-180);t.forEach(e=>{n.latitude=Math.max(n.latitude,e.coordinates.latitude),n.longitude=Math.min(n.longitude,e.coordinates.longitude),r.latitude=Math.min(r.latitude,e.coordinates.latitude),r.longitude=Math.max(r.longitude,e.coordinates.longitude)});const o=new e.Coordinate(n.latitude-.5*(n.latitude-r.latitude),n.longitude+.5*(r.longitude-n.longitude)),s=new e.CoordinateSpan(1.3*Math.abs(n.latitude-r.latitude),1.3*Math.abs(r.longitude-n.longitude));return new e.CoordinateRegion(o,s)}function c(e,t){return()=>{const n=e.createElement("div");return n.classList.add("mapkit-popup-content"),t(n),n}}function l(e,t){return new Promise(n=>{if(t.mapkitScriptIsLoading)(0,r.Cu)(t,"mapkit").then(e=>{n(e)});else{t.mapkitScriptIsLoading=!0;const o=e.createElement("script");o.addEventListener("load",async()=>{const e=await(0,r.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,n(e)},{once:!0}),o.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",o.crossOrigin="anonymous",e.head.appendChild(o)}})}function u(e,t,n){return new Promise((t,r)=>{n.mapkitIsInitialized?t():n.mapkitIsInitializing?function(e){return new Promise((t,n)=>{const r=()=>{void 0===e.mapkitIsInitializing?n():!1===e.mapkitIsInitializing?t():e.requestAnimationFrame(r)};r()})}(n).then(()=>{t()}):(n.mapkitIsInitializing=!0,n.mapkitIsInitialized=!1,e.init({authorizationCallback:async e=>{try{const o=await fetch("https://public-api.wordpress.com/wpcom/v2/mapkit");if(200===o.status){e((await o.json()).wpcom_mapkit_access_token)}else r();n.mapkitIsInitializing=!1,n.mapkitIsInitialized=!0,t()}catch{r()}}}))})}},39698(e,t,n){"use strict";var r=n(86087),o=n(10790);const s=(0,r.createContext)({map:null,mapkit:null,loaded:!1,activeMarker:null,calloutReference:null,currentDoc:null,currentWindow:null,admin:!1,setPoints:()=>{},points:[],previousCenter:null});n.d(t,["C",0,s,"u",0,({value:e,children:t})=>{const[n,i]=(0,r.useState)(null),[a,c]=(0,r.useState)(null),[l,u]=(0,r.useState)(null);return(0,o.jsx)(s.Provider,{value:{...e,activeMarker:n,setActiveMarker:i,calloutReference:a,setCalloutReference:c,previousCenter:l,setPreviousCenter:u},children:t})}])},5389(e,t,n){"use strict";var r=n(39384),o=n(47143),s=n(86087),i=n(27723),a=n(66087),c=n(34377),l=n(42470),u=n(39698);const __=i.__,d=()=>(0,s.useContext)(u.C);n.d(t,["$H",0,(e,t,n=null,r=null)=>{const{mapkit:o,map:i,loaded:a,currentWindow:c}=d(),l=(0,s.useRef)(n),u=(0,s.useRef)(r);(0,s.useEffect)(()=>{if(a){i.annotations.filter(t=>!e.find(e=>e.id===t.data.id)).forEach(e=>i.removeAnnotation(e));const n=e.map(e=>{const n=i.annotations.find(t=>t.data.id===e.id);if(n)return n.title=e.title,n.color=t,n;const r=new o.MarkerAnnotation(new o.Coordinate(e.coordinates.latitude,e.coordinates.longitude),{color:t,data:{id:e.id}});return r.calloutEnabled=!0,r.title=e.title,l.current&&(r.callout={calloutElementForAnnotation:l.current}),u.current&&r.addEventListener("select",()=>u.current(e,i)),r});i.annotations.length!==n.length&&i.showItems(new c.Array(...n))}},[e,a,i,o,t,l,u,c])},"FN",0,(e,t)=>{const{mapkit:n,map:r}=d(),o=(0,s.useRef)(e),i=(0,s.useRef)(t);(0,s.useEffect)(()=>{if(!n||!r||!o.current)return;const e=o.current?.lat??o.current?.latitude,t=o.current?.lng??o.current?.longitude;"number"==typeof e&&"number"==typeof t&&(r.center=new n.Coordinate(e,t))},[n,r,o]),(0,s.useEffect)(()=>{if(!n||!r)return;const e=()=>{if(r.center){const{latitude:e,longitude:t}=r.center;i.current({lat:e,lng:t})}};return r.addEventListener("region-change-end",(0,a.debounce)(e,1e3)),()=>{r.removeEventListener("region-change-end",e)}},[n,r,i])},"I3",0,(e,t,n)=>{const[r,o]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t&&o(new e.Map(n.current,{showsMapTypeControl:!1}))},[e,t,n]),{map:r}},"LR",0,(e,t)=>{const{mapkit:n,map:r,points:o}=d();(0,s.useEffect)(()=>{if(n&&r)if(o&&o.length<=1){const t=(0,l.c6)(13,r.center.latitude);if(e){const t=(0,l.c6)(e,r.center.latitude);t!==r.cameraDistance&&(r.cameraDistance=t)}else t!==r.cameraDistance&&(r.cameraDistance=t);r.isZoomEnabled=!0,r.isScrollEnabled=!0}else r.region=(0,l.nQ)(n,o),r.isZoomEnabled=!1,r.isScrollEnabled=!1},[n,r,e,o]),(0,s.useEffect)(()=>{const e=()=>{t((0,l.Sm)(r.cameraDistance,r.center.latitude))};return r.addEventListener("zoom-end",e),()=>{r.removeEventListener("zoom-end",e)}},[n,r,t])},"PC",0,e=>{const[t,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(!1),[u,d]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[m,g]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=(0,o.select)(r.CONNECTION_STORE_ID).getBlogId(),{currentDoc:s,currentWindow:i}=(0,c.sG)(e.current);if(e.current){h(i),g(s);const e=__("Failed to retrieve a Mapkit API token. Please try refreshing.","jetpack");i.mapkit?(d(i.mapkit),(0,l.IR)(i.mapkit,t,i).then(()=>{n(!0)},()=>{a(e)})):(0,l.Yc)(s,i).then(r=>{d(r),(0,l.IR)(r,t,i).then(()=>{n(!0)},()=>{a(e)})})}},[e]),{loaded:t,error:i,mapkit:u,currentDoc:m,currentWindow:p}},"ST",0,d,"bY",0,e=>{const{map:t,loaded:n}=d(),r=(0,s.useRef)(e);(0,s.useEffect)(()=>{n&&r.current(t)},[n,t,r])},"mA",0,(e,t)=>{const{mapkit:n,map:r}=d();(0,s.useEffect)(()=>{if(n&&r&&e?.length){(new n.Geocoder).lookup(e,(e,n)=>{if(n?.results?.length){const e=n.results[0],r=e.formattedAddress,o={placeTitle:r,title:r,caption:r,coordinates:{longitude:e.coordinate.longitude,latitude:e.coordinate.latitude},id:`${r} ${Number(e.coordinate.latitude).toFixed(2)} ${Number(e.coordinate.longitude).toFixed(2)}`};t.current([o])}})}},[n,r,e,t])},"wB",0,e=>{const{map:t,previousCenter:n,loaded:r}=d(),o=(0,s.useRef)(e);(0,s.useEffect)(()=>{r&&t.addEventListener("single-tap",()=>{o.current(n)})},[r,t,n,o])},"y7",0,e=>{const{mapkit:t,map:n}=d();(0,s.useEffect)(()=>{t&&n&&(n.mapType=(()=>{switch(e){case"satellite":return t.Map.MapTypes.Satellite;case"black_and_white":return t.Map.MapTypes.MutedStandard;case"hybrid":return t.Map.MapTypes.Hybrid;default:return t.Map.MapTypes.Standard}})())},[t,n,e])}])},20974(e,t,n){"use strict";var r=n(94715),o=n(13022),s=n(90907),i=n(62393),a=n(10790);const c=({attributes:e})=>{const{align:t,mapDetails:n,points:c,zoom:l,mapCenter:u,markerColor:d,scrollToZoom:p,mapHeight:h,showFullscreenButton:m}=e,g=r.useBlockProps.save(),{className:f}=g,b=(0,s.D)(i.A,f),v=c.map((e,t)=>{const{longitude:n,latitude:r}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+r+","+n;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:o,children:e.title})},t)});return(0,a.jsx)("div",{...g,className:(0,o.A)(f,t?`align${t}`:null),"data-map-style":b,"data-map-details":n,"data-points":JSON.stringify(c),"data-zoom":l,"data-map-center":JSON.stringify(u),"data-marker-color":d,"data-scroll-to-zoom":p||null,"data-map-height":h||null,"data-show-fullscreen-button":m||null,children:c.length>0&&(0,a.jsx)("ul",{children:v})})};n.d(t,["A",0,c])},62393(e,t,n){"use strict";var r=n(27723),o=n(93797),s=n(49364),i=n(77971),a=n(98430),c=n(27415),l=n(72386),u=n(92747),d=n(44950);const __=r.__,p=(0,d.A)(),h=[{name:"default",label:__("Basic","jetpack"),preview:"mapkit"===p?a:i,isDefault:!0},{name:"black_and_white",label:"mapkit"===p?__("Muted","jetpack",0):__("Black & White","jetpack"),preview:"mapkit"===p?s:o},{name:"satellite",label:__("Satellite","jetpack"),preview:"mapkit"===p?l:c},{name:"terrain",label:__("Terrain","jetpack"),preview:u}];n.d(t,["A",0,h])},44950(e,t,n){"use strict";const r=e=>{if(e?.mapStyle&&["terrain"].includes(e.mapStyle))return"mapbox";const t=function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()}("map_provider");return t||(window&&"string"==typeof window.Jetpack_Maps?.provider&&["mapbox","mapkit"].includes(window.Jetpack_Maps?.provider)?window.Jetpack_Maps?.provider:"mapbox")};n.d(t,["A",0,r])},91844(e,t,n){"use strict";const r=(e,t=null)=>{if(t)e.style.height=t+"px";else{const t=e.offsetWidth,n=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,r=Math.min(t*(3/4),n);e.style.height=r+"px"}};n.d(t,["A",0,r])},80178(e,t,n){"use strict";var r=n(13022),o=n(10790);const s=({className:e,label:t,isPressed:n,onClick:s})=>{const i=(0,r.A)(e,"components-button components-tab-button",{"is-pressed":n});return(0,o.jsx)("button",{className:i,onClick:s,children:(0,o.jsx)("span",{children:t})})};n.d(t,["A",0,s])},30068(e,t,n){"use strict";var r=n(94715),o=n(29491),s=n(47143),i=n(86087),a=n(27723),c=n(80178),l=n(51497),u=n(10790);const __=a.__,d="editor",p="preview",h=(0,o.compose)([(0,s.withSelect)(e=>({currentBlockId:e("core/block-editor").getSelectedBlockClientId()})),(0,s.withDispatch)((e,{currentBlockId:t})=>({removeBlock:()=>e("core/block-editor").removeBlocks(t)}))])(({attributes:e,setAttributes:t,isSelected:n,removeBlock:o})=>{const{source:s}=e,a=!s||""===s.trim(),h=(0,r.useBlockProps)(),{className:m}=h,[g,f]=(0,i.useState)(d),b=(0,i.useRef)(null),v=e=>t({source:e}),y=e=>{8===e.keyCode&&""===s&&(o(),e.preventDefault())};let k;return(0,i.useEffect)(()=>{n?g===d&&b?.current.focus():g===p&&f(d)},[n,g,f]),k=!n&&a?(0,u.jsx)("p",{className:`${m}__placeholder`,children:__("Write your _Markdown_ **here**…","jetpack")}):(0,u.jsxs)("div",{className:m,children:[(0,u.jsx)(r.BlockControls,{children:(0,u.jsxs)("div",{className:"components-toolbar",children:[(0,u.jsx)(c.A,{className:m,label:__("Markdown","jetpack"),isPressed:g===d,onClick:()=>f(d)}),(0,u.jsx)(c.A,{className:m,label:__("Preview","jetpack"),isPressed:g===p,onClick:()=>f(p)})]})}),g!==p&&n?(0,u.jsx)(r.PlainText,{className:`${m}__editor`,onChange:v,onKeyDown:y,"aria-label":__("Markdown","jetpack"),ref:b,value:s}):(0,u.jsx)(l.A,{className:`${m}__preview`,source:s})]}),(0,u.jsx)("div",{...h,children:k})});n.d(t,["A",0,h])},57809(e,t,n){"use strict";var r=n(94375),o=n(73431),s=n(30068),i=n(19235);n(1982);(0,r.M)(o,{edit:s.A,save:i.A})},51497(e,t,n){"use strict";var r=n(94715),o=n(86087),s=n(27723),i=n(97158),a=n(20305),c=n.n(a),l=n(10790);const __=s.__,u=new i.A({typographer:!0}).use(c()),d=e=>{if("A"===e.target.nodeName){window.confirm(__("Are you sure you wish to leave this page?","jetpack"))||e.preventDefault()}},p=(e={})=>{const t=(0,r.__experimentalGetSpacingClassesAndStyles)?.(e);return t?.style?t.style:{}},h=({className:e,source:t="",attributes:n})=>(0,l.jsx)(o.RawHTML,{className:e,onClick:d,style:p(n),children:t.length?u.render(t):""});n.dn(h),n.d(t,["A",0,h])},19235(e,t,n){"use strict";var r=n(94715),o=n(51497),s=n(10790);const i=({attributes:e})=>{const t=r.useBlockProps.save();return(0,s.jsx)(o.A,{...t,source:e.source,attributes:e})};n.dn(i),n.d(t,["A",0,i])},18658(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(27723),i=n(10790);const __=s.__,_x=s._x,a=e=>{const{defaultClassName:t,nextdoorShareUrl:n,onFormSubmit:r,setNextdoorShareUrl:s}=e;return(0,i.jsx)(o.PanelBody,{title:__("Embed URL","jetpack"),initialOpen:!0,children:(0,i.jsxs)("form",{onSubmit:r,className:`${t}-embed-form-sidebar`,children:[(0,i.jsx)("input",{type:"text",id:"nextdoorShareUrl",onChange:e=>s(e.target.value),placeholder:__("Nextdoor post URL","jetpack"),value:n||"",className:"components-placeholder__input"}),(0,i.jsx)("div",{children:(0,i.jsx)(o.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]})})},c=e=>(0,i.jsx)(r.InspectorControls,{children:(0,i.jsx)(a,{...e})});n.d(t,["A",0,c])},57796(e,t,n){"use strict";var r=n(85985),o=n(94715),s=n(74997),i=n(56427),a=n(86087),c=n(27723),l=(n(92610),n(66087)),u=n(78218),d=n(17195),p=n(18658),h=n(52755),m=n(10790);const __=c.__,_x=c._x,g=(0,r.sh)(d);const f=({defaultClassName:e,iframeUrl:t,clientId:n})=>{const r=`\n\t\t<script>\n\t\t\twindow.addEventListener( 'message', function ( event ) {\n\t\t\t\tif ( ! event.origin.startsWith( 'https://nextdoor' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar iframe = document.getElementById( 'nextdoor-embed-${n}' );\n\t\t\t\tif ( event.source !== iframe.contentWindow ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tiframe.setAttribute( 'height', event.data.height );\n\t\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\t\t\t\twindow.parent.postMessage( { action: 'resize', width: clientBoundingRect.width, height: clientBoundingRect.height }, '*' );\n\t\t\t} );\n\t\t<\/script>\n\t\t<iframe id="nextdoor-embed-${n}" width="100%" height="200" frameBorder="0" src="${t}" title="${__("Nextdoor","jetpack")}" />\n\t\t`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:`${e}-overlay`}),(0,m.jsx)(i.SandBox,{html:r})]})},b=(0,i.withNotices)(function({attributes:e,clientId:t,name:n,noticeOperations:r,noticeUI:c,setAttributes:b}){const v=(0,o.useBlockProps)(),y=(0,s.getBlockDefaultClassName)(n),k=(0,u.y)(d.attributes,e);(0,l.isEqual)(k,e)||b(k);const{url:w}=k,[x,_]=(0,a.useState)(w?(0,h.Dl)(w):null),[j,C]=(0,a.useState)(x),A=()=>{r.removeAllNotices(),r.createErrorNotice(__("Your Nextdoor post couldn't be embedded. Please double check the URL or code.","jetpack"))},S=e=>{if(!e)return _(null),void A();if(e.preventDefault(),!j)return _(null),void A();const t=(0,h.Dl)(j);if(!t)return _(null),void A();_(t),b({url:t})},E=(0,m.jsx)(i.Placeholder,{label:__("Nextdoor","jetpack"),instructions:__("Enter the URL of your Nextdoor post to share below.","jetpack"),icon:g,notices:c,children:(0,m.jsxs)("form",{onSubmit:S,children:[(0,m.jsx)("input",{type:"text",id:"nextdoorShareUrl",onChange:e=>C(e.target.value),placeholder:__("Nextdoor post URL","jetpack"),value:j||"",className:"components-placeholder__input"}),(0,m.jsx)("div",{children:(0,m.jsx)(i.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})})]})});return(0,m.jsxs)("div",{...v,children:[(0,m.jsx)(p.A,{defaultClassName:y,nextdoorShareUrl:j,onFormSubmit:S,setNextdoorShareUrl:C}),x?(0,m.jsx)(f,{defaultClassName:y,iframeUrl:x,clientId:t}):E]})});n.d(t,["A",0,b])},3361(e,t,n){"use strict";n(92610);var r=n(74997),o=n(94375),s=n(17195),i=n(57796),a=n(95571),c=n(52755);(0,o.M)(s,{edit:i.A,save:a.A,transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&c.QL.test(e.textContent),transform:e=>{const t=(0,c.Dl)(e.textContent);return(0,r.createBlock)("jetpack/nextdoor",{url:t})}}]}})},95571(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s(){const e=r.useBlockProps.save();return(0,o.jsx)("div",{...e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},52755(e,t,n){"use strict";const r=/(^|\/\/|www\.)(nextdoor\.[^"']*)/i,o=/([^/]+$)/,s=e=>{let t;t=0===e.indexOf("https")?new URL(e):new URL("https:"+e);const n=t.pathname.match(o);if(n)return t.origin+"/embed/"+n[1]};n.d(t,["Dl",0,e=>{if(!e||!e.match(r))return;const t=s(e);return t||void 0},"QL",0,r])},39103(e,t,n){"use strict";var r=n(79018),o=n(10790);const s={attributes:r.attributes,supports:{align:!0,html:!1},save:({attributes:{rid:e}})=>(0,o.jsx)(o.Fragment,{children:e.map(e=>(0,o.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},e))})};n.d(t,["A",0,s])},50260(e,t,n){"use strict";var r=n(79018),o=n(10790);const s={attributes:r.attributes,migrate:e=>{const{style:t,className:n}=e,r="standard"===t?"":`is-style-${t}`;return{...e,className:n?`${n} ${r}`:r}},isEligible:({style:e,className:t})=>!(!e||"standard"===e)&&(!t||-1===t.indexOf("is-style-")),save:({attributes:{rid:e}})=>(0,o.jsx)("div",{children:e.map(e=>(0,o.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},e))})};n.d(t,["A",0,s])},64627(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(74997),a=n(56427),c=n(86087),l=n(27723),u=n(57273),d=n(13022),p=n(66087),h=n(90907),m=n(78218),g=n(79018),f=n(82101),b=n(74739),v=n(50387),y=n(59038),k=n(84260),w=(n(79935),n(10790));const __=l.__,x=(0,o.sh)(g);const _=(0,a.withNotices)(function({attributes:e,clientId:t,isSelected:n,name:o,noticeOperations:_,noticeUI:j,setAttributes:C}){const A=(0,s.useBlockProps)(),S=(0,i.getBlockDefaultClassName)(o),E=(0,m.y)(g.attributes,e);(0,p.isEqual)(E,e)||C(E);const{align:T,rid:N,iframe:P,domain:B,lang:M,newtab:I,negativeMargin:R}=e,L=(0,p.isEmpty)(N),D=(0,h.D)((0,v.Iy)(),e.className),F=(0,h.D)((0,v.Iy)(N),e.className),O=(0,y.A)(F),z=(0,p.isEqual)(N,["1"]);(0,c.useEffect)(()=>{if(_.removeAllNotices(),!L&&!z&&"wide"===F&&"wide"!==T&&"full"!==T){const e=(0,w.jsx)(w.Fragment,{children:__('With the OpenTable block you may encounter display issues if you use its "wide" style with anything other than "wide" or "full" alignment. The wide display style may also not work well on smaller screens.',"jetpack")});_.createNotice({status:"warning",content:e})}},[z,T,L,N,F]),(0,c.useEffect)(()=>{"button"===D&&Array.isArray(N)&&N?.length>1&&C({className:"",style:""})},[N,D,C]),(0,c.useEffect)(()=>{n&&(Array.isArray(N)&&N?.length>1?(0,i.unregisterBlockStyle)("jetpack/opentable",["button"]):(0,i.registerBlockStyle)("jetpack/opentable",v.i9))},[n,N]),(0,c.useEffect)(()=>{"wide"===O&&"wide"===T&&C({align:""}),"wide"===F&&O&&F!==O&&C({align:"wide"}),C({style:F})},[T,F,O,C]);const U=(0,v.K5)(N),H=e=>N?.length>1?["multi","button"!==e?e:"standard"]:["button"===e?"button":"standard","button"===e?"standard":e],$=e=>{Array.isArray(e)?C({rid:e,style:e.length>1&&"button"===F?"standard":F}):(e=>{const t=(0,k.a9)(e);t||(_.removeAllNotices(),_.createErrorNotice((0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("strong",{children:__("We ran into an issue","jetpack")}),(0,w.jsx)("br",{}),__("Please ensure this embed matches the one from your OpenTable account","jetpack")]})));const n=(0,m.y)(g.attributes,t);C(n),_.removeAllNotices()})(e)},V=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s.InspectorAdvancedControls,{children:[(0,w.jsx)(a.ToggleControl,{label:__("Load the widget in an iFrame (Recommended)","jetpack"),checked:P,onChange:()=>C({iframe:!P}),className:"is-opentable",__nextHasNoMarginBottom:!0}),"button"===F&&(0,w.jsx)(a.ToggleControl,{label:__("Remove button margin","jetpack"),checked:R,onChange:()=>C({negativeMargin:!R}),__nextHasNoMarginBottom:!0})]}),(0,w.jsx)(s.InspectorControls,{children:(0,w.jsxs)(a.PanelBody,{title:__("Settings","jetpack"),children:[(0,w.jsx)(b.A,{rids:N,onChange:$}),(0,w.jsx)(a.SelectControl,{label:__("Language","jetpack"),value:M,onChange:e=>C({lang:e}),options:f.P,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,w.jsx)(a.ToggleControl,{label:__("Open in a new window","jetpack"),checked:I,onChange:()=>C({newtab:!I}),__nextHasNoMarginBottom:!0})]})})]}),q=(0,r.isWpcomPlatformSite)()?"https://en.support.wordpress.com/wordpress-editor/blocks/opentable-block/":"https://jetpack.com/support/jetpack-blocks/opentable-block/",G=(0,w.jsxs)(a.Placeholder,{label:__("OpenTable Reservation","jetpack"),icon:x,instructions:__("Enter your restaurants IDs, separated by comma, or paste an OpenTable Reservation Widget embed code.","jetpack"),notices:j,children:[(0,w.jsx)(b.A,{rids:N,onSubmit:$}),(0,w.jsxs)("div",{className:`${S}-placeholder-links`,children:[(0,w.jsx)(u.N,{openInNewTab:!0,href:"https://restaurant.opentable.com/get-started/",children:__("Sign up for OpenTable","jetpack")}),(0,w.jsx)(u.N,{openInNewTab:!0,href:q,children:__("Learn more","jetpack")})]})]}),W=(0,d.A)({[`is-style-${F}`]:!L&&U.includes(F),"is-placeholder":L,"is-multi":"multi"===H(F)[0],[`align${T}`]:T,"has-no-margin":R});return(0,w.jsxs)("div",{...A,children:[j,(0,w.jsxs)("div",{className:W,children:[!L&&V,L?G:(e=>{const[n,r]=H(e||F);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:`${S}-overlay`}),(0,w.jsx)("iframe",{title:(0,l.sprintf)(/* translators: %s: a unique ID. */
82 82 __("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${Array.isArray(N)?N.join("%2C"):""}&type=${n}&theme=${r}&overlay=false&domain=${B}&lang=${M&&f.L.includes(M)?M:"en-US"}&newtab=${I}&disablega=true`})]})})()]})]})});n.d(t,["A",0,_])},71992(e,t,n){"use strict";var r=n(94715),o=n(74997),s=n(94375),i=n(79018),a=n(39103),c=n(50260),l=n(64627),u=n(50387),d=n(84260),p=(n(79935),n(45199),n(10790));(0,s.M)(i,{edit:l.A,save:({attributes:{rid:e}})=>{const t=r.useBlockProps.save();return(0,p.jsx)("div",{...t,children:e?.map((e,t)=>(0,p.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},`${e}-${t}`))})},attributes:i.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,o.createBlock)("jetpack/opentable",t)}}]},deprecated:[a.A,c.A]})},82101(e,t,n){"use strict";const r=[{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"}],o=r.map(e=>e.value);n.d(t,["L",0,o,"P",0,r])},74739(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(56427),o=n(86087),s=n(27723),i=n(66087),a=n(10790);const __=s.__,_n=s._n,c=/^\s*(http[s]?:\/\/|<script)/;function l(e){const[t,n]=(0,o.useState)(""),[s,l]=(0,o.useState)(e.rids||[]),u=/^(\d+)$|\(#(\d+)\)$/,d=(0,a.jsx)(r.FormTokenField,{value:s,saveTransform:e=>c.test(e)?"":e.trim(),onInputChange:n,label:_n("Restaurant ID","Restaurant IDs",s.length,"jetpack"),...e,onChange:t=>{const n=t.map(e=>{const t=u.exec(e);if(t){return t[1]||t[2]}return e});l(n),e.onChange&&e.onChange(n)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0});return(0,a.jsx)("div",{className:"wp-block-jetpack-opentable-restaurant-picker",children:e.onSubmit?(0,a.jsxs)("form",{onSubmit:n=>{n.preventDefault(),e.onSubmit((0,i.isEmpty)(s)?t:s)},children:[d,(0,a.jsx)(r.Button,{variant:"secondary",type:"submit",children:__("Embed","jetpack")})]}):d})}},50387(e,t,n){"use strict";var r=n(27723);const __=r.__,o={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},s=e=>[{name:"standard",label:__("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:__("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:__("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&o].filter(Boolean);n.d(t,["Iy",0,s,"K5",0,e=>s(e).map(e=>e.name),"i9",0,o])},59038(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(86087);function o(e){const t=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},84260(e,t,n){"use strict";const r=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,o=/restref=([0-9]+)&/,s=/rid=([0-9]+)&/;n.d(t,["JJ",0,o,"XA",0,s,"a9",0,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 n=new URLSearchParams(t.search);let r=n.get("theme");"button"===n.get("type")&&(r=n.get("type"));let o=n.getAll("rid");if(o&&0!==o.length||(o=n.getAll("restref")),!o||0===o.length)return;const s={};o&&(s.rid=o);const i=n.get("domain");i&&(s.domain=i);const a=n.get("iframe");a&&(s.iframe=a);const c=n.get("lang");c&&(s.lang=c);const l=n.get("newtab");return l&&(s.newtab=l),r&&(s.style=r),s})((e=>{const t=e.match(r);return t&&t[1]?t[1]:o.test(e)||s.test(e)?e:void 0})(e))}])},92809(e,t,n){"use strict";var r=n(94715),o=n(47143),s=n(86087),i=n(52619),a=n(27723),c=n(13022),l=n(2274),u=n(57810),d=n(53796),p=n(26247),h=n(16521),m=n(10790);const __=a.__,g=["jetpack/recurring-payments"];const f=function({clientId:e,attributes:t}){const{layout:n,fontSize:a}=t,{connectUrl:f,isApiConnected:b}=(0,o.useSelect)(e=>{const{getConnectUrl:t,isApiStateConnected:n}=e(h.M);return{connectUrl:t(),isApiConnected:n()}}),v=(0,p.A)(),y=(0,o.useSelect)(t=>t("core/block-editor").getBlock(e).innerBlocks.filter(e=>"jetpack/recurring-payments"===e.name),[e]);(0,s.useEffect)(()=>{(0,i.addFilter)("jetpack.recurringPayments.editorSettings","jetpack/payment-buttons-hide-nudges-from-inner-blocks",(e,t)=>y.some(e=>e.clientId===t)?{...e,showStripeNudge:!1,showUpgradeNudge:!1}:e)},[y]);const k=!b&&!!f,w=(0,r.useBlockProps)({className:(0,c.A)({"has-custom-font-size":!!a||t?.style?.typography?.fontSize})}),x=(0,r.useInnerBlocksProps)(w,{allowedBlocks:g,orientation:"horizontal",template:[["jetpack/recurring-payments"]],templateInsertUpdatesSelection:!0,layout:n});return delete x.id,delete x["data-block"],v?(0,m.jsxs)("div",{...w,children:[k&&(0,m.jsx)(r.BlockControls,{group:"block",children:(0,m.jsx)(u.A,{blockName:"jetpack/payment-buttons",connectUrl:f})}),k&&(0,m.jsx)(d.V,{blockName:"payment-buttons"}),(0,m.jsx)("div",{...x})]}):(0,m.jsx)("div",{...w,children:(0,m.jsx)(l.A,{block:"Payment Buttons",explanation:__("Connect your WordPress.com account to enable payment buttons on your site.","jetpack")})})};n.d(t,["A",0,f])},54154(e,t,n){"use strict";var r=n(94375),o=n(97472),s=n(92809),i=n(458);n(64521);(0,r.M)(o,{edit:s.A,save:i.A})},458(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(13022),s=n(10790);function i({attributes:e}){const t=(0,o.A)({"has-custom-font-size":!!e?.fontSize||e?.style?.typography?.fontSize}),n=r.useBlockProps.save({className:t}),i=r.useInnerBlocksProps.save(n);return(0,s.jsx)("div",{...i})}},87339(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(10790);const s="undefined"!=typeof window?window.wp?.blocks?.getBlockType:null;function i({variations:e,onSelect:t,label:n}){return(0,o.jsx)("ul",{"aria-label":n,className:"wp-block-jetpack-payments-intro__variation-picker",children:e.map(e=>(0,o.jsxs)("li",{children:[(0,o.jsx)(r.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>t(e),className:"wp-block-jetpack-payments-intro__variation-picker__variation",label:e.description||e.title}),(0,o.jsx)("span",{className:"wp-block-jetpack-payments-intro__variation-picker__variation-label",role:"presentation",children:e.displayTitle||s?.(e.name)?.title||e.title})]},e.name))})}},44809(e,t,n){"use strict";const r=[n(64681)];n.d(t,["A",0,r])},71938(e,t,n){"use strict";n.d(t,["A",0,{}])},64681(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>s.A,supports:()=>i.A});var r=n(94715),o=n(10790),s=n(71938),i=n(62755);n.d(t,["save",0,()=>(0,o.jsx)(r.InnerBlocks.Content,{})])},62755(e,t,n){"use strict";n.d(t,["A",0,{alignWide:!1,className:!0,customClassName:!1,html:!1,reusable:!1}])},10377(e,t,n){"use strict";n.d(t,{A:()=>g});var r=n(94715),o=n(74997),s=n(56427),i=n(47143),a=n(86087),c=n(27723),l=n(2274),u=n(26247),d=n(87339),p=n(26692),h=n(69661),m=n(10790);const __=c.__;function g({name:e,clientId:t}){const n=e=>e.categories?.includes("shop"),c=(0,r.useBlockProps)(),{blockType:g,hasInnerBlocks:f,hasPatterns:b,settings:v}=(0,i.useSelect)(s=>{const{getBlocks:i,__experimentalGetAllowedPatterns:a,getSettings:c}=s(r.store);return{settings:c(),blockType:(0,o.getBlockType)(e),hasInnerBlocks:i(t)?.length>0,hasPatterns:a?.().filter(n).length>0}}),y=(0,u.A)(),{replaceBlock:k,selectBlock:w,updateSettings:x}=(0,i.useDispatch)(r.store),_=(0,a.useCallback)(e=>{!0===v?.allowedBlockTypes||v?.allowedBlockTypes?.includes(e)||x({...v,allowedBlockTypes:[...v.allowedBlockTypes,e]})},[v,x]),j=e=>{const n=e.name;_(n),k(t,(0,o.createBlock)(n,e.attributes??{})),w(t)},C=h.A.filter(e=>(0,o.getBlockType)(e.name));(0,a.useEffect)(()=>{f||o.registerBlockVariation||j(C[0])});const A=C.length&&o.registerBlockVariation;let S,E=__("Please select which kind of payment you'd like to add.","jetpack");return b&&(E=__("Start by choosing one of our suggested layout patterns.","jetpack")),S=y?!f&&A?(0,m.jsxs)(s.Placeholder,{icon:g?.icon?.src,label:g?.title,instructions:E,children:[b&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(p.A,{onBlockPatternSelect:e=>k(t,e.map(o.cloneBlock)),patternFilter:n}),(0,m.jsx)("p",{children:__("Or use one of our blocks to create your own.","jetpack")})]}),(0,m.jsx)(d.A,{label:__("Payment Block list","jetpack"),variations:C,onSelect:(e=C[0])=>{j(e)}})]}):(0,m.jsx)(r.InnerBlocks,{}):(0,m.jsx)(l.A,{block:"Payments",explanation:__("Connect your WordPress.com account to start using payments blocks.","jetpack")}),(0,m.jsx)("div",{...c,children:S})}},36838(e,t,n){"use strict";var r=n(94715),o=n(94375),s=n(87325),i=n(58087),a=n(77675),c=n(80830),l=n(44809),u=n(10377),d=(n(98373),n(10790));(0,o.M)(c,{edit:u.A,save:()=>{const e=r.useBlockProps.save();return(0,d.jsx)("div",{...e,children:(0,d.jsx)(r.InnerBlocks.Content,{})})},keywords:[...new Set([...c.keywords,s.title,...s.keywords,a.title,...a.keywords,i.title,...i.keywords])],deprecated:l.A})},26692(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(10790);const __=i.__;function c({onBlockPatternSelect:e,patternFilter:t}){const[n,i]=(0,s.useState)(!1);return r.__experimentalBlockPatternSetup?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Button,{variant:"primary",onClick:()=>i(!0),className:"wp-payments-intro-pattern-picker__opener",children:__("Choose a pattern","jetpack")}),n&&(0,a.jsx)(o.Modal,{className:"wp-block-jetpack-payments-intro__pattern-picker__selection-modal",title:__("Choose a pattern","jetpack"),closeLabel:__("Cancel","jetpack"),onRequestClose:()=>i(!1),children:(0,a.jsx)(r.__experimentalBlockPatternSetup,{onBlockPatternSelect:e,filterPatternsFn:t})})]}):null}},69661(e,t,n){"use strict";var r=n(85985),o=n(87325),s=n(30746),i=n(97472),a=n(58087);const c=[...[[o.name,o],[i.name,i],[a.name,a]].map(([e,t])=>{const n=t.icon.src??t.icon;return{name:e.includes("/")?e:"jetpack/"+e,title:t.title,description:t.description,icon:"string"==typeof n&&n.toLowerCase().startsWith("<svg")?(0,r.sh)(t):n}}),{name:"jetpack/donations",displayTitle:s.Ay.title,description:s.Ay.description,icon:s.Ay.icon,attributes:s.Ay.attributes}];n.d(t,["A",0,c])},32129(e,t,n){"use strict";n(90705);var r=n(82201),o=n(94715),s=n(56427),i=n(47143),a=n(43656),c=n(86087),l=n(27723),u=n(13109),d=n(62107),p=n(88901),h=n(92634),m=n(2274),g=n(49452),f=n(37906),b=n(42167),v=n(82500),y=n(26247),k=n(10790);const __=l.__;const w=function({clientId:e}){const t=(0,o.useBlockProps)(),n=(0,i.useSelect)(e=>e(a.store).getCurrentPostType(),[]),l=(0,b.I)(n),w=(0,y.A)(),x=(0,v.iF)(),{getBlock:_}=(0,i.useSelect)(o.store),j=(0,c.useRef)(x);j.current=x,(0,c.useEffect)(()=>()=>{_(e)||j.current(f.P2.everybody.key)},[e,_]);const{stripeConnectUrl:C,hasTierPlans:A}=(0,i.useSelect)(e=>{const{getNewsletterTierProducts:t,getConnectUrl:n}=e("jetpack/membership-products");return{stripeConnectUrl:n(),hasTierPlans:0!==t()?.length}}),[S,E]=(0,c.useState)(!1);function T(e){f.P2.paid_subscribers.key!==e||!C&&A?x(e):E(!0)}if((0,c.useEffect)(()=>{l===f.P2.everybody.key&&x(f.P2.subscribers.key)},[l,x]),!w)return(0,k.jsx)("div",{...t,children:(0,k.jsx)(m.A,{block:"Paywall",explanation:__("Connect your WordPress.com account to enable a paywall for your site.","jetpack")})});const N=e=>e===f.P2.paid_subscribers.key?f.P2.paid_subscribers.label:f.P2.subscribers.label,P=(e=>{switch(e){case f.P2.subscribers.key:return __("Subscriber-only content below","jetpack");case f.P2.paid_subscribers.key:return __("Paid content below this line","jetpack");default:return __("Paywall","jetpack")}})(l);let B=l??f.P2.subscribers.key;return B===f.P2.everybody.key&&(B=f.P2.subscribers.key),(0,k.jsxs)("div",{...t,children:[(0,k.jsx)("div",{className:"wp-block-jetpack-paywall-block",children:(0,k.jsxs)("span",{children:[P,(0,k.jsx)(u.A,{icon:d.A,size:16})]})}),(0,k.jsx)(o.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,k.jsx)(s.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:h.A,text:N(l),children:({onClose:e})=>(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(s.MenuGroup,{children:[(0,k.jsx)(s.MenuItem,{onClick:()=>{T(f.P2.subscribers.key),e()},isSelected:l===f.P2.subscribers.key,icon:l===f.P2.subscribers.key&&p.A,iconPosition:"right",children:N(f.P2.subscribers.key)}),(0,k.jsx)(s.MenuItem,{onClick:()=>{T(f.P2.paid_subscribers.key),e()},isSelected:l===f.P2.paid_subscribers.key,icon:l===f.P2.paid_subscribers.key&&p.A,iconPosition:"right",children:N(f.P2.paid_subscribers.key)})]})})})}),(0,k.jsx)(g.A,{closeDialog:()=>E(!1),showDialog:S}),(0,k.jsx)(o.InspectorControls,{children:(0,k.jsx)(s.PanelBody,{className:"jetpack-subscribe-newsletters-panel",title:__("Content access","jetpack"),icon:(0,k.jsx)(r.jt,{}),initialOpen:!0,children:(0,k.jsx)(v.EX,{accessLevel:B,stripeConnectUrl:C,hasTierPlans:A,postHasPaywallBlock:!0,explainPaywallConstraint:!1})})})]})};n.d(t,["A",0,w])},19954(e,t,n){"use strict";var r=n(74997),o=n(47143),s=n(43656),i=n(94375),a=n(64524),c=n(32129),l=n(89110);n(90705);const u=(0,o.subscribe)(()=>{const e=(0,o.select)(s.store).getCurrentPostType();null!==e&&(u(),e&&"post"!==e&&void 0!==(0,r.getBlockType)(a.name)&&(0,r.unregisterBlockType)(a.name))});(0,i.M)(a,{edit:c.A,save:()=>null,transforms:l.A})},89110(e,t,n){"use strict";var r=n(74997),o=n(64524);const s={from:[{type:"block",blocks:["core/more","core/nextpage"],transform:()=>(0,r.createBlock)(o.name)}],to:[{type:"block",blocks:["core/more"],transform:()=>(0,r.createBlock)("core/more")},{type:"block",blocks:["core/nextpage"],transform:()=>(0,r.createBlock)("core/nextpage")}]};n.d(t,["A",0,s])},59767(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(85985),o=n(56427),s=n(27723),i=n(73800),a=n(10790);const __=s.__,_x=s._x,c=(0,r.sh)(i);function l({className:e,onSubmit:t,noticeUI:n,url:r,setUrl:s}){return(0,a.jsx)("div",{className:e,children:(0,a.jsx)(o.Placeholder,{label:__("Pinterest","jetpack"),icon:c,notices:n,children:(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),t()},children:[(0,a.jsx)("input",{type:"url",value:r,className:"components-placeholder__input","aria-label":__("Pinterest URL","jetpack"),placeholder:__("Enter URL to embed here…","jetpack"),onChange:e=>s(e.target.value)}),(0,a.jsx)(o.Button,{variant:"secondary",type:"submit",children:_x("Embed","button label","jetpack")})]})})})}},62769(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(74997),o=n(56427),s=n(86087),i=n(27723),a=n(10790);const __=i.__,_x=i._x;function c({fallbackUrl:e,onClick:t}){return(0,a.jsxs)(a.Fragment,{children:[__("Sorry, this content could not be embedded.","jetpack")," ",(0,a.jsx)(o.Button,{variant:"link",onClick:()=>{const n=(0,a.jsx)("a",{href:e,children:e});t((0,r.createBlock)("core/paragraph",{content:(0,s.renderToString)(n)}))},children:_x("Convert block to link","button label","jetpack")})]})}},83646(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(56427),o=n(27723),s=n(10790);const __=o.__;function i(){return(0,s.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,s.jsx)(r.Spinner,{}),(0,s.jsx)("p",{children:__("Embedding…","jetpack")})]})}},76910(e,t,n){"use strict";n.d(t,["_",0,/^\s*https?:\/\/(?:www\.)?(?:[a-z]{2}\.)?(?:pinterest\.[a-z.]+|pin\.it)\/([^/]+)(\/[^/]+)?/i,"e",0,"https://pinterest.com/anapinskywalker/"])},62713(e,t,n){"use strict";var r=n(57462),o=n(10790);const s={attributes:{url:{type:"string"}},supports:{align:!1,html:!1},save:({attributes:e,className:t})=>{const{url:n}=e;return(0,r.C)(n)?(0,o.jsx)("div",{className:t,children:(0,o.jsx)("a",{"data-pin-do":(0,r.C)(n),href:n})}):null}};n.d(t,["A",0,s])},32089(e,t,n){"use strict";var r=n(94715),o=n(56427),s=n(86087),i=n(59767),a=n(62769),c=n(83646),l=n(67627),u=n(57462),d=n(10790);const p=(0,o.withNotices)(function({attributes:e,isSelected:t,noticeOperations:n,noticeUI:p,setAttributes:h,onReplace:m}){const{url:g}=e,f=(0,r.useBlockProps)(),{isFetching:b,pinterestUrl:v,testUrl:y,hasTestUrlError:k}=(0,l.A)(),[w,x]=(0,s.useState)(!1),[_,j]=(0,s.useState)(""),[C,A]=(0,s.useState)(!1),S=(0,s.useCallback)(()=>(0,d.jsx)(a.A,{fallbackUrl:_,onClick:m}),[k]),E=()=>{b||(y(_),A(!1))},T=()=>{x(!0)};if((0,s.useEffect)(()=>{g&&y(g)},[]),(0,s.useEffect)(()=>{!t&&w&&x(!1)},[t,w]),(0,s.useEffect)(()=>{h({url:v}),n.removeAllNotices(),v&&j(v),k&&n.createErrorNotice(S())},[v,k,h,S]),b)return(0,d.jsx)(c.A,{});const N=(0,u.C)(g);let P;if(C||!g||g&&!N)P=(0,d.jsx)(i.A,{onSubmit:E,noticeUI:p,url:_,setUrl:j});else{const e=`<a data-pin-do='${N}' href='${g}'></a>`;P=(0,d.jsx)("div",{...f,children:(0,d.jsxs)("div",{children:[(0,d.jsx)(o.SandBox,{html:e,scripts:["https://assets.pinterest.com/js/pinit.js"],onFocus:T}),!w&&(0,d.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:T})]})})}return(0,d.jsx)("div",{...f,children:P})});n.d(t,["A",0,p])},46010(e,t,n){"use strict";var r=n(94375),o=n(73800),s=n(62713),i=n(32089),a=n(9114);(0,r.M)(o,{edit:i.A,save:a.A,deprecated:[s.A]})},67627(e,t,n){"use strict";var r=n(86087),o=n(56145),s=n(76910);const i=(e="")=>{const[t,n]=(0,r.useState)(!1),[i,a]=(0,r.useState)(e),[c,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i&&i!==s.e&&(n(!0),(0,o.A)(i).then(e=>{n(!1),a(e),l(!1)}).catch(()=>{n(!1),a(i||void 0),l(!0)}))},[i]),{isFetching:t,pinterestUrl:i,hasTestUrlError:c,testUrl:a}};n.d(t,["A",0,i])},9114(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s({attributes:e}){const t=r.useBlockProps.save(),{url:n}=e;return(0,o.jsx)("a",{...t,href:n,children:n})}},57462(e,t,n){"use strict";n.d(t,{C:()=>s});var r=n(93832),o=n(76910);function s(e){if(!o._.test(e))return"";const t=(0,r.getPath)(e);return t?t.startsWith("pin/")?"embedPin":t.match(/^([^/]+)\/?$/)?"embedUser":t.match(/^([^/]+)\/([^/]+)\/?$/)?"embedBoard":"":""}},50961(e,t,n){"use strict";var r=n(1455),o=n.n(r),s=n(93832),i=n(38288);n.d(t,["N",0,async()=>await o()({path:"/wpcom/v2/podcast-player/track-quantity"}),"T",0,async({url:e,guids:t=[],fetchEpisodeOptions:n=!1})=>{let r,a,c;try{r=await o()({path:(0,s.addQueryArgs)("/wpcom/v2/podcast-player",{url:e,guids:t,"episode-options":n})})}catch(e){a=e}if(r)return{type:i.g,data:r};try{c=await o()({path:(0,s.addQueryArgs)("/oembed/1.0/proxy",{url:e})})}catch{}const l='<a href="'+e+'">'+e+"</a>";if(c&&c.html!==l)return{type:i.Q};throw a}])},73959(e,t,n){"use strict";var r=n(86087),o=n(13022),s=n(77722),i=n(10790);const a=(0,r.memo)(({playerId:e,title:t,cover:n,link:r,track:o,children:s,showEpisodeTitle:a,showCoverArt:l,showEpisodeDescription:u,colors:d})=>l||a||u?(0,i.jsxs)("div",{className:"jetpack-podcast-player__header",children:[(0,i.jsxs)("div",{className:"jetpack-podcast-player__current-track-info",children:[l&&n&&(0,i.jsx)("div",{className:"jetpack-podcast-player__cover",children:(0,i.jsx)("img",{className:"jetpack-podcast-player__cover-image",src:n,alt:""})}),a&&!!(t||o&&o.title)&&(0,i.jsx)(c,{playerId:e,title:t,link:r,track:o,colors:d})]}),!!(u&&o&&o.description)&&(0,i.jsx)("p",{id:`${e}__track-description`,className:"jetpack-podcast-player__track-description",children:o.description}),s]}):s),c=(0,r.memo)(({playerId:e,title:t,link:n,track:r,colors:a={primary:{name:null,custom:null,classes:""}}})=>(0,i.jsxs)("h2",{id:`${e}__title`,className:"jetpack-podcast-player__title",children:[!(!r||!r.title)&&(0,i.jsxs)("span",{className:(0,o.A)("jetpack-podcast-player__current-track-title",a.primary.classes),style:{color:a.primary.custom},children:[r.title,(0,i.jsx)("a",{className:"jetpack-podcast-player__track-title-link",href:r.link||r.src,target:"_blank",rel:"noopener noreferrer nofollow",children:s.A})]}),!!(r&&r.title&&t)&&(0,i.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:" - "}),!!t&&(0,i.jsx)(l,{title:t,link:n,colors:a})]})),l=(0,r.memo)(({title:e,link:t})=>(0,i.jsx)("span",{className:"jetpack-podcast-player__podcast-title",children:t?(0,i.jsx)("a",{className:"jetpack-podcast-player__link",href:t,target:"_blank",rel:"noopener noreferrer nofollow",children:e}):{title:e}})),u=a;n.d(t,["A",0,u])},5028(e,t,n){"use strict";var r=n(86087),o=n(23117),s=n(15663),i=n(10790);const a=(0,r.memo)(({playerId:e,tracks:t,selectTrack:n,currentTrack:r,playerState:a,colors:c})=>(0,i.jsx)("ol",{className:"jetpack-podcast-player__tracks","aria-labelledby":`jetpack-podcast-player__tracklist-title--${e}`,"aria-describedby":`jetpack-podcast-player__tracklist-description--${e}`,children:t.map((e,t)=>{const l=r===t;return(0,i.jsx)(s.A,{index:t,track:e,selectTrack:n,isActive:l,isPlaying:l&&a===o.v8,isError:l&&a===o.pF,colors:c},e.id)})}));n.d(t,["A",0,a])},81894(e,t,n){"use strict";var r=n(20195),o=n(29491),s=n(47143),i=n(86087),a=n(27723),c=n(13022),l=n(72445),u=n(23117),d=n(19812),p=n(73959),h=n(5028),m=n(19634),g=n(10790);const __=a.__;class f extends i.Component{state={currentTrack:0,hasUserInteraction:!1};recordUserInteraction=()=>{this.state.hasUserInteraction||this.setState({hasUserInteraction:!0})};selectTrack=e=>{const{currentTrack:t}=this.state;if(t===e)return this.recordUserInteraction(),void this.props.toggleMediaSource(this.props.playerId);-1!==t&&this.props.pauseMediaSource(this.props.playerId),this.loadAndPlay(e)};loadTrack=e=>{const t=this.getTrack(e);if(!t)return!1;this.state.currentTrack!==e&&this.setState({currentTrack:e});const{title:n,link:o,description:s}=t;return this.props.updateMediaSourceData(this.props.playerId,{title:n,link:o}),(0,r.speak)(/* translators: %s is the track title. It describes the current state of the track as "Loading: [track title]". */
83 83 `${(0,a.sprintf)(__("Loading: %s","jetpack"),n)} ${s}`,"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,r.speak)(`${__("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")};handlePlay=()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})};handlePause=()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==u.pF&&this.props.pauseMediaSource(this.props.playerId)};handleTimeChange=e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)};handleJump=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)};handleSkip=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)};updateMediaData=e=>{this.props.updateMediaSourceData(this.props.playerId,{duration:e.target?.duration,domId:e.target?.id})};registerPlayer(){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):[],n=t(this.props.tracks),r=new Set(t(e.tracks));n.length===r.size&&n.every(e=>r.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:n,cover:r,tracks:o,attributes:s,currentTime:i,playerState:u}=this.props,{itemsToShow:m,primaryColor:f,customPrimaryColor:b,hexPrimaryColor:v,secondaryColor:y,customSecondaryColor:k,hexSecondaryColor:w,backgroundColor:x,customBackgroundColor:_,hexBackgroundColor:j,showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S}=s,{currentTrack:E}=this.state,T=o.slice(0,m),N=this.getTrack(E),P=(0,d.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:y,customSecondaryColor:k,backgroundColor:x,customBackgroundColor:_}),B={color:k,backgroundColor:_,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":w,"--jetpack-podcast-player-background":j},M=(0,c.A)("jetpack-podcast-player",u,P.secondary.classes,P.background.classes);return(0,g.jsxs)("section",{className:M,style:B,"aria-labelledby":t||N&&N.title?`${e}__title`:void 0,"aria-describedby":N&&N.description?`${e}__track-description`:void 0,"data-jetpack-iframe-ignore":!0,children:[(0,g.jsx)(p.A,{playerId:e,title:t,link:n,cover:r,track:this.getTrack(E),showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S,colors:P,children:(0,g.jsx)(l.A,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(E).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:u,currentTime:i,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData,preload:"none"})}),T.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,a.sprintf)(
84 84 // translators: %s is the track title.
85 85 __("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:T,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,o.compose)([m.A,(0,s.withSelect)((e,t)=>{const{playerId:n}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:o}=e(u.ax);return{currentTime:r(n),playerState:o(n)}}),(0,s.withDispatch)(e=>{const{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:o,playMediaSource:s,pauseMediaSource:i,toggleMediaSource:a,errorMediaSource:c,setMediaSourceCurrentTime:l}=e(u.ax);return{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:o,playMediaSource:s,pauseMediaSource:i,toggleMediaSource:a,errorMediaSource:c,setMediaSourceCurrentTime:l}})])(f);n.d(t,["A",0,b])},18142(e,t,n){"use strict";var r=n(86087),o=n(27723),s=n(10790);const __=o.__,i=(0,r.memo)(({link:e,title:t,colors:n})=>(0,s.jsxs)("div",{className:"jetpack-podcast-player__track-error",children:[__("Episode unavailable.","jetpack")," ",e&&(0,s.jsx)("span",{className:n.secondary.classes,style:{color:n.secondary.custom},children:(0,s.jsxs)("a",{className:"jetpack-podcast-player__link",href:e,rel:"noopener noreferrer nofollow",target:"_blank",children:[(0,s.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${(0,o.sprintf)(/* translators: %s is the title of the track. This text is visually hidden from the screen, but available to screen readers. */
@@ -132,9 +132,9 @@
132 132 __("image %1$d of %2$d in gallery","jetpack"),t+1,s.length),{src:y,srcSet:k}=(0,a.A)(e,{layoutStyle:d});return(0,u.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:f===t,link:e.link,linkTo:l,onMoveBackward:c?void 0:p(t),onMoveForward:c?void 0:h(t),onRemove:c?void 0:m(t),onSelect:c?void 0:g(t),origUrl:e.url,setAttributes:c?void 0:b(t),showMovers:s.length>1,srcSet:k,url:y,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:i,roundedCorners:d,onResize:p,isSave:h,columnWidths:m}=this.props,g=(0,a.s)(i)?l.A:c.A,f=this.props.images.map(this.renderImage,this),b="circle"!==i?Math.min(d,20):0;return(0,u.jsxs)("div",{className:(0,s.A)(n,{[`has-rounded-corners-${b}`]:b>0}),children:[(0,u.jsx)(g,{align:e,columns:r,columnWidths:h?m:void 0,images:o,layoutStyle:i,renderedImages:f,onResize:h?void 0:p}),t]})}}},18228(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(86087),o=n(63307),s=n(37471),i=n(66645),a=n(70394),c=n(10790);class l extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:l,columnWidths:u}=this.props,d=(0,a.mJ)(n),p="columns"===r?(0,a.FL)(d,t):(0,a.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,c.jsx)(s.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,c.jsx)(i.A,{children:e.map((e,n)=>{const r=l.slice(h,h+e);return h+=e,(0,c.jsx)(o.A,{width:u?.[t]?.[n],children:r},n)})},t))})}}},70394(e,t,n){"use strict";n.d(t,{FL:()=>i,VU:()=>C,mJ:()=>o});var r=n(66087);function o(e){return e.map(s)}function s({height:e,width:t}){return e&&t?t/e:1}function i(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,o=[];let s=e,i=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,t=>{const r=i<=(e+1)*n;return r&&(i+=t),r}).length;o.push(t),s=s.slice(t)}return o.push(s.length),[o]}const a=A([2,1,2],5),c=S([E,E,T,E,E]),l=S([E,E,E,T,E,E,E]),u=A([3,1,3],5),d=S([T,E,E,T]),p=A([1,2,1],5),h=S([T,E,E,E]),m=A([1,3],3),g=S([E,E,E,T]),f=A([3,1],3),b=S([P(1.6),(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2))]),v=A([1,2],3),y=A([1,1,1,1,1],1),k=A([1,1,1,1],1),w=A([1,1,1],3),x=S([(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2)),P(1.6)]),_=A([2,1],3),j=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const n=(e,o)=>{if(!o.length)return e;let s;s=o.length>15&&c(o)&&a(e)?[2,1,2]:o.length>15&&l(o)&&u(e)?[3,1,3]:5!==o.length&&d(o)&&p(e)?[1,2,1]:h(o)&&m(e)?[1,3]:g(o)&&f(e)?[3,1]:b(o)&&v(e)?[1,2]:t&&(5===o.length||10!==o.length&&o.length>6)&&y(e)&&(0,r.sum)(o.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)(t.slice(0,4));return k(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,o)?[1,1,1,1]:function(e,t,n){const o=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(o<2.5||o<5&&t.length>=3&&t[0]===t[2]||n)}(e,o,t)?[1,1,1]:x(o)&&_(e)?[2,1]:j(o)?[1]:o.length>3?[1,1]:Array(o.length).fill(1);const i=e.concat([s]),C=(0,r.sum)(s),A=o.slice(C);return n(i,A)};return n([],e)}function A(e,t){return n=>!n.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function T(e){return e<1}function N(e){return t=>t>=e}function P(e){return t=>t<e}},66645(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13022),o=n(10790);function s({children:e,className:t}){return(0,o.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},49611(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(66087),o=n(63307),s=n(37471),i=n(66645),a=n(10790);function c({columns:e,renderedImages:t}){const n=Math.min(20,e),c=t.length%n;return(0,a.jsx)(s.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),n)].map((e,t)=>(0,a.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,a.jsx)(o.A,{children:e},t))},t))})}},93865(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(90907),o=n(60041),s=n(98413),i=n(10790);function a(e){return Math.min(3,e.images.length)}function c({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:c,className:l,columns:u=a(e),linkTo:d,roundedCorners:p,columnWidths:h}=e;return(0,i.jsx)(s.A,{align:c,className:l,columns:u,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,r.D)(o.kc,l),linkTo:d,roundedCorners:p,columnWidths:h})}},13014(e,t,n){"use strict";n.d(t,{A:()=>i,s:()=>s});var r=n(63162),o=n(14936);function s(e){return["circle","square"].includes(e)}function i(e,t={}){if(!e.height||!e.url||!e.width)return{};if((0,r.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};const n=e.url.split("?",1)[0],{height:i,width:c}=e,{layoutStyle:l}=t,u=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)?a:o.A;let d;if(s(l)&&c&&i){const e=Math.min(2e3,c,i);d=u(n,{resize:`${e},${e}`})}else d=u(n);let p=[];if(s(l)){const e=Math.min(600,c,i),t=Math.min(2e3,c,i);for(let r=e;r<t;r+=300){const e=u(n,{resize:`${r},${r}`,strip:"info"});e&&p.push(`${e} ${r}w`)}}else{const e=Math.min(600,c),t=Math.min(2e3,c);for(let r=e;r<t;r+=300){const e=u(n,{strip:"info",width:r});e&&p.push(`${e} ${r}w`)}}return p=p.join(","),Object.assign({src:d},p&&{srcSet:p})}function a(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,o]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,o);return r.toString()}},86136(e,t,n){"use strict";const r="rectangular",o=[{isDefault:!0,name:r},{name:"circle"},{name:"square"},{name:"columns"}];n.d(t,["T$",0,r,"kc",0,o])},52469(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(63162),o=n(13022),s=n(10790);function i(e){const{alt:t,imageFilter:n,height:i,id:a,link:c,linkTo:l,origUrl:u,url:d,width:p}=e;if((0,r.isBlobURL)(u))return null;let h;switch(l){case"media":h=d;break;case"attachment":h=c}const m=(0,s.jsx)("img",{alt:t,"data-height":i,"data-id":a,"data-link":c,"data-url":u,"data-width":p,src:d,"data-amp-layout":"responsive"});return(0,s.jsx)("figure",{className:(0,o.A)("tiled-gallery__item",{[`filter__${n}`]:!!n}),children:h?(0,s.jsx)("a",{href:h,children:m}):m})}},24753(e,t,n){"use strict";n.r(t),n.d(t,{save:()=>o.A});var r=n(86136),o=n(83276);const s={align:{default:"center",type:"string"},className:{default:`is-style-${r.T$}`,type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}};n.d(t,["attributes",0,s,"supports",0,{align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}])},81992(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,width:t}){const n=t?{flexBasis:`${t}%`}:void 0;return(0,r.jsx)("div",{className:"tiled-gallery__col",style:n,children:e})}},7270(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,galleryRef:t}){return(0,r.jsx)("div",{className:"tiled-gallery__gallery",ref:t,children:e})}},66972(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(27723),s=n(13022),i=n(52469),a=n(32083),c=n(55807),l=n(35151),u=n(10790);const __=o.__;class d extends r.Component{renderImage(e,t){const{columns:n,imageFilter:r,images:s,isSave:c,linkTo:l,layoutStyle:d,onMoveBackward:p,onMoveForward:h,onRemoveImage:m,onSelectImage:g,selectedImage:f,setImageAttributes:b}=this.props,v=(0,o.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */
133 133 __("image %1$d of %2$d in gallery","jetpack"),t+1,s.length),{src:y,srcSet:k}=(0,a.A)(e,{layoutStyle:d});return(0,u.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:f===t,link:e.link,linkTo:l,onMoveBackward:c?void 0:p(t),onMoveForward:c?void 0:h(t),onRemove:c?void 0:m(t),onSelect:c?void 0:g(t),origUrl:e.url,setAttributes:c?void 0:b(t),showMovers:s.length>1,srcSet:k,url:y,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:i,roundedCorners:d,onResize:p,style:h,isSave:m,columnWidths:g}=this.props,f=(0,a.s)(i)?l.A:c.A,b=this.props.images.map(this.renderImage,this),v="circle"!==i?Math.min(d,20):0;return(0,u.jsxs)("div",{style:h,className:(0,s.A)(n,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,u.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:o,layoutStyle:i,renderedImages:b,onResize:m?void 0:p}),t]})}}},55807(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(94107),s=n(81992),i=n(7270),a=n(14476),c=n(71245),l=n(86461),u=n(10790);class d extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t,r=[];(0,l.S)(n).forEach(t=>{r.push((0,l.r)(t,e))}),void 0!==this.props.onResize&&this.props.onResize(r)}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new o.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,n){let r=0;return e.map(e=>e.map(e=>{const n=t.slice(r,r+e);return r+=e,n})).map(e=>(0,l.r)(e,n))}render(){const{align:e,columns:t,images:n,layoutStyle:o,renderedImages:l}=this.props,d=(0,c.mJ)(n),p="columns"===o?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,l,1e3)})();let m=0;return(0,u.jsx)(i.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,u.jsx)(a.A,{children:e.map((e,n)=>{const r=l.slice(m,m+e);return m+=e,(0,u.jsx)(s.A,{width:h?.[t]?.[n],children:r},n)})},t))})}}},71245(e,t,n){"use strict";n.d(t,{FL:()=>i,VU:()=>C,mJ:()=>o});var r=n(66087);function o(e){return e.map(s)}function s({height:e,width:t}){return e&&t?t/e:1}function i(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,o=[];let s=e,i=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,t=>{const r=i<=(e+1)*n;return r&&(i+=t),r}).length;o.push(t),s=s.slice(t)}return o.push(s.length),[o]}const a=A([2,1,2],5),c=S([E,E,T,E,E]),l=S([E,E,E,T,E,E,E]),u=A([3,1,3],5),d=S([T,E,E,T]),p=A([1,2,1],5),h=S([T,E,E,E]),m=A([1,3],3),g=S([E,E,E,T]),f=A([3,1],3),b=S([P(1.6),(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2))]),v=A([1,2],3),y=A([1,1,1,1,1],1),k=A([1,1,1,1],1),w=A([1,1,1],3),x=S([(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2)),P(1.6)]),_=A([2,1],3),j=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const n=(e,o)=>{if(!o.length)return e;let s;s=o.length>15&&c(o)&&a(e)?[2,1,2]:o.length>15&&l(o)&&u(e)?[3,1,3]:5!==o.length&&d(o)&&p(e)?[1,2,1]:h(o)&&m(e)?[1,3]:g(o)&&f(e)?[3,1]:b(o)&&v(e)?[1,2]:t&&(5===o.length||10!==o.length&&o.length>6)&&y(e)&&(0,r.sum)(o.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)(t.slice(0,4));return k(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,o)?[1,1,1,1]:function(e,t,n){const o=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(o<2.5||o<5&&t.length>=3&&t[0]===t[2]||n)}(e,o,t)?[1,1,1]:x(o)&&_(e)?[2,1]:j(o)?[1]:o.length>3?[1,1]:Array(o.length).fill(1);const i=e.concat([s]),C=(0,r.sum)(s),A=o.slice(C);return n(i,A)};return n([],e)}function A(e,t){return n=>!n.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function T(e){return e<1}function N(e){return t=>t>=e}function P(e){return t=>t<e}},86461(e,t,n){"use strict";function r(e,t){const n=(t-e.reduce((e,t)=>e+t,0))/e.length;return e.map(e=>e+n)}function o(e,t){return function(e,[t,n],o){const s=1/t*(o-4*(e.childElementCount-1)-n);return function(e,{rawHeight:t,rowWidth:n}){const o=i(e),s=o.map(e=>(t-4*(e.childElementCount-1))*c(e)[0]),u=r(s,n);o.forEach((e,n)=>{const o=s[n],i=u[n];!function(e,{colHeight:t,width:n,rawWidth:o}){const s=a(e).map(e=>o/l(e)),i=r(s,t);Array.from(e.children).forEach((e,t)=>{const r=i[t];e.setAttribute("style",`height:${r}px;width:${n}px;`)})}(e,{colHeight:t-4*(e.childElementCount-1),width:i,rawWidth:o})});return u.map(e=>parseFloat(e/n*100).toFixed(5))}(e,{rawHeight:s,rowWidth:o-4*(e.childElementCount-1)})}(e,function(e){const t=i(e).map(c).reduce(([e,t],[n,r])=>[e+n,t+r],[0,0]);return t}(e),t)}function s(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function i(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function a(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function c(e){const t=a(e),n=t.length,r=1/t.map(l).reduce((e,t)=>e+1/t,0);return[r,r*n||1]}function l(e){const t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}n.d(t,{S:()=>s,r:()=>o})},14476(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13022),o=n(10790);function s({children:e,className:t}){return(0,o.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},35151(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(66087),o=n(81992),s=n(7270),i=n(14476),a=n(10790);function c({columns:e,renderedImages:t}){const n=Math.min(20,e),c=t.length%n;return(0,a.jsx)(s.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),n)].map((e,t)=>(0,a.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,a.jsx)(o.A,{children:e},t))},t))})}},83276(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(90907),o=n(86136),s=n(66972),i=n(10790);function a(e){return Math.min(3,e.images.length)}function c({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:c,className:l,columns:u=a(e),linkTo:d,roundedCorners:p,columnWidths:h}=e;return(0,i.jsx)(s.A,{align:c,className:l,columns:u,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,r.D)(o.kc,l),linkTo:d,roundedCorners:p,columnWidths:h})}},32083(e,t,n){"use strict";n.d(t,{A:()=>l,s:()=>c});var r=n(97999),o=n(85985),s=n(63162),i=n(14936),a=n(13087);function c(e){return["circle","square"].includes(e)}function l(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,a.A)())return{src:e.url};if((0,s.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.isWoASite)()&&(0,o.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:l,width:d}=e,{layoutStyle:p}=t,h=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)?u:i.A;let m;if(c(p)&&d&&l){const e=Math.min(2e3,d,l);m=h(n,{resize:`${e},${e}`})}else m=h(n);let g=[];if(c(p)){const e=Math.min(600,d,l),t=Math.min(2e3,d,l);for(let r=e;r<t;r+=300){const e=h(n,{resize:`${r},${r}`,strip:"info"});e&&g.push(`${e} ${r}w`)}}else{const e=Math.min(600,d),t=Math.min(2e3,d);for(let r=e;r<t;r+=300){const e=h(n,{strip:"info",width:r});e&&g.push(`${e} ${r}w`)}}return g=g.join(","),Object.assign({src:m},g&&{srcSet:g})}function u(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,o]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,o);return r.toString()}},60601(e,t,n){"use strict";n.d(t,["A",0,{align:{type:"string",default:"center"},className:{type:"string",default:"is-style-rectangular"},columns:{type:"number"},columnWidths:{type:"array",default:[]},ids:{type:"array",default:[]},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",type:"number",selector:"img",source:"attribute"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}}])},62554(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>o.A});var r=n(60601),o=n(2500),s=n(55035)},55035(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(94715),o=n(90907),s=n(35463),i=n(22728),a=n(6775),c=n(10790);function l({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:l,className:u,columns:d=(0,i.EB)(e),linkTo:p,roundedCorners:h,columnWidths:m}=e,g=r.useBlockProps.save();return(0,c.jsx)("div",{...g,children:(0,c.jsx)(a.A,{align:l,className:u,columns:d,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,o.D)(s.kc,u),linkTo:p,roundedCorners:h,columnWidths:m,skipPhotonDomain:!1})})}},2500(e,t,n){"use strict";n.d(t,["A",0,{align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}])},92990(e,t,n){"use strict";n.d(t,["A",0,{align:{type:"string",default:"center"},className:{type:"string",default:"is-style-rectangular"},columns:{type:"number"},columnWidths:{type:"array",default:[]},ids:{type:"array",default:[]},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",type:"number",selector:"img",source:"attribute"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}}])},18151(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(63162),o=n(13022),s=n(10790);function i(e){const{alt:t,imageFilter:n,height:i,id:a,link:c,linkTo:l,origUrl:u,url:d,width:p}=e;if((0,r.isBlobURL)(u))return null;let h;switch(l){case"media":h=u;break;case"attachment":h=c}const m=(0,s.jsx)("img",{alt:t,"data-height":i,"data-id":a,"data-link":c,"data-url":u,"data-width":p,src:d,"data-amp-layout":"responsive"});return(0,s.jsx)("figure",{className:(0,o.A)("tiled-gallery__item",{[`filter__${n}`]:!!n}),children:h?(0,s.jsx)("a",{href:h,children:m}):m})}},59679(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>o.A});var r=n(92990),o=n(93951),s=n(56137)},22026(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,width:t}){const n=Math.pow(10,12),o=Math.round(t*n)/n,s=t?{flexBasis:`${o}%`}:void 0;return(0,r.jsx)("div",{className:"tiled-gallery__col",style:s,children:e})}},90984(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,galleryRef:t}){return(0,r.jsx)("div",{className:"tiled-gallery__gallery",ref:t,children:e})}},66746(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(27723),s=n(13022),i=n(18151),a=n(52537),c=n(88833),l=n(48669),u=n(10790);const __=o.__;class d extends r.Component{renderImage(e,t){const{columns:n,imageFilter:r,images:s,isSave:c,linkTo:l,layoutStyle:d,onMoveBackward:p,onMoveForward:h,onRemoveImage:m,onSelectImage:g,selectedImage:f,setImageAttributes:b}=this.props,v=(0,o.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */
134 134 __("image %1$d of %2$d in gallery","jetpack"),t+1,s.length),{src:y,srcSet:k}=(0,a.A)(e,{layoutStyle:d});return(0,u.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:f===t,link:e.link,linkTo:l,onMoveBackward:c?void 0:p(t),onMoveForward:c?void 0:h(t),onRemove:c?void 0:m(t),onSelect:c?void 0:g(t),origUrl:e.url,setAttributes:c?void 0:b(t),showMovers:s.length>1,srcSet:k,url:y,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:i,roundedCorners:d,onResize:p,isSave:h,columnWidths:m}=this.props,g=(0,a.s)(i)?l.A:c.A,f=this.props.images.map(this.renderImage,this),b="circle"!==i?Math.min(d,20):0;return(0,u.jsxs)("div",{className:(0,s.A)(n,{[`has-rounded-corners-${b}`]:b>0}),children:[(0,u.jsx)(g,{align:e,columns:r,columnWidths:h?m:void 0,images:o,layoutStyle:i,renderedImages:f,onResize:h?void 0:p}),t]})}}},88833(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(86087),o=n(22026),s=n(90984),i=n(45610),a=n(79167),c=n(10790);class l extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:l,columnWidths:u}=this.props,d=(0,a.mJ)(n),p="columns"===r?(0,a.FL)(d,t):(0,a.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,c.jsx)(s.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,c.jsx)(i.A,{children:e.map((e,n)=>{const r=l.slice(h,h+e);return h+=e,(0,c.jsx)(o.A,{width:u?.[t]?.[n],children:r},n)})},t))})}}},79167(e,t,n){"use strict";n.d(t,{FL:()=>i,VU:()=>C,mJ:()=>o});var r=n(66087);function o(e){return e.map(s)}function s({height:e,width:t}){return e&&t?t/e:1}function i(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,o=[];let s=e,i=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,t=>{const r=i<=(e+1)*n;return r&&(i+=t),r}).length;o.push(t),s=s.slice(t)}return o.push(s.length),[o]}const a=A([2,1,2],5),c=S([E,E,T,E,E]),l=S([E,E,E,T,E,E,E]),u=A([3,1,3],5),d=S([T,E,E,T]),p=A([1,2,1],5),h=S([T,E,E,E]),m=A([1,3],3),g=S([E,E,E,T]),f=A([3,1],3),b=S([P(1.6),(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2))]),v=A([1,2],3),y=A([1,1,1,1,1],1),k=A([1,1,1,1],1),w=A([1,1,1],3),x=S([(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2)),P(1.6)]),_=A([2,1],3),j=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const n=(e,o)=>{if(!o.length)return e;let s;s=o.length>15&&c(o)&&a(e)?[2,1,2]:o.length>15&&l(o)&&u(e)?[3,1,3]:5!==o.length&&d(o)&&p(e)?[1,2,1]:h(o)&&m(e)?[1,3]:g(o)&&f(e)?[3,1]:b(o)&&v(e)?[1,2]:t&&(5===o.length||10!==o.length&&o.length>6)&&y(e)&&(0,r.sum)(o.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)(t.slice(0,4));return k(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,o)?[1,1,1,1]:function(e,t,n){const o=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(o<2.5||o<5&&t.length>=3&&t[0]===t[2]||n)}(e,o,t)?[1,1,1]:x(o)&&_(e)?[2,1]:j(o)?[1]:o.length>3?[1,1]:Array(o.length).fill(1);const i=e.concat([s]),C=(0,r.sum)(s),A=o.slice(C);return n(i,A)};return n([],e)}function A(e,t){return n=>!n.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function T(e){return e<1}function N(e){return t=>t>=e}function P(e){return t=>t<e}},45610(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13022),o=n(10790);function s({children:e,className:t}){return(0,o.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},48669(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(66087),o=n(22026),s=n(90984),i=n(45610),a=n(10790);function c({columns:e,renderedImages:t}){const n=Math.min(20,e),c=t.length%n;return(0,a.jsx)(s.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),n)].map((e,t)=>(0,a.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,a.jsx)(o.A,{children:e},t))},t))})}},56137(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(13022),s=n(90907),i=n(35463),a=n(22728),c=n(66746),l=n(10790);function u({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:u,className:d,columns:p=(0,a.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,l.jsxs)("div",{...f,className:(0,o.A)(f.className,d),children:[" ",(0,l.jsx)(c.A,{align:u,columns:p,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(i.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},93951(e,t,n){"use strict";n.d(t,["A",0,{align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}])},52537(e,t,n){"use strict";n.d(t,{A:()=>l,s:()=>c});var r=n(97999),o=n(85985),s=n(63162),i=n(14936),a=n(13087);function c(e){return["circle","square"].includes(e)}function l(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,a.A)())return{src:e.url};if((0,s.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.isWoASite)()&&(0,o.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:l,width:d}=e,{layoutStyle:p}=t,h=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)?u:i.A;let m;if(c(p)&&d&&l){const e=Math.min(2e3,d,l);m=h(n,{resize:`${e},${e}`})}else m=h(n);let g=[];if(c(p)){const e=Math.min(600,d,l),t=Math.min(2e3,d,l);for(let r=e;r<t;r+=300){const e=h(n,{resize:`${r},${r}`,strip:"info"});e&&g.push(`${e} ${r}w`)}}else{const e=Math.min(600,d),t=Math.min(2e3,d);for(let r=e;r<t;r+=300){const e=h(n,{strip:"info",width:r});e&&g.push(`${e} ${r}w`)}}return g=g.join(","),Object.assign({src:m},g&&{srcSet:g})}function u(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,o]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,o);return r.toString()}},75e3(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>o.A});var r=n(37336),o=n(69813),s=n(11045)},11045(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(13022),s=n(90907),i=n(35463),a=n(22728),c=n(72712),l=n(10790);function u({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:u,className:d,columns:p=(0,a.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,l.jsxs)("div",{...f,className:(0,o.A)(f.className,d),children:[" ",(0,l.jsx)(c.A,{align:u,columns:p,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(i.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},37336(e,t,n){"use strict";n.d(t,["A",0,{align:{type:"string",default:"center"},className:{type:"string",default:"is-style-rectangular"},columns:{type:"number"},columnWidths:{type:"array",default:[]},ids:{type:"array",default:[]},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",type:"number",selector:"img",source:"attribute"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},customLink:{attribute:"data-custom-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}}])},32377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(97999),o=n(63162),s=n(13022),i=n(10790);function a(e){const{alt:t,imageFilter:n,height:a,id:c,link:l,linkTo:u,customLink:d,origUrl:p,url:h,width:m,"aria-label":g}=e;if((0,o.isBlobURL)(p))return null;let f;switch(u){case"media":f=p;break;case"attachment":f=l;break;case"custom":f=d||"";break;default:f=""}const b=(0,i.jsx)("img",{alt:t,"data-height":a,"data-id":c,"data-link":l,"data-url":p,"data-custom-link":d,"data-width":m,src:h,...!(0,r.isSimpleSite)()&&{"data-amp-layout":"responsive"},tabIndex:0,role:"button","aria-label":g});return(0,i.jsx)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${n}`]:!!n}),children:f?(0,i.jsx)("a",{href:f,children:b}):b})}},20837(e,t,n){"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>o.A});var r=n(37336),o=n(69813),s=n(49928)},72712(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(27723),s=n(13022),i=n(69322),a=n(92978),c=n(90256),l=n(32377),u=n(10790);const __=o.__;class d extends r.Component{renderImage(e,t){const{columns:n,imageFilter:r,images:s,isSave:i,linkTo:a,layoutStyle:d,onMoveBackward:p,onMoveForward:h,onRemoveImage:m,onSelectImage:g,selectedImage:f,setImageAttributes:b}=this.props,v=(0,o.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */
135 135 __("Open image %1$d of %2$d in full-screen","jetpack"),t+1,s.length),y=l.A,{src:k,srcSet:w}=(0,c.AW)(e,{layoutStyle:d},{skipPhotonDomain:!1});return(0,u.jsx)(y,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:f===t,link:e.link,linkTo:a,customLink:e.customLink,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:h(t),onRemove:i?void 0:m(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:b(t),showMovers:s.length>1,srcSet:w,url:k,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:l,roundedCorners:d,onResize:p,style:h,isSave:m,columnWidths:g}=this.props,f=(0,c.sL)(l)?a.A:i.A,b=this.props.images.map(this.renderImage,this),v="circle"!==l?Math.min(d,20):0;return(0,u.jsxs)("div",{style:h,className:(0,s.A)(n,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,u.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:o,layoutStyle:l,renderedImages:b,onResize:m?void 0:p}),t]})}}},49928(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(13022),s=n(90907),i=n(35463),a=n(22728),c=n(72712),l=n(10790);function u({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:u,className:d,columns:p=(0,a.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,l.jsxs)("div",{...f,className:(0,o.A)(f.className,d),children:[" ",(0,l.jsx)(c.A,{align:u,columns:p,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(i.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},69813(e,t,n){"use strict";n.d(t,["A",0,{align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}])},22728(e,t,n){"use strict";n.d(t,{EB:()=>b});var r=n(85985),o=n(94715),s=n(56427),i=n(43656),a=n(86087),c=n(27723),l=n(66087),u=n(90907),d=n(76585),p=n(35463),h=n(55702),m=n(6775),g=n(9888),f=n(10790);const __=c.__;function b(e){return e.images.length>0?Math.min(3,e.images.length):3}const v=e=>{const t=(0,l.pick)(e,[["alt"],["id"],["link"]]);return t.url=e?.sizes?.large?.url||e?.media_details?.sizes?.large?.source_url||e.url,t},y=(0,s.withNotices)(({attributes:e,isSelected:t,noticeOperations:n,noticeUI:c,setAttributes:l})=>{const{align:y,columns:k=b(e),imageFilter:w,images:x,linkTo:_,roundedCorners:j,columnWidths:C}=e,A=(0,u.D)(p.kc,e.className),S=(0,o.useBlockProps)(),[E,T]=(0,a.useState)(null),[N,P]=(0,a.useState)(void 0===C||0===C?.length),B=e=>{l({images:e,ids:e.map(({id:e})=>parseInt(e,10))})},M=e=>{(0,i.mediaUpload)({allowedTypes:p.eN,filesList:e,onFileChange:e=>B((x||[]).concat(e.map(v))),onError:n.createErrorNotice}),P(!0)},I=e=>()=>{const t=x.filter((t,n)=>e!==n);T(null),P(!0),B(t),l({columns:k?Math.min(t.length,k):k})},R=e=>()=>{E!==e&&T(e)},L=e=>{const t=e.map(e=>{const t=x.find(t=>parseInt(t.id,10)===parseInt(e.id,10));return t?.customLink?{...v(e),customLink:t.customLink}:v(e)});B(t),l({columns:k?Math.min(e.length,k):k}),P(!0)},D=(e,t)=>{const n=[...x];n.splice(t,1,x[e]),n.splice(e,1,x[t]),T(t),P(!0),B(n)},F=e=>()=>{e!==x.length-1&&D(e,e+1)},O=e=>()=>{0!==e&&D(e,e-1)},z=e=>{!N&&(0,g.O)(e,C)||l({columnWidths:e})},U=e=>M(e.target.files),H=e=>t=>{x[e]&&B([...x.slice(0,e),{...x[e],...t},...x.slice(e+1)])};let $;return(0,a.useEffect)(()=>{t||null===E||T(null)},[t,E,T]),$=0===x.length?(0,f.jsx)(o.MediaPlaceholder,{icon:(0,r.sh)(d),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:L,accept:"image/*",allowedTypes:p.eN,multiple:!0,notices:c,onError:n.createErrorNotice}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h.M,{layoutStyle:A,images:x,columns:k,selectedImage:E,setImageAttributes:H,onColumnsChange:e=>l({columns:e}),roundedCorners:j,onRoundedCornersChange:e=>l({roundedCorners:e}),linkTo:_,onLinkToChange:e=>l({linkTo:e})}),c,(0,f.jsxs)(m.A,{className:"tiled-gallery__wrapper",align:y,columns:k,imageFilter:w,images:x,layoutStyle:A,linkTo:_,onMoveBackward:O,onMoveForward:F,onRemoveImage:I,onSelectImage:R,onResize:z,roundedCorners:j,selectedImage:t?E:null,setImageAttributes:H,children:[(0,f.jsx)(s.DropZone,{onFilesDrop:M}),t&&(0,f.jsx)("div",{className:"tiled-gallery__add-item",children:(0,f.jsx)(s.FormFileUpload,{multiple:!0,className:"tiled-gallery__add-item-button",onChange:U,accept:"image/*",icon:"insert",__next40pxDefaultSize:!0,children:__("Upload an image","jetpack")})})]})]}),(0,f.jsxs)("div",{...S,children:[(0,f.jsx)(h.c,{images:x,onSelectImages:L,imageFilter:w,onFilterChange:e=>{l({imageFilter:e}),T(null)}}),$]})});n.d(t,["Ay",0,y])},25589(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(76585),i=n(10602),a=n(22728),c=n(96575),l=n(32022),u=n(2369),d=n(24324),p=n(49263),h=n(76882),m=n(86781);n(80490);const g={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:l,width:160,height:95},{alt:"",link:"",url:u,width:160,height:107},{alt:"",link:"",url:d,width:304,height:203},{alt:"",link:"",url:p,width:312,height:207},{alt:"",link:"",url:h,width:152,height:101},{alt:"",link:"",url:m,width:152,height:105}],linkTo:"none"};function f(e=[]){return e.filter(({id:e,url:t})=>e&&t)}(0,o.M)(s,{edit:a.Ay,save:c.A,transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:e=>f(e).length>0,transform:e=>{const t=f(e);return(0,r.createBlock)(s.name,{images:t.map(({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r})),ids:t.map(({id:e})=>e)})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:({images:e=[]},t)=>{!e.length&&t?.length&&(e=t.filter(e=>"core/image"===e.name&&e.attributes?.url).map(({attributes:e})=>({id:e.id,url:e.url,link:e.href,alt:e.alt})));const n=f(e);return n.length>0?(0,r.createBlock)(s.name,{images:n.map(({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r})),ids:n.map(({id:e})=>e)}):(0,r.createBlock)(s.name)}}],to:[{type:"block",blocks:["core/gallery"],transform:({images:e,ids:t,columns:n,linkTo:o})=>(0,r.createBlock)("core/gallery",{images:e,ids:t,columns:n,imageCrop:!0,linkTo:o})},{type:"block",blocks:["core/image"],transform:({align:e,images:t})=>t.length>0?t.map(({id:t,url:n,alt:o})=>(0,r.createBlock)("core/image",{align:e,id:t,url:n,alt:o})):(0,r.createBlock)("core/image")}]},providesContext:{imageCrop:"imageCrop"},deprecated:i.A,example:{attributes:g}})},62820(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(56427),s=n(27723),i=n(10790);const __=s.__,_x=s._x,a=[{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})]}),title:_x("Original","image style","jetpack"),value:void 0},{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})]}),title:_x("Black and White","image style","jetpack"),value:"black-and-white"},{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})]}),title:_x("Sepia","image style","jetpack"),value:"sepia"},{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})]}),title:"1977",value:"1977"},{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})]}),title:_x("Clarendon","image style","jetpack"),value:"clarendon"},{icon:(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0z"}),(0,i.jsx)(o.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})]}),title:_x("Gingham","image style","jetpack"),value:"gingham"}],c=__("Pick an image filter","jetpack"),l=(0,i.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,i.jsx)(o.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,i.jsx)(o.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"})]});function u({value:e,onChange:t}){return(0,i.jsx)(o.Dropdown,{placement:"bottom-start",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:({onToggle:e,isOpen:t})=>(0,i.jsx)(r.BlockControls,{children:(0,i.jsx)(o.Toolbar,{label:c,children:(0,i.jsx)(o.ToolbarButton,{onClick:e,"aria-expanded":t,"aria-haspopup":"true",label:c,showTooltip:!0,icon:l})})}),renderContent:({onClose:n})=>(0,i.jsx)(o.NavigableMenu,{className:"tiled-gallery__filter-picker-menu",children:a.map(({icon:r,title:s,value:a})=>{return(0,i.jsx)(o.MenuItem,{className:e===a?"is-active":void 0,icon:r,isSelected:e===a,onClick:(c=a,()=>{t(e===c?void 0:c),n()}),role:"menuitemcheckbox",children:s},a||"original");var c})})})}},42777(e,t,n){"use strict";var r=n(63162),o=n(56427),s=n(47143),i=n(86087),a=n(27723),c=n(48558),l=n(13022),u=n(74540),d=n(10790);const __=a.__;class p extends i.Component{img=(0,i.createRef)();state={isLoading:!1};onImageClick=()=>{this.props.isSelected||this.props.onSelect()};onImageKeyDown=e=>{const{isSelected:t,onRemove:n}=this.props;t&&[c.BACKSPACE,c.DELETE].includes(e.keyCode)&&(e.preventDefault(),n())};onImageLoadComplete=()=>{this.setState({isLoading:!1}),this.removeImageEventListeners()};addImageEventListeners=()=>{if(this.removeImageEventListeners(),this.img.current&&!(0,r.isBlobURL)(this.props.origUrl)){const e=this.img.current.complete;this.setState({isLoading:!e}),e||(this.img.current.addEventListener("load",this.onImageLoadComplete,{once:!0}),this.img.current.addEventListener("error",this.onImageLoadComplete,{once:!0}))}};removeImageEventListeners=()=>{this.img.current&&(this.img.current.removeEventListener("load",this.onImageLoadComplete),this.img.current.removeEventListener("error",this.onImageLoadComplete))};componentDidMount(){(0,r.isBlobURL)(this.props.origUrl)||this.img.current?.complete||(this.setState({isLoading:!0}),this.addImageEventListeners())}componentWillUnmount(){this.removeImageEventListeners()}componentDidUpdate(e){const{alt:t,height:n,image:o,link:s,url:i,width:a,origUrl:c}=this.props,l=(0,r.isBlobURL)(e.origUrl);if((0,r.isBlobURL)(c)||this.img.current?.complete||!l&&e.url===i||(this.setState({isLoading:!0}),this.addImageEventListeners()),o){const e={};!t&&o.alt_text&&(e.alt=o.alt_text),!n&&o.media_details&&o.media_details.height&&(e.height=+o.media_details.height),!s&&o.link&&(e.link=o.link),!i&&o.source_url&&(e.url=o.source_url),!a&&o.media_details&&o.media_details.width&&(e.width=+o.media_details.width),Object.keys(e).length&&this.props.setAttributes(e)}}render(){const{"aria-label":e,alt:t,columns:n,height:s,id:a,imageFilter:c,isFirstItem:p,isLastItem:h,isSelected:m,link:g,linkTo:f,customLink:b,onMoveBackward:v,onMoveForward:y,onRemove:k,origUrl:w,showMovers:x,srcSet:_,url:j,width:C}=this.props,{isLoading:A}=this.state;let S;switch(f){case"media":S=w;break;case"attachment":S=g;break;case"custom":S=b||"";break;default:S=""}const E=(0,r.isBlobURL)(w),T=(0,d.jsxs)(i.Fragment,{children:[(0,d.jsx)("img",{alt:t,"data-height":s,"data-id":a,"data-link":g,"data-url":w,"data-width":C,ref:this.img,src:E?void 0:j,srcSet:E?void 0:_,style:E?{backgroundImage:`url(${w})`}:void 0}),E&&(0,d.jsx)(o.Spinner,{})]});return(0,d.jsxs)("div",{className:(0,l.A)("tiled-gallery__item",{"is-selected":m,"is-transient":E,"is-loading":!E&&A,[`filter__${c}`]:!!c}),tabIndex:"0",role:"button",onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,"aria-label":e,children:[x&&(0,d.jsxs)("div",{className:"tiled-gallery__item__move-menu",children:[(0,d.jsx)(o.Button,{icon:1===n?u.Lo:u.Nd,onClick:p?void 0:v,className:"tiled-gallery__item__move-backward",label:__("Move image backward","jetpack"),"aria-disabled":p,disabled:!m}),(0,d.jsx)(o.Button,{icon:1===n?u.W4:u.Gy,onClick:h?void 0:y,className:"tiled-gallery__item__move-forward",label:__("Move image forward","jetpack"),"aria-disabled":h,disabled:!m})]}),(0,d.jsx)("div",{className:"tiled-gallery__item__inline-menu",children:(0,d.jsx)(o.Button,{icon:u.VN,onClick:k,className:"tiled-gallery__item__remove",label:__("Remove image","jetpack"),disabled:!m})}),S?(0,d.jsx)("a",{"aria-hidden":"true",children:T}):T]})}}const h=(0,s.withSelect)((e,t)=>{const{getEntityRecord:n}=e("core"),{id:r}=t;return{image:r?n("postType","attachment",r):null}})(p);n.d(t,["A",0,h])},52026(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(97999),o=n(63162),s=n(13022),i=n(10790);function a(e){const{alt:t,imageFilter:n,height:a,id:c,link:l,linkTo:u,customLink:d,origUrl:p,url:h,width:m}=e;if((0,o.isBlobURL)(p))return null;let g;switch(u){case"media":g=p;break;case"attachment":g=l;break;case"custom":g=d||"";break;default:g=""}const f=(0,r.isSimpleSite)()?{}:{"data-amp-layout":"responsive"},b=(0,i.jsx)("img",{alt:t,"data-height":a,"data-id":c,"data-link":l,"data-url":p,"data-width":m,src:h,...f});return(0,i.jsx)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${n}`]:!!n}),children:g?(0,i.jsx)("a",{href:g,children:b}):b})}},74540(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=(0,o.jsx)(r.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})}),i=(0,o.jsx)(r.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})}),a=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})}),c=(0,o.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})}),l=(0,o.jsx)(r.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(r.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"})});n.d(t,["Gy",0,i,"Lo",0,c,"Nd",0,s,"VN",0,l,"W4",0,a])},98737(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,width:t}){const n=t?{flexBasis:`${t}%`}:void 0;return(0,r.jsx)("div",{className:"tiled-gallery__col",style:n,children:e})}},3645(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(10790);function o({children:e,galleryRef:t}){return(0,r.jsx)("div",{className:"tiled-gallery__gallery",ref:t,children:e})}},6775(e,t,n){"use strict";n.d(t,{A:()=>p});var r=n(86087),o=n(27723),s=n(13022),i=n(42777),a=n(52026),c=n(90256),l=n(69322),u=n(92978),d=n(10790);const __=o.__;class p extends r.Component{renderImage(e,t){const{columns:n,imageFilter:r,images:s,isSave:l,linkTo:u,layoutStyle:p,onMoveBackward:h,onMoveForward:m,onRemoveImage:g,onSelectImage:f,selectedImage:b,setImageAttributes:v,skipPhotonDomain:y}=this.props,k=(0,o.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */
136 -__("image %1$d of %2$d in gallery","jetpack"),t+1,s.length),w=l?a.A:i.A,{src:x,srcSet:_}=(0,c.AW)(e,{layoutStyle:p},{skipPhotonDomain:y});return(0,d.jsx)(w,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:b===t,link:e.link,linkTo:u,customLink:e.customLink,onMoveBackward:l?void 0:h(t),onMoveForward:l?void 0:m(t),onRemove:l?void 0:g(t),onSelect:l?void 0:f(t),origUrl:e.url,setAttributes:l?void 0:v(t),showMovers:s.length>1,srcSet:_,url:x,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:i,roundedCorners:a,onResize:p,style:h,isSave:m,columnWidths:g}=this.props,f=(0,c.sL)(i)?u.A:l.A,b=this.props.images.map(this.renderImage,this),v="circle"!==i?Math.min(a,20):0;return(0,d.jsxs)("div",{style:h,className:(0,s.A)(n,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:o,layoutStyle:i,renderedImages:b,onResize:m?void 0:p}),t]})}}},69322(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(94107),s=n(98737),i=n(3645),a=n(51663),c=n(74176),l=n(18980),u=n(10790);class d extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;lastWidth=null;ro=null;observedContainer=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()}isContentSized(e,t){const n=t.getComputedStyle(e);if("inline-flex"===n.display||"inline-block"===n.display)return!0;if("absolute"===n.position||"fixed"===n.position)return!0;if(n.float&&"none"!==n.float)return!0;if(n.width&&/^(max|min|fit)-content/.test(n.width))return!0;const r=e.parentElement;if(!r)return!1;const o=t.getComputedStyle(r);if("flex"!==o.display&&"inline-flex"!==o.display)return!1;if(/^column/.test(o.flexDirection)){const e=n.alignSelf&&"auto"!==n.alignSelf?n.alignSelf:o.alignItems;return!!e&&"stretch"!==e&&"normal"!==e}const s=n.flexBasis;return"0"===n.flexGrow&&(!s||"auto"===s||"content"===s)}getFlexContainer(){const e=this.gallery.current;if(!e)return null;const t=e.ownerDocument?.defaultView||window;let n=e.parentElement;for(;n&&n.parentElement;){if(n.matches(".is-root-container, .editor-styles-wrapper"))return null;const e=n.parentElement,r=t.getComputedStyle(e).display;if(("flex"===r||"inline-flex"===r)&&!this.isContentSized(e,t))return e;n=e}return null}countFlexItems(e,t){const n=["STYLE","SCRIPT","TEMPLATE","LINK"];return Array.from(e.children).filter(e=>{if(n.includes(e.tagName))return!1;const r=t.getComputedStyle(e);return"none"!==r.display&&("absolute"!==r.position&&"fixed"!==r.position)}).length}getLayoutWidth(){const e=this.getFlexContainer();if(!e)return this.gallery.current?this.gallery.current.clientWidth:0;const t=e.ownerDocument?.defaultView||window,n=t.getComputedStyle(e);if(/^column/.test(n.flexDirection))return e.clientWidth;const r=this.countFlexItems(e,t);if(r<=1)return e.clientWidth;const o=parseFloat(n.columnGap)||0;return(e.clientWidth-o*(r-1))/r}syncContainerObservation(){if(!this.ro)return;const e=this.getFlexContainer();e!==this.observedContainer&&(this.observedContainer&&this.ro.unobserve(this.observedContainer),this.observedContainer=e,e&&this.ro.observe(e))}handleGalleryResize=()=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{const e=this.gallery.current;if(!e)return;this.syncContainerObservation();const t=this.getLayoutWidth();if(t<=0)return;if(null!==this.lastWidth&&Math.abs(t-this.lastWidth)<1)return;this.lastWidth=t;const n=[];(0,l.S)(e).forEach(e=>{n.push((0,l.r)(e,t))}),void 0!==this.props.onResize&&this.props.onResize(n)})};triggerResize(){this.gallery.current&&(this.lastWidth=null,this.handleGalleryResize())}observeResize(){this.triggerResize(),this.ro=new o.A(this.handleGalleryResize),this.gallery.current&&(this.ro.observe(this.gallery.current),this.syncContainerObservation())}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.observedContainer=null,this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map(e=>e.map(e=>{const n=t.slice(r,r+e);return r+=e,n})).map(e=>(0,l.r)(e,n))}render(){const{align:e,columns:t,images:n,layoutStyle:o,renderedImages:l}=this.props,d=(0,c.mJ)(n),p="columns"===o?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,l,1e3)})();let m=0;return(0,u.jsx)(i.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,u.jsx)(a.A,{children:e.map((e,n)=>{const r=l.slice(m,m+e);return m+=e,(0,u.jsx)(s.A,{width:h?.[t]?.[n],children:r},n)})},t))})}}},74176(e,t,n){"use strict";n.d(t,{FL:()=>i,VU:()=>C,mJ:()=>o});var r=n(66087);function o(e){return e.map(s)}function s({height:e,width:t}){return e&&t?t/e:1}function i(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,o=[];let s=e,i=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,t=>{const r=i<=(e+1)*n;return r&&(i+=t),r}).length;o.push(t),s=s.slice(t)}return o.push(s.length),[o]}const a=A([2,1,2],5),c=S([E,E,T,E,E]),l=S([E,E,E,T,E,E,E]),u=A([3,1,3],5),d=S([T,E,E,T]),p=A([1,2,1],5),h=S([T,E,E,E]),m=A([1,3],3),g=S([E,E,E,T]),f=A([3,1],3),b=S([P(1.6),(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2))]),v=A([1,2],3),y=A([1,1,1,1,1],1),k=A([1,1,1,1],1),w=A([1,1,1],3),x=S([(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2)),P(1.6)]),_=A([2,1],3),j=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const n=(e,o)=>{if(!o.length)return e;let s;s=o.length>15&&c(o)&&a(e)?[2,1,2]:o.length>15&&l(o)&&u(e)?[3,1,3]:5!==o.length&&d(o)&&p(e)?[1,2,1]:h(o)&&m(e)?[1,3]:g(o)&&f(e)?[3,1]:b(o)&&v(e)?[1,2]:t&&(5===o.length||10!==o.length&&o.length>6)&&y(e)&&(0,r.sum)(o.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)(t.slice(0,4));return k(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,o)?[1,1,1,1]:function(e,t,n){const o=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(o<2.5||o<5&&t.length>=3&&t[0]===t[2]||n)}(e,o,t)?[1,1,1]:x(o)&&_(e)?[2,1]:j(o)?[1]:o.length>3?[1,1]:Array(o.length).fill(1);const i=e.concat([s]),C=(0,r.sum)(s),A=o.slice(C);return n(i,A)};return n([],e)}function A(e,t){return n=>!n.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function T(e){return e<1}function N(e){return t=>t>=e}function P(e){return t=>t<e}},18980(e,t,n){"use strict";function r(e,t){const n=(t-e.reduce((e,t)=>e+t,0))/e.length;return e.map(e=>e+n)}function o(e,t){return function(e,[t,n],o){const s=4*(e.childElementCount-1),u=o-s;return function(e,{rawHeight:t,rowWidth:n}){const o=i(e),s=o.map(e=>(t-4*(e.childElementCount-1))*c(e)[0]),u=r(s,n);o.forEach((e,n)=>{const o=s[n],i=u[n];!function(e,{colHeight:t,width:n,rawWidth:o}){const s=a(e).map(e=>o/l(e)),i=r(s,t);Array.from(e.children).forEach((e,t)=>{const r=i[t];e.setAttribute("style",`height:${r}px;width:${n}px;`)})}(e,{colHeight:t-4*(e.childElementCount-1),width:i,rawWidth:o})});return u.map(e=>parseFloat(e/n*100).toFixed(5))}(e,{rawHeight:1/t*(u-n),rowWidth:u})}(e,function(e){const t=i(e).map(c).reduce(([e,t],[n,r])=>[e+n,t+r],[0,0]);return t}(e),t)}function s(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function i(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function a(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function c(e){const t=a(e),n=t.length,r=1/t.map(l).reduce((e,t)=>e+1/t,0);return[r,r*n||1]}function l(e){const t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}n.d(t,{S:()=>s,r:()=>o})},51663(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13022),o=n(10790);function s({children:e,className:t}){return(0,o.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},92978(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(66087),o=n(98737),s=n(3645),i=n(51663),a=n(10790);function c({columns:e,renderedImages:t}){const n=Math.min(20,e),c=t.length%n;return(0,a.jsx)(s.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),n)].map((e,t)=>(0,a.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,a.jsx)(o.A,{children:e},t))},t))})}},9888(e,t,n){"use strict";function r(e){return["columns","circle","square"].includes(e)}function o(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>e?.length===t[n]?.length)}n.d(t,{O:()=>o,o:()=>r})},96575(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(13022),s=n(90907),i=n(35463),a=n(22728),c=n(6775),l=n(10790);function u({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:u,className:d,columns:p=(0,a.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,l.jsx)("div",{...f,className:(0,o.A)(f.className,d),children:(0,l.jsx)(c.A,{align:u,columns:p,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(i.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})})}},90256(e,t,n){"use strict";n.d(t,{AW:()=>l,sL:()=>c});var r=n(97999),o=n(85985),s=n(63162),i=n(14936),a=n(13087);function c(e){return["circle","square"].includes(e)}function l(e,t={},{skipPhotonDomain:n=u()}={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,a.A)())return{src:e.url};if((0,s.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.isWoASite)()&&(0,o.pP)())return{src:e.url};const l=e.url.split("?",1)[0],{height:p,width:h}=e,{layoutStyle:m}=t,g=n||(0,r.isSimpleSite)()?d:i.A;let f;if(c(m)&&h&&p){const e=Math.min(2e3,h,p);f=g(l,{resize:`${e},${e}`})}else f=g(l);let b=[];if(c(m)){const e=Math.min(600,h,p),t=Math.min(2e3,h,p);for(let n=e;n<t;n+=300){const e=g(l,{resize:`${n},${n}`,strip:"info"});e&&b.push(`${e} ${n}w`)}}else{const e=Math.min(600,h),t=Math.min(2e3,h);for(let n=e;n<t;n+=300){const e=g(l,{strip:"info",width:n});e&&b.push(`${e} ${n}w`)}}return b=b.join(","),Object.assign({src:f},b&&{srcSet:b})}function u(){return!0===(0,r.getScriptData)()?.jetpack?.flags?.skipPhotonDomain}function d(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,o]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,o);return r.toString()}},98746(e,t,n){"use strict";n.d(t,{A:()=>p});var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(375),c=n(48558),l=(n(20744),n(10790));const __=i.__,u=({tockUrl:e,setEditedUrl:t,setUrl:n,cancel:r})=>{const i=(0,s.useRef)(!0),u=(0,s.useRef)(!1),d=e=>{n(),u.current=!0,e()};return(0,l.jsx)(o.ToolbarGroup,{children:(0,l.jsx)(o.Dropdown,{popoverProps:{variant:"toolbar"},onClose:()=>u.current?u.current=!1:r(),placement:"bottom-start",renderToggle:({isOpen:t,onToggle:n})=>(!i.current||t||e||(i.current=!1,n()),(0,l.jsx)(o.ToolbarButton,{className:"components-toolbar__control",label:__("Edit Tock business name","jetpack"),onClick:()=>{n(),t&&r()},children:__("Edit","jetpack")})),renderContent:({onClose:n})=>(0,l.jsx)(o.BaseControl,{className:"jetpack-tock-url-settings",help:(0,s.createInterpolateElement)(__("The Tock business can be found in the URL of your public Tock page. For example: www.exploretock.com/<b>myname</b>","jetpack"),{b:(0,l.jsx)("strong",{})}),__nextHasNoMarginBottom:!0,children:(0,l.jsxs)("div",{className:"jetpack-tock-url-input-wrapper",children:[(0,l.jsx)(o.TextControl,{placeholder:__("Add Tock business name","jetpack"),onChange:t,value:e,onKeyDownCapture:t=>((t,n)=>{const{keyCode:o}=t;o===c.ENTER&&""!==e&&(t.preventDefault(),d(n)),o===c.ESCAPE&&(t.preventDefault(),r(),n())})(t,n),className:"jetpack-tock-url-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)("div",{className:"jetpack-tock-url-input-action",children:(0,l.jsx)(o.Button,{type:"submit",label:__("Submit","jetpack"),icon:a.A,className:"jetpack-tock-url-input-submit",onClick:()=>d(n)})})]})})})})},d=({url:e,popoverAnchor:t})=>{const n=`\n\t\t<div id="Tock_widget_container" data-tock-display-mode="Button" data-tock-color-mode="Blue" data-tock-locale="en-us" data-tock-timezone="America/New_York" style="display:inline-block;"></div>\n\t\t<script src="https://www.exploretock.com/tock.js" async><\/script>\n\t\t<script>\n\t\t\t!function(t,o){if(!t.tock){var e=t.tock=function(){e.callMethod?\n\t\t\t e.callMethod.apply(e,arguments):e.queue.push(arguments)};t._tock||(t._tock=e),\n\t\t\t e.push=e,e.loaded=!0,e.version='1.0',e.queue=[];}}(window,document);\n\t\t\ttock('init', ${r=e,JSON.stringify(r).replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/&/g,"\\u0026")});\n\t\t<\/script>\n\t`;var r;return(0,l.jsxs)("div",{ref:t,children:[(0,l.jsx)(o.SandBox,{html:n},`tock-${e}`),(0,l.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};function p({attributes:e,setAttributes:t,isSelected:n}){const o=e.url??"",[i,a]=(0,s.useState)(o),c=(0,s.useCallback)(()=>{a(o)},[o]);return(0,s.useEffect)(()=>{n||c()},[n,c]),(0,l.jsxs)("div",{...(0,r.useBlockProps)(),children:[(0,l.jsx)(r.BlockControls,{children:(0,l.jsx)(u,{tockUrl:i,setEditedUrl:a,setUrl:()=>{const e=i.replace(/.*exploretock.com\//,"");a(e),t({url:e})},cancel:c})}),(0,l.jsx)(d,{url:o})]})}},94881(e,t,n){"use strict";var r=n(94375),o=n(86525),s=n(98746),i=n(10790);(0,r.M)(o,{edit:s.A,save:()=>(0,i.jsx)("div",{id:"Tock_widget_container","data-tock-display-mode":"Button","data-tock-color-mode":"Blue","data-tock-locale":"en-us","data-tock-timezone":"America/New_York"})})},66096(e,t,n){"use strict";n.d(t,{G:()=>c,O:()=>a});var r=n(56427),o=n(86087),s=n(27723),i=n(10790);const __=s.__;function a({attributes:e,setAttributes:t,postTypesData:n,toggleAttributes:a,setToggleAttributes:c}){const{displayAuthor:l,displayContext:u,displayDate:d,displayThumbnail:p,period:h,postsToShow:m}=e,[g,f]=(0,o.useState)(!1);if(!n)return;const b=[{label:__("Last 24 hours","jetpack"),value:"1"},{label:__("Last 48 hours","jetpack"),value:"2"},{label:__("Last 7 days","jetpack"),value:"7"},{label:__("Last 30 days","jetpack"),value:"30"},{label:__("Last 90 days","jetpack"),value:"90"},{label:__("Last year","jetpack"),value:"365"},{label:__("All-time","jetpack"),value:"all-time"}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{title:__("Block settings","jetpack"),children:[(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of items","jetpack"),value:m,onChange:e=>t({postsToShow:Math.min(e,10)}),min:1,max:10}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Stats period","jetpack"),value:h,onChange:e=>t({period:e}),options:b})]}),(0,i.jsxs)(r.PanelBody,{title:__("Items to display","jetpack"),children:[n.map(e=>{return(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.sprintf)(/* translators: %s: Content type (eg. post/page). */
136 +__("image %1$d of %2$d in gallery","jetpack"),t+1,s.length),w=l?a.A:i.A,{src:x,srcSet:_}=(0,c.AW)(e,{layoutStyle:p},{skipPhotonDomain:y});return(0,d.jsx)(w,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:r,isFirstItem:0===t,isLastItem:t+1===s.length,isSelected:b===t,link:e.link,linkTo:u,customLink:e.customLink,onMoveBackward:l?void 0:h(t),onMoveForward:l?void 0:m(t),onRemove:l?void 0:g(t),onSelect:l?void 0:f(t),origUrl:e.url,setAttributes:l?void 0:v(t),showMovers:s.length>1,srcSet:_,url:x,width:e.width},t)}render(){const{align:e,children:t,className:n,columns:r,images:o,layoutStyle:i,roundedCorners:a,onResize:p,style:h,isSave:m,columnWidths:g}=this.props,f=(0,c.sL)(i)?u.A:l.A,b=this.props.images.map(this.renderImage,this),v="circle"!==i?Math.min(a,20):0;return(0,d.jsxs)("div",{style:h,className:(0,s.A)(n,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:o,layoutStyle:i,renderedImages:b,onResize:m?void 0:p}),t]})}}},69322(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(86087),o=n(94107),s=n(98737),i=n(3645),a=n(51663),c=n(74176),l=n(18980),u=n(10790);class d extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;lastWidth=null;ro=null;observedContainer=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()}isContentSized(e,t){const n=t.getComputedStyle(e);if("inline-flex"===n.display||"inline-block"===n.display)return!0;if("absolute"===n.position||"fixed"===n.position)return!0;if(n.float&&"none"!==n.float)return!0;if(n.width&&/^(max|min|fit)-content/.test(n.width))return!0;const r=e.parentElement;if(!r)return!1;const o=t.getComputedStyle(r);if("flex"!==o.display&&"inline-flex"!==o.display)return!1;if(/^column/.test(o.flexDirection)){const e=n.alignSelf&&"auto"!==n.alignSelf?n.alignSelf:o.alignItems;return!!e&&"stretch"!==e&&"normal"!==e}const s=n.flexBasis;return"0"===n.flexGrow&&(!s||"auto"===s||"content"===s)}getFlexContainer(){const e=this.gallery.current;if(!e)return null;const t=e.ownerDocument?.defaultView||window;let n=e.parentElement;for(;n&&n.parentElement;){if(n.matches(".is-root-container, .editor-styles-wrapper"))return null;const e=n.parentElement,r=t.getComputedStyle(e).display;if(("flex"===r||"inline-flex"===r)&&!this.isContentSized(e,t))return e;n=e}return null}countFlexItems(e,t){const n=["STYLE","SCRIPT","TEMPLATE","LINK"];return Array.from(e.children).filter(e=>{if(n.includes(e.tagName))return!1;const r=t.getComputedStyle(e);return"none"!==r.display&&("absolute"!==r.position&&"fixed"!==r.position)}).length}getLayoutWidth(){const e=this.getFlexContainer();if(!e)return this.gallery.current?this.gallery.current.clientWidth:0;const t=e.ownerDocument?.defaultView||window,n=t.getComputedStyle(e);if(/^column/.test(n.flexDirection))return e.clientWidth;const r=this.countFlexItems(e,t);if(r<=1)return e.clientWidth;const o=parseFloat(n.columnGap)||0;return(e.clientWidth-o*(r-1))/r}syncContainerObservation(){if(!this.ro)return;const e=this.getFlexContainer();e!==this.observedContainer&&(this.observedContainer&&this.ro.unobserve(this.observedContainer),this.observedContainer=e,e&&this.ro.observe(e))}handleGalleryResize=()=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame(()=>{const e=this.gallery.current;if(!e)return;this.syncContainerObservation();const t=this.getLayoutWidth();if(t<=0)return;if(null!==this.lastWidth&&Math.abs(t-this.lastWidth)<1)return;this.lastWidth=t;const n=[];(0,l.S)(e).forEach(e=>{n.push((0,l.r)(e,t))}),void 0!==this.props.onResize&&this.props.onResize(n)})};triggerResize(){this.gallery.current&&(this.lastWidth=null,this.handleGalleryResize())}observeResize(){this.triggerResize(),this.ro=new o.A(this.handleGalleryResize),this.gallery.current&&(this.ro.observe(this.gallery.current),this.syncContainerObservation())}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.observedContainer=null,this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map(e=>e.map(e=>{const n=t.slice(r,r+e);return r+=e,n})).map(e=>(0,l.r)(e,n))}render(){const{align:e,columns:t,images:n,layoutStyle:o,renderedImages:l}=this.props,d=(0,c.mJ)(n),p="columns"===o?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,l,1e3)})();let m=0;return(0,u.jsx)(i.A,{galleryRef:this.gallery,children:p.map((e,t)=>(0,u.jsx)(a.A,{children:e.map((e,n)=>{const r=l.slice(m,m+e);return m+=e,(0,u.jsx)(s.A,{width:h?.[t]?.[n],children:r},n)})},t))})}}},74176(e,t,n){"use strict";n.d(t,{FL:()=>i,VU:()=>C,mJ:()=>o});var r=n(66087);function o(e){return e.map(s)}function s({height:e,width:t}){return e&&t?t/e:1}function i(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,o=[];let s=e,i=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(s,t=>{const r=i<=(e+1)*n;return r&&(i+=t),r}).length;o.push(t),s=s.slice(t)}return o.push(s.length),[o]}const a=A([2,1,2],5),c=S([E,E,T,E,E]),l=S([E,E,E,T,E,E,E]),u=A([3,1,3],5),d=S([T,E,E,T]),p=A([1,2,1],5),h=S([T,E,E,E]),m=A([1,3],3),g=S([E,E,E,T]),f=A([3,1],3),b=S([P(1.6),(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2))]),v=A([1,2],3),y=A([1,1,1,1,1],1),k=A([1,1,1,1],1),w=A([1,1,1],3),x=S([(0,r.overEvery)(N(.9),P(2)),(0,r.overEvery)(N(.9),P(2)),P(1.6)]),_=A([2,1],3),j=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const n=(e,o)=>{if(!o.length)return e;let s;s=o.length>15&&c(o)&&a(e)?[2,1,2]:o.length>15&&l(o)&&u(e)?[3,1,3]:5!==o.length&&d(o)&&p(e)?[1,2,1]:h(o)&&m(e)?[1,3]:g(o)&&f(e)?[3,1]:b(o)&&v(e)?[1,2]:t&&(5===o.length||10!==o.length&&o.length>6)&&y(e)&&(0,r.sum)(o.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)(t.slice(0,4));return k(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,o)?[1,1,1,1]:function(e,t,n){const o=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&w(e)&&(o<2.5||o<5&&t.length>=3&&t[0]===t[2]||n)}(e,o,t)?[1,1,1]:x(o)&&_(e)?[2,1]:j(o)?[1]:o.length>3?[1,1]:Array(o.length).fill(1);const i=e.concat([s]),C=(0,r.sum)(s),A=o.slice(C);return n(i,A)};return n([],e)}function A(e,t){return n=>!n.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function T(e){return e<1}function N(e){return t=>t>=e}function P(e){return t=>t<e}},18980(e,t,n){"use strict";function r(e,t){const n=(t-e.reduce((e,t)=>e+t,0))/e.length;return e.map(e=>e+n)}function o(e,t){return function(e,[t,n],o){const s=4*(e.childElementCount-1),u=o-s;return function(e,{rawHeight:t,rowWidth:n}){const o=i(e),s=o.map(e=>(t-4*(e.childElementCount-1))*c(e)[0]),u=r(s,n);o.forEach((e,n)=>{const o=s[n],i=u[n];!function(e,{colHeight:t,width:n,rawWidth:o}){const s=a(e).map(e=>o/l(e)),i=r(s,t);Array.from(e.children).forEach((e,t)=>{const r=i[t];e.setAttribute("style",`height:${r}px;width:${n}px;`)})}(e,{colHeight:t-4*(e.childElementCount-1),width:i,rawWidth:o})});return u.map(e=>parseFloat(e/n*100).toFixed(5))}(e,{rawHeight:1/t*(u-n),rowWidth:u})}(e,function(e){const t=i(e).map(c).reduce(([e,t],[n,r])=>[e+n,t+r],[0,0]);return t}(e),t)}function s(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function i(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function a(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function c(e){const t=a(e),n=t.length,r=1/t.map(l).reduce((e,t)=>e+1/t,0);return[r,r*n||1]}function l(e){const t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}n.d(t,{S:()=>s,r:()=>o})},51663(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(13022),o=n(10790);function s({children:e,className:t}){return(0,o.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},92978(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(66087),o=n(98737),s=n(3645),i=n(51663),a=n(10790);function c({columns:e,renderedImages:t}){const n=Math.min(20,e),c=t.length%n;return(0,a.jsx)(s.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),n)].map((e,t)=>(0,a.jsx)(i.A,{className:`columns-${e.length}`,children:e.map((e,t)=>(0,a.jsx)(o.A,{children:e},t))},t))})}},9888(e,t,n){"use strict";function r(e){return["columns","circle","square"].includes(e)}function o(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>e?.length===t[n]?.length)}n.d(t,{O:()=>o,o:()=>r})},96575(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(94715),o=n(13022),s=n(90907),i=n(35463),a=n(22728),c=n(6775),l=n(10790);function u({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:u,className:d,columns:p=(0,a.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,l.jsx)("div",{...f,className:(0,o.A)(f.className,d),children:(0,l.jsx)(c.A,{align:u,columns:p,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(i.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})})}},90256(e,t,n){"use strict";n.d(t,{AW:()=>l,sL:()=>c});var r=n(97999),o=n(85985),s=n(63162),i=n(14936),a=n(13087);function c(e){return["circle","square"].includes(e)}function l(e,t={},{skipPhotonDomain:n=u()}={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,a.A)())return{src:e.url};if((0,s.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.isWoASite)()&&(0,o.pP)())return{src:e.url};const l=e.url.split("?",1)[0],{height:p,width:h}=e,{layoutStyle:m}=t,g=n||(0,r.isSimpleSite)()?d:i.A;let f;if(c(m)&&h&&p){const e=Math.min(2e3,h,p);f=g(l,{resize:`${e},${e}`})}else f=g(l);let b=[];if(c(m)){const e=Math.min(600,h,p),t=Math.min(2e3,h,p);for(let n=e;n<t;n+=300){const e=g(l,{resize:`${n},${n}`,strip:"info"});e&&b.push(`${e} ${n}w`)}}else{const e=Math.min(600,h),t=Math.min(2e3,h);for(let n=e;n<t;n+=300){const e=g(l,{strip:"info",width:n});e&&b.push(`${e} ${n}w`)}}return b=b.join(","),Object.assign({src:f},b&&{srcSet:b})}function u(){return!0===(0,r.getScriptData)()?.jetpack?.flags?.skipPhotonDomain}function d(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,o]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,o);return r.toString()}},98746(e,t,n){"use strict";n.d(t,{A:()=>p});var r=n(94715),o=n(56427),s=n(86087),i=n(27723),a=n(375),c=n(48558),l=(n(20744),n(10790));const __=i.__,u=({tockUrl:e,setEditedUrl:t,setUrl:n,cancel:r})=>{const i=(0,s.useRef)(!0),u=(0,s.useRef)(!1),d=e=>{n(),u.current=!0,e()};return(0,l.jsx)(o.ToolbarGroup,{children:(0,l.jsx)(o.Dropdown,{popoverProps:{variant:"toolbar"},onClose:()=>u.current?u.current=!1:r(),placement:"bottom-start",renderToggle:({isOpen:t,onToggle:n})=>(!i.current||t||e||(i.current=!1,n()),(0,l.jsx)(o.ToolbarButton,{className:"components-toolbar__control",label:__("Edit Tock business name","jetpack"),onClick:()=>{n(),t&&r()},children:__("Edit","jetpack")})),renderContent:({onClose:n})=>(0,l.jsx)(o.BaseControl,{className:"jetpack-tock-url-settings",help:(0,s.createInterpolateElement)(__("The Tock business can be found in the URL of your public Tock page. For example: www.exploretock.com/<b>myname</b>","jetpack"),{b:(0,l.jsx)("strong",{})}),__nextHasNoMarginBottom:!0,children:(0,l.jsxs)("div",{className:"jetpack-tock-url-input-wrapper",children:[(0,l.jsx)(o.TextControl,{placeholder:__("Add Tock business name","jetpack"),onChange:t,value:e,onKeyDownCapture:t=>((t,n)=>{const{keyCode:o}=t;o===c.ENTER&&""!==e&&(t.preventDefault(),d(n)),o===c.ESCAPE&&(t.preventDefault(),r(),n())})(t,n),className:"jetpack-tock-url-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)("div",{className:"jetpack-tock-url-input-action",children:(0,l.jsx)(o.Button,{type:"submit",label:__("Submit","jetpack"),icon:a.A,className:"jetpack-tock-url-input-submit",onClick:()=>d(n)})})]})})})})},d=({url:e,popoverAnchor:t})=>{const n=`\n\t\t<div id="Tock_widget_container" data-tock-display-mode="Button" data-tock-color-mode="Blue" data-tock-locale="en-us" data-tock-timezone="America/New_York" style="display:inline-block;"></div>\n\t\t<script src="https://www.exploretock.com/tock.js" async><\/script>\n\t\t<script>\n\t\t\t!function(t,o){if(!t.tock){var e=t.tock=function(){e.callMethod?\n\t\t\t e.callMethod.apply(e,arguments):e.queue.push(arguments)};t._tock||(t._tock=e),\n\t\t\t e.push=e,e.loaded=!0,e.version='1.0',e.queue=[];}}(window,document);\n\t\t\ttock('init', '${e}');\n\t\t<\/script>\n\t`;return(0,l.jsxs)("div",{ref:t,children:[(0,l.jsx)(o.SandBox,{html:n},`tock-${e}`),(0,l.jsx)("div",{className:"block-library-embed__interactive-overlay"})]})};function p({attributes:e,setAttributes:t,isSelected:n}){const o=e.url??"",[i,a]=(0,s.useState)(o),c=(0,s.useCallback)(()=>{a(o)},[o]);return(0,s.useEffect)(()=>{n||c()},[n,c]),(0,l.jsxs)("div",{...(0,r.useBlockProps)(),children:[(0,l.jsx)(r.BlockControls,{children:(0,l.jsx)(u,{tockUrl:i,setEditedUrl:a,setUrl:()=>{const e=i.replace(/.*exploretock.com\//,"");a(e),t({url:e})},cancel:c})}),(0,l.jsx)(d,{url:o})]})}},94881(e,t,n){"use strict";var r=n(94375),o=n(86525),s=n(98746),i=n(10790);(0,r.M)(o,{edit:s.A,save:()=>(0,i.jsx)("div",{id:"Tock_widget_container","data-tock-display-mode":"Button","data-tock-color-mode":"Blue","data-tock-locale":"en-us","data-tock-timezone":"America/New_York"})})},66096(e,t,n){"use strict";n.d(t,{G:()=>c,O:()=>a});var r=n(56427),o=n(86087),s=n(27723),i=n(10790);const __=s.__;function a({attributes:e,setAttributes:t,postTypesData:n,toggleAttributes:a,setToggleAttributes:c}){const{displayAuthor:l,displayContext:u,displayDate:d,displayThumbnail:p,period:h,postsToShow:m}=e,[g,f]=(0,o.useState)(!1);if(!n)return;const b=[{label:__("Last 24 hours","jetpack"),value:"1"},{label:__("Last 48 hours","jetpack"),value:"2"},{label:__("Last 7 days","jetpack"),value:"7"},{label:__("Last 30 days","jetpack"),value:"30"},{label:__("Last 90 days","jetpack"),value:"90"},{label:__("Last year","jetpack"),value:"365"},{label:__("All-time","jetpack"),value:"all-time"}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.PanelBody,{title:__("Block settings","jetpack"),children:[(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of items","jetpack"),value:m,onChange:e=>t({postsToShow:Math.min(e,10)}),min:1,max:10}),(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Stats period","jetpack"),value:h,onChange:e=>t({period:e}),options:b})]}),(0,i.jsxs)(r.PanelBody,{title:__("Items to display","jetpack"),children:[n.map(e=>{return(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.sprintf)(/* translators: %s: Content type (eg. post/page). */
137 137 __("Display %s","jetpack"),e.label.toLowerCase()),checked:a[e.id]||!1,onChange:(n=e.id,e=>{const r={...a,[n]:e};if(Object.values(r).every(e=>!1===e))return f(!0);c(r),t({postTypes:r}),f(!1)})},e.id);var n}),g&&(0,i.jsx)(r.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1,children:__("At least one item must be selected.","jetpack")})]}),(0,i.jsxs)(r.PanelBody,{title:__("Metadata settings","jetpack"),children:[(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:l,onChange:e=>t({displayAuthor:e})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})]})]})}function c({attributes:e,setAttributes:t}){const{layout:n}=e,o=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===n},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===n}];return(0,i.jsx)(r.ToolbarGroup,{controls:o})}},45026(e,t,n){"use strict";var r=n(85985),o=n(1455),s=n.n(o),i=n(94715),a=n(86087),c=n(13022),l=n(10798),u=n(66096),d=n(15909),p=(n(51378),n(74192),n(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:n,isChangingStatus:o,isModuleActive:m,changeStatus:g}=(0,r.q7)("stats"),f=(0,i.useBlockProps)(),{className:b}=f,[v,y]=(0,a.useState)(),[k,w]=(0,a.useState)(),[x,_]=(0,a.useState)(),[j,C]=(0,a.useState)({}),{displayAuthor:A,displayContext:S,displayDate:E,displayThumbnail:T,layout:N,period:P,postsToShow:B,postTypes:M}=e;let I;return(0,a.useEffect)(()=>{s()({path:"/wpcom/v2/post-types"}).then(e=>{_(e),e.forEach(e=>{M&&M[e.id]&&C(t=>({...t,[e.id]:!0}))})})},[M]),(0,a.useEffect)(()=>{m&&s()({path:`/wpcom/v2/top-posts?period=${P}`}).then(e=>{y(e)})},[P,m]),(0,a.useEffect)(()=>{const e=v;if(!e)return;const t=[];for(let n=0;t.length!==B&&(e[n]&&M[e[n].type]&&t.push((0,p.jsx)(h,{title:e[n].title,date:e[n].date,author:e[n].author,thumbnail:e[n].thumbnail,context:e[n].context,displayDate:E,displayAuthor:A,displayThumbnail:T,displayContext:S},"jetpack-top-posts-"+e[n].id)),e[n]);n++);w(t)},[A,S,E,T,v,M,B,w]),I=m||n?k?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(i.InspectorControls,{children:(0,p.jsx)(u.O,{attributes:e,setAttributes:t,toggleAttributes:j,setToggleAttributes:C,postTypesData:x})}),(0,p.jsx)(i.BlockControls,{children:(0,p.jsx)(u.G,{attributes:e,setAttributes:t})}),(0,p.jsx)("div",{"data-item-count":k.length,children:(0,p.jsx)("div",{className:"jetpack-top-posts-wrapper",children:k})})]}):(0,p.jsx)(l.G,{}):(0,p.jsx)(d.k,{className:b,changeStatus:g,isLoading:o}),(0,p.jsx)("div",{...f,className:(0,c.A)(b,`is-${N}-layout`),children:I})};n.d(t,["A",0,m])},99883(e,t,n){"use strict";var r=n(74997),o=n(94375),s=n(35075),i=n(45026);(0,o.M)(s,{edit:i.A,save:()=>null,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"top-posts"===e,transform:({instance:e})=>{const t=e.raw.title?(0,r.createBlock)("core/heading",{content:e.raw.title,level:3}):null,n=(0,r.createBlock)("jetpack/top-posts",{displayAuthor:!1,displayDate:!1,displayThumbnail:"text"!==e.raw.display,layout:"grid"===e.raw.display?"grid":"list",period:"2",postsToShow:e.raw.count,postTypes:e.raw.types.reduce((e,t)=>(e[t]=!0,e),{})});return t?[t,n]:n}}]}})},15909(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(56427),i=n(27723),a=n(57273),c=n(35075),l=n(10790);const __=i.__;n.d(t,["k",0,({className:e,isLoading:t,changeStatus:n})=>{const i=(0,r.isWoASite)()?"https://wordpress.com/support/stats/":"https://jetpack.com/support/jetpack-stats/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(s.Placeholder,{icon:(0,o.sh)(c),instructions:__("You'll need to activate the Stats module to use this block.","jetpack"),label:c.title,children:[(0,l.jsx)(s.Button,{disabled:t,isBusy:t,onClick:()=>n(!0),variant:"secondary",children:t?__("Activating Stats","jetpack"):__("Activate Stats","jetpack",0)}),(0,l.jsx)("div",{className:"components-placeholder__learn-more",children:(0,l.jsx)(a.N,{openInNewTab:!0,href:i,children:__("Learn more about the Stats module.","jetpack")})})]})})}])},33983(e,t,n){"use strict";var r=n(86087),o=n(10790);const s=(0,r.createContext)();n.d(t,["Z",0,s,"f",0,({onFilesSelected:e,onMediaItemSelected:t,onUploadFinished:n,children:r})=>(0,o.jsx)(s.Provider,{value:{onFilesSelected:e,onMediaItemSelected:t,onUploadFinished:n},children:r})])},74628(e,t,n){"use strict";n.d(t,["C1",0,[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],"NF",0,{PUBLIC:0,PRIVATE:1,SITE_DEFAULT:2}])},59257(e,t,n){"use strict";const r={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"}},support:{reusable:!1},save:n(36564).A,isDeprecation:!0};n.d(t,["A",0,r])},36564(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(94715),o=n(10790);function s({attributes:e}){const{caption:t,guid:n}=e;if(!n)return null;const s=`https://videopress.com/v/${n}`;return(0,o.jsxs)("figure",{className:"wp-block-embed is-type-video is-provider-videopress",children:[(0,o.jsx)("div",{className:"wp-block-embed__wrapper",children:`\n${s}\n`}),!r.RichText.isEmpty(t)&&(0,o.jsx)(r.RichText.Content,{tagName:"figcaption",value:t})]})}},21440(e,t,n){"use strict";var r=n(37037),o=n(31481);const s={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsInline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},src:{type:"string"},videoPressClassNames:{type:"string"},align:{type:"wide"}},support:{reusable:!1},isEligible:({videoPressClassNames:e,guid:t})=>t&&void 0===e,migrate:e=>{const{className:t,videoPressClassNames:n}=e;return{...e,...(0,o.j)(t,n)}},save:r.A,isDeprecation:!0};n.d(t,["A",0,s])},37037(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(94715),o=n(77473),s=n(10790);function i(e){const{attributes:{autoplay:t,caption:n,controls:i,guid:a,loop:c,muted:l,poster:u,preload:d,videoPressClassNames:p}={}}=e;if(!a)return null;const h=(0,o.e)(a,{autoplay:t,controls:i,loop:c,muted:l,poster:u,preload:d});return(0,s.jsxs)("figure",{className:p,children:[(0,s.jsx)("div",{className:"wp-block-embed__wrapper",children:`\n${h}\n`}),!r.RichText.isEmpty(n)&&(0,s.jsx)(r.RichText.Content,{tagName:"figcaption",value:n})]})}},77473(e,t,n){"use strict";var r=n(93832);n.d(t,["e",0,(e,{autoplay:t,controls:n,loop:o,muted:s,poster:i,preload:a})=>{if(!e)return null;const c={...t&&{autoPlay:!0},...!n&&{controls:!1},...o&&{loop:!0},...s&&{muted:!0,persistVolume:!1},...i&&{posterUrl:i},..."none"!==a&&{preloadContent:a}};return(0,r.addQueryArgs)(`https://videopress.com/v/${e}`,c)}])},31481(e,t,n){"use strict";var r=n(36536),o=n.n(r);const s=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.77",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}];n.d(t,["j",0,(e,t)=>{const n=s.map(e=>e.className),r=new(o())(e);r.remove(...n,"wp-block-embed","is-type-video","is-provider-videopress");const i=new(o())(e);return i.add(t),i.remove(...r),{className:r.value,videoPressClassNames:i.value}}])},54727(e,t,n){"use strict";const r={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},muted:{type:"boolean"},playsinline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},seekbarPlayedColor:{type:"string",default:""},seekbarLoadingColor:{type:"string",default:""},seekbarColor:{type:"string",default:""},src:{type:"string"},videoPressClassNames:{type:"string"}},support:{reusable:!1},isEligible:e=>e.guid,save:n(36478).A,isDeprecation:!0};n.d(t,["A",0,r])},36478(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(13022),s=n(70222),i=n(10790);function a(e){const{attributes:{autoplay:t,caption:n,controls:a,guid:c,loop:l,muted:u,playsinline:d,poster:p,preload:h,videoPressClassNames:m,className:g,align:f,seekbarColor:b,seekbarPlayedColor:v,seekbarLoadingColor:y}={}}=e,k=r.useBlockProps.save({className:(0,o.A)("wp-block-video",g,m,{[`align${f}`]:f})}),w=(0,s.e)(c,{autoplay:t,controls:a,loop:l,muted:u,playsinline:d,poster:p,preload:h,seekbarColor:b,seekbarPlayedColor:v,seekbarLoadingColor:y});return(0,i.jsxs)("figure",{...k,children:[(0,i.jsx)("div",{className:"wp-block-embed__wrapper",children:`\n${w}\n`}),!r.RichText.isEmpty(n)&&(0,i.jsx)(r.RichText.Content,{tagName:"figcaption",value:n})]})}},70222(e,t,n){"use strict";var r=n(93832);n.d(t,["e",0,(e,{autoplay:t,controls:n,loop:o,muted:s,playsinline:i,poster:a,preload:c,seekbarColor:l,seekbarPlayedColor:u,seekbarLoadingColor:d})=>{if(!e)return null;const p={resizeToParent:!0,...t&&{autoPlay:!0},...!n&&{controls:!1},...o&&{loop:!0},...s&&{muted:!0,persistVolume:!1},...i&&{playsinline:!0},...a&&{posterUrl:a},..."none"!==c&&{preloadContent:c},...""!==l&&{sbc:l},...""!==u&&{sbpc:u},...""!==d&&{sblc:d}};return(0,r.addQueryArgs)(`https://videopress.com/v/${e}`,p)}])},65390(e,t,n){"use strict";const r={attributes:{autoplay:{type:"boolean"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",default:!0},maxWidth:{type:"string",default:"100%"},guid:{type:"string"},id:{type:"number"},loop:{type:"boolean"},isVideoPressExample:{type:"boolean",default:!1},muted:{type:"boolean"},playsinline:{type:"boolean"},poster:{type:"string"},preload:{type:"string",default:"metadata"},seekbarPlayedColor:{type:"string",default:""},seekbarLoadingColor:{type:"string",default:""},seekbarColor:{type:"string",default:""},src:{type:"string"},videoPressTracks:{type:"array",items:{type:"object"},default:[]},videoPressClassNames:{type:"string"}},support:{reusable:!1},isEligible:e=>e.guid,migrate:e=>({...e,useAverageColor:!1}),save:n(34135).A,isDeprecation:!0};n.d(t,["A",0,r])},34135(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(13022),s=n(9847),i=n(10790);function a(e){const{attributes:{autoplay:t,caption:n,controls:a,guid:c,loop:l,muted:u,playsinline:d,poster:p,preload:h,videoPressClassNames:m,className:g,align:f,seekbarColor:b,seekbarPlayedColor:v,seekbarLoadingColor:y,maxWidth:k}={}}=e,w=r.useBlockProps.save({className:(0,o.A)("wp-block-video",g,m,{[`align${f}`]:f})}),x=(0,s.e)(c,{autoplay:t,controls:a,loop:l,muted:u,playsinline:d,poster:p,preload:h,seekbarColor:b,seekbarPlayedColor:v,seekbarLoadingColor:y});let _={};return k&&k.length>0&&"100%"!==k&&(_={maxWidth:k,margin:"auto"}),(0,i.jsxs)("figure",{...w,children:[(0,i.jsx)("div",{className:"wp-block-embed__wrapper",style:_,children:`\n${x}\n`}),!r.RichText.isEmpty(n)&&(0,i.jsx)(r.RichText.Content,{tagName:"figcaption",value:n})]})}},9847(e,t,n){"use strict";var r=n(93832);n.d(t,["e",0,(e,{autoplay:t,controls:n,loop:o,muted:s,playsinline:i,poster:a,preload:c,seekbarColor:l,seekbarPlayedColor:u,seekbarLoadingColor:d})=>{if(!e)return null;const p={resizeToParent:!0,cover:!0,...t&&{autoPlay:!0},...!n&&{controls:!1},...o&&{loop:!0},...s&&{muted:!0,persistVolume:!1},...i&&{playsinline:!0},...a&&{posterUrl:a},..."none"!==c&&{preloadContent:c},...""!==l&&{sbc:l},...""!==u&&{sbpc:u},...""!==d&&{sblc:d}};return(0,r.addQueryArgs)(`https://videopress.com/v/${e}`,p)}])},85719(e,t,n){"use strict";var r=n(35750),o=n(1455),s=n.n(o),i=n(63162),a=n(94715),c=n(56427),l=n(29491),u=n(47143),d=n(86087),p=n(89877),h=n(27723),m=n(13109),g=n(57273),f=n(13022),b=n(33983),v=n(74628),y=n(64655),k=n(57636),w=n(63739),x=n(51742),_=n(9821),j=n(73475),C=n(17900),A=n(47960),S=n(10790);const __=h.__,_x=h._x,E=["image"],T=e=>{const t=(0,a.useBlockProps)({className:"resumable-upload"}),{onChangeTitle:n,title:o,filename:s,onSelectPoster:i,onRemovePoster:p,videoPosterImageData:h,fileForUpload:g,isUploadComplete:f,onDismissEditor:v,onSave:y,onVideoFrameSelected:w}=e,x=(0,u.useSelect)(e=>e("core/editor").isSavingPost(),[]),_=(0,l.usePrevious)(x);return(0,d.useEffect)(()=>{x&&!_&&y()},[x,_,y]),(0,S.jsx)(b.f,{onUploadFinished:e.uploadFinished,children:(0,S.jsxs)(d.Fragment,{children:[e.blockSettings,(0,S.jsxs)("div",{...t,children:[(0,S.jsxs)("div",{className:"uploader-block__logo",children:[(0,S.jsx)(m.A,{icon:r.KZ}),(0,S.jsx)("div",{className:"uploader-block__logo-text",children:__("VideoPress","jetpack")})]}),(0,S.jsx)(j.d,{file:g,filename:s,title:o,onChangeTitle:n,onSelectPoster:i,onRemovePoster:p,videoPosterImageData:h,onVideoFrameSelected:w}),!f&&(0,S.jsx)(k.A,{file:g}),f&&(0,S.jsxs)("div",{className:"uploader-block__upload-complete",children:[(0,S.jsxs)("span",{children:[__("Upload Complete!","jetpack")," 🎉"]}),(0,S.jsx)(c.Button,{variant:"primary",onClick:v,children:__("Done","jetpack")})]})]})]})})},N=e=>{const{scripts:t}=e,{html:n,interactive:r,caption:o,isSelected:s,hideOverlay:i,attributes:l,setAttributes:u,shouldRenderLoadingBlock:p}=e,{align:h,className:m,videoPressClassNames:g,maxWidth:b}=l,v=(0,a.useBlockProps)({className:(0,f.A)("wp-block-video",m,g,{[`align${h}`]:h})}),k=(0,d.useMemo)(()=>(0,w.e)(t),[t]);if(p)return(0,S.jsx)("figure",{...v,children:(0,S.jsx)(y.A,{text:__("Generating preview…","jetpack")})});return(0,S.jsxs)("figure",{...v,children:[(0,S.jsx)("div",{className:"wp-block-embed__wrapper",children:(0,S.jsx)(c.ResizableBox,{enable:{top:!1,bottom:!1,left:!0,right:!0},maxWidth:"100%",size:{width:b},style:{margin:"auto"},onResizeStop:(e,t,n)=>{let r=getComputedStyle(n).width;if(null!==n.parentElement){r===getComputedStyle(n.parentElement).width&&(r="100%")}u({maxWidth:r})},children:(0,S.jsx)(c.SandBox,{html:n,scripts:k,type:g,allowSameOrigin:!0})})}),!r&&(0,S.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:i}),(!a.RichText.isEmpty(o)||s)&&(0,S.jsx)(a.RichText,{tagName:"figcaption",placeholder:__("Write caption…","jetpack"),value:o,onChange:e=>u({caption:e}),inlineToolbar:!0})]})},P=(0,l.createHigherOrderComponent)((0,l.compose)([(0,u.withSelect)((e,t)=>{const{autoplay:n,controls:r,fileForImmediateUpload:o,guid:s,loop:a,muted:c,playsinline:l,poster:u,preload:d,seekbarColor:p,seekbarLoadingColor:h,seekbarPlayedColor:m,src:g,useAverageColor:f}=t.attributes,{getEmbedPreview:b,isRequestingEmbedPreview:v}=e("core"),y=(0,C.e)(s,{autoplay:n,controls:r,loop:a,muted:c,playsinline:l,poster:u,preload:d,seekbarColor:p,seekbarLoadingColor:h,seekbarPlayedColor:m,useAverageColor:f}),k=!!y&&b(y),w=!!y&&v(y),x=!!window.videoPressResumableEnabled;return{fileForImmediateUpload:o,isFetchingPreview:w,isUploading:!x&&(0,i.isBlobURL)(g),preview:k,resumableUploadEnabled:x,url:y}}),(0,u.withDispatch)(e=>({invalidateCachedEmbedPreview:t=>{e("core/data").invalidateResolution("core","getEmbedPreview",[t])}})),l.withInstanceId,e=>class extends d.Component{constructor(e){super(...arguments),this.state={media:null,isFetchingMedia:!1,fallback:!1,interactive:!1,rating:null,lastRequestedMediaId:null,isUpdatingRating:!1,allowDownload:null,privacySetting:v.NF.SITE_DEFAULT,isUpdatingAllowDownload:!1,fileForUpload:e.fileForImmediateUpload,isUpdatingIsPrivate:!1,isEditingWhileUploading:!1,isUploadComplete:!1,lastPosterValueSource:"",pendingVideoAttributes:null},this.posterImageButton=(0,d.createRef)(),this.previewCacheReloadTimer=null,this.previewFailuresCount=0}static getDerivedStateFromProps(e,t){const n={};if(!e.isSelected&&t.interactive&&(n.interactive=!1),t.fileForUpload&&!t.isEditingWhileUploading){null!==t.fileForUpload&&t.fileForUpload instanceof File&&(n.isEditingWhileUploading=!0)}else t.pendingVideoAttributes&&(n.isEditingWhileUploading=!0);return Object.keys(n).length?n:null}hideOverlay=()=>{this.setState({interactive:!0})};async componentDidMount(){const{guid:e}=this.props.attributes;e?this.setTracks(e):await this.setGuid(),this.setRatingAndAllowDownload()}setRatingAndAllowDownload=async()=>{const e=this.props?.attributes?.id,t=await this.requestMedia(e);let n=t?.jetpack_videopress?.rating;const r=t?.jetpack_videopress?.allow_download,o=t?.jetpack_videopress?.privacy_setting??v.NF.SITE_DEFAULT;n&&("X-18"===n&&(n="R-17"),this.setState({rating:n})),void 0!==r&&this.setState({allowDownload:!!r}),void 0!==o&&this.setState({privacySetting:o})};async componentDidUpdate(e){const{attributes:t,invalidateCachedEmbedPreview:n,preview:r,setAttributes:o,url:s,isFetchingPreview:i}=this.props;t.id!==e.attributes.id&&(await this.setGuid(),this.setRatingAndAllowDownload());let a=!1;if(s&&s!==e.url&&(n(s),a=!0),r){const e=(0,A.Zz)(r.html,(0,f.A)("wp-block-embed","is-type-video","is-provider-videopress"),!1);this.previewFailuresCount=0,o({videoPressClassNames:e})}else i||a||!this.props.attributes.guid||this.schedulePreviewCacheReload()}schedulePreviewCacheReload=()=>{const{invalidateCachedEmbedPreview:e,url:t}=this.props;null===this.previewCacheReloadTimer&&this.previewFailuresCount<5&&(this.previewFailuresCount++,this.previewCacheReloadTimer=setTimeout(()=>{e(t),this.previewCacheReloadTimer=null},2e3*this.previewFailuresCount))};fallbackToCore=()=>{this.props.setAttributes({guid:void 0}),this.setState({fallback:!0})};setGuid=async()=>{const{attributes:e,setAttributes:t}=this.props,{id:n}=e;if(n)try{const e=await this.requestMedia(n);if(null===e)return;const r=e?.jetpack_videopress?.guid;r?(t({guid:r}),this.setTracks(r)):this.fallbackToCore()}catch{this.setState({isFetchingMedia:!1}),this.fallbackToCore()}else t({guid:void 0})};requestMedia=async e=>{if(!e)return null;if(null!==this.state.media&&this.state.lastRequestedMediaId===e)return this.state.media;this.setState({isFetchingMedia:!0});const t=await s()({path:`/wp/v2/media/${e}`}).catch(()=>(this.setState({fallback:!0}),null)).finally(()=>{this.setState({isFetchingMedia:!1})}),{id:n}=this.props.attributes;return e!==n?null:(this.setState({media:t,lastRequestedMediaId:e}),t)};setTracks=e=>{const{setAttributes:t}=this.props;e&&s()({url:`https://public-api.wordpress.com/rest/v1.1/videos/${e}`,credentials:"omit",global:!0}).then(e=>{const n=[];Object.keys(e.tracks).forEach(t=>{for(const r in e.tracks[t]){const o=e.tracks[t][r];n.push({src:o.src,kind:t,srcLang:r,label:o.label})}}),t({videoPressTracks:n})})};switchToEditing=()=>{this.props.setAttributes({id:void 0,guid:void 0,src:void 0})};onSelectPoster=e=>{const{setAttributes:t}=this.props;t({poster:e.url}),this.setState({videoPosterImageData:e})};onRemovePoster=()=>{const{setAttributes:e}=this.props;e({poster:""}),this.setState({videoPosterImageData:null}),this.posterImageButton.current.focus()};toggleAttribute=e=>t=>{this.props.setAttributes({[e]:t})};getAutoplayHelp=e=>e?__("Note: Autoplaying videos may cause usability issues for some visitors.","jetpack"):null;getPreloadHelp(){const{attributes:e}=this.props;return"auto"===e.preload?__("Note: Automatically downloading videos may cause issues if there are many videos displayed on the same page.","jetpack"):null}getPrivacySettingHelp=e=>{const t=parseInt(e,10);return v.NF.PRIVATE===t?__("Restrict views to members of this site","jetpack"):v.NF.PUBLIC===t?__("Video can be viewed by anyone","jetpack"):__("Follow the site privacy setting","jetpack")};renderControlLabelWithTooltip(e,t){return(0,S.jsx)(c.Tooltip,{text:t,position:"top",children:(0,S.jsx)("span",{children:e})})}onChangeRating=e=>{const t=this.state.rating;"X-18"===e&&(e="R-17"),-1!==["G","PG-13","R-17"].indexOf(e)&&this.updateMetaApiCall({rating:e},()=>this.setState({isUpdatingRating:!0,rating:e}),()=>this.setState({rating:t}),()=>this.setState({isUpdatingRating:!1}))};onChangeAllowDownload=e=>{const t=this.state.allowDownload;this.updateMetaApiCall({allow_download:e?1:0},()=>this.setState({isUpdatingAllowDownload:!0,allowDownload:e}),()=>this.setState({allowDownload:t}),()=>this.setState({isUpdatingAllowDownload:!1}))};onChangePrivacySetting=e=>{const t=this.state.privacySetting;this.updateMetaApiCall({privacy_setting:e},()=>this.setState({isUpdatingPrivacySetting:!0,privacySetting:e}),()=>this.setState({privacySetting:t}),()=>this.setState({isUpdatingPrivacySetting:!1}))};updateMetaApiCall=(e,t,n,r)=>{const{invalidateCachedEmbedPreview:o,url:i}=this.props,{id:a}=this.props.attributes;if(!a)return;t();const c={id:a};Object.assign(c,e),s()({path:"/wpcom/v2/videopress/meta",method:"POST",data:c}).then(e=>{status in e&&200!==e.status&&n()}).catch(()=>n()).finally(()=>{r(),o(i)})};render(){const{attributes:t,instanceId:n,isFetchingPreview:r,isUploading:o,preview:i,resumableUploadEnabled:l,setAttributes:u}=this.props,{fallback:m,fileForUpload:f,isFetchingMedia:k,isUpdatingRating:w,interactive:j,rating:C,allowDownload:P,privacySetting:B,isUpdatingAllowDownload:M,isUpdatingPrivacySetting:I,videoPosterImageData:R}=this.state,{autoplay:L,caption:D,controls:F,guid:O,loop:z,muted:U,playsinline:H,poster:$,preload:V,useAverageColor:q,videoPressTracks:G,isVideoPressExample:W,src:Z}=t;if(W&&Z)return(0,S.jsx)("img",{src:Z,alt:D});const J=`video-block__poster-image-description-${n}`,K=!(!$&&!R),Y=(0,S.jsxs)(d.Fragment,{children:[(0,S.jsx)(a.BlockControls,{group:"block",children:(0,S.jsx)(_.A,{tracks:G,onChange:e=>{u({videoPressTracks:e})},guid:O})}),(0,S.jsx)(a.BlockControls,{children:(0,S.jsx)(c.ToolbarGroup,{children:(0,S.jsx)(c.ToolbarButton,{className:"components-icon-button components-toolbar__control",text:__("Replace","jetpack"),onClick:this.switchToEditing})})}),(0,S.jsxs)(a.InspectorControls,{children:[(0,S.jsxs)(c.PanelBody,{title:__("Video Settings","jetpack"),children:[(0,S.jsx)(c.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Autoplay","jetpack"),/* translators: Tooltip describing the "autoplay" option for the VideoPress player */
138 138 __("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:L,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,S.jsx)(c.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Loop","jetpack"),/* translators: Tooltip describing the "loop" option for the VideoPress player */
139 139 __("Restarts the video when it reaches the end","jetpack")),onChange:this.toggleAttribute("loop"),checked:z,__nextHasNoMarginBottom:!0}),(0,S.jsx)(c.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:U,__nextHasNoMarginBottom:!0}),(0,S.jsx)(c.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),/* translators: Tooltip describing the "controls" option for the VideoPress player */
140 140 __("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:F,__nextHasNoMarginBottom:!0}),(0,S.jsx)(c.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),/* translators: Tooltip describing the "playsinline" option for the VideoPress player */
@@ -168,9 +168,9 @@
168 168 __("%s / month","jetpack"),s);case"1 year":return(0,a.sprintf)(
169 169 // translators: %s: amount
170 170 __("%s / year","jetpack"),s);case"one-time":return s}return(0,a.sprintf)(
171 171 // translators: %1$s: formatted price, %2$s: plan interval
172 -__("%1$s / %2$s","jetpack"),s,n)}function y({onClose:e,product:t}){const{selectedProductIds:n,setSelectedProductIds:r}=(0,m.B)(),{id:o,title:i}=t,a=n&&n.includes(o),c=a?l.A:void 0,u=t?" "+v(t):null;return(0,b.jsxs)(s.MenuItem,{icon:c,onClick:t=>{t.preventDefault();const s=a?n.filter(e=>e!==o):[...n,o];r(s),e()},selected:a,value:o,children:[i," : ",u]})}function k({onClose:e}){const{clientId:t,productType:n}=(0,m.B)(),r=(0,i.useSelect)(e=>e(p.M).getSiteSlug()),o=(0,g.A)(t);if(h.Wd===(0,h.AU)())return(0,b.jsx)(s.MenuItem,{children:r&&(0,b.jsx)(d.N,{openInNewTab:!0,href:`https://wordpress.com/earn/payments/${r}#add-new-payment-plan`,children:(0,f.W)("add a new product",n)})});return(0,b.jsx)(s.MenuItem,{onClick:t=>{t.preventDefault(),o(),setTimeout(()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()},100),e()},children:(0,f.W)("add a new product",n)})}function w(){const{products:e,productType:t,selectedProductIds:n}=(0,m.B)(),r=(0,i.useSelect)(e=>e(p.M).getSelectedProducts(n),[n]);let a=null,l=u.A;return r.length>1?a=__("Multiple products selected","jetpack"):1===r.length&&(a=v(r[0])),r.length!=r.length&&(a=(0,f.W)("product not found",t),l=c.A),(0,b.jsx)(o.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,b.jsx)(s.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:l,label:(0,f.W)("select a product",t),text:a,children:({onClose:t})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.MenuGroup,{children:e.map(e=>(0,b.jsx)(y,{onClose:t,product:e},e.id))}),(0,b.jsx)(s.MenuGroup,{children:(0,b.jsx)(k,{onClose:t})})]})})})}},21212(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(47143),s=n(14309),i=n(59340);function a(e){const t=(0,i.AU)(),{selectBlock:n}=(0,o.useDispatch)(r.store),{enableComplementaryArea:a}=(0,o.useDispatch)("core/interface"),{closePublishSidebar:c}=(0,o.useDispatch)(s.store);return()=>{switch(e&&n(e),t){case"site":return a("core/edit-site","edit-site/block-inspector");case"widget":return a("core/edit-widgets","edit-widgets/block-inspector");default:c(),a("core/edit-post","edit-post/block")}}}},1990(e,t,n){"use strict";n.d(t,{G:()=>c,W:()=>i});var r=n(27723),o=n(29726);const __=r.__,s={"add a new product":{[o._]:__("Add a new payment plan","jetpack"),[o.h]:__("Add a new subscription","jetpack")},"product not found":{[o._]:__("Payment plan not found","jetpack"),[o.h]:__("Subscription not found","jetpack")},"select a product":{[o._]:__("Select a payment plan","jetpack"),[o.h]:__("Select a subscription","jetpack")},"default new product title":{[o._]:__("Monthly Subscription","jetpack"),[o.h]:__("Monthly Subscription","jetpack")},"manage your products":{[o._]:__("Manage your payment plans.","jetpack"),[o.h]:__("Manage your subscriptions.","jetpack")},"saving product":{[o._]:__("Saving payment plan…","jetpack"),[o.h]:__("Saving subscription…","jetpack")},"add product":{[o._]:__("Add payment plan","jetpack"),[o.h]:__("Add subscription","jetpack")},"product requires a name":{[o._]:__("Payment plan requires a name","jetpack"),[o.h]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[o._]:__("Payment plan requires a valid price","jetpack"),[o.h]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[o._]:__("Successfully created payment plan","jetpack"),[o.h]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[o._]:__("There was an error when adding the payment plan.","jetpack"),[o.h]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[o._]:__("Invalid payment plan configured for this block.","jetpack"),[o.h]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[o._]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[o.h]:__("The subscribe button will be hidden from your visitors until you select a valid subscription.","jetpack")},"mark this product as a donation":{[o._]:__("Mark this payment plan as a donation","jetpack"),[o.h]:__("Mark this subscription as a donation","jetpack")}};function i(e,t=o._){return s?.[e]?.[t]||null}const a={"1 month":__("Monthly Subscription","jetpack"),"1 year":__("Yearly Subscription","jetpack"),"one-time":__("Subscription","jetpack")};function c(e){return a[[e]]??""}},57810(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(85985),o=n(35750),s=n(56427),i=n(27723),a=(n(53472),n(10790));const __=i.__;function c({blockName:e,connectUrl:t}){const{autosaveAndRedirect:n}=(0,r.ZR)(t),{tracks:i}=(0,r.st)();return(0,a.jsx)(s.ToolbarButton,{className:"connect-stripe components-tab-button",icon:o.k7,onClick:t=>{t.preventDefault(),i.recordEvent("jetpack_editor_block_stripe_connect_click",{block:e}),n(t)},children:__("Connect Stripe","jetpack")})}},53796(e,t,n){"use strict";var r=n(3924),o=n(97999),s=n(85985),i=n(47143),a=n(27723),c=n(57273),l=n(71218),u=n(16521),d=n(11998),p=(n(51082),n(10790));const __=a.__;n.d(t,["V",0,({blockName:e})=>{const t=(0,i.select)(u.M).getConnectUrl(),{tracks:n}=(0,s.st)();if(!t)return null;let a,h;const m=(0,o.isWpcomPlatformSite)();switch(e){case"payment-buttons":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-payments-block"):(0,r.A)("jetpack-support-jetpack-blocks-payments-block");break;case"donations":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-donations-block"):(0,r.A)("jetpack-support-jetpack-blocks-donations-block"),h=(0,p.jsx)(c.N,{openInNewTab:!0,href:(0,r.A)("jetpack-support-donation-block-stripe-reqs"),children:__("Review Stripe’s requirements for accepting donations","jetpack")});break;case"premium-content":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-premium-content-block"):(0,r.A)("jetpack-support-jetpack-blocks-premium-content-block");break;default:a=m?(0,r.A)("wpcom-support-payments-button-block"):(0,r.A)("jetpack-support-jetpack-blocks-payments-block")}return(0,p.jsx)(d.A,{className:"jetpack-stripe-nudge__banner",buttonLabel:__("Connect","jetpack"),icon:(0,p.jsx)(l.A,{className:"jetpack-stripe-nudge__icon",size:18,"aria-hidden":"true",role:"img",focusable:"false"}),href:t,links:(0,p.jsxs)(p.Fragment,{children:[h,(0,p.jsx)(c.N,{openInNewTab:!0,href:a,children:__("Learn more about the block and fees","jetpack")})]}),onClick:()=>n.recordEvent("jetpack_editor_block_stripe_connect_click",{block:e}),title:__("Connect to Stripe to use this block on your site","jetpack"),subtitle:__("This block will be hidden from your visitors until you connect to Stripe.","jetpack")})}])},72730(e,t,n){"use strict";n.d(t,{C_:()=>l,Xj:()=>a,dv:()=>i,kF:()=>c});var r=n(26356);const o={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5},s=Object.keys(o).map(e=>{const{symbol:t}=(n=e,r.y[n]||{symbol:"$",decimal:".",grouping:",",precision:2});var n;var o;return{value:e,label:t===e?e:`${e} ${o=t,String(o||"").replace(/\.+$/,"")}`}});function i(e){return o[e]}function a(e){const t=i(e);return[10*t,30*t,200*t]}function c(e,t){return!isNaN(t)&&t>=i(e)}function l(e,t){if(!e)return null;if("number"==typeof e)return e;let n=e;return r.y[t].grouping&&(n=e.replace(new RegExp("\\"+r.y[t].grouping,"g"),"")),e=parseFloat(n.replace(new RegExp("\\"+r.y[t].decimal,"g"),".")),isNaN(e)?null:e}n.d(t,["T",0,s,"VK",0,o])},74006(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=({label:e,onClick:t})=>(0,o.jsx)(r.ToolbarButton,{className:"components-toolbar__control",onClick:t,icon:"edit",title:e,showTooltip:!0});n.dn(s),n.d(t,["A",0,s])},56539(e,t,n){"use strict";const r=new Map,o=e=>r.has(e),s={acquire:e=>{if(o(e))return null;const t=Math.random();return r.set(e,t),[e,t]},blockExecution:async(e,t=10)=>{for(;o(e);)await new Promise(e=>setTimeout(e,t))},clearAll:()=>r.clear(),isLocked:o,release:e=>{const[t,n]=e;return!(!o(t)||r.get(t)!==n)&&(r.delete(t),!0)}};n.d(t,["A",0,s])},333(e,t,n){"use strict";n.d(t,{wc:()=>i});var r=n(85985),o=n(66087);function s(){return(0,r.$i)()?.allowedMimeTypes??[]}function i(e,t){if(!e||!t)return!1;if(!s())return!1;const n=(r=t)?(0,o.pickBy)(s(),e=>e.startsWith(`${r}/`)):{};var r;const i=(a=n)?Object.keys(a).map(e=>e.split("|")).flat():[];var a;if("string"==typeof e){const t=e.split(".").pop();return t&&i.includes(t)}return"object"==typeof e&&(e.type&&Object.values(n).includes(e.type))}},97969(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(74997);function o(...e){const t=(0,r.getCategories)();for(const n of e)if(t.some(({slug:e})=>e===n))return n;throw new Error(`Could not find a category from the provided list: ${e.join(",")}`)}},27574(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(93832);function o(e,t){if(!(0,r.isURL)(t))return null;let n=t;try{const o=(0,r.getQueryArg)(t,"state"),s=JSON.parse(atob(o));if(e)s.from_editor_post_id=e;else{const e=new URLSearchParams(window.location.search);s.from_site_editor_post_id=e.get("postId"),s.from_site_editor_post_type=e.get("postType")}n=(0,r.addQueryArgs)(t,{state:btoa(JSON.stringify(s))})}catch(e){0}return n}},59340(e,t,n){"use strict";var r=n(47143);const o="customizer";n.d(t,["AU",0,()=>(0,r.select)("core/edit-site")?"site":(0,r.select)("core/edit-widgets")?"widget":(0,r.select)("core/customize-widgets")?o:(0,r.select)("core/edit-navigation")?"navigation":(0,r.select)("core/edit-post")?"post":"unknown","Wd",0,o])},78218(e,t,n){"use strict";n.d(t,["y",0,(e,t)=>Object.entries(t).reduce((t,[n,r])=>{if(void 0===e[n])return t;const{type:o,validator:s,validValues:i,default:a}=e[n];return t[n]="boolean"===o?"false"!==r&&!!r:s?s(r)?r:a:i?i.includes(r)?r:a:r,t},{})])},84112(e,t,n){"use strict";var r=n(13022),o=n(49789),s=(n(65823),n(10790));const i=({children:e=null,isError:t=!1,...n})=>{const i=(0,r.A)("help-message",{"help-message-is-error":t});return e&&(0,s.jsxs)("div",{className:i,...n,children:[t&&(0,s.jsx)(o.A,{size:"24","aria-hidden":"true",role:"img",focusable:"false"}),(0,s.jsx)("span",{children:e})]})};n.dn(i),n.d(t,["A",0,i])},21604(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(85985);function o(){return(0,r.$i)()?.jetpack?.is_active??!1}},98212(e,t,n){"use strict";function r(e,t=[]){if("string"!=typeof e)return"";let n;try{n=new URL(e)}catch{return""}if("https:"!==n.protocol)return"";const r=n.hostname.toLowerCase();return t.some(e=>{if(e instanceof RegExp)return e.test(r);const t=String(e).toLowerCase();return r===t||r.endsWith(`.${t}`)})?n.href:""}function o(e,t=[]){return""!==r(e,t)}n.d(t,{A:()=>o,h:()=>r})},13087(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(85985);function o(){return(0,r.$i)()?.jetpack?.is_offline_mode??!1}},92420(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(92279),i=n(44978),a=n(10790);const __=o.__,{Fill:c,Slot:l}=(0,r.createSlotFill)("JetpackLikesAndSharingPanel");(0,s.registerPlugin)("jetpack-likes-and-sharing-panel",{render:()=>(0,a.jsx)(l,{children:e=>e.length?(0,a.jsx)(i.A,{children:(0,a.jsx)(r.PanelBody,{className:"jetpack-likes-sharing-panel",title:__("Insert likes and sharing","jetpack"),initialOpen:!1,children:e})}):null})}),n.d(t,["A",0,c])},44978(e,t,n){"use strict";var r=n(35750),o=n(56427),s=n(43656),i=n(86087),a=n(92279),c=(n(20209),n(10790));const{Fill:l,Slot:u}=(0,o.createSlotFill)("JetpackPluginSidebar");(0,a.registerPlugin)("jetpack-sidebar",{render:()=>(0,c.jsx)(u,{children:e=>e.length?(0,c.jsxs)(i.Fragment,{children:[(0,c.jsx)(s.PluginSidebarMoreMenuItem,{target:"jetpack",icon:(0,c.jsx)(r.ux,{}),children:"Jetpack"}),(0,c.jsx)(s.PluginSidebar,{name:"jetpack",title:"Jetpack",icon:(0,c.jsx)(r.ux,{}),children:e})]}):null})}),n.d(t,["A",0,l])},54919(e,t,n){"use strict";function r(e){return e=e.toLowerCase(),""===(e=["pt_br","pt-br","zh_tw","zh-tw","zh_cn","zh-cn"].includes(e)?e.replace("_","-"):e.replace(/([-_].*)$/i,""))?"en":e}n.d(t,{i:()=>r})},37906(e,t,n){"use strict";var r=n(27723);const __=r.__,o={everybody:{key:"everybody",label:__("Everyone","jetpack")},subscribers:{key:"subscribers",label:__("Subscribers","jetpack")},paid_subscribers:{key:"paid_subscribers",label:__("Paid subscribers","jetpack")}};n.d(t,["KG",0,"_jetpack_dont_email_post_to_subs","P2",0,o,"a7",0,"_jetpack_newsletter_tier_id","jr",0,"_jetpack_newsletter_access"])},42167(e,t,n){"use strict";var r=n(85985),o=n(3582),s=n(37906);n.d(t,["I",0,e=>{const[t=[]]=(0,o.useEntityProp)("postType",e,"meta");let n=t[s.jr]??s.P2.everybody.key;return n||(n=s.P2.everybody.key),n},"V",0,()=>(0,r.$i)()?.jetpack?.is_newsletter_feature_enabled??!1])},82500(e,t,n){"use strict";n.d(t,{EX:()=>A,GG:()=>S,iF:()=>_,ix:()=>E});var r=n(54268),o=n(94715),s=n(56427),i=n(29491),a=n(3582),c=n(47143),l=n(43656),u=n(27723),d=n(57273),p=n(88050),h=n(42472),m=n(61868),g=n(13022),f=n(64524),b=n(16521),v=(n(81641),n(37906)),y=n(9894),k=n(10790);const __=u.__;function w({accessLevel:e,subscribers:t,paidSubscribers:n,postHasPaywallBlock:r=!1}){switch(t=t??0,n=n??0,v.P2[e]?.key){case v.P2.everybody.key:case v.P2.subscribers.key:return t;case v.P2.paid_subscribers.key:return r?t:n;default:return 0}}function x(e,t=!1){switch(e){case v.P2.subscribers.key:return t?__("Only subscribers can read the content below the paywall. Subscribers receive it by email.","jetpack",0):__("Only subscribers can read this post. Others see a preview and can subscribe. Subscribers receive it by email.","jetpack");case v.P2.paid_subscribers.key:return t?__("Only paid subscribers can read the content below the paywall. All subscribers receive it by email.","jetpack",0):__("Only paid subscribers can read this post. Others see a preview and can subscribe. Only paid subscribers receive it by email.","jetpack");default:return __("Anyone can read this post. Subscribers receive it by email.","jetpack")}}function _(){const e=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[t,n]=(0,a.useEntityProp)("postType",e,"meta");return e=>{delete t[v.a7],n({...t,[v.jr]:e})}}function j(){const e=(0,c.useSelect)(e=>e(b.M).getNewsletterTierProducts()).filter(e=>"1 month"===e.interval).sort((e,t)=>Number(t.price)-Number(e.price)),t=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[{[v.a7]:n}]=(0,a.useEntityProp)("postType",t,"meta"),r=function(){const e=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[t,n]=(0,a.useEntityProp)("postType",e,"meta");return e=>{n({...t,[v.a7]:e})}}();return e.length<2?null:(0,k.jsx)("div",{className:"jetpack-editor-post-tiers",children:(0,k.jsx)(s.RadioControl,{label:__("Choose Newsletter Tier","jetpack"),hideLabelFromVision:!0,selected:String(n),options:e.map(e=>({label:e.title,value:String(e.id)})),onChange:e=>r(Number(e))})})}function C({id:e,groupName:t,value:n,label:r,checked:o,disabled:s,describedBy:i,onChange:a}){return(0,k.jsxs)("div",{className:(0,g.A)("components-radio-control__option",{"jetpack-newsletter-access-radio-buttons__disabled-option":s}),children:[(0,k.jsx)("input",{type:"radio",className:"components-radio-control__input",id:e,name:s?void 0:t,value:n,checked:o,"aria-disabled":s||void 0,"aria-describedby":i,readOnly:s,onChange:s?void 0:e=>a(e.target.value),onClick:s?e=>e.preventDefault():void 0,onKeyDown:s?e=>{" "===e.key&&e.preventDefault()}:void 0}),(0,k.jsx)("label",{className:"components-radio-control__label",htmlFor:e,children:r})]})}function A({accessLevel:e,hasTierPlans:t,stripeConnectUrl:n,postHasPaywallBlock:o=!1,explainPaywallConstraint:a=!0}){const l=null===n,{totalSubscribers:u,paidSubscribers:g}=(0,c.useSelect)(e=>e(b.M).getSubscriberCounts()),f=l&&t,S=e===v.P2.paid_subscribers.key,E=!f&&!S,T=e===v.P2.everybody.key,N=!!o&&!T,P=N&&a,B=_(),M=w({accessLevel:v.P2.subscribers.key,subscribers:u,paidSubscribers:g}),I=w({accessLevel:v.P2.paid_subscribers.key,subscribers:u,paidSubscribers:g}),R=(0,i.useInstanceId)(A,"jetpack-newsletter-access"),L=`${R}-group`,D=`${R}-paywall-notice`,F=`${R}-paid-setup-link`,O=[{value:v.P2.everybody.key,label:v.P2.everybody.label,disabled:N,describedBy:P?D:void 0},{value:v.P2.subscribers.key,label:`${v.P2.subscribers.label} (${(0,r.qe)(M)})`},{value:v.P2.paid_subscribers.key,label:`${v.P2.paid_subscribers.label} (${(0,r.qe)(I)})`,disabled:E,describedBy:E?F:void 0}];return(0,k.jsxs)("div",{className:"jetpack-newsletter-access-radio-buttons",children:[P&&(0,k.jsxs)(p.b,{intent:"info",icon:null,id:D,children:[(0,k.jsx)(h.h,{children:__("Paywall active","jetpack")}),(0,k.jsx)(m.V,{children:__("Choose who can read the full post. Everyone can still read the content above the paywall.","jetpack")})]}),(0,k.jsxs)("fieldset",{role:"radiogroup",className:"components-radio-control",children:[(0,k.jsx)(s.BaseControl.VisualLabel,{as:"legend",children:__("Who can read this post?","jetpack")}),(0,k.jsx)("div",{className:"components-radio-control__group-wrapper",children:O.map(t=>(0,k.jsx)(C,{id:`${R}-${t.value}`,groupName:L,value:t.value,label:t.label,checked:!t.disabled&&e===t.value,disabled:!!t.disabled,describedBy:t.describedBy,onChange:B},t.value))})]}),E&&(0,k.jsx)(d.N,{id:F,openInNewTab:!0,href:(0,y.Qu)(t),children:__("Turn on paid subscribers","jetpack")}),S&&f&&(0,k.jsx)(j,{}),(0,k.jsx)("p",{className:"jetpack-newsletter-access-radio-buttons__description",children:x(e,!!o)})]})}function S({accessLevel:e}){const{hasTierPlans:t,stripeConnectUrl:n,isLoading:r,postHasPaywallBlock:i}=(0,c.useSelect)(e=>{const{getNewsletterTierProducts:t,getConnectUrl:n,isApiStateLoading:r}=e(b.M),{getBlocks:s}=e(o.store);return{isLoading:r(),stripeConnectUrl:n(),hasTierPlans:0!==t()?.length,postHasPaywallBlock:s().some(e=>e.name===f.name)}}),a=(0,c.useSelect)(e=>e(l.store).getEditedPostVisibility());if(r)return(0,k.jsx)(s.Flex,{direction:"column",align:"center",children:(0,k.jsx)(s.Spinner,{})});const u=e??v.P2.everybody.key,d=v.P2[u]?.label,p=(0,y.fI)(a,e);return(0,k.jsx)(l.PostVisibilityCheck,{render:({canEdit:e})=>(0,k.jsxs)(s.Flex,{direction:"column",children:[p&&(0,k.jsx)(y.mf,{}),(0,k.jsxs)(s.FlexBlock,{children:[e&&(0,k.jsx)(A,{accessLevel:u,stripeConnectUrl:n,hasTierPlans:t,postHasPaywallBlock:i}),!e&&(0,k.jsx)("span",{children:d})]})]})})}function E(){const e=(0,c.useSelect)(e=>e(l.store).isCurrentPostPublished(),[]),t=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),{saveEditedEntityRecord:n}=(0,c.useDispatch)(a.store),[r,o]=(0,a.useEntityProp)("postType",t,"meta"),i=(0,a.useEntityId)("postType",t),u=(0,c.useSelect)(e=>{const{getPostEmailSentState:t}=e(b.M);return i?t(i):null},[i]),d=null!=u?.email_sent_at,p=e=>{const s={...r,[v.KG]:!e};o(s),n("postType",t,i)},h=(0,c.useSelect)(e=>{const t=e(l.store).getEditedPostAttribute("meta");return!t?.[v.KG]});return d?null:(0,k.jsx)(l.PostVisibilityCheck,{render:({canEdit:t})=>(0,k.jsx)(s.ToggleControl,{className:"jetpack-subscribe-email-document-setting",checked:h,disabled:e||!t,label:__("Send this post to subscribers","jetpack"),onChange:p})})}},181(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(56427),a=n(47143),c=n(43656),l=n(86087),u=n(27723),d=n(75200),p=n(64524),h=n(37906),m=n(16521),g=n(10790);const __=u.__,f=(e,t,n=!0)=>{if(!n&&!e?.length)return"";const r=e?.length?e:[1],o=t.filter(e=>r.includes(e.id)).map(e=>e.name);o.push(__("All content","jetpack"));const s=o.map(e=>`<strong>${e}</strong>`);let i;if(1===s.length)i=s[0];else if(2===s.length)i=(0,u.sprintf)(
172 +__("%1$s / %2$s","jetpack"),s,n)}function y({onClose:e,product:t}){const{selectedProductIds:n,setSelectedProductIds:r}=(0,m.B)(),{id:o,title:i}=t,a=n&&n.includes(o),c=a?l.A:void 0,u=t?" "+v(t):null;return(0,b.jsxs)(s.MenuItem,{icon:c,onClick:t=>{t.preventDefault();const s=a?n.filter(e=>e!==o):[...n,o];r(s),e()},selected:a,value:o,children:[i," : ",u]})}function k({onClose:e}){const{clientId:t,productType:n}=(0,m.B)(),r=(0,i.useSelect)(e=>e(p.M).getSiteSlug()),o=(0,g.A)(t);if(h.Wd===(0,h.AU)())return(0,b.jsx)(s.MenuItem,{children:r&&(0,b.jsx)(d.N,{openInNewTab:!0,href:`https://wordpress.com/earn/payments/${r}#add-new-payment-plan`,children:(0,f.W)("add a new product",n)})});return(0,b.jsx)(s.MenuItem,{onClick:t=>{t.preventDefault(),o(),setTimeout(()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()},100),e()},children:(0,f.W)("add a new product",n)})}function w(){const{products:e,productType:t,selectedProductIds:n}=(0,m.B)(),r=(0,i.useSelect)(e=>e(p.M).getSelectedProducts(n),[n]);let a=null,l=u.A;return r.length>1?a=__("Multiple products selected","jetpack"):1===r.length&&(a=v(r[0])),r.length!=r.length&&(a=(0,f.W)("product not found",t),l=c.A),(0,b.jsx)(o.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,b.jsx)(s.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:l,label:(0,f.W)("select a product",t),text:a,children:({onClose:t})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.MenuGroup,{children:e.map(e=>(0,b.jsx)(y,{onClose:t,product:e},e.id))}),(0,b.jsx)(s.MenuGroup,{children:(0,b.jsx)(k,{onClose:t})})]})})})}},21212(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(94715),o=n(47143),s=n(14309),i=n(59340);function a(e){const t=(0,i.AU)(),{selectBlock:n}=(0,o.useDispatch)(r.store),{enableComplementaryArea:a}=(0,o.useDispatch)("core/interface"),{closePublishSidebar:c}=(0,o.useDispatch)(s.store);return()=>{switch(e&&n(e),t){case"site":return a("core/edit-site","edit-site/block-inspector");case"widget":return a("core/edit-widgets","edit-widgets/block-inspector");default:c(),a("core/edit-post","edit-post/block")}}}},1990(e,t,n){"use strict";n.d(t,{G:()=>c,W:()=>i});var r=n(27723),o=n(29726);const __=r.__,s={"add a new product":{[o._]:__("Add a new payment plan","jetpack"),[o.h]:__("Add a new subscription","jetpack")},"product not found":{[o._]:__("Payment plan not found","jetpack"),[o.h]:__("Subscription not found","jetpack")},"select a product":{[o._]:__("Select a payment plan","jetpack"),[o.h]:__("Select a subscription","jetpack")},"default new product title":{[o._]:__("Monthly Subscription","jetpack"),[o.h]:__("Monthly Subscription","jetpack")},"manage your products":{[o._]:__("Manage your payment plans.","jetpack"),[o.h]:__("Manage your subscriptions.","jetpack")},"saving product":{[o._]:__("Saving payment plan…","jetpack"),[o.h]:__("Saving subscription…","jetpack")},"add product":{[o._]:__("Add payment plan","jetpack"),[o.h]:__("Add subscription","jetpack")},"product requires a name":{[o._]:__("Payment plan requires a name","jetpack"),[o.h]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[o._]:__("Payment plan requires a valid price","jetpack"),[o.h]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[o._]:__("Successfully created payment plan","jetpack"),[o.h]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[o._]:__("There was an error when adding the payment plan.","jetpack"),[o.h]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[o._]:__("Invalid payment plan configured for this block.","jetpack"),[o.h]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[o._]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[o.h]:__("The subscribe button will be hidden from your visitors until you select a valid subscription.","jetpack")},"mark this product as a donation":{[o._]:__("Mark this payment plan as a donation","jetpack"),[o.h]:__("Mark this subscription as a donation","jetpack")}};function i(e,t=o._){return s?.[e]?.[t]||null}const a={"1 month":__("Monthly Subscription","jetpack"),"1 year":__("Yearly Subscription","jetpack"),"one-time":__("Subscription","jetpack")};function c(e){return a[[e]]??""}},57810(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(85985),o=n(35750),s=n(56427),i=n(27723),a=(n(53472),n(10790));const __=i.__;function c({blockName:e,connectUrl:t}){const{autosaveAndRedirect:n}=(0,r.ZR)(t),{tracks:i}=(0,r.st)();return(0,a.jsx)(s.ToolbarButton,{className:"connect-stripe components-tab-button",icon:o.k7,onClick:t=>{t.preventDefault(),i.recordEvent("jetpack_editor_block_stripe_connect_click",{block:e}),n(t)},children:__("Connect Stripe","jetpack")})}},53796(e,t,n){"use strict";var r=n(3924),o=n(97999),s=n(85985),i=n(47143),a=n(27723),c=n(57273),l=n(71218),u=n(16521),d=n(11998),p=(n(51082),n(10790));const __=a.__;n.d(t,["V",0,({blockName:e})=>{const t=(0,i.select)(u.M).getConnectUrl(),{tracks:n}=(0,s.st)();if(!t)return null;let a,h;const m=(0,o.isWpcomPlatformSite)();switch(e){case"payment-buttons":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-payments-block"):(0,r.A)("jetpack-support-jetpack-blocks-payments-block");break;case"donations":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-donations-block"):(0,r.A)("jetpack-support-jetpack-blocks-donations-block"),h=(0,p.jsx)(c.N,{openInNewTab:!0,href:(0,r.A)("jetpack-support-donation-block-stripe-reqs"),children:__("Review Stripe’s requirements for accepting donations","jetpack")});break;case"premium-content":a=m?(0,r.A)("wpcom-support-wordpress-editor-blocks-premium-content-block"):(0,r.A)("jetpack-support-jetpack-blocks-premium-content-block");break;default:a=m?(0,r.A)("wpcom-support-payments-button-block"):(0,r.A)("jetpack-support-jetpack-blocks-payments-block")}return(0,p.jsx)(d.A,{className:"jetpack-stripe-nudge__banner",buttonLabel:__("Connect","jetpack"),icon:(0,p.jsx)(l.A,{className:"jetpack-stripe-nudge__icon",size:18,"aria-hidden":"true",role:"img",focusable:"false"}),href:t,links:(0,p.jsxs)(p.Fragment,{children:[h,(0,p.jsx)(c.N,{openInNewTab:!0,href:a,children:__("Learn more about the block and fees","jetpack")})]}),onClick:()=>n.recordEvent("jetpack_editor_block_stripe_connect_click",{block:e}),title:__("Connect to Stripe to use this block on your site","jetpack"),subtitle:__("This block will be hidden from your visitors until you connect to Stripe.","jetpack")})}])},72730(e,t,n){"use strict";n.d(t,{C_:()=>l,Xj:()=>a,dv:()=>i,kF:()=>c});var r=n(26356);const o={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5},s=Object.keys(o).map(e=>{const{symbol:t}=(n=e,r.y[n]||{symbol:"$",decimal:".",grouping:",",precision:2});var n;var o;return{value:e,label:t===e?e:`${e} ${o=t,String(o||"").replace(/\.+$/,"")}`}});function i(e){return o[e]}function a(e){const t=i(e);return[10*t,30*t,200*t]}function c(e,t){return!isNaN(t)&&t>=i(e)}function l(e,t){if(!e)return null;if("number"==typeof e)return e;let n=e;return r.y[t].grouping&&(n=e.replace(new RegExp("\\"+r.y[t].grouping,"g"),"")),e=parseFloat(n.replace(new RegExp("\\"+r.y[t].decimal,"g"),".")),isNaN(e)?null:e}n.d(t,["T",0,s,"VK",0,o])},74006(e,t,n){"use strict";var r=n(56427),o=n(10790);const s=({label:e,onClick:t})=>(0,o.jsx)(r.ToolbarButton,{className:"components-toolbar__control",onClick:t,icon:"edit",title:e,showTooltip:!0});n.dn(s),n.d(t,["A",0,s])},56539(e,t,n){"use strict";const r=new Map,o=e=>r.has(e),s={acquire:e=>{if(o(e))return null;const t=Math.random();return r.set(e,t),[e,t]},blockExecution:async(e,t=10)=>{for(;o(e);)await new Promise(e=>setTimeout(e,t))},clearAll:()=>r.clear(),isLocked:o,release:e=>{const[t,n]=e;return!(!o(t)||r.get(t)!==n)&&(r.delete(t),!0)}};n.d(t,["A",0,s])},333(e,t,n){"use strict";n.d(t,{wc:()=>i});var r=n(85985),o=n(66087);function s(){return(0,r.$i)()?.allowedMimeTypes??[]}function i(e,t){if(!e||!t)return!1;if(!s())return!1;const n=(r=t)?(0,o.pickBy)(s(),e=>e.startsWith(`${r}/`)):{};var r;const i=(a=n)?Object.keys(a).map(e=>e.split("|")).flat():[];var a;if("string"==typeof e){const t=e.split(".").pop();return t&&i.includes(t)}return"object"==typeof e&&(e.type&&Object.values(n).includes(e.type))}},97969(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(74997);function o(...e){const t=(0,r.getCategories)();for(const n of e)if(t.some(({slug:e})=>e===n))return n;throw new Error(`Could not find a category from the provided list: ${e.join(",")}`)}},27574(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(93832);function o(e,t){if(!(0,r.isURL)(t))return null;let n=t;try{const o=(0,r.getQueryArg)(t,"state"),s=JSON.parse(atob(o));if(e)s.from_editor_post_id=e;else{const e=new URLSearchParams(window.location.search);s.from_site_editor_post_id=e.get("postId"),s.from_site_editor_post_type=e.get("postType")}n=(0,r.addQueryArgs)(t,{state:btoa(JSON.stringify(s))})}catch(e){0}return n}},59340(e,t,n){"use strict";var r=n(47143);const o="customizer";n.d(t,["AU",0,()=>(0,r.select)("core/edit-site")?"site":(0,r.select)("core/edit-widgets")?"widget":(0,r.select)("core/customize-widgets")?o:(0,r.select)("core/edit-navigation")?"navigation":(0,r.select)("core/edit-post")?"post":"unknown","Wd",0,o])},78218(e,t,n){"use strict";n.d(t,["y",0,(e,t)=>Object.entries(t).reduce((t,[n,r])=>{if(void 0===e[n])return t;const{type:o,validator:s,validValues:i,default:a}=e[n];return t[n]="boolean"===o?"false"!==r&&!!r:s?s(r)?r:a:i?i.includes(r)?r:a:r,t},{})])},84112(e,t,n){"use strict";var r=n(13022),o=n(49789),s=(n(65823),n(10790));const i=({children:e=null,isError:t=!1,...n})=>{const i=(0,r.A)("help-message",{"help-message-is-error":t});return e&&(0,s.jsxs)("div",{className:i,...n,children:[t&&(0,s.jsx)(o.A,{size:"24","aria-hidden":"true",role:"img",focusable:"false"}),(0,s.jsx)("span",{children:e})]})};n.dn(i),n.d(t,["A",0,i])},21604(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(85985);function o(){return(0,r.$i)()?.jetpack?.is_active??!1}},13087(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(85985);function o(){return(0,r.$i)()?.jetpack?.is_offline_mode??!1}},92420(e,t,n){"use strict";var r=n(56427),o=n(27723),s=n(92279),i=n(44978),a=n(10790);const __=o.__,{Fill:c,Slot:l}=(0,r.createSlotFill)("JetpackLikesAndSharingPanel");(0,s.registerPlugin)("jetpack-likes-and-sharing-panel",{render:()=>(0,a.jsx)(l,{children:e=>e.length?(0,a.jsx)(i.A,{children:(0,a.jsx)(r.PanelBody,{className:"jetpack-likes-sharing-panel",title:__("Insert likes and sharing","jetpack"),initialOpen:!1,children:e})}):null})}),n.d(t,["A",0,c])},44978(e,t,n){"use strict";var r=n(35750),o=n(56427),s=n(43656),i=n(86087),a=n(92279),c=(n(20209),n(10790));const{Fill:l,Slot:u}=(0,o.createSlotFill)("JetpackPluginSidebar");(0,a.registerPlugin)("jetpack-sidebar",{render:()=>(0,c.jsx)(u,{children:e=>e.length?(0,c.jsxs)(i.Fragment,{children:[(0,c.jsx)(s.PluginSidebarMoreMenuItem,{target:"jetpack",icon:(0,c.jsx)(r.ux,{}),children:"Jetpack"}),(0,c.jsx)(s.PluginSidebar,{name:"jetpack",title:"Jetpack",icon:(0,c.jsx)(r.ux,{}),children:e})]}):null})}),n.d(t,["A",0,l])},54919(e,t,n){"use strict";function r(e){return e=e.toLowerCase(),""===(e=["pt_br","pt-br","zh_tw","zh-tw","zh_cn","zh-cn"].includes(e)?e.replace("_","-"):e.replace(/([-_].*)$/i,""))?"en":e}n.d(t,{i:()=>r})},37906(e,t,n){"use strict";var r=n(27723);const __=r.__,o={everybody:{key:"everybody",label:__("Everyone","jetpack")},subscribers:{key:"subscribers",label:__("Subscribers","jetpack")},paid_subscribers:{key:"paid_subscribers",label:__("Paid subscribers","jetpack")}};n.d(t,["KG",0,"_jetpack_dont_email_post_to_subs","P2",0,o,"a7",0,"_jetpack_newsletter_tier_id","jr",0,"_jetpack_newsletter_access"])},42167(e,t,n){"use strict";var r=n(85985),o=n(3582),s=n(37906);n.d(t,["I",0,e=>{const[t=[]]=(0,o.useEntityProp)("postType",e,"meta");let n=t[s.jr]??s.P2.everybody.key;return n||(n=s.P2.everybody.key),n},"V",0,()=>(0,r.$i)()?.jetpack?.is_newsletter_feature_enabled??!1])},82500(e,t,n){"use strict";n.d(t,{EX:()=>A,GG:()=>S,iF:()=>_,ix:()=>E});var r=n(54268),o=n(94715),s=n(56427),i=n(29491),a=n(3582),c=n(47143),l=n(43656),u=n(27723),d=n(57273),p=n(88050),h=n(42472),m=n(61868),g=n(13022),f=n(64524),b=n(16521),v=(n(81641),n(37906)),y=n(9894),k=n(10790);const __=u.__;function w({accessLevel:e,subscribers:t,paidSubscribers:n,postHasPaywallBlock:r=!1}){switch(t=t??0,n=n??0,v.P2[e]?.key){case v.P2.everybody.key:case v.P2.subscribers.key:return t;case v.P2.paid_subscribers.key:return r?t:n;default:return 0}}function x(e,t=!1){switch(e){case v.P2.subscribers.key:return t?__("Only subscribers can read the content below the paywall. Subscribers receive it by email.","jetpack",0):__("Only subscribers can read this post. Others see a preview and can subscribe. Subscribers receive it by email.","jetpack");case v.P2.paid_subscribers.key:return t?__("Only paid subscribers can read the content below the paywall. All subscribers receive it by email.","jetpack",0):__("Only paid subscribers can read this post. Others see a preview and can subscribe. Only paid subscribers receive it by email.","jetpack");default:return __("Anyone can read this post. Subscribers receive it by email.","jetpack")}}function _(){const e=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[t,n]=(0,a.useEntityProp)("postType",e,"meta");return e=>{delete t[v.a7],n({...t,[v.jr]:e})}}function j(){const e=(0,c.useSelect)(e=>e(b.M).getNewsletterTierProducts()).filter(e=>"1 month"===e.interval).sort((e,t)=>Number(t.price)-Number(e.price)),t=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[{[v.a7]:n}]=(0,a.useEntityProp)("postType",t,"meta"),r=function(){const e=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),[t,n]=(0,a.useEntityProp)("postType",e,"meta");return e=>{n({...t,[v.a7]:e})}}();return e.length<2?null:(0,k.jsx)("div",{className:"jetpack-editor-post-tiers",children:(0,k.jsx)(s.RadioControl,{label:__("Choose Newsletter Tier","jetpack"),hideLabelFromVision:!0,selected:String(n),options:e.map(e=>({label:e.title,value:String(e.id)})),onChange:e=>r(Number(e))})})}function C({id:e,groupName:t,value:n,label:r,checked:o,disabled:s,describedBy:i,onChange:a}){return(0,k.jsxs)("div",{className:(0,g.A)("components-radio-control__option",{"jetpack-newsletter-access-radio-buttons__disabled-option":s}),children:[(0,k.jsx)("input",{type:"radio",className:"components-radio-control__input",id:e,name:s?void 0:t,value:n,checked:o,"aria-disabled":s||void 0,"aria-describedby":i,readOnly:s,onChange:s?void 0:e=>a(e.target.value),onClick:s?e=>e.preventDefault():void 0,onKeyDown:s?e=>{" "===e.key&&e.preventDefault()}:void 0}),(0,k.jsx)("label",{className:"components-radio-control__label",htmlFor:e,children:r})]})}function A({accessLevel:e,hasTierPlans:t,stripeConnectUrl:n,postHasPaywallBlock:o=!1,explainPaywallConstraint:a=!0}){const l=null===n,{totalSubscribers:u,paidSubscribers:g}=(0,c.useSelect)(e=>e(b.M).getSubscriberCounts()),f=l&&t,S=e===v.P2.paid_subscribers.key,E=!f&&!S,T=e===v.P2.everybody.key,N=!!o&&!T,P=N&&a,B=_(),M=w({accessLevel:v.P2.subscribers.key,subscribers:u,paidSubscribers:g}),I=w({accessLevel:v.P2.paid_subscribers.key,subscribers:u,paidSubscribers:g}),R=(0,i.useInstanceId)(A,"jetpack-newsletter-access"),L=`${R}-group`,D=`${R}-paywall-notice`,F=`${R}-paid-setup-link`,O=[{value:v.P2.everybody.key,label:v.P2.everybody.label,disabled:N,describedBy:P?D:void 0},{value:v.P2.subscribers.key,label:`${v.P2.subscribers.label} (${(0,r.qe)(M)})`},{value:v.P2.paid_subscribers.key,label:`${v.P2.paid_subscribers.label} (${(0,r.qe)(I)})`,disabled:E,describedBy:E?F:void 0}];return(0,k.jsxs)("div",{className:"jetpack-newsletter-access-radio-buttons",children:[P&&(0,k.jsxs)(p.b,{intent:"info",icon:null,id:D,children:[(0,k.jsx)(h.h,{children:__("Paywall active","jetpack")}),(0,k.jsx)(m.V,{children:__("Choose who can read the full post. Everyone can still read the content above the paywall.","jetpack")})]}),(0,k.jsxs)("fieldset",{role:"radiogroup",className:"components-radio-control",children:[(0,k.jsx)(s.BaseControl.VisualLabel,{as:"legend",children:__("Who can read this post?","jetpack")}),(0,k.jsx)("div",{className:"components-radio-control__group-wrapper",children:O.map(t=>(0,k.jsx)(C,{id:`${R}-${t.value}`,groupName:L,value:t.value,label:t.label,checked:!t.disabled&&e===t.value,disabled:!!t.disabled,describedBy:t.describedBy,onChange:B},t.value))})]}),E&&(0,k.jsx)(d.N,{id:F,openInNewTab:!0,href:(0,y.Qu)(t),children:__("Turn on paid subscribers","jetpack")}),S&&f&&(0,k.jsx)(j,{}),(0,k.jsx)("p",{className:"jetpack-newsletter-access-radio-buttons__description",children:x(e,!!o)})]})}function S({accessLevel:e}){const{hasTierPlans:t,stripeConnectUrl:n,isLoading:r,postHasPaywallBlock:i}=(0,c.useSelect)(e=>{const{getNewsletterTierProducts:t,getConnectUrl:n,isApiStateLoading:r}=e(b.M),{getBlocks:s}=e(o.store);return{isLoading:r(),stripeConnectUrl:n(),hasTierPlans:0!==t()?.length,postHasPaywallBlock:s().some(e=>e.name===f.name)}}),a=(0,c.useSelect)(e=>e(l.store).getEditedPostVisibility());if(r)return(0,k.jsx)(s.Flex,{direction:"column",align:"center",children:(0,k.jsx)(s.Spinner,{})});const u=e??v.P2.everybody.key,d=v.P2[u]?.label,p=(0,y.fI)(a,e);return(0,k.jsx)(l.PostVisibilityCheck,{render:({canEdit:e})=>(0,k.jsxs)(s.Flex,{direction:"column",children:[p&&(0,k.jsx)(y.mf,{}),(0,k.jsxs)(s.FlexBlock,{children:[e&&(0,k.jsx)(A,{accessLevel:u,stripeConnectUrl:n,hasTierPlans:t,postHasPaywallBlock:i}),!e&&(0,k.jsx)("span",{children:d})]})]})})}function E(){const e=(0,c.useSelect)(e=>e(l.store).isCurrentPostPublished(),[]),t=(0,c.useSelect)(e=>e(l.store).getCurrentPostType(),[]),{saveEditedEntityRecord:n}=(0,c.useDispatch)(a.store),[r,o]=(0,a.useEntityProp)("postType",t,"meta"),i=(0,a.useEntityId)("postType",t),u=(0,c.useSelect)(e=>{const{getPostEmailSentState:t}=e(b.M);return i?t(i):null},[i]),d=null!=u?.email_sent_at,p=e=>{const s={...r,[v.KG]:!e};o(s),n("postType",t,i)},h=(0,c.useSelect)(e=>{const t=e(l.store).getEditedPostAttribute("meta");return!t?.[v.KG]});return d?null:(0,k.jsx)(l.PostVisibilityCheck,{render:({canEdit:t})=>(0,k.jsx)(s.ToggleControl,{className:"jetpack-subscribe-email-document-setting",checked:h,disabled:e||!t,label:__("Send this post to subscribers","jetpack"),onChange:p})})}},181(e,t,n){"use strict";var r=n(97999),o=n(85985),s=n(94715),i=n(56427),a=n(47143),c=n(43656),l=n(86087),u=n(27723),d=n(75200),p=n(64524),h=n(37906),m=n(16521),g=n(10790);const __=u.__,f=(e,t,n=!0)=>{if(!n&&!e?.length)return"";const r=e?.length?e:[1],o=t.filter(e=>r.includes(e.id)).map(e=>e.name);o.push(__("All content","jetpack"));const s=o.map(e=>`<strong>${e}</strong>`);let i;if(1===s.length)i=s[0];else if(2===s.length)i=(0,u.sprintf)(
173 173 // translators: %1$s: first category name, %2$s: second category name
174 174 __("%1$s and %2$s","jetpack"),s[0],s[1]);else{const e=s.slice(0,-1).join(`${__(",","jetpack")} `),t=s[s.length-1];i=(0,u.sprintf)(
175 175 // translators: %1$s: a comma-separated list of category names except for the last one, %2$s: the name of the last category
176 176 __("%1$s, and %2$s","jetpack"),e,t)}return i};function b(e,t=null,n=!1){return"paid_subscribers"===e&&n?__("all subscribers","jetpack"):function(e,t=null){if(!e)return __("all subscribers","jetpack");let n;switch(e){case"everybody":case"subscribers":default:n=__("all subscribers","jetpack");break;case"paid_subscribers":n=__("paid subscribers","jetpack")}return t&&"paid_subscribers"===e?(0,u.sprintf)(