chunks
5 days ago
vendor
10 months ago
admin.build.js
1 month ago
admin.js
4 months ago
analytics-tracker.js
2 months ago
analytics.build.js
5 days ago
blocks.build.js
5 days ago
carousel.js
1 year ago
custom-player.build.js
1 month ago
documents-viewer-script.js
4 months ago
ep-gr-elementor-control.js
1 month ago
ep-pdf-lightbox.js
4 months ago
ep-view-count.js
1 month ago
ep-yt-queue.js
2 months ago
feature-notices.js
8 months ago
feature-preview-modal.js
1 month ago
front.js
1 month ago
frontend.build.js
4 months ago
gallery-justify.js
1 month ago
google-reviews.build.js
5 days ago
google-reviews.js
5 days ago
gutneberg-script.js
3 months ago
index.html
7 years ago
initCarousel.js
2 years ago
initplyr.js
3 months ago
instafeed.js
2 months ago
instagram-shortcode-generator.js
2 months ago
lazy-load.js
7 months ago
license.js
4 months ago
meetup-timezone.js
4 months ago
onboarding.build.js
1 month ago
pdf-gallery-elementor-editor.js
4 months ago
pdf-gallery.js
4 months ago
preview.js
3 weeks ago
settings.js
4 months ago
sponsored.js
10 months ago
google-reviews.build.js
4 lines
| 1 | import{j as e,r as a}from"./chunks/index-DOwIfqLg.js";import{c as Te}from"./chunks/client-CYGEkzri.js";const y=window.wp&&window.wp.i18n&&window.wp.i18n.__||(r=>r),Ie=window.wp&&window.wp.i18n&&window.wp.i18n.sprintf||((r,...n)=>{let p=0;return String(r).replace(/%(\d+\$)?[ds]/g,i=>{if(i.includes("$")){const d=parseInt(i,10)-1;return n[d]}return n[p++]})}),Ae="/embedpress/v1/google-reviews",Fe={limit:10,min_rating:0,layout:"list",show_photo:!0,show_stars:!0,show_date:!0,show_images:!0,show_link:!1,columns:3,gap:20,max_width:0,show_summary:!0,sort:"newest",keyword:"",hide_empty:!1,load_more:!0,theme:"light",accent_color:"",autoplay:!1,schema:!1},z=typeof window<"u"&&window.epGoogleReviewsAdmin||{},I=!!z.proActive,M=z.upgradeUrl||"https://wpdeveloper.com/in/upgrade-embedpress",ee=r=>{const n=String(r||"");return n.length<=12?n:`${n.slice(0,6)}${"*".repeat(11)}${n.slice(-6)}`},ge=[{label:"List",value:"list"},{label:"Grid",value:"grid"},{label:"Card",value:"card"},{label:"Carousel",value:"carousel"},{label:"Masonry",value:"masonry",pro:!0},{label:"Compact badge",value:"badge",pro:!0},{label:"Spotlight",value:"spotlight",pro:!0},{label:"Knowledge panel",value:"knowledge",pro:!0},{label:"Marquee",value:"marquee",pro:!0},{label:"Bubble",value:"bubble",pro:!0}],ce={list:{reviews:!0,columns:!1,gap:!1,slider:!1,autoplay:!1,loadMore:!0,images:!0},grid:{reviews:!0,columns:!0,gap:!0,slider:!1,autoplay:!1,loadMore:!0,images:!0},card:{reviews:!0,columns:!0,gap:!0,slider:!1,autoplay:!1,loadMore:!0,images:!0},carousel:{reviews:!0,columns:!0,gap:!0,slider:!0,autoplay:!0,loadMore:!1,images:!1},masonry:{reviews:!0,columns:!0,gap:!0,slider:!1,autoplay:!1,loadMore:!0,images:!0},badge:{reviews:!1,columns:!1,gap:!1,slider:!1,autoplay:!1,loadMore:!1,images:!1},spotlight:{reviews:!0,columns:!1,gap:!1,slider:!1,autoplay:!0,loadMore:!1,images:!0},knowledge:{reviews:!1,columns:!1,gap:!1,slider:!1,autoplay:!1,loadMore:!1,images:!1},marquee:{reviews:!0,columns:!0,gap:!0,slider:!1,autoplay:!1,loadMore:!1,images:!1},bubble:{reviews:!0,columns:!0,gap:!0,slider:!1,autoplay:!1,loadMore:!0,images:!0}},me=r=>ce[r]||ce.list;new Set(ge.filter(r=>r.pro).map(r=>r.value));const $e=[{name:"Default",color:""},{name:"EmbedPress",color:"#5b4e96"},{name:"Google Blue",color:"#4285f4"},{name:"Green",color:"#34a853"},{name:"Amber",color:"#fbbc05"},{name:"Red",color:"#ea4335"},{name:"Slate",color:"#334155"}];function P(r,n,p,i){const d=z.restUrl||"/wp-json"+Ae,l=d.indexOf("?")!==-1;let o;if(l?o=d.replace(/([?&]rest_route=)([^&]*)/,(h,g,x)=>g+encodeURIComponent(decodeURIComponent(x)+n)):o=d+n,p){const h=Object.keys(p).map(g=>encodeURIComponent(g)+"="+encodeURIComponent(p[g])).join("&");h&&(o+=(o.indexOf("?")!==-1?"&":"?")+h)}const c={method:r,headers:{"X-WP-Nonce":z.nonce||"","Content-Type":"application/json"},credentials:"same-origin"};return i&&(c.body=JSON.stringify(i)),fetch(o,c).then(h=>h.json().then(g=>({ok:h.ok,status:h.status,body:g})))}const Me=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const n=Math.random()*16|0;return(r==="x"?n:n&3|8).toString(16)}),Ue=5*60*1e3,De=(r,n,p,i)=>{const d=(r||[]).map(o=>o.place_id).filter(Boolean);if(!d.length)return;const l=++n.current;i&&i(!0),P("GET","/place-counts",{place_ids:d.join(",")}).then(o=>{if(l!==n.current)return;i&&i(!1);const c=o&&o.ok&&o.body&&o.body.counts||{};Object.keys(c).length&&p(h=>h.map(g=>{const x=c[g.place_id];return x?{...g,rating:x.rating!=null?x.rating:g.rating,review_count:x.review_count!=null?x.review_count:g.review_count}:g}))}).catch(()=>{i&&l===n.current&&i(!1)})},He=[{k:"limit"},{k:"min_rating",cap:"reviews",pro:!0},{k:"layout"},{k:"show_photo",cap:"reviews"},{k:"show_stars",cap:"reviews"},{k:"show_date",cap:"reviews"},{k:"show_images",cap:"images",pro:!0},{k:"show_link",cap:"reviews"},{k:"show_summary"},{k:"columns",cap:"columns"},{k:"gap",cap:"gap"},{k:"max_width"},{k:"sort",cap:"reviews"},{k:"keyword",cap:"reviews"},{k:"hide_empty",cap:"reviews"},{k:"load_more",cap:"loadMore"},{k:"theme"},{k:"accent_color"},{k:"autoplay",cap:"autoplay"},{k:"schema"}];function Oe(r,n){if(!r)return"";const p=me(n.layout),i=["embedpress_google_reviews",`place_id="${r.place_id}"`];return r.main_text&&i.push(`place_name="${r.main_text.replace(/"/g,""")}"`),He.forEach(({k:d,cap:l,pro:o})=>{if(l&&!p[l]||o&&!I)return;let c=n[d];c===Fe[d]||c===void 0||(typeof c=="boolean"&&(c=c?"true":"false"),c!==""&&i.push(`${d}="${c}"`))}),`[${i.join(" ")}]`}const Be=()=>{const[r,n]=a.useState({connected:!1,site_id:"",tier:"",connected_at:0,home_url:"",endpoint:"",would_send:{site_url:"",admin_email:""}}),[p,i]=a.useState(!1),[d,l]=a.useState(!1),[o,c]=a.useState({text:"",tone:""}),[h,g]=a.useState(21600),[x,j]=a.useState(!1),[m,N]=a.useState(!1);a.useEffect(()=>{P("GET","/managed/status").then(t=>{t.ok&&n(t.body),i(!0)}),P("GET","/settings").then(t=>{t.ok&&t.body&&t.body.cache_ttl&&g(parseInt(t.body.cache_ttl,10))})},[]);const _=(t,b)=>{c({text:t,tone:b}),setTimeout(()=>c({text:"",tone:""}),7e3)},A=()=>{l(!0),P("POST","/managed/connect").then(t=>{l(!1),t.ok&&t.body&&t.body.connected?(n(t.body),window.dispatchEvent(new CustomEvent("ep-gr-connection-changed",{detail:{connected:!0}})),_("Connected to the EmbedPress API.","success")):_(t.body&&t.body.message||"Couldn’t connect. Try again.","error")})},k=()=>{l(!0),P("POST","/managed/disconnect").then(t=>{l(!1),t.ok?(n(t.body),window.dispatchEvent(new CustomEvent("ep-gr-connection-changed",{detail:{connected:!1}})),_("Disconnected from the EmbedPress API.","error")):_(t.body&&t.body.message||"Couldn’t disconnect. Try again.","error")})},S=()=>{j(!0),P("POST","/settings",null,{cache_ttl:h}).then(t=>{j(!1),t.ok?_("Settings saved.","success"):_(t.body&&t.body.message||"Couldn’t save settings.","error")})},U=()=>{P("POST","/clear-cache",null,{}).then(t=>{t.ok?_(`Cache cleared (${t.body&&t.body.deleted||0} reviews).`,"success"):_("Couldn’t clear the cache.","error")})};if(!p)return e.jsxs("section",{className:"ep-gr-card ep-gr-card--api ep-gr-card--skeleton","aria-hidden":"true",children:[e.jsxs("header",{className:"ep-gr-card-header",children:[e.jsx("span",{className:"ep-gr-step-badge",children:"·"}),e.jsxs("div",{className:"ep-gr-card-headtext",children:[e.jsx("h2",{children:e.jsx("span",{className:"ep-gr-skel ep-gr-skel--title",style:{width:180}})}),e.jsxs("p",{children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line ep-gr-skel--line-short"})]})]})]}),e.jsx("div",{className:"ep-gr-card-body",children:e.jsxs("div",{className:"ep-gr-api-cta",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--btn",style:{width:200,height:32}}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line",style:{width:100}})]})})]});const L=!!r.connected,$=r.would_send||{};return e.jsxs("section",{className:"ep-gr-card ep-gr-card--api",children:[e.jsxs("header",{className:"ep-gr-card-header",children:[e.jsx("span",{className:"ep-gr-step-badge",children:"1"}),e.jsxs("div",{className:"ep-gr-card-headtext",children:[e.jsxs("h2",{children:["EmbedPress API",L?e.jsxs("span",{className:"ep-gr-hpill ep-gr-hpill--on",children:[e.jsx("span",{className:"ep-gr-hpill-dot"}),"Connected",` · ${I?"PRO":"Free"}`]}):e.jsxs("span",{className:"ep-gr-hpill ep-gr-hpill--off",children:[e.jsx("span",{className:"ep-gr-hpill-dot"}),"Not connected"]})]}),e.jsx("p",{children:L?"Your site is connected and ready to pull Google reviews. This connection is locked to this site only.":"Connect in one click to start pulling Google reviews — no signup or API keys needed."})]})]}),e.jsxs("div",{className:"ep-gr-card-body",children:[L?e.jsxs("div",{className:"ep-gr-api-status",children:[e.jsxs("div",{className:"ep-gr-api-status-meta",children:[e.jsx("span",{className:"ep-gr-api-status-label",children:"Site ID"}),e.jsx("code",{className:"ep-gr-api-status-val",children:r.site_id?ee(r.site_id):"—"})]}),e.jsx("button",{type:"button",className:"button",disabled:d,onClick:k,children:d?"Disconnecting…":"Disconnect"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ep-gr-api-cta",children:[e.jsx("button",{type:"button",className:"button button-primary",disabled:d,onClick:A,children:d?"Connecting…":"Connect to EmbedPress API"}),e.jsx("button",{type:"button",className:"ep-gr-linklike","aria-expanded":m,onClick:()=>N(t=>!t),children:m?"Hide Data Privacy Info":"View Data Privacy Info"})]}),m&&e.jsxs("ul",{className:"ep-gr-send-list","aria-label":"Information sent at connect",children:[e.jsxs("li",{children:[e.jsx("span",{className:"ep-gr-send-key",children:"Site URL"}),e.jsx("code",{className:"ep-gr-send-val",children:$.site_url||""}),e.jsx("span",{className:"ep-gr-send-note",children:"used to verify and connect this site"})]}),e.jsxs("li",{children:[e.jsx("span",{className:"ep-gr-send-key",children:"Email"}),e.jsx("code",{className:"ep-gr-send-val",children:$.admin_email||""}),e.jsx("span",{className:"ep-gr-send-note",children:"used to identify this connection"})]})]})]}),e.jsx("div",{className:"ep-gr-advanced",children:e.jsxs("div",{className:"ep-gr-advanced-body",children:[e.jsxs("div",{className:"ep-gr-advanced-row",children:[e.jsxs("div",{className:"ep-gr-advanced-control",children:[e.jsx("label",{htmlFor:"ep-gr-cache-ttl",children:"Cache reviews for"}),e.jsxs("div",{className:"ep-gr-advanced-inline",children:[e.jsxs("select",{id:"ep-gr-cache-ttl",value:h,onChange:t=>g(parseInt(t.target.value,10)),children:[e.jsx("option",{value:3600,children:"1 hour"}),e.jsx("option",{value:21600,children:"6 hours"}),e.jsx("option",{value:86400,children:"24 hours"})]}),e.jsx("button",{type:"button",className:"button button-primary",disabled:x,onClick:S,children:x?"Saving…":"Save"})]})]}),e.jsxs("button",{type:"button",className:"button ep-gr-clear-cache",onClick:U,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),"Clear reviews cache"]})]}),e.jsx("p",{className:"ep-gr-advanced-hint",children:"How long fetched reviews are stored before EmbedPress checks for fresh ones."})]})}),o.text&&e.jsx("span",{className:`ep-gr-status ep-gr-status--${o.tone}`,"aria-live":"polite",children:o.text})]})]})},se=()=>e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fill:"currentColor",d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 2h14v2H5v-2z"})}),de=()=>e.jsxs("svg",{className:"ep-gr-suggestion-pin",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),e.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),pe=({rating:r,count:n,loading:p})=>{if(n==null&&r==null)return p?e.jsx("span",{className:"ep-gr-suggestion-meta ep-gr-suggestion-meta--loading","aria-hidden":"true",children:e.jsx("span",{className:"ep-gr-suggestion-skeleton"})}):e.jsx("span",{className:"ep-gr-suggestion-meta ep-gr-suggestion-meta--unknown",children:e.jsx("span",{className:"ep-gr-suggestion-count",children:y("Reviews unavailable","embedpress")})});const i=n===0;return e.jsxs("span",{className:"ep-gr-suggestion-meta",children:[(r!=null||i)&&e.jsxs("span",{className:"ep-gr-suggestion-rating",children:[e.jsx("span",{className:"ep-gr-suggestion-star","aria-hidden":"true",children:"� |
| 2 | "}),Number(r||0).toFixed(1)]}),n!=null&&e.jsx("span",{className:"ep-gr-suggestion-count",children:i?y("No reviews yet","embedpress"):`${Number(n).toLocaleString()} ${y(n===1?"review":"reviews","embedpress")}`})]})},Ge=({locked:r,children:n})=>r?e.jsxs("div",{className:"ep-gr-prolock",role:"button",tabIndex:0,title:y("This is a Pro feature — click to upgrade.","embedpress"),onClick:()=>window.open(M,"_blank","noopener"),onKeyDown:p=>{p.key==="Enter"&&window.open(M,"_blank","noopener")},children:[e.jsxs("span",{className:"ep-gr-prolock-badge",children:[e.jsx(se,{})," ",y("Pro","embedpress")]}),e.jsx("div",{className:"ep-gr-prolock-inner","aria-hidden":"true",children:n})]}):n,qe=e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),e.jsx("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),e.jsx("line",{x1:"8",y1:"14",x2:"13",y2:"14"})]}),We=({value:r,onChange:n})=>e.jsx("div",{className:"ep-gr-layout-picker",children:ge.map(p=>{const i=p.pro&&!I;return e.jsxs("button",{type:"button",className:"ep-gr-layout-tile"+(p.value===r?" is-active":"")+(i?" is-locked":""),"aria-pressed":p.value===r,disabled:i,title:i?`${p.label} — ${y("Pro","embedpress")}`:p.label,onClick:()=>{i?window.open(M,"_blank","noopener"):n(p.value)},children:[i&&e.jsx("svg",{className:"ep-gr-tile-crown",width:"12",height:"12",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{fill:"#f0b849",d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 2h14v2H5v-2z"})}),e.jsx("span",{className:"ep-gr-layout-tile-icon",children:qe}),e.jsx("span",{className:"ep-gr-layout-tile-label",children:p.label})]},p.value)})}),ze=({place:r,apifyConnected:n,onClose:p})=>{const i=n?50:10,d={place_id:r.place_id,main_text:r.place_name||r.place_id},[l,o]=a.useState({limit:10,min_rating:0,layout:"list",show_photo:!0,show_stars:!0,show_date:!0,show_images:!0,show_link:!1,show_summary:!0,columns:3,gap:20,max_width:0,sort:"newest",keyword:"",hide_empty:!1,load_more:!0,theme:"light",accent_color:"",autoplay:!1,schema:!1}),[c,h]=a.useState(""),[g,x]=a.useState(!1),[j,m]=a.useState(null),[N,_]=a.useState(!1),A=a.useRef(null),k=(t,b)=>o(E=>({...E,[t]:b})),S=me(l.layout);a.useEffect(()=>{const t=E=>{E.key==="Escape"&&p()};document.addEventListener("keydown",t);const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=b}},[p]);const U=a.useCallback(()=>{x(!0),m(null);const t={place_id:d.place_id,place_name:d.main_text||"",...l};P("GET","/preview",t).then(b=>{x(!1),b.ok&&b.body.html?h(b.body.html):(h(""),m(b.body&&(b.body.message||b.body.code)||`Preview failed (HTTP ${b.status}).`))}).catch(()=>{x(!1),m("Network error — could not reach the server.")})},[d.place_id,d.main_text,l]);a.useEffect(()=>(clearTimeout(A.current),A.current=setTimeout(U,250),()=>clearTimeout(A.current)),[l,U]);const L=Oe(d,l),$=()=>{if(!L)return;(b=>{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(b);const E=document.createElement("textarea");return E.value=b,document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E),Promise.resolve()})(L).then(()=>{_(!0),setTimeout(()=>_(!1),2e3)})};return e.jsx("div",{className:"ep-gr-modal-overlay",onMouseDown:p,role:"presentation",children:e.jsxs("div",{className:"ep-gr-modal",role:"dialog","aria-modal":"true","aria-label":`Generate shortcode for ${d.main_text}`,onMouseDown:t=>t.stopPropagation(),children:[e.jsxs("header",{className:"ep-gr-modal-header",children:[e.jsxs("div",{className:"ep-gr-modal-title",children:[e.jsx("span",{className:"ep-gr-modal-title-icon","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})}),e.jsxs("div",{children:[e.jsx("h2",{children:"Embed this place"}),e.jsx("p",{children:d.main_text})]})]}),e.jsx("button",{type:"button",className:"ep-gr-modal-close","aria-label":"Close",onClick:p,children:"×"})]}),e.jsxs("div",{className:"ep-gr-modal-body",children:[e.jsxs("div",{className:"ep-gr-callout",children:["Use the shortcode in ",e.jsx("strong",{children:"Classic, Bricks, Divi"}),", or any builder. In ",e.jsx("strong",{children:"Gutenberg"})," & ",e.jsx("strong",{children:"Elementor"}),", use the dedicated ",e.jsx("strong",{children:"Google Reviews"})," block/widget for richer controls."]}),e.jsxs("div",{className:"ep-gr-split",children:[e.jsxs("div",{className:"ep-gr-split-pane",children:[e.jsx("h3",{children:"Layout"}),e.jsx(We,{value:l.layout,onChange:t=>k("layout",t)}),e.jsx("h3",{className:"ep-gr-h3-spaced",children:"Display"}),e.jsxs("div",{className:"ep-gr-row ep-gr-row--three",children:[S.reviews&&e.jsx(Ge,{locked:!I,children:e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-min-rating",children:"Minimum rating"}),e.jsxs("select",{id:"ep-gr-min-rating",value:l.min_rating,onChange:t=>k("min_rating",parseInt(t.target.value,10)),children:[e.jsx("option",{value:0,children:"Any"}),e.jsx("option",{value:3,children:"3+"}),e.jsx("option",{value:4,children:"4+"}),e.jsx("option",{value:5,children:"5"})]})]})}),S.loadMore&&e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-limit",children:"Reviews per page"}),e.jsx("select",{id:"ep-gr-limit",value:l.limit,onChange:t=>k("limit",parseInt(t.target.value,10)),children:(i>5?[1,2,3,4,5,6,8,10,15,20,30,40,50]:[1,2,3,4,5]).filter(t=>t<=i).map(t=>e.jsx("option",{value:t,children:t},t))})]}),S.columns&&e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-columns",children:"Columns"}),e.jsx("select",{id:"ep-gr-columns",value:l.columns,onChange:t=>k("columns",parseInt(t.target.value,10)),children:[1,2,3,4,5,6].map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),S.reviews&&e.jsxs("fieldset",{className:"ep-gr-toggles",children:[e.jsx("legend",{children:"Review Elements"}),e.jsx("div",{className:"ep-gr-chips",children:[["show_photo","Reviewer photo",!0,!1],["show_stars","Star rating",!0,!1],["show_date","Date",!0,!1],["show_images","Review images",S.images,!0],["show_link","“View on Google” link",!0,!1],["show_summary","Show header",!0,!1]].filter(([,,t])=>t).map(([t,b,,E])=>{const R=E&&!I;return e.jsxs("label",{className:`ep-gr-chip${l[t]&&!R?" is-on":""}${R?" is-locked":""}`,title:R?"Pro feature":void 0,onClick:R?D=>{D.preventDefault(),window.open(M,"_blank","noopener")}:void 0,children:[e.jsx("input",{type:"checkbox",checked:l[t]&&!R,disabled:R,onChange:D=>{R||k(t,D.target.checked)}}),b,R&&e.jsx(se,{})]},t)})})]}),S.loadMore&&e.jsx("div",{className:"ep-gr-pro-toggles",children:e.jsxs("label",{className:`ep-gr-switch${l.load_more?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:l.load_more,onChange:t=>k("load_more",t.target.checked)}),e.jsx("span",{className:"ep-gr-switch-track"})," Load More"]})}),e.jsx("div",{className:"ep-gr-section-divider",children:e.jsx("span",{children:"Filtering & style"})}),e.jsxs(e.Fragment,{children:[S.reviews&&e.jsxs("div",{className:"ep-gr-row ep-gr-row--two",children:[e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-sort",children:"Sort by"}),e.jsxs("select",{id:"ep-gr-sort",value:l.sort,onChange:t=>k("sort",t.target.value),children:[e.jsx("option",{value:"newest",children:"Newest"}),e.jsx("option",{value:"highest",children:"Highest rated"}),e.jsx("option",{value:"lowest",children:"Lowest rated"}),e.jsx("option",{value:"relevant",children:"Most relevant"})]})]}),e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-keyword",children:"Keyword filter"}),e.jsx("input",{id:"ep-gr-keyword",type:"text",placeholder:"e.g. service, staff",value:l.keyword,onChange:t=>k("keyword",t.target.value)})]})]}),e.jsxs("div",{className:"ep-gr-row ep-gr-row--two",children:[e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-theme",children:"Theme"}),e.jsxs("select",{id:"ep-gr-theme",value:l.theme,onChange:t=>k("theme",t.target.value),children:[e.jsx("option",{value:"light",children:"Light"}),e.jsx("option",{value:"dark",children:"Dark"})]})]}),e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{children:"Accent color"}),e.jsx("div",{className:"ep-gr-swatches",children:$e.map(t=>e.jsx("button",{type:"button",className:"ep-gr-swatch"+(l.accent_color===t.color?" is-active":"")+(t.color===""?" ep-gr-swatch--none":""),style:t.color?{background:t.color}:void 0,title:t.name,"aria-label":t.name,onClick:()=>k("accent_color",t.color)},t.name))})]})]}),e.jsxs("div",{className:"ep-gr-pro-toggles",children:[S.reviews&&e.jsxs("label",{className:`ep-gr-switch${l.hide_empty?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:l.hide_empty,onChange:t=>k("hide_empty",t.target.checked)}),e.jsx("span",{className:"ep-gr-switch-track"})," Hide reviews with no text"]}),S.autoplay&&e.jsxs("label",{className:`ep-gr-switch${l.autoplay?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:l.autoplay,onChange:t=>k("autoplay",t.target.checked)}),e.jsx("span",{className:"ep-gr-switch-track"})," Autoplay"]}),e.jsxs("label",{className:`ep-gr-switch${l.schema?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:l.schema,onChange:t=>k("schema",t.target.checked)}),e.jsx("span",{className:"ep-gr-switch-track"})," Output review schema (JSON-LD)"]})]})]}),e.jsxs("div",{className:"ep-gr-field ep-gr-shortcode-field",children:[e.jsxs("div",{className:"ep-gr-shortcode-head",children:[e.jsx("label",{htmlFor:"ep-gr-shortcode",children:"Generated shortcode"}),e.jsx("span",{className:"ep-gr-shortcode-hint",children:"Paste into any post, page, or builder widget."})]}),e.jsxs("div",{className:`ep-gr-shortcode-row${N?" is-copied":""}`,children:[e.jsx("span",{className:"ep-gr-shortcode-prompt","aria-hidden":"true",children:"</>"}),e.jsx("textarea",{id:"ep-gr-shortcode",rows:1,readOnly:!0,value:L,onFocus:t=>t.target.select()}),e.jsx("button",{type:"button",className:"ep-gr-shortcode-copy",disabled:!L,onClick:$,"aria-label":N?"Copied":"Copy shortcode",children:N?e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})]})]}),e.jsxs("div",{className:"ep-gr-split-pane",children:[e.jsx("h3",{children:"Live preview"}),e.jsxs("div",{className:"ep-gr-preview-wrap",children:[g&&c&&e.jsx("span",{className:"ep-gr-preview-loading",children:"Updating"}),j?e.jsxs("p",{className:"ep-gr-inline-note ep-gr-inline-note--error",role:"alert",children:[e.jsx("strong",{children:"Preview failed:"})," ",j]}):c?e.jsx("div",{dangerouslySetInnerHTML:{__html:c}}):e.jsxs("div",{className:"ep-gr-preview-skeleton","aria-hidden":"true",children:[e.jsxs("div",{className:"ep-gr-preview-skel-summary",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--avatar"}),e.jsxs("div",{className:"ep-gr-preview-skel-summary-lines",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--title"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--sub"})]})]}),[0,1,2].map(t=>e.jsxs("div",{className:"ep-gr-preview-skel-card",children:[e.jsxs("div",{className:"ep-gr-preview-skel-card-head",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--avatar"}),e.jsxs("div",{className:"ep-gr-preview-skel-card-meta",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--title"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--sub"})]})]}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--line ep-gr-skel--line-short"})]},t))]})]})]})]})]})]})})},Ke=[50,100,500],Ve=r=>{const n=a.useRef(null),[p,i]=a.useState(!1),[d,l]=a.useState(!1);return a.useLayoutEffect(()=>{if(!r){l(!1);return}const o=n.current;if(!o)return;const c=()=>{const h=o.offsetParent||o.parentElement;if(!h){l(!0);return}const g=h.getBoundingClientRect(),x=o.offsetHeight||200,j=window.innerHeight-g.bottom,m=g.top;i(j<x+12&&m>j),l(!0)};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[r]),[n,p,d]},te=r=>{const n=a.useRef(null),[p,i]=a.useState(!1),[d,l]=a.useState(!1);return a.useEffect(()=>{const o=h=>{n.current&&!n.current.contains(h.target)&&r()},c=h=>{h.key==="Escape"&&r()};return document.addEventListener("mousedown",o),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",c)}},[r]),a.useLayoutEffect(()=>{const o=n.current;if(!o)return;const c=o.offsetParent||o.parentElement;if(!c){l(!0);return}const h=c.getBoundingClientRect(),g=o.offsetHeight||200,x=window.innerHeight-h.bottom,j=h.top;i(x<g+12&&j>x),l(!0)},[]),a.useEffect(()=>{const o=()=>{const c=n.current;if(!c)return;const h=c.offsetParent||c.parentElement;if(!h)return;const g=h.getBoundingClientRect(),x=c.offsetHeight||200,j=window.innerHeight-g.bottom,m=g.top;i(j<x+12&&m>j)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),[n,p,d]},K=1e3,Ye=({onConfirm:r,onClose:n,total:p=0})=>{const[i,d]=a.useState("quick"),[l,o]=a.useState("100"),[c,h,g]=te(n),x=p>0?Math.min(p,K):K,j=()=>{if(i==="quick"){r({mode:"quick",count:0});return}const m=l==="all"?0:parseInt(l,10),N=Number.isFinite(m)&&m>0?Math.min(m,x):0;r({mode:"full",count:N})};return e.jsxs("div",{className:`ep-gr-refetch-pop${h?" is-up":""}${g?"":" is-measuring"}`,ref:c,role:"dialog","aria-label":"Refetch reviews",children:[e.jsx("p",{className:"ep-gr-refetch-pop-title",children:"Refetch reviews"}),e.jsxs("div",{className:"ep-gr-refetch-modes",role:"radiogroup","aria-label":"Refetch mode",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":i==="quick",className:`ep-gr-refetch-mode${i==="quick"?" is-active":""}`,onClick:()=>d("quick"),children:[e.jsx("span",{className:"ep-gr-refetch-mode-title",children:"Quick check"}),e.jsx("span",{className:"ep-gr-refetch-mode-desc",children:"Only pull new reviews since last fetch (recommended)."})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":i==="full",className:`ep-gr-refetch-mode${i==="full"?" is-active":""}`,onClick:()=>d("full"),children:[e.jsx("span",{className:"ep-gr-refetch-mode-title",children:"Full refresh"}),e.jsx("span",{className:"ep-gr-refetch-mode-desc",children:"Wipe and re-pull. Surfaces edits and deleted reviews."})]})]}),i==="full"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ep-gr-refetch-presets",children:[Ke.map(m=>e.jsx("button",{type:"button",className:`ep-gr-refetch-preset${l===String(m)?" is-active":""}`,onClick:()=>o(String(m)),children:m},m)),e.jsx("button",{type:"button",className:`ep-gr-refetch-preset${l==="all"?" is-active":""}`,onClick:()=>o("all"),children:"All"})]}),e.jsxs("div",{className:"ep-gr-refetch-custom",children:[e.jsx("input",{type:"text",inputMode:"numeric",value:l==="all"?"All":l,onChange:m=>{const N=m.target.value.replace(/[^0-9]/g,"");if(N===""){o("");return}o(String(Math.min(parseInt(N,10),x)))},onKeyDown:m=>{m.key==="Enter"&&j()},"aria-label":"Number of reviews to fetch"}),e.jsx("button",{type:"button",className:"button button-primary button-small",onClick:j,children:"Fetch"})]}),e.jsx("p",{className:"ep-gr-refetch-hint",children:"More reviews = longer fetch time."})]}),i==="quick"&&e.jsx("div",{className:"ep-gr-refetch-actions",children:e.jsx("button",{type:"button",className:"button button-primary button-small",onClick:j,children:"Check now"})})]})},B=10,Je=({fetched:r,total:n,onClose:p})=>{const[i,d,l]=te(p),o=!I&&r>=B&&(!n||n>B);return e.jsxs("div",{className:`ep-gr-refetch-pop ep-gr-info-pop${d?" is-up":""}${l?"":" is-measuring"}`,ref:i,role:"dialog","aria-label":"About this count",children:[e.jsx("p",{className:"ep-gr-refetch-pop-title",children:"About this count"}),n>0?e.jsxs("p",{className:"ep-gr-info-pop-count",children:[e.jsx("strong",{children:r.toLocaleString()})," of ",n.toLocaleString()," reviews ready to show"]}):e.jsxs("p",{className:"ep-gr-info-pop-count",children:[e.jsx("strong",{children:r.toLocaleString()})," reviews ready to show"]}),!o&&n>r?e.jsx("p",{className:"ep-gr-info-pop-body",children:"Google may not make all reviews available for automated collection, so the number imported can be lower than the total shown on Google."}):null,I&&r>=K?e.jsxs("p",{className:"ep-gr-info-pop-body",children:["EmbedPress keeps up to ",e.jsx("strong",{children:K.toLocaleString()})," reviews per place."]}):null,o?e.jsxs("div",{className:"ep-gr-upsell ep-gr-info-pop-note",children:[e.jsxs("p",{className:"ep-gr-upsell-text",children:["Free shows up to ",e.jsx("strong",{children:B})," reviews for ",e.jsx("strong",{children:"1"})," place. Upgrade to Pro for ",e.jsx("strong",{children:"unlimited places"})," and up to ",e.jsx("strong",{children:"1,000"})," reviews each."]}),e.jsx("a",{className:"ep-gr-upsell-cta",href:M,target:"_blank",rel:"noopener noreferrer",children:"Upgrade to Pro →"})]}):e.jsxs("p",{className:"ep-gr-info-pop-note",children:["Use ",e.jsx("strong",{children:"Refetch"})," to pick up new or updated reviews."]})]})},Qe=({placeName:r,onConfirm:n,onClose:p})=>{const[i,d,l]=te(p);return e.jsxs("div",{className:`ep-gr-refetch-pop ep-gr-confirm-pop${d?" is-up":""}${l?"":" is-measuring"}`,ref:i,role:"dialog","aria-label":"Confirm remove",children:[e.jsx("p",{className:"ep-gr-refetch-pop-title",children:"Remove this place?"}),e.jsxs("p",{className:"ep-gr-confirm-pop-body",children:[e.jsx("strong",{children:r})," and its cached reviews will be deleted from your library. You can re-add it anytime."]}),e.jsxs("div",{className:"ep-gr-confirm-pop-actions",children:[e.jsx("button",{type:"button",className:"button button-small",onClick:p,children:"Cancel"}),e.jsx("button",{type:"button",className:"button button-small button-primary ep-gr-confirm-pop-danger",onClick:n,children:"Remove"})]})]})},ue=["Connecting…","Opening Google Maps…","Finding the place…","Loading reviews…"],Xe=({fetched:r=0,message:n="",total:p=0})=>{const[i,d]=a.useState(0),l=r<=0&&!n;a.useEffect(()=>{if(!l)return;const c=setInterval(()=>{d(h=>h<ue.length-1?h+1:h)},2200);return()=>clearInterval(c)},[l]);let o;return r>0?o=Ie(y("Fetching reviews… %d","embedpress"),r):n?o=n:o=ue[i],e.jsxs("span",{className:"ep-gr-pill ep-gr-pill--running",children:[e.jsx("span",{className:"ep-gr-spinner","aria-hidden":"true"}),e.jsx("span",{className:"ep-gr-running-text",children:o})]})},Ze=()=>{const[r,n]=a.useState([]),[p,i]=a.useState(!0),[d,l]=a.useState(""),[o,c]=a.useState([]),[h,g]=a.useState(!1),[x,j]=a.useState(!1),[m,N]=a.useState(null),[_,A]=a.useState(""),[k,S]=a.useState({text:"",tone:""}),[U,L]=a.useState(null),[$,t]=a.useState(null),[b,E]=a.useState(null),[R,D]=a.useState(null),[V,Y]=a.useState(""),[G,re]=a.useState(""),[xe,fe]=a.useState(!1),[H,ne]=a.useState(null),J=a.useRef(null),[je,ve,we]=Ve(o.length>0),F=(s,u)=>{S({text:s,tone:u}),setTimeout(()=>S({text:"",tone:""}),7e3)},q=a.useRef(!1),ae=a.useRef(0),W=a.useCallback(()=>{if(q.current)return;q.current=!0;const s=++ae.current;P("GET","/places").then(u=>{q.current=!1,s===ae.current&&(i(!1),u.ok&&Array.isArray(u.body.places)&&n(f=>{const v={};return f.forEach(w=>{v[w.place_id]=w}),u.body.places.map(w=>{const T=v[w.place_id],C=w.fetch_status==="running"||w.fetch_status==="queued";if(T&&C&&(T.fetch_status==="running"||T.fetch_status==="queued")){const Z=Math.max(w.fetched_so_far||0,T.fetched_so_far||0);return{...w,fetched_so_far:Z}}return w})}))}).catch(()=>{q.current=!1})},[]);a.useEffect(()=>{W()},[W]),a.useEffect(()=>{P("GET","/settings").then(s=>{s.ok&&fe(!!s.body.apify_token_configured)})},[]);const[Q,X]=a.useState(null);a.useEffect(()=>{const s=u=>{const f=!!(u.detail&&u.detail.connected);N(null),X(f)};return window.addEventListener("ep-gr-connection-changed",s),()=>window.removeEventListener("ep-gr-connection-changed",s)},[]);const le=r.some(s=>s.fetch_status==="running"||s.fetch_status==="queued");a.useEffect(()=>{if(!le)return;const s=setInterval(W,2e3);return()=>clearInterval(s)},[le,W]);const oe=a.useRef({});a.useEffect(()=>{if(!I)for(const u of r){const f=u.fetch_status==="running"||u.fetch_status==="queued";if(oe.current[u.place_id]&&!f&&u.last_fetched_at&&u.total&&(u.review_count||0)<u.total){E(u.place_id);break}}const s={};r.forEach(u=>{s[u.place_id]=u.fetch_status==="running"||u.fetch_status==="queued"}),oe.current=s},[r]);const O=a.useRef({token:"",mintedAt:0}),be=a.useRef(0),[ye,ke]=a.useState(!1),Ne=()=>{const s=Date.now();return(!O.current.token||s-O.current.mintedAt>Ue)&&(O.current={token:Me(),mintedAt:s}),O.current.token},_e=()=>{O.current={token:"",mintedAt:0}};a.useEffect(()=>{if(clearTimeout(J.current),N(null),Q===!1){c([]),j(!1),g(!1);return}if(d.trim().length<3){c([]),j(!1);return}return g(!0),J.current=setTimeout(()=>{P("GET","/search",{q:d.trim(),session_token:Ne()}).then(s=>{g(!1),s.ok&&Array.isArray(s.body.predictions)?(X(!0),c(s.body.predictions),j(s.body.predictions.length===0),De(s.body.predictions,be,c,ke)):s.body&&s.body.code==="embedpress_gr_not_connected"?(X(!1),c([]),j(!1)):(c([]),j(!1),N(s.body&&(s.body.message||s.body.code)||`Search failed (HTTP ${s.status}).`))}).catch(()=>{g(!1),c([]),j(!1),N("Network error — could not reach the server.")})},800),()=>clearTimeout(J.current)},[d,Q]);const Ce=s=>{(f=>{if(navigator.clipboard&&navigator.clipboard.writeText)return navigator.clipboard.writeText(f);const v=document.createElement("textarea");return v.value=f,document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v),Promise.resolve()})(s).then(()=>{re(s),setTimeout(()=>re(f=>f===s?"":f),2e3)})},Se=(s,u,f="",v={})=>{if(V)return;_e(),Y(s);const w={};v.total!=null&&Number(v.total)>0&&(w.total=Number(v.total)),v.rating!=null&&Number(v.rating)>0&&(w.rating=Number(v.rating)),P("POST","/places",null,{action:"add",place_id:s,place_name:u||"",place_address:f||"",...w}).then(T=>{if(Y(""),T.ok){n(T.body.places||[]),l(""),c([]),j(!1),N(null);const C=(T.body.places||[]).find(Z=>Z.place_id===s);!I&&C&&C.review_count>=B&&(!C.total||C.total>B)?(ne({place:C.place_name||"This place",fetched:C.review_count,total:C.total||0}),F("Place added.","success")):C&&C.total&&C.total>C.review_count?F(`Place added — showing ${C.review_count} of ${C.total} reviews. Refetch to pull more.`,"success"):F("Place added.","success")}else T.body&&T.body.code==="embedpress_gr_pro_required"?F(T.body.message||"Upgrade to EmbedPress Pro to add more places.","error"):F("Couldn’t add that place. Try again.","error")}).catch(()=>{Y(""),F("Couldn’t add that place. Try again.","error")})},Ee=(s,{mode:u,count:f})=>{t(null),A(s);const v=f==="all"||f===""||!f;P("POST","/places",null,{action:"refetch",place_id:s,fetch_max:v?0:Number(f)||0,sort:"newest",mode:u==="full"?"full":"quick"}).then(w=>{A(""),w.ok?(n(w.body.places||[]),F(u==="quick"?"Checking for new reviews…":v?"Fetching all reviews in the background…":`Fetching up to ${f} reviews in the background…`,"info")):F(w.body&&w.body.message||"Couldn’t start the refetch. Try again.","error")})},Pe=s=>{D(null),A(s),P("POST","/places",null,{action:"remove",place_id:s}).then(u=>{A(""),u.ok?(n(u.body.places||[]),F("Place removed.","success")):F("Couldn’t remove that place.","error")})},Re=new Set(r.map(s=>s.place_id)),Le=s=>s?new Date(s.replace(" ","T")).toLocaleString():"—",ie=!I&&r.length>=1;return e.jsxs("section",{className:"ep-gr-card",children:[e.jsxs("header",{className:"ep-gr-card-header",children:[e.jsx("span",{className:"ep-gr-step-badge",children:"2"}),e.jsxs("div",{className:"ep-gr-card-headtext",children:[e.jsx("h2",{children:"Add your places"}),e.jsxs("p",{children:["Search and save the Google Businesses you want to display. Reviews are stored on your site, so every block, widget, and shortcode reuses them — no repeat lookups. Hit ",e.jsx("strong",{children:"Refetch"})," anytime to pull the latest."]})]})]}),e.jsxs("div",{className:"ep-gr-card-body",children:[e.jsxs("div",{className:"ep-gr-field",children:[e.jsx("label",{htmlFor:"ep-gr-place-search",children:e.jsx("strong",{children:"Add a place"})}),e.jsx("input",{id:"ep-gr-place-search",type:"text",autoComplete:"off",placeholder:"e.g. Sydney Opera House",value:d,onChange:s=>l(s.target.value)}),Q===!1&&d.trim().length>0&&e.jsxs("p",{className:"ep-gr-inline-note ep-gr-inline-note--error",role:"alert",children:[e.jsx("strong",{children:"Connect to the EmbedPress API to search."})," ","Connect in ",e.jsx("strong",{children:"step 1"})," above, then search for a place to add."]}),h&&!m&&e.jsx("p",{className:"description",children:"Searching…"}),o.length>0&&e.jsxs("div",{ref:je,className:`ep-gr-suggestions-panel${ve?" is-up":""}${we?"":" is-measuring"}`,children:[e.jsx("ul",{className:"ep-gr-suggestions",children:o.map(s=>{const u=Re.has(s.place_id),f=ie&&!u,v=V===s.place_id,w=!!V;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:`ep-gr-suggestion${f?" is-locked":""}${w?" is-adding-busy":""}`,disabled:w,"aria-busy":v,title:f?y("Adding more places needs EmbedPress Pro — click to upgrade.","embedpress"):void 0,onClick:()=>{if(!w){if(f){window.open(M,"_blank","noopener");return}Se(s.place_id,s.main_text||s.description,s.secondary_text||"",{total:s.review_count,rating:s.rating})}},children:[e.jsx(de,{}),e.jsxs("span",{className:"ep-gr-suggestion-body",children:[e.jsx("strong",{children:s.main_text||s.description}),s.secondary_text&&e.jsx("span",{children:s.secondary_text}),e.jsx(pe,{rating:s.rating,count:s.review_count,loading:ye})]}),v?e.jsxs("em",{className:"ep-gr-suggestion-add ep-gr-suggestion-add--loading",children:[e.jsx("span",{className:"ep-gr-spinner","aria-hidden":"true"})," ",y("Adding…","embedpress")]}):u?e.jsx("em",{className:"ep-gr-already",children:y("already added","embedpress")}):f?e.jsxs("em",{className:"ep-gr-suggestion-pro",children:[e.jsx(se,{})," ",y("Upgrade to add","embedpress")]}):e.jsxs("em",{className:"ep-gr-suggestion-add",children:["+ ",y("Add","embedpress")]})]})},s.place_id)})}),ie&&e.jsxs("p",{className:"ep-gr-inline-note ep-gr-inline-note--muted ep-gr-suggestions-note",children:[y("You’ve added your 1 free place.","embedpress")," ",e.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer",children:y("Go Pro","embedpress")})," ",y("to show reviews from multiple businesses at once.","embedpress")]})]}),!h&&x&&!m&&e.jsxs("p",{className:"ep-gr-inline-note ep-gr-inline-note--muted",children:["No matches for “",d.trim(),"”. Try a different spelling or include the city."]}),m&&e.jsxs("p",{className:"ep-gr-inline-note ep-gr-inline-note--error",role:"alert",children:[e.jsx("strong",{children:"Search failed:"})," ",m,/missing|api[_ ]?key|not configured|no_key|not connected/i.test(m)&&e.jsxs(e.Fragment,{children:[" "," ","Connect a provider in ",e.jsx("strong",{children:"step 1"})," above before searching."]})]})]}),H&&!I&&e.jsxs("div",{className:"ep-gr-upsell-banner",role:"status",children:[e.jsx("span",{className:"ep-gr-upsell-crown","aria-hidden":"true",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3 7l4 4 5-6 5 6 4-4v10H3V7z"})})}),e.jsxs("div",{className:"ep-gr-upsell-banner-body",children:[e.jsx("strong",{children:"You’re on the free plan."})," ",H.place," shows"," ",H.total?e.jsxs(e.Fragment,{children:[H.fetched," of ",H.total," reviews"]}):e.jsxs(e.Fragment,{children:["up to ",H.fetched," reviews"]}),"."," ","Upgrade to Pro for ",e.jsx("strong",{children:"unlimited places"})," and up to"," ",e.jsx("strong",{children:"1,000"})," reviews each."]}),e.jsx("a",{className:"ep-gr-upsell-banner-cta",href:M,target:"_blank",rel:"noopener noreferrer",children:"Upgrade to Pro →"}),e.jsx("button",{type:"button",className:"ep-gr-upsell-banner-x","aria-label":"Dismiss",onClick:()=>ne(null),children:"×"})]}),p?e.jsxs("table",{className:"ep-gr-places-table ep-gr-places-table--skeleton","aria-hidden":"true",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"ep-gr-col-place",children:"Place"}),e.jsx("th",{className:"ep-gr-col-num",children:"Reviews"}),e.jsx("th",{className:"ep-gr-col-num",children:"Rating"}),e.jsx("th",{className:"ep-gr-col-status",children:"Last fetched"}),e.jsx("th",{className:"ep-gr-col-actions"})]})}),e.jsx("tbody",{children:[0,1,2].map(s=>e.jsxs("tr",{children:[e.jsxs("td",{className:"ep-gr-col-place",children:[e.jsx("span",{className:"ep-gr-skel ep-gr-skel--title"}),e.jsx("span",{className:"ep-gr-skel ep-gr-skel--sub"})]}),e.jsx("td",{className:"ep-gr-col-num",children:e.jsx("span",{className:"ep-gr-skel ep-gr-skel--num"})}),e.jsx("td",{className:"ep-gr-col-num",children:e.jsx("span",{className:"ep-gr-skel ep-gr-skel--num"})}),e.jsx("td",{children:e.jsx("span",{className:"ep-gr-skel ep-gr-skel--text"})}),e.jsx("td",{className:"ep-gr-col-actions",children:e.jsx("span",{className:"ep-gr-skel ep-gr-skel--btn"})})]},s))})]}):r.length===0?e.jsxs("div",{className:"ep-gr-places-empty",children:[e.jsx("p",{children:"No places saved yet."}),e.jsx("p",{className:"description",children:"Search above to add a Google Business, then Refetch it to load its reviews."})]}):e.jsxs("table",{className:"ep-gr-places-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"ep-gr-col-place",children:"Place"}),e.jsx("th",{className:"ep-gr-col-num",children:"Reviews"}),e.jsx("th",{className:"ep-gr-col-num",children:"Rating"}),e.jsx("th",{className:"ep-gr-col-status",children:"Last fetched"}),e.jsx("th",{className:"ep-gr-col-actions"})]})}),e.jsx("tbody",{children:r.map(s=>{const u=s.fetch_status==="running"||s.fetch_status==="queued",f=s.fetch_status==="failed";return e.jsxs("tr",{className:u?"is-running":"",children:[e.jsx("td",{className:"ep-gr-col-place",children:e.jsxs("span",{className:"ep-gr-place-cell",children:[e.jsx(de,{}),e.jsxs("span",{className:"ep-gr-place-cell-body",children:[e.jsxs("span",{className:"ep-gr-place-title",children:[e.jsx("strong",{children:s.place_name||ee(s.place_id)}),e.jsx("button",{type:"button",className:`ep-gr-copy-id${G===s.place_id?" is-copied":""}`,onClick:()=>Ce(s.place_id),"aria-label":G===s.place_id?y("Place ID copied","embedpress"):y("Copy Place ID","embedpress"),"data-tip":G===s.place_id?y("Place ID copied!","embedpress"):`${y("Copy Place ID","embedpress")} · ${ee(s.place_id)}`,children:G===s.place_id?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),s.address&&e.jsx("span",{className:"ep-gr-place-address",children:s.address}),e.jsx(pe,{rating:s.rating||null,count:s.total||(s.review_count!=null?s.review_count:null)})]})]})}),e.jsx("td",{className:"ep-gr-col-num",children:u&&s.fetched_so_far?e.jsx("b",{className:"ep-gr-count-live",children:s.fetched_so_far}):s.last_fetched_at||s.review_count?e.jsxs("span",{className:"ep-gr-count-wrap",children:[e.jsx("b",{children:s.review_count}),s.total&&s.review_count<s.total&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"ep-gr-info-btn","aria-label":"About this count",title:"About this count",onClick:()=>E(b===s.place_id?null:s.place_id),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M12 11v5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"8",r:"1.2",fill:"currentColor"})]})}),b===s.place_id&&e.jsx(Je,{fetched:s.review_count,total:s.total||0,onClose:()=>E(null)})]})]}):e.jsx("span",{className:"ep-gr-muted",children:"—"})}),e.jsx("td",{className:"ep-gr-col-num",children:s.rating?e.jsxs("span",{className:"ep-gr-rating",children:[s.rating,"� |
| 3 | "]}):e.jsx("span",{className:"ep-gr-muted",children:"—"})}),e.jsx("td",{className:"ep-gr-col-status",children:u?e.jsx(Xe,{fetched:s.fetched_so_far||0,message:s.fetch_message||"",total:s.total||0}):f?e.jsx("span",{className:"ep-gr-pill ep-gr-pill--error",title:s.fetch_message||"",children:"Failed"}):s.last_fetched_at?e.jsx("span",{className:"ep-gr-fetched-at",children:Le(s.last_fetched_at)}):e.jsx("span",{className:"ep-gr-muted",children:"Not fetched yet"})}),e.jsx("td",{className:"ep-gr-col-actions",children:e.jsxs("div",{className:"ep-gr-actions-row",children:[e.jsx("button",{type:"button",className:"ep-gr-icon-btn",title:s.last_fetched_at?"Get shortcode":"Refetch this place first to load reviews","aria-label":"Get shortcode",disabled:!s.last_fetched_at||u,onClick:()=>L(s),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("polyline",{points:"8 7 3 12 8 17"}),e.jsx("polyline",{points:"16 7 21 12 16 17"})]})}),e.jsxs("span",{className:"ep-gr-refetch-wrap",children:[e.jsx("button",{type:"button",className:`button button-small${_===s.place_id?" is-loading":""}`,disabled:_===s.place_id||u,"aria-haspopup":"dialog","aria-expanded":$===s.place_id,onClick:()=>t($===s.place_id?null:s.place_id),children:_===s.place_id?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ep-gr-spinner","aria-hidden":"true"}),"Starting…"]}):"Refetch"}),$===s.place_id&&e.jsx(Ye,{total:s.total||s.review_count||0,onConfirm:v=>Ee(s.place_id,v),onClose:()=>t(null)})]}),e.jsxs("span",{className:"ep-gr-refetch-wrap",children:[e.jsx("button",{type:"button",className:"button button-small button-link-delete",disabled:_===s.place_id,"aria-haspopup":"dialog","aria-expanded":R===s.place_id,onClick:()=>D(R===s.place_id?null:s.place_id),children:"Remove"}),R===s.place_id&&e.jsx(Qe,{placeName:s.place_name||s.place_id,onConfirm:()=>Pe(s.place_id),onClose:()=>D(null)})]})]})})]},s.place_id)})})]}),k.text&&e.jsx("span",{className:`ep-gr-status ep-gr-status--${k.tone}`,"aria-live":"polite",children:k.text})]}),U&&e.jsx(ze,{place:U,apifyConnected:xe,onClose:()=>L(null)})]})},es=()=>e.jsxs("div",{className:"ep-gr-app",children:[e.jsxs("header",{className:"ep-gr-page-title",children:[e.jsxs("div",{className:"ep-gr-page-title-main",children:[e.jsx("h1",{children:"Google Reviews"}),e.jsx("p",{children:"Embed Google Business reviews on any page, post, or page-builder widget — search a place, pick your options, and copy the shortcode."})]}),e.jsxs("a",{className:"ep-gr-doc-link",href:"https://embedpress.com/docs/embed-google-reviews-in-wordpress/",target:"_blank",rel:"noopener noreferrer",children:["Read the documentation",e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M7 17 17 7M7 7h10v10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),e.jsxs("div",{className:"ep-gr-stack",children:[e.jsx(Be,{}),e.jsx(Ze,{})]})]}),he=document.getElementById("embedpress-google-reviews-root");he&&Te(he).render(e.jsx(es,{})); |
| 4 |