var rpi=rpi||{};
rpi.Toast=function(a){function c(d){b||(b=document.createElement("div"),b.className="rpi-toast",b.innerHTML="<style>.rpi-toast{position:fixed;bottom:20px;right:20px;z-index:999999;display:flex;flex-direction:column;gap:8px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;}.rpi-toast-msg{min-width:220px;max-width:320px;padding:10px 14px;border-radius:8px;background:#ffffff;color:#000000;box-shadow:0 10px 30px rgba(0,0,0,.15);display:flex;align-items:center;gap:8px;font-size:13px;opacity:0;transform:translateY(60px);transition:transform .45s ease,opacity .45s ease;}.rpi-toast--success{background:#16a34a;color:#ffffff;}.rpi-toast--error{background:#dc2626;color:#ffffff;}.rpi-toast__close{background:none;border:0;font-size:18px;line-height:1;cursor:pointer;color:inherit;}.rpi-toast__action{background:none;border:0;padding:0;font:inherit;font-weight:600;cursor:pointer;color:inherit;text-decoration:underline;}</style>",document.body.appendChild(b),
b._timers=new Set,b.addEventListener("mouseenter",function(){b._timers.forEach(function(e){clearTimeout(e.id);e.id=null})}),b.addEventListener("mouseleave",function(){b._timers.forEach(function(e){e.id=setTimeout(e.fn,e.ms)})}));"left"===d?(b.style.left="20px",b.style.right=""):(b.style.right="20px",b.style.left="");return b}a=a||{};let b=document.querySelector(".rpi-toast");return{show:function(d){function e(){A&&q._timers.delete(A);l.parentNode&&l.parentNode.removeChild(l)}function h(){l.style.pointerEvents=
"none";l.style.opacity="0";l.style.transform="translateY(60px)";setTimeout(e,300)}d=d||{};if(d.msg){var f=(null!=d.timeout?d.timeout:a.timeout)||30,k=d.type||"default",q=c(d.position||a.position||"right"),l=document.createElement("div");l.className="rpi-toast-msg";"success"===k?l.className+=" rpi-toast--success":"error"===k&&(l.className+=" rpi-toast--error");l.innerHTML='<span style="flex:1;">'+d.msg+"</span>"+(d.action?'<button type="button" class="rpi-toast__action">'+d.action.label+"</button>":
"")+'<button type="button" class="rpi-toast__close">&times;</button>';q.appendChild(l);requestAnimationFrame(function(){l.style.opacity="1";l.style.transform="translateY(0)"});(k=l.querySelector(".rpi-toast__action"))&&k.addEventListener("click",function(u){u.stopPropagation();h();d.action.onClick()});(k=l.querySelector(".rpi-toast__close"))&&k.addEventListener("click",function(u){u.stopPropagation();e()});if(0<f){var A={ms:1E3*f,fn:h,id:null};A.id=setTimeout(h,A.ms);q._timers.add(A)}return l}}}};
rpi=rpi||{};
rpi.Lightbox=function(a){let c=document.querySelector(".rpi-lightbox-wrap"),b;c||(c=document.createElement("div"),c.className="rpi-lightbox-wrap",c.innerHTML='<div class="rpi-lightbox"><div class="rpi-lightbox-inner"><div class="rpi-lightbox-xxx"></div></div></div><div class="rpi-x"></div>',b=c.querySelector(".rpi-lightbox"),c.querySelector(".rpi-x").onclick=function(){c.style.display="none"},b.onclick=function(e){b==e.target&&(c.style.display="none")},c.style.display="none",document.body.appendChild(c));let d=
c.querySelector(".rpi-lightbox-xxx");d.innerHTML="";d.appendChild(a);return _this={show:function(e){c.style.display="flex";b.style.backdropFilter=e?"blur(2px)":""},hide:function(){c.style.display="none"}}};
jQuery(document).ready(function(a){a(".grw-admin-page a.nav-tab").on("click",function(A){var u=a(this),C=u.attr("href");a(C).show().siblings(".tab-content").hide();u.addClass("nav-tab-active").siblings().removeClass("nav-tab-active");A.preventDefault()});var c=a("#grw-rate_us");if(c.length){var b=a("#grw-rate_us-feedback"),d=a(".rpi-star",b);grw_svg_init();-1<window.location.href.indexOf("grw_feed_id=")&&!window.grw_rateus&&c.addClass("grw-flash-visible");a(".rpi-star i",c).click(function(){var u=
a(this).index()+1;3<u?(a.post({url:ajaxurl,type:"POST",dataType:"json",data:{rate:u,action:"grw_rateus_ajax",grw_nonce:a("#grw_nonce").val()},success:function(C){console.log(C)}}),window.open("https://wordpress.org/support/plugin/widget-google-reviews/reviews/?rate="+u+"#new-post","_blank"),A()):(d.attr("data-rating",u),b.dialog({modal:!0,width:"50%",maxWidth:"600px"}),a(".ui-widget-overlay").bind("click",function(){b.dialog("close")}))});a("i",d).click(function(){d.attr("data-rating",a(this).index()+
1)});a(".grw-rate_us-cancel").click(function(){b.dialog("close")});a(".grw-rate_us-send").click(function(){a.post({url:ajaxurl,type:"POST",dataType:"json",data:{rate:d.attr("data-rating"),email:a("input",b).val(),msg:a("textarea",b).val(),action:"grw_rateus_ajax_feedback",grw_nonce:a("#grw_nonce").val()},success:function(u){b.dialog({title:"Feedback sent"});b.html('<b style="color:#4cc74b">Thank you for your feedback!<br>We received it and will investigate your suggestions.</b>');A();setTimeout(function(){b.fadeOut(500,
function(){b.dialog("close")})},1500)}})});function A(){setTimeout(function(){c.addClass("grw-flash-gout");c.removeClass("grw-flash-visible");c.removeClass("grw-flash-gout");window.grw_rateus=1},1E3)}}if(a("#grw-overview-rating").length){var e=6,h=a("#grw-overview-places"),f=a("#grw-overview-months"),k=a("#grw-overview-rating"),q=a("#grw-overview-reviews"),l=null;grw_svg_init();h.change(function(){A(this.value)});f.change(function(){e=this.value;A(h.val())});A(0,function(u){a.each(u.places,function(C,
D){h.append(a("<option>",{value:D.id,text:D.name}))})});function A(u,C){var D={action:"grw_overview_ajax",grw_nonce:jQuery("#grw_nonce").val()};u&&(D.place_id=u);jQuery.post({url:ajaxurl,type:"POST",dataType:"json",data:D,success:function(w){var r=1<w.places.length?w.places.find(E=>E.id==u):w.places[0],t=null;if(w.stats_minmax.length){var n={},x=0,v=((new Date).getTime()/1E3).toFixed(0);for(var B=0;B<w.stats_minmax.length;B++){var z=w.stats_minmax[B],y=z.google_place_id;x=!x||z.time<x?z.time:x;n[y]?
(n[y]={time:parseInt(v-n[y].time),rating:parseFloat((z.rating-n[y].rating).toFixed(1)),review_count:parseInt(z.review_count-n[y].review_count)},t=t?{time:n[y].time,rating:t.rating+n[y].rating,review_count:t.review_count+n[y].review_count}:n[y],delete n[y]):n[y]={time:x,rating:z.rating,review_count:z.review_count}}}n=a("#grw-overview-stats");n.html("Not calculated yet");t&&(x=t.rating,v=t.review_count,n.html('<div class="grw-overview-h">While using the plugin</div><div>Usage time: <span class="grw-stat-val grw-stat-up">'+
grw_s2dmy(t.time)+'</span></div><div>Rating up: <span class="grw-stat-val grw-stat-'+(0>x?"down":0<x?"up":"")+'">'+x+'</span></div><div>Reviews up: <span class="grw-stat-val grw-stat-'+(0>v?"down":0<v?"up":"")+'">'+v+"</span></div>"));k.html('<div class="grw-overview-h">'+r.name+'</div><span class="rpi-stars" style="--rpi-star-size:26px;--rating:'+w.rating+'">'+w.rating+'</span><div class="wp-google-powered">Based on '+w.review_count+" reviews</div>"+(r.updated?'<div class="wp-google-powered">Last updated: <span class="wp-google-time">'+
rpi.Time.getTimeAgo(parseInt(r.updated),rpi.Utils.lang())+"</span></div>":""));r=document.createElement("div");const F=document.createElement("div");t=rpi.Common(q[0],{text_size:50},{time:"wp-google-time",text:"wp-google-text",readmore:"wp-more-toggle"});F.className="wp-google-reviews";a.each(w.reviews,function(E,I){F.appendChild(grw_review(I))});r.className="wp-gr wpac";r.appendChild(F);q.html("");q[0].appendChild(r);t.init();a(".wp-review-hide",q).unbind("click").click(function(){grw_review_hide_global(a(this));
return!1});t={};for(r=0;r<w.stats.length;r++)n=w.stats[r],x=n.google_place_id,t[x]=t[x]||[],t[x].push({time:parseInt(n.time),rating:parseFloat(n.rating),review_count:parseInt(n.review_count)});r=parseInt((w.stats[0].time-w.stats[w.stats.length-1].time)/2592E3);x=4<r?e:r||1;r={};v=new Date;for(B=0;B<x;B++)for(g in n=new Date(v.getFullYear(),v.getMonth()-B,1),z=(new Date(v.getFullYear(),v.getMonth()+1-B,0)).getTime(),y=n.toLocaleString("default",{month:"short"})+" "+n.getFullYear().toString().slice(-2),
r[y]=r[y]||{},t){var G=0,H=t[g];do{n=H[G++];var J=1E3*n.time;r[y][g]=r[y][g]||{};r[y][g].count=parseInt(n.review_count)}while(J>z&&G<H.length)}t=[];n=[];x=[];v={};for(m in r){B=0;for(p in r[m])B+=r[m][p].count,z=w.places.find(E=>E.id==p),v[z.name]=v[z.name]||{},v[z.name].data=v[z.name].data||[],v[z.name].data.unshift(r[m][p].count);t.unshift(m);n.unshift(B)}for(tt in v)x.push({name:tt,data:v[tt].data});r={series:[{name:"Reviews",data:n}],chart:{height:350,type:"bar"},plotOptions:{bar:{dataLabels:{position:"top"}}},
dataLabels:{enabled:!0,offsetY:-20,style:{fontSize:"12px",colors:["#304758"]}},tooltip:{enabled:!0,intersect:!1,custom:function(){return""}},xaxis:{categories:t,axisBorder:{show:!1},axisTicks:{show:!1},tooltip:{enabled:!0}},yaxis:{axisBorder:{show:!1},axisTicks:{show:!1}},title:{text:"Monthly reviews count",align:"center",style:{color:"#444"}}};l?l.updateOptions({series:[{name:"Reviews",data:n}],xaxis:{categories:t}}):(l=new ApexCharts(document.querySelector("#chart"),r),l.render());C&&C(w)}})}}});
function grw_svg_init(){var a=document.createElement("span");a.style.display="none";a.innerHTML=grw_svg();document.body.appendChild(a)}
function grw_svg(){return'<svg><defs><g id="rp-logo-g" height="44" width="44" fill="none" fill-rule="evenodd"><path d="M482.56 261.36c0-16.73-1.5-32.83-4.29-48.27H256v91.29h127.01c-5.47 29.5-22.1 54.49-47.09 71.23v59.21h76.27c44.63-41.09 70.37-101.59 70.37-173.46z" fill="#4285f4"></path><path d="M256 492c63.72 0 117.14-21.13 156.19-57.18l-76.27-59.21c-21.13 14.16-48.17 22.53-79.92 22.53-61.47 0-113.49-41.51-132.05-97.3H45.1v61.15c38.83 77.13 118.64 130.01 210.9 130.01z" fill="#34a853"></path><path d="M123.95 300.84c-4.72-14.16-7.4-29.29-7.4-44.84s2.68-30.68 7.4-44.84V150.01H45.1C29.12 181.87 20 217.92 20 256c0 38.08 9.12 74.13 25.1 105.99l78.85-61.15z" fill="#fbbc05"></path><path d="M256 113.86c34.65 0 65.76 11.91 90.22 35.29l67.69-67.69C373.03 43.39 319.61 20 256 20c-92.25 0-172.07 52.89-210.9 130.01l78.85 61.15c18.56-55.78 70.59-97.3 132.05-97.3z" fill="#ea4335"></path><path d="M20 20h472v472H20V20z"></path></g></defs></svg>'}
function grw_review(a){const c=document.createElement("div");c.className="wp-google-review"+(""===a.hide?"":" wp-review-hidden");c.dataset.rev=String(a.provider||"");const b=document.createElement("div");b.className="wp-google-right";c.appendChild(b);var d=document.createElement("a");d.className="wp-google-name";d.target="_blank";d.rel="nofollow noopener";d.href=grw_safeUrl(a.author_url);d.textContent=a.author_name||"";b.appendChild(d);d=document.createElement("div");d.className="wp-google-time";
d.dataset.time=String(a.time||"");b.appendChild(d);d=document.createElement("div");d.className="wp-google-feedback";b.appendChild(d);var e=document.createElement("span");e.className="rpi-stars";e.style.setProperty("--rpi-star-size","16px");e.style.setProperty("--rating",a.rating);d.appendChild(e);e=document.createElement("span");e.className="wp-google-text";e.textContent=a.text;e.innerHTML=e.innerHTML.replace(/\n/g,"<br>");d.appendChild(e);d=document.createElement("a");d.href="#";d.className="wp-review-hide";
d.dataset.id=String(a.id||"");d.textContent=(""===a.hide?"Hide":"Show")+" review";b.appendChild(d);return c}function grw_safeUrl(a){if(!a)return"#";a=String(a).trim();return/^https?:\/\//i.test(a)?a:"#"}function grw_s2dmy(a){a=(a/86400).toFixed(0);return 30<a?365<a?Math.round(a/365)+" years":Math.round(a/30)+" months":a+" days"}const GRW_AUTOSAVE_KEYUP_TIMEOUT=1500;var GRW_AUTOSAVE_TIMEOUT=null;
const GRW_LANGS=[["af","Afrikaans"],["sq","Albanian"],["am","Amharic"],["ar","Arabic"],["hy","Armenian"],["az","Azerbaijani"],["eu","Basque"],["be","Belarusian"],["bn","Bengali"],["bs","Bosnian"],["bg","Bulgarian"],["my","Burmese"],["ca","Catalan"],["zh","Chinese"],["zh-HK","Chinese (Hong Kong)"],["zh-CN","Chinese (Simplified)"],["zh-TW","Chinese (Traditional)"],["hr","Croatian"],["cs","Czech"],["da","Danish"],["nl","Dutch"],["en","English"],["et","Estonian"],["fa","Farsi"],["fil","Filipino"],["fi",
"Finnish"],["fr","French"],["fr-CA","French (Canada)"],["gl","Galician"],["ka","Georgian"],["de","German"],["el","Greek"],["gu","Gujarati"],["iw","Hebrew"],["hi","Hindi"],["hu","Hungarian"],["is","Icelandic"],["id","Indonesian"],["it","Italian"],["ja","Japanese"],["kn","Kannada"],["kk","Kazakh"],["km","Khmer"],["ko","Korean"],["ky","Kyrgyz"],["lo","Lao"],["lv","Latvian"],["lt","Lithuanian"],["mk","Macedonian"],["ms","Malay"],["ml","Malayalam"],["mr","Marathi"],["mn","Mongolian"],["ne","Nepali"],["no",
"Norwegian"],["pl","Polish"],["pt","Portuguese"],["pa","Punjabi"],["ro","Romanian"],["ru","Russian"],["sr","Serbian (Cyrillic)"],["sr-Latn","Serbian (Latin script)"],["si","Sinhalese"],["sk","Slovak"],["sl","Slovenian"],["es","Spanish"],["sw","Swahili"],["sv","Swedish"],["ta","Tamil"],["te","Telugu"],["th","Thai"],["tr","Turkish"],["uk","Ukrainian"],["ur","Urdu"],["uz","Uzbek"],["vi","Vietnamese"],["zu","Zulu"]],GRW_HTML_CONTENT='<div class="grw-builder-platforms grw-builder-inside"><div class="grw-builder-connect grw-connect-google">Connect Google</div><div id="grw-connect-wizard" title="Connect Google Reviews" style="display:none;">{{wizard}}</div><div class="grw-connections"></div></div><div class="grw-connect-options"><div class="grw-builder-inside"><div class="grw-builder-option">Layout<select id="view_mode" name="view_mode"><option value="slider" selected="selected">Slider</option><option value="grid">Grid</option><option value="list">List</option><option value="rating">Rating</option></select></div></div><div class="grw-builder-top grw-toggle">Common Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option">Pagination<input type="text" name="pagination" value=""></div><div class="grw-builder-option">Maximum characters before \'read more\' link<input type="text" name="text_size" value=""></div><div class="grw-builder-option"><label><input type="checkbox" name="header_center" value="">Show rating by center</label></div><div class="grw-builder-option"><label><input type="checkbox" name="header_hide_photo" value="">Hide business photo</label></div><div class="grw-builder-option"><label><input type="checkbox" name="header_hide_name" value="">Hide business name</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_based_on" value="">Hide \'Based on ... reviews\'</label></div><div class="grw-builder-option"><label><input type="checkbox" name="hide_writereview" value="">Hide \'review us on G\' button</label></div><div class="grw-builder-option"><label><input type="checkbox" name="short_last_name" value="">Short last name (GDPR)</label><span class="grw-quest grw-quest-top grw-toggle" title="Click to help">?</span><div class="grw-quest-help" style="display:none;">Show only first name and first letter of last name</div></div><div class="grw-builder-option"><label><input type="checkbox" name="min_letter" value="">Hide reviews without text</label></div><div class="grw-builder-option"><label><input type="checkbox" name="header_hide_social" value="">Hide rating header, leave only reviews</label></div></div><div class="grw-builder-top grw-toggle">Slider Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option">Speed in second<input type="text" name="slider_speed" value="" placeholder="Default: 3"></div><div class="grw-builder-option">Text height<input type="text" name="slider_text_height" value="" placeholder="Default: 100px"></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_autoplay" value="" checked>Auto-play</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_mousestop" value="" checked>Stop auto play on mouse over</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_prevnext" value="">Hide prev & next buttons</label></div><div class="grw-builder-option"><label><input type="checkbox" name="slider_hide_dots" value="">Hide dots</label></div></div><div class="grw-builder-top grw-toggle">Column Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option"><input type="hidden" name="slider_breakpoints"><label>How many columns to show (for Slider & Grid)</label><div class="grw-slider-br"><label><select><option value="off">Disable</option><option value="3000">Large Desktop & TV</option><option value="1200">Desktop</option><option value="1024">Laptop</option><option value="768">Table</option><option value="480">Mobile</option><option value="">Custom</option></select></label><label><input type="range" name="" value="3" min="1" max="12" step="1" oninput="this.nextSibling.innerHTML=this.value"/><span></span></label><span class="grw-quest" title="Click to add new breakpoints">+</span></div></div></div><div class="grw-builder-top grw-toggle">Style Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option"><input type="color" name="--star-color" value="#fb8e28" data-val="#fb8e28" data-defval="#fb8e28"/><input type="text" value="#fb8e28"/>Stars color</div><div class="grw-builder-option"><input type="color" name="--head-name-color" value="#333333" data-val="#333333" data-defval="#333333"/><input type="text" value="#333333"/>Business name color</div><div class="grw-builder-option"><input type="color" name="--head-based-color" value="#555555" data-val="#555555" data-defval="#555555"/><input type="text" value="#555555"/>Based on color</div><div class="grw-builder-option"><input type="color" name="--powered-color" value="#777777" data-val="#777777" data-defval="#777777"/><input type="text" value="#777777"/>Powered color</div><div class="grw-builder-option"><input type="color" name="--btn-color" value="#1f67e7" data-val="#1f67e7" data-defval="#1f67e7"/><input type="text" value="#1f67e7"/>Button color</div><div class="grw-builder-option"><input type="color" name="--rev-color" value="#f4f4f4" data-val="#f4f4f4" data-defval="#f4f4f4"/><input type="text" value="#f4f4f4"/>Reviews color</div><div class="grw-builder-option"><input type="color" name="--name-color" value="#154fc1" data-val="#154fc1" data-defval="#154fc1"/><input type="text" value="#154fc1"/>Review author name color</div><div class="grw-builder-option"><input type="color" name="--text-color" value="#222222" data-val="#222222" data-defval="#222222"/><input type="text" value="#222222"/>Reviews text color</div><div class="grw-builder-option"><a href="javascript:void(0)" onclick="stylereset(this.parentNode.parentNode);grw_serialize_connections()">Reset to default style</a></div><div class="grw-builder-option"><label><input type="checkbox" name="dark_theme">Dark background</label></div><div class="grw-builder-option"><label><input type="checkbox" name="--rev-color" value="#f4f4f4" data-on="transparent" data-off="#f4f4f4" data-defval="#f4f4f4">Hide reviews background</label></div><div class="grw-builder-option"><label><input type="checkbox" name="show_round" value="" checked>Round reviews borders</label></div><div class="grw-builder-option"><label><input type="checkbox" name="show_shadow" value="">Show reviews shadow</label></div><input id="style_vars" name="style_vars" type="hidden"/></div><div class="grw-builder-top grw-toggle">Advance Options</div><div class="grw-builder-inside" style="display:none"><div class="grw-builder-option"><label><input type="checkbox" name="lazy_load_img" checked>Lazy load images</label></div><div class="grw-builder-option"><label><input type="checkbox" name="nofollow_link" checked>Use no follow links</label></div><div class="grw-builder-option"><label><input type="checkbox" name="open_link" checked>Open links in new Window</label></div><div class="grw-builder-option"><label><input type="checkbox" name="aria_label">Enable ARIA label for screen readers</label></div><div class="grw-builder-option"><label><input type="checkbox" name="media" value="" checked>Show review images</label></div><div class="grw-builder-option"><label><input type="checkbox" name="reply" value="" checked>Show owner responses</label></div><div class="grw-builder-option"><label><input type="checkbox" name="google_def_rev_link">Use default Google reviews link</label><span class="grw-quest grw-quest-top grw-toggle" title="Click to help">?</span><div class="grw-quest-help" style="display:none;">If the direct link to all reviews <b>https://search.google.com/local/reviews?placeid=&lt;PLACE_ID&gt;</b> does not work with your Google place (leads to 404), please use this option to use the default reviews link to Google map.</div></div><div class="grw-builder-option">Reviewer avatar size<select name="reviewer_avatar_size"><option value="56" selected="selected">Small: 56px</option><option value="128">Medium: 128px</option><option value="256">Large: 256px</option></select></div><div class="grw-builder-option">Cache data<select name="cache"><option value="1">1 Hour</option><option value="3">3 Hours</option><option value="6">6 Hours</option><option value="12" selected="selected">12 Hours</option><option value="24">1 Day</option><option value="48">2 Days</option><option value="168">1 Week</option><option value="">Disable (NOT recommended)</option></select></div><div class="grw-builder-option">Reviews limit<input type="text" name="reviews_limit" value=""></div><input type="hidden" id="hidden_ids" name="hidden" value=""></div></div>',
GRW_WIZARD='<iframe id="gpidc" src="https://app.richplugins.com/public/connect?authcode={{authcode}}&lang={{lang}}" style="width:100%;height:99%"></iframe><small class="grw-connect-error"></small>',GRW_WIZARD2='<div id="gpidc" style="height:400px;background:#ffffff;padding:20px"><h3>Connection Wizard</h3><p>Please start typing your business name or address in the search field below.<br>Alternatively, you can paste your Google Place ID if you know it.</p><div style="position:relative"><input id="grw_place_autocomplete" type="text" placeholder="Start typing here your business place address and name" autofocus/><svg id="grw_place_spin_svg" style="display:none" viewBox="0 0 16 16"><path fill="#999999" d="M12.9 3.1c1.3 1.2 2.1 3 2.1 4.9 0 3.9-3.1 7-7 7s-7-3.1-7-7c0-1.9 0.8-3.7 2.1-4.9l-0.8-0.8c-1.4 1.5-2.3 3.5-2.3 5.7 0 4.4 3.6 8 8 8s8-3.6 8-8c0-2.2-0.9-4.2-2.3-5.7l-0.8 0.8z"/></svg><ul id="grw_place_list" role="listbox"></ul></div><div id="grw_place" style="display:none;margin-top:12px"><div class="wp-google-place" style="display:flex;align-items:center;gap:16px;flex-wrap:wrap"><div class="wp-google-left"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="g business img" width="50" height="50" title="g business img" style="border-radius:50%"></div><div class="wp-google-right"><b class="wp-google-name"></b><div style="display:flex;align-items:center;gap:2px"><span class="wp-google-rating"></span><svg width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#fb8e28"></path></svg><svg width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#fb8e28"></path></svg><svg width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#fb8e28"></path></svg><svg width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#fb8e28"></path></svg><svg width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#fb8e28"></path></svg></div><small class="wp-google-powered">Based on <span class="wp-google-based"></span> reviews</small></div><select id="grw_place_lang"></select><button id="grw_place_btn">Connect</button></div></div><p id="grw_place_error" class="grw-connect-error"></p></div>';
var GRW_LIGHTBOX;const GRW_TOAST=rpi.Toast({timeout:25});
function grw_stylechange2(a){let c=document.getElementsByClassName("wp-gr")[0];if("range"==a.type||"color"==a.type){var b=a.value+(a.getAttribute("data-postfix")||"");a.setAttribute("data-val",b);c.style.setProperty(a.name,b);"color"==a.type&&(a.nextSibling.value=b)}else if("checkbox"==a.type||"radio"==a.type){if(b=a.getAttribute("data-vars")){b=b.split(";");for(let d=0;d<b.length;d++){let e=b[d].split(":");1<e.length&&(a.checked?(e[1].trim(),c.style.setProperty(e[0].trim(),e[1].trim())):c.style.removeProperty(e[0].trim()))}}a.checked?
c.style.setProperty(a.name,a.getAttribute("data-on")):a.getAttribute("data-off")?c.style.setProperty(a.name,a.getAttribute("data-off")):c.style.removeProperty(a.name)}(a=c.getAttribute("style").match(/(--[a-z]+(-[a-z]+)*:\s*[#0-9a-z]+\s*;)+/g))&&a.length&&(window.style_vars.value=a.join(""))}function stylereset(a,c){window.style_vars.value=""}
function grw_builder_init(a,c){var b=document.querySelector(c.el);if(b){var d=GRW_VARS.lang?GRW_VARS.lang.toLowerCase().split(/[_-]/)[0]:"";b.innerHTML=GRW_HTML_CONTENT.replace("{{wizard}}",c.key?GRW_WIZARD2:GRW_WIZARD.replace("{{authcode}}",c.authcode).replace("{{lang}}",d));GRW_LIGHTBOX=rpi.Lightbox(window.gpidc);c.conns&&c.conns.connections&&c.conns.connections.length?grw_deserialize_connections(a,b,c):(GRW_LIGHTBOX.show(!0),window.gpidc.focus());window.onmessage=function(h){if("https://app.richplugins.com"===
h.origin&&h.data){let f=h.data;switch(f.action){case "get_place":a.post(ajaxurl,{pid:f.pid,lang:f.lang,token:f.token,action:"grw_get_place",grw_nonce:jQuery("#grw_nonce").val()},function(k){"success"==k.status?(k.result.place_id=f.pid,window.gpidc.contentWindow.postMessage({data:k,action:"set_place"},"*")):grw_connect_error(a,grw_get_error(k))});break;case "connect":grw_connect_ajax(a,b,f,c.authcode,1,function(){window.gpidc.contentWindow.postMessage({action:"connect_done"},"*")})}}};grw_sbs_init();
a('.grw-connect-options input[type="text"]:not([name^="--"]),.grw-connect-options textarea').keyup(function(){clearTimeout(GRW_AUTOSAVE_TIMEOUT);GRW_AUTOSAVE_TIMEOUT=setTimeout(grw_serialize_connections,GRW_AUTOSAVE_KEYUP_TIMEOUT)});a('.grw-connect-options input[type="checkbox"]:not([name^="--"]),.grw-connect-options select').change(function(){grw_serialize_connections()});a('.grw-connect-options input[name^="--"]').on("input",function(){grw_stylechange2(this);clearTimeout(GRW_AUTOSAVE_TIMEOUT);GRW_AUTOSAVE_TIMEOUT=
setTimeout(grw_serialize_connections,GRW_AUTOSAVE_KEYUP_TIMEOUT)});a('.grw-connect-options input[type="color"][name^="--"] + input[type="text"]').keyup(function(){0==this.value.indexOf("#")&&7==this.value.length&&(this.previousElementSibling.value=this.value,this.previousElementSibling.dispatchEvent(new Event("input")))});a(".grw-toggle",b).unbind("click").click(function(){a(this).toggleClass("toggled");a(this).next().slideToggle()});a(".grw-builder-connect.grw-connect-google").click(function(){GRW_LIGHTBOX.show(!0)});
a(".grw-connections").sortable&&(a(".grw-connections").sortable({stop:function(h,f){grw_serialize_connections()}}),a(".grw-connections").disableSelection());a(".wp-review-hide").click(function(){grw_review_hide(a(this));return!1});a("#grw_save").click(function(){return(new URL(window.location.href)).searchParams.has("grw_feed_id")?(grw_serialize_connections(),!1):!0});var e=!1;document.querySelector(".grw-builder form").addEventListener("submit",function(){e=!0});window.addEventListener("beforeunload",
function(h){const f=new URL(window.location.href);!window.grw_post_id.value||e||f.searchParams.has("grw_feed_id")&&!GRW_AUTOSAVE_TIMEOUT||(h.preventDefault(),h.returnValue="")});if(c.key){let h='<option value="" selected="selected">Choose language if needed</option>';for(d=0;d<GRW_LANGS.length;d++)h+='<option value="'+GRW_LANGS[d][0]+'"'+(void 0==GRW_LANGS[d][0]?' selected="selected"':"")+">"+GRW_LANGS[d][1]+"</option>";window.grw_place_lang.innerHTML=h;window.grw_place_autocomplete.focus();window.grw_place_autocomplete.addEventListener("keyup",
grw_input_keyup)}}}function grw_input_keyup(a){clearTimeout(window.keyupTimeout);if(13!==a.keyCode){var c=this.value.trim();c&&/^(\s+|\S+)+$/giu.test(c)?(grw_place_spin(1),/^ChIJ\S+$/giu.test(c)?grw_get_place(c):keyupTimeout=setTimeout(grw_on_keyup,1E3,a,this.value.trim())):grw_place_spin()}}
function grw_on_keyup(a,c){c&&c!=window.grw_keyup_val?(grw_keyup_val=c,a.preventDefault(),jQuery.post(ajaxurl,{input:c,action:"grw_place_autocomplete",grw_nonce:jQuery("#grw_nonce").val()},function(b){grw_place_spin();window.grw_place_list.innerHTML="";if(b&&b.error_message)window.grw_place_error.innerHTML=b.error_message;else{for(let d=0;d<b.predictions.length;d++)(function(e){let h=document.createElement("a");h.href="#";h.className="dropdown-item";h.role="option";h.innerHTML='<div class="location-name">'+
e.structured_formatting.main_text+"</div>";e.structured_formatting.secondary_text&&(h.innerHTML+='<small class="location-address">'+e.structured_formatting.secondary_text+"</small>");h.onclick=function(k){k.preventDefault();grw_get_place(e.place_id);grw_place_spin(1)};let f=document.createElement("li");f.appendChild(h);window.grw_place_list.appendChild(f)})(b.predictions[d]);window.grw_place_list.style.display="block"}})):grw_place_spin()}
function grw_get_place(a){jQuery.post(ajaxurl,{pid:a,action:"grw_get_place",grw_nonce:jQuery("#grw_nonce").val()},function(c){grw_place_spin();window.grw_place_list.innerHTML="";const b=grw_get_error(c);b?window.grw_place_error.innerHTML=b:grw_set_place(a,c.result)})}function grw_get_error(a){return a?.result?.error_message?.message||a?.result?.error_message||null}
function grw_set_place(a,c){let b=window.grw_place.getElementsByTagName("img")[0],d=window.grw_place.getElementsByClassName("wp-google-name")[0],e=window.grw_place.getElementsByClassName("wp-google-rating")[0],h=window.grw_place.getElementsByClassName("wp-google-based")[0];b.src=c.photo||c.icon;d.innerHTML=c.name;e.innerHTML=c.rating;h.innerHTML=c.user_ratings_total;window.grw_place_list.style.display="none";window.grw_place.style.display="block";window.grw_place_btn.onclick=function(f){f.preventDefault();
let k=f.target;k.disabled=!0;grw_connect_ajax(jQuery,document,{id:a,lang:window.grw_place_lang.value},null,1,function(){k.disabled=!1;grw_place_spin();grw_wizard_close()});grw_place_spin(1)}}function grw_place_spin(a){window.grw_place_spin_svg.style.display=a?"block":"none"}
function grw_feed_save_ajax(){if(!window.grw_title.value)return window.grw_title.focus(),!1;window.grw_save.innerText="Auto save, wait";window.grw_save.disabled=!0;jQuery.post(ajaxurl,{post_id:window.grw_post_id.value,title:window.grw_title.value,content:document.getElementById("grw-builder-connection").value,action:"grw_feed_save_ajax",grw_nonce:jQuery("#grw_nonce").val()},function(a){rpi.Utils.clear();for(var c=document.querySelectorAll(".wp-gr"),b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
window.grw_collection_preview.innerHTML=a;window.grw_boot&&window.grw_boot();jQuery(".wp-review-hide").unbind("click").click(function(){grw_review_hide(jQuery(this));return!1});window.grw_post_id.value||(a=document.querySelector(".wp-gr").getAttribute("data-id"),c=document.querySelector(".grw-toolbar-control"),b=document.createElement("label"),b.innerHTML='<span id="grw_sc_msg">Copy Shortcode </span> <input id="grw_sc" type="text" value="[grw id='+a+']" data-grw-shortcode="[grw id='+a+']" onclick="this.select(); document.execCommand(\'copy\'); window.grw_sc_msg.innerHTML = \'Shortcode Copied! Paste on page. \';" readonly="">',
c.insertBefore(b,window.grw_save),window.grw_post_id.value=a);a=jQuery("#grw-rate_us");!a.length||a.hasClass("grw-flash-visible")||window.grw_rateus||a.addClass("grw-flash-visible");window.grw_save.innerText="Save & Update";window.grw_save.disabled=!1;GRW_AUTOSAVE_TIMEOUT=null})}
function grw_review_hide(a){a=a.attr("data-id");let c=window.hidden_ids.value;if(c){c=c.split(",");let b=c.indexOf(a);0>b?c.push(a):c.splice(b,1)}else c=[a];window.hidden_ids.value=c.join(",");grw_serialize_connections()}
function grw_review_hide_global(a){jQuery.post(ajaxurl,{id:a.attr("data-id"),feed_id:jQuery('input[name="grw_feed[post_id]"]').val(),grw_wpnonce:jQuery("#grw_nonce").val(),action:"grw_hide_review"},function(c){var b=a.parent().parent();c.hide?(a.text("show review"),b.addClass("wp-review-hidden")):(a.text("hide review"),b.removeClass("wp-review-hidden"))},"json")}
function grw_connect_ajax(a,c,b,d,e,h){c.querySelector(".grw-connect-btn");var f=void 0!==b.local_img?b.local_img:!0;window.grw_save.innerText="Auto save, wait";window.grw_save.disabled=!0;d={id:decodeURIComponent(b.id),url:b.url,lang:b.lang,local_img:f,token:b.token,feed_id:a('input[name="grw_feed[post_id]"]').val(),grw_wpnonce:a("#grw_nonce").val(),action:"grw_connect_google",v:(new Date).getTime()};a.post(ajaxurl,d,function(k){console.log("grw_connect_debug:",k);if("success"==k.status){var q=document.querySelectorAll(".grw-connect-error");
for(let l=0;l<q.length;l++)q[l].innerHTML="";grw_wizard_close();q={default_photo:k.result.photo};k.result.map_url&&(q.map_url=k.result.map_url);grw_connection_add(a,c,{id:k.result.id,lang:b.lang,name:k.result.name,photo:k.result.photo,refresh:!0,local_img:f,platform:"google",props:q});grw_serialize_connections();GRW_TOAST.show({msg:("refresh"===b.event?"Reviews updated":"Widget saved")+" successfully. "+(-1<k.result.credits?"<br><b>"+k.result.credits+" attempts remaining (without your API key).</b>":
""),type:"success"})}else q=grw_get_error(k),GRW_TOAST.show({msg:q,type:"error"});h&&h(k)},"json")}function grw_wizard_close(){GRW_LIGHTBOX.hide()}
function grw_connect_error(a,c,b){let d=document.querySelectorAll(".grw-connect-error");for(let e=0;e<d.length;e++)d[e].innerHTML="";switch(c){case "usage_limit":a("#dialog").dialog({width:"50%",maxWidth:"600px"});break;case "bot_check":b&&b();break;default:for(a=0;a<d.length;a++)d[a].innerHTML="<b>Error</b>: "+c}window.grw_save.innerText="Save & Update";window.grw_save.disabled=!1}
function grw_connection_add(a,c,b,d,e){var h=grw_connection_id(b),f=a("#"+h);f.length?(b.photo&&grw_change_photo(f,b.photo),b.props&&b.props.map_url&&(e=f.children().eq(1),d=a('input[name="map_url"]',e),d.length&&d.remove(),e.prepend('<input type="hidden" name="map_url" value="'+b.props.map_url+'" class="grw-connect-prop" readonly="">'))):f.length||(f=a('<div class="grw-connection"></div>')[0],f.id=h,void 0!=b.lang&&f.setAttribute("data-lang",b.lang),f.setAttribute("data-platform",b.platform),f.innerHTML=
grw_connection_render(b,d),d=a(".grw-connections")[0],e?d.appendChild(f):d.prepend(f),jQuery(".grw-toggle",f).unbind("click").click(function(){jQuery(this).toggleClass("toggled");jQuery(this).next().slideToggle()}),jQuery(".grw-connect-photo-change",f).on("click",function(k){k.preventDefault();grw_upload_photo(f,void 0,function(){grw_serialize_connections()});return!1}),jQuery(".grw-connect-photo-default",f).on("click",function(k){grw_change_photo(f,b.props.default_photo);grw_serialize_connections();
return!1}),a('input[type="text"]',f).keyup(function(){clearTimeout(GRW_AUTOSAVE_TIMEOUT);GRW_AUTOSAVE_TIMEOUT=setTimeout(grw_serialize_connections,GRW_AUTOSAVE_KEYUP_TIMEOUT)}),a('input[type="checkbox"]',f).click(function(){grw_serialize_connections()}),a("select.grw-connect-lang",f).change(function(){b.lang=this.value;f.id=grw_connection_id(b);f.setAttribute("data-lang",this.value);grw_reconnect(a,c,b);return!1}),a('input[name="local_img"]',f).unbind("click").click(function(){b.local_img=this.checked;
grw_reconnect(a,c,b)}),a(".grw-connect-reconnect",f).click(function(){grw_reconnect(a,c,b);return!1}),a(".grw-connect-delete",f).click(function(){confirm("Are you sure to delete this business?")&&(a(f).remove(),grw_serialize_connections());return!1}))}
function grw_reconnect(a,c,b){window.gpidc instanceof HTMLIFrameElement?(b.event="refresh",b.url=b.props.map_url,window.grw_save.disabled=!0,window.grw_save.innerText="Updating...",window.gpidc.contentWindow.postMessage({params:b,action:"connect"},"*")):grw_connect_ajax(a,c,b,null,1)}function grw_connection_id(a){var c="grw-"+a.platform+"-"+a.id.replace(/\//g,"");null!=a.lang&&(c+=a.lang);return c}
function grw_connection_render(a,c){var b=a.name;a.lang&&(b+=" ("+a.lang+")");a.photo=a.photo||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var d=document.createElement("option");d.value="google"==a.platform&&a.props&&a.props.place_id?a.props.place_id:a.id;d.text=grw_capitalize(a.platform)+": "+a.name;c='<div class="grw-toggle grw-builder-connect grw-connect-business"><input type="checkbox" class="grw-connect-select" onclick="event.stopPropagation();" '+(c?"checked":
"")+" /> "+b+(a.address?" ("+a.address+")":"")+'</div><div style="display:none">';b=a.props;d="";for(prop in b)"platform"!=prop&&Object.prototype.hasOwnProperty.call(b,prop)&&(d+='<input type="hidden" name="'+prop+'" value="'+b[prop]+'" class="grw-connect-prop" readonly />');return c+d+'<input type="hidden" name="id" value="'+a.id+'" readonly />'+(a.address?'<input type="hidden" name="address" value="'+a.address+'" readonly />':"")+(a.access_token?'<input type="hidden" name="access_token" value="'+
a.access_token+'" readonly />':"")+'<div class="grw-builder-option"><img src="'+a.photo+'" alt="'+a.name+'" class="grw-connect-photo"><a href="#" class="grw-connect-photo-change">Change</a><a href="#" class="grw-connect-photo-default">Default</a><input type="hidden" name="photo" class="grw-connect-photo-hidden" value="'+a.photo+'" tabindex="2"/></div><div class="grw-builder-option"><input type="text" name="name" value="'+a.name+'" /></div>'+(void 0!=a.website?'<div class="grw-builder-option"><input type="text" name="website" value="'+
a.website+'" /></div>':"")+(void 0!=a.lang?'<div class="grw-builder-option">'+grw_lang("Show all",a.lang)+"</div>":"")+(void 0!=a.review_count?'<div class="grw-builder-option"><input type="text" name="review_count" value="'+a.review_count+'" placeholder="Total number of reviews" /><span class="grw-quest grw-toggle" title="Click to help">?</span><div class="grw-quest-help">Google return only 5 most helpful reviews and does not return information about total number of reviews and you can type here it manually.</div></div>':
"")+(void 0!=a.refresh?'<div class="grw-builder-option"><label><input type="checkbox" name="refresh" '+(a.refresh?"checked":"")+"> Include in auto-update<br><small>Works only with your own Google API key</small></label></div>":"")+'<div class="grw-builder-option"><label><input type="checkbox" name="local_img" '+(a.local_img?"checked":"")+'>Save images locally (GDPR)</label></div><div class="grw-builder-option"><button class="grw-connect-reconnect">Update reviews</button></div><div class="grw-builder-option"><button class="grw-connect-delete">Delete connection</button></div><div class="grw-builder-option"><small class="grw-connect-error"></small></div></div>'}
function grw_serialize_connections(){var a=[],c=document.querySelectorAll(".grw-connection");for(q in c)if(Object.prototype.hasOwnProperty.call(c,q)){var b=c[q].querySelector(".grw-connect-select");if(!b||grw_is_hidden(b)||b.checked){var d={};b=c[q].getAttribute("data-lang");var e=c[q].getAttribute("data-platform"),h=c[q].querySelectorAll("input");void 0!=b&&(d.lang=b);for(var f in h)if(Object.prototype.hasOwnProperty.call(h,f)){b=h[f];var k=b.getAttribute("name");k&&("grw-connect-prop"==b.className?
(d.props=d.props||{},d.props[k]=b.value):d[k]="checkbox"==b.type?b.checked:b.value)}d.platform=e;a.push(d)}}c={};var q=document.querySelector(".grw-connect-options").querySelectorAll("input[name],select,textarea");for(var l in q)Object.prototype.hasOwnProperty.call(q,l)&&(b=q[l],k=b.getAttribute("name"),"checkbox"==b.type?c[k]=b.checked:void 0!=b.value&&(c[k]="textarea"==b.type||"word_filter"==k||"word_exclude"==k?encodeURIComponent(b.value):b.value));document.getElementById("grw-builder-connection").value=
JSON.stringify({connections:a,options:c});a.length&&(a=a[0],window.grw_title.value||(window.grw_title.value=a.name),grw_feed_save_ajax())}
function grw_deserialize_connections(a,c,b){var d=b.conns;b=d.options;if(Array.isArray(d.connections))d=d.connections;else{var e=[];if(Array.isArray(d.google)){for(var h=0;h<d.google.length;h++)d.google[h].platform="google";e=e.concat(d.google)}if(Array.isArray(d.facebook)){for(h=0;h<d.facebook.length;h++)d.facebook[h].platform="facebook";e=e.concat(d.facebook)}if(Array.isArray(d.yelp)){for(h=0;h<d.yelp.length;h++)d.yelp[h].platform="yelp";e=e.concat(d.yelp)}d=e}e=c.querySelector(".grw-builder-platforms");
for(h=0;h<d.length;h++)grw_connection_add(a,e,d[h],!0,!0);for(var f in b)Object.prototype.hasOwnProperty.call(b,f)&&f&&(a=c.querySelector('input[name="'+f+'"],select[name="'+f+'"],textarea[name="'+f+'"]'))&&(d=a.getAttribute("name"),"boolean"===typeof b[f]?a.checked=b[f]:(a.value="textarea"==a.type||"word_filter"==d||"word_exclude"==d?decodeURIComponent(b[f]):b[f],-1<f.indexOf("_photo")&&a.value&&(a.parentNode.querySelector("img").src=a.value),"style_vars"==f&&rplg_sv_parse(c,a.value),"slider_breakpoints"==
f&&grw_sbs_parse(a.value)))}
function rplg_sv_parse(a,c){if(c){c=c.split(";");for(let d=0;d<c.length;d++)if(c[d]){let e=c[d].split(":"),h=a.querySelectorAll('input[name="'+e[0].trim()+'"]');for(let f=0;f<h.length;f++){let k=h[f];if("checkbox"==k.type){var b=k.getAttribute("data-off");let q=k.getAttribute("data-on");k.checked=e[1].trim()!=b?e[1].trim()==q:!1}else b=k.getAttribute("data-postfix"),k.setAttribute("data-val",e[1].trim()),k.value=e[1].trim().replace(b,""),"color"==k.type&&(k.nextSibling.value=e[1].trim())}}}else stylereset()}
function grw_upload_photo(a,c,b){c||(c=wp.media.frames.file_frame=wp.media({title:jQuery(this).data("uploader_title"),button:{text:jQuery(this).data("uploader_button_text")},multiple:!1}),c.on("select",function(){var d=c.state().get("selection").first().toJSON();grw_change_photo(a,d.url);b&&b(d.url)}));c.open()}function grw_change_photo(a,c){var b=jQuery(".grw-connect-photo-hidden",a);a=jQuery(".grw-connect-photo",a);b.val(c);a.attr("src",c);a.show()}
function grw_popup(a,c,b,d){function e(){k&&0==k.closed?setTimeout(e,100):d()}var h=h||screen.height/2-b/2,f=f||screen.width/2-c/2,k=window.open(a,"","location=1,status=1,resizable=yes,width="+c+",height="+b+",top="+h+",left="+f);setTimeout(e,100)}function grw_randstr(a){for(var c="",b=0;b<a;b++)c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return c}function grw_is_hidden(a){return null===a.offsetParent}
function grw_capitalize(a){return a.charAt(0).toUpperCase()+a.slice(1)}function grw_lang(a,c){for(var b="",d=0;d<GRW_LANGS.length;d++)b+='<option value="'+GRW_LANGS[d][0]+'"'+(c==GRW_LANGS[d][0]?' selected="selected"':"")+">"+GRW_LANGS[d][1]+"</option>";return'<select class="grw-connect-lang" name="lang"><option value=""'+(c?"":' selected="selected"')+">"+a+"</option>"+b+"</select>"}
function grw_sbs_init(){var a=document.querySelector(".grw-slider-br select"),c=document.querySelector('.grw-slider-br input[type="range"]'),b=document.querySelector(".grw-slider-br .grw-quest");a.addEventListener("change",grw_sbs_keyup);c.addEventListener("input",grw_sbs_keyup);b.onclick=function(){grw_sbs_clone(document.querySelector(".grw-slider-br:last-child"));grw_sbs_keyup()}}
function grw_sbs_parse(a){var c,b=document.querySelector(".grw-slider-br select"),d=document.querySelector('.grw-slider-br input[type="range"]'),e=document.querySelector('.grw-slider-br input[type="range"] + span');if(a&&(c=a.split(",")).length)for(a=c.shift().split(":"),b.value=a[0].replace("px","").trim(),d.value=parseInt(a[1]),e.innerHTML=a[1];c.length;)grw_sbs_clone(document.querySelector(".grw-slider-br:last-child"),c.shift().split(":"))}
function grw_sbs_clone(a,c){let b=a.cloneNode(!0),d=a.querySelector("select"),e=b.querySelector(".grw-quest"),h=b.querySelector("select"),f=b.querySelector('input[type="text"]');range=b.querySelector('input[type="range"]');span=b.querySelector('input[type="range"] + span');clearTimeout(window.grw_sbt);h.options.length>d.selectedIndex+1&&(h.selectedIndex=d.selectedIndex+1);0==h.selectedIndex&&(h.selectedIndex=1);e.innerHTML="-";a.parentNode.appendChild(b);c&&(h.value=c[0],h.value?f&&f.parentNode.removeChild(f):
(h.value="",f||(f=document.createElement("input"),f.type="text",h.after(f)),f.value=c[0],f.addEventListener("keyup",grw_sbs_keyup)),range.value=c[1],span.innerHTML=c[1]);h.addEventListener("change",grw_sbs_keyup);range.addEventListener("input",grw_sbs_keyup);e.onclick=function(){b.parentNode.removeChild(b);grw_sbs_keyup()}}
function grw_sbs_keyup(){clearTimeout(window.grw_sbt);var a=[];let c=document.querySelectorAll(".grw-slider-br");for(let e=0;e<c.length;e++){var b=c[e].querySelector("select"),d=c[e].querySelector('input[type="text"]');let h=c[e].querySelector('input[type="range"]');"off"==b.value?rpi.Utils.rm(d):(b.value||d&&d.value)&&h.value?(b.value?(b=b.value,rpi.Utils.rm(d)):b=d.value,a.push([b,h.value].join(":"))):d||(d=document.createElement("input"),d.type="text",d.addEventListener("keyup",grw_sbs_keyup),
b.after(d),d.focus())}a=a.join(",");rpi.Instances[0].setBreakpoints(a);grw_sbs_set(a)}function grw_sbs_set(a){let c=document.querySelector('input[name="slider_breakpoints"]');c.value!=a&&(c.value=a,window.grw_sbt=setTimeout(grw_serialize_connections,3E3))};
