Heray-Was-Here
Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67451637 ( 67451637)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /homepages/10/d4299163471/htdocs/wordpress/wp-content/plugins/kubio/build/admin-area/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /homepages/10/d4299163471/htdocs/wordpress/wp-content/plugins/kubio/build/admin-area/index.js
(()=>{"use strict";var e={7418:e=>{var t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var o,s,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in o=Object(arguments[l]))a.call(o,c)&&(r[c]=o[c]);if(t){s=t(o);for(var d=0;d<s.length;d++)i.call(o,s[d])&&(r[s[d]]=o[s[d]])}}return r}},5251:(e,t,a)=>{var i=a(9196),n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,a){var i,o={},c=null,d=null;for(i in void 0!==a&&(c=""+a),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,i)&&!l.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===o[i]&&(o[i]=t[i]);return{$$typeof:n,type:e,key:c,ref:d,props:o,_owner:r.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},5893:(e,t,a)=>{e.exports=a(5251)},9196:e=>{e.exports=window.React}},t={};function a(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{a.r(i),a.d(i,{activatePlugin:()=>_,getAdminData:()=>F,initAdminData:()=>D,initDemoImport:()=>T,initNoticePluginInstall:()=>Pe,initSiteWizard:()=>Ne,installPlugin:()=>k});const e=window.lodash;let t={},n={};const o="ACTIVE",s="INSTALLED",r="NOT_INSTALLED",l=e=>t={...t,...e,plugins_states:{...t.plugins_states,...e.plugins_states}},c=()=>{var e;return(null===(e=n)||void 0===e?void 0:e.plugins)||[]},d=a=>{const i=(0,e.find)(t.demos,{slug:a});n=i},u=()=>t.ajax_nonce,p=()=>t.ajax_url,b=e=>{var a;return(null===(a=t.texts)||void 0===a?void 0:a[e])||""},m=e=>t.plugins_states[e]||r,h=window.jQuery,g=window.wp.i18n,w=window.wp.url,f=t=>new Promise(((a,i)=>{const n=t instanceof window.FormData?t:new window.FormData;n.append("nonce",u()),(0,e.each)(t,((e,t)=>n.append(t,e))),h.ajax({method:"POST",url:(0,w.addQueryArgs)(p(),{nonce:u(),action:n.get("action")}),data:n,contentType:!1,processData:!1}).done((e=>{if(!1===e.success){var t,n;const a=(null==e||null===(t=e.data)||void 0===t?void 0:t.error_message)||(null==e||null===(n=e.data)||void 0===n?void 0:n.error);i(a)}else a(e)})).fail((e=>{i(`${e.status} ( ${e.statusText} ) : ${e.responseText}`)}))})),k=async e=>await f({action:"kubio-demo-site-install-plugin",slug:e}),_=async e=>await f({action:"kubio-demo-site-activate-plugin",slug:e}),y=async e=>{const t=m(e);try{switch(t){case o:return!0;case s:await _(e);break;case r:await k(e),await _(e)}}catch(e){throw e}},x=async(t=null)=>{let a={action:"kubio-demo-site-import-data",slug:n.slug||0,first_call:!0};try{let i={};do{if(t&&a.first_call?((0,e.each)(a,((e,a)=>t.append(a,e))),i=await f(t)):i=await f(a),a=(0,e.omit)(a,"first_call"),i.before_import_action?(S(C.PREPARING,I.PROGRESS),a={...a,before_import_action:i.before_import_action}):(S(C.PREPARING,I.DONE),S(C.CONTENT,I.PROGRESS),a=(0,e.omit)(a,"before_import_action")),"finished"===i.status){S(C.CONTENT,I.DONE);break}}while("requires-new-ajax-call"===i.status)}catch(e){L(e)}};let v=0;const j=(e=!0)=>{const a=h("#kubio-templates-list"),i=h("#kubio-template-installing");if(e){v=window.scrollY,a.hide(),i.css("display","flex").hide().fadeIn(100),i.find("img").attr("src",n.thumb);const e=(0,g.sprintf)(b("importing_template"),n.name);i.find("[data-title]").html(e);const o=c(),s=i.find("[data-plugins]"),r=i.find("[data-plugins-list]");o.length?(s.show(),r.empty(),o.forEach((e=>{const a=(i=e.slug,t.texts.plugins_states[m(i)]);var i;r.append(`<li><span>${e.label}</span><span>${a}</span></li>`)}))):s.hide();const l=!n.is_pro;(e=>{const t=h("#kubio-template-installing"),a=t.find("#import-button"),i=t.find("[data-available-pro-only]"),n=t.find("[data-check-pro-features]");e?(i.addClass("hidden"),n.addClass("hidden"),a.attr("data-start-import",""),a.show()):(a.removeAttr("data-start-import"),a.hide(),i.removeClass("hidden"),n.removeClass("hidden"))})(!(!t.kubio_pro_active&&!l))}else i.css("display","flex").hide(),h("#kubio-templates-list").show(),setTimeout((()=>window.scrollTo(0,v)),5)},N=async()=>{h(".kubio-admin-page-header-start-editing").addClass("hidden");const e=h("#kubio-template-installing"),t=e.find("[data-info]"),a=e.find("[data-progress]"),i=e.find("[data-install-buttons]"),n=e.find("[data-install-success-buttons]"),o=h(".kubio-progress-bar");t.hide(),a.css("display","flex").show(),i.hide(),o.show();try{await(async()=>{try{S(C.PLUGINS,I.PROGRESS);const e=c();for(let t=0;t<e.length;t++){const{slug:a}=e[t];await y(a)}S(C.PLUGINS,I.DONE)}catch(e){L(e)}})(),await x()}catch(e){L()}o.hide(),n.show(),h(".kubio-admin-page-header-start-editing").removeClass("hidden")},A=()=>{h((()=>{!function(){try{const e=new URL(location).searchParams.get("import");if(!e)return;d(e),j(),N()}catch(e){console.error(e)}}(),h(document).on("click","#kubio-templates-list button[data-slug]",(function(){const e=h(this).data("slug");d(e),j()})),h(document).on("click","#kubio-template-installing button[data-cancel-import]",(function(){j(!1)})),h(document).on("click","#kubio-template-installing button[data-start-import]",N),h(document).on("submit","#kubio-import-demo-site",(async e=>{e.preventDefault(),e.stopPropagation();const t=e.target,a=new window.FormData(t);E=!0;const i=h(t).siblings(".kubio-progress-bar");i.show(),h(t).hide();try{await x(a)}catch(e){i.hide();const t=P(e);h("[data-kubio-manual-demo-site-errors]").append(`<div class="kubio-demo-site-manual-import-error">${t}</div>`)}i.hide()}))}))},C={PLUGINS:"plugins",PREPARING:"preparing",CONTENT:"content"},O={plugins:"data-installing-plugins",preparing:"data-preparing-for-import",content:"data-importing-content"},I={INACTIVE:"",PROGRESS:"progress",DONE:"active"},S=(e,t)=>{h(`[data-progress-list] [${O[e]}]`).attr("class",t)};let E=!1;const P=t=>{t=(0,e.castArray)(t);let a="";return t.forEach((e=>a+=`<p>${e}</p>`)),a},R=t=>{if(E)return;const a="[data-importing-errors]";h(a).show(),(t=(0,e.castArray)(t)).forEach((e=>h(`${a} [data-importing-errors-content]`).append(`<p>${e}</p>`)))},L=e=>{throw E||(R(e),R(b("import_stopped")),E=!0),h(".kubio-progress-bar").hide(),h("[data-progress-list] li").attr("class",""),e},T=e=>{l(e),A()},D=e=>{l(e)},F=()=>t,$=h("#upgrade_to_pro_wrapper #kubio-page-builder-activate-license-form");let G=$;const U=h(".notice #kubio-page-builder-activate-license-form");U.length&&(G=U);const K=h("#kubio-page-builder-check-license form");if(K.length&&(G=K),G.length){const Re=G.find("input[type=text]"),Le=G.parent(),Te=Le.find("#kubio-page-builder-activate-license-message"),De=Le.find(".description"),Fe=Le.find(".spinner-holder");function $e(e){const t=jQuery(document.createElement("div")).append(e);return t.find("input,button,script,style").remove(),t.find("body").length?t.find("body").html():t.html()}function Ge(){Te.hide()}function Ue(e){Me(),Te.attr("class","message error-message"),Te.html($e(e)),Te.show()}function Ke(e="",t=""){G.hide(),Te.hide(),De.hide(),Fe.show(),""!==e&&("loader"===e?(Fe.removeClass("ok"),Fe.find(".icon .loader").show()):"ok"===e&&Fe.addClass("ok")),""!==t&&Fe.find(".message").text(t)}function Me(){G.show(),Te.show(),De.show(),Fe.hide()}Re.on("keyup change",Ge),G.on("submit",(function(e){var t,a;e.preventDefault(),e.stopPropagation();const i=Re.val();i?(Ge(),Ke("loader",(0,g.__)("Loading…","kubio")),G.addClass("disabled"),wp.ajax.send("kubiowp-page-builder-activate",{data:{key:i,_wpnonce:null===(t=top)||void 0===t||null===(a=t.kubioUtilsData)||void 0===a?void 0:a.kubio_ajax_nonce}}).done((function(e){var t,a;$.length?(Ke("loader",(0,g.__)("Installing Kubio PRO…","kubio")),wp.ajax.post("kubiowp-page-builder-maybe-install-pro",{_wpnonce:null===(t=top)||void 0===t||null===(a=t.kubioUtilsData)||void 0===a?void 0:a.kubio_ajax_nonce}).done((function(){Ke("ok",(0,g.__)("Kubio PRO sucessfully installed","kubio")),M(i)})).fail((function(e){e.message?Ue(e.message):Ue((0,g.__)("There was an error installing the Kubio PRO plugin","kubio"))}))):Ke("ok",e||(0,g.__)("Activated successfully","kubio"))})).fail((function(e){Me(),G.removeClass("disabled"),Ue(e.responseJSON.data)}))):Ue((0,g.__)("License key is empty","kubio"))})),K.length&&window.wp&&window.wp.ajax&&wp.ajax.send("kubiowp-page-builder-check-license",{data:{_wpnonce:top.kubioUtilsData.kubio_ajax_nonce}}).fail((function(e){G.closest(".notice").removeClass("hidden"),Ue($e(e.responseJSON.data))}))}function M(e){h(".kubio--modal").removeClass("kubio--modal-hidden"),h("input[name=upgrade__reason]").on("click",(function(){h(".kubio--popup__form label").removeClass("kubio--popup__form--checked"),h(this).parents("label").addClass("kubio--popup__form--checked"),0===h("input[name=upgrade__reason]:checked").length?h(".kubio--popup__form").addClass("kubio--popup__form-has-errors"):(h(".kubio--popup__form").removeClass("kubio--popup__form-has-errors"),h(".kubio--modal").addClass("kubio--modal-hidden"),function(e,t){wp.ajax.send("kubiowp-page-builder-upgrade-feedback",{data:{reason:e,license:t,_wpnonce:top.kubioUtilsData.kubio_ajax_nonce}}).done((function(){console.log("Thank you for your feedback")}))}(h("input[name=upgrade__reason]:checked").val(),e))}))}h(".kubio--popup__close button").on("click",(function(e){e.preventDefault(),h(this).parents(".kubio--modal").addClass("kubio--modal-hidden")})),window.kubio=window.kubio||{},window.kubio.showFeedbackForm=M;const q=window.kubio.ai,B=window.kubio.core,W=window.kubio.coreHooks,z=window.kubio.log,H=window.kubio.pro,Q=window.kubio.utils,Y=window.wp.element;var V=a(9196),J=a.n(V),Z=a(7418),X=a.n(Z),ee=function(){return ee=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ee.apply(this,arguments)};const te=function(e){for(var t=e.url,a=e.allowFullScreen,i=e.position,n=e.display,o=e.height,s=e.width,r=e.overflow,l=e.styles,c=e.onLoad,d=e.onMouseOver,u=e.onMouseOut,p=e.scrolling,b=e.id,m=e.frameBorder,h=e.ariaHidden,g=e.sandbox,w=e.allow,f=e.className,k=e.title,_=e.ariaLabel,y=e.ariaLabelledby,x=e.name,v=e.target,j=e.loading,N=e.importance,A=e.referrerpolicy,C=e.allowpaymentrequest,O=e.src,I=X()({src:O||t,target:v||null,style:{position:i||null,display:n||"block",overflow:r||null},scrolling:p||null,allowpaymentrequest:C||null,importance:N||null,sandbox:g||null,loading:j||null,styles:l||null,name:x||null,className:f||null,referrerpolicy:A||null,title:k||null,allow:w||null,id:b||null,"aria-labelledby":y||null,"aria-hidden":h||null,"aria-label":_||null,width:s||null,height:o||null,onLoad:c||null,onMouseOver:d||null,onMouseOut:u||null}),S=Object.create(null),E=0,P=Object.keys(I);E<P.length;E++){var R=P[E];null!=I[R]&&(S[R]=I[R])}for(var L=0,T=Object.keys(S.style);L<T.length;L++){var D=T[L];null==S.style[D]&&delete S.style[D]}if(a)if("allow"in S){var F=S.allow.replace("fullscreen","");S.allow=("fullscreen "+F.trim()).trim()}else S.allow="fullscreen";return m>=0&&(S.style.hasOwnProperty("border")||(S.style.border=m)),J().createElement("iframe",ee({},S))};var ae=a(5893);let ie="",ne=()=>(0,Q.getBackendData)("kubioAIPricingURL");ne=H.upgradeToProURL;const oe=(0,Y.memo)((({message:e})=>(0,ae.jsxs)("p",{className:"spinner-holder",children:[(0,ae.jsx)("span",{className:"loader",dangerouslySetInnerHTML:{__html:ie}}),e]}))),se=({message:e})=>(0,ae.jsx)("div",{className:"notice notice-error",children:(0,ae.jsx)("p",{children:e})}),re=({remainingCredits:e,email:t})=>{const[a,i]=(0,Y.useState)(1),[n,o]=(0,Y.useState)(!0),[s,r]=(0,Y.useState)({data:[]});let l=(0,ae.jsx)(ae.Fragment,{});return(0,W.useEffectAsync)((async()=>{try{o(!0);const e=await(0,q.getAIUsage)(a);r(e)}catch(e){}finally{o(!1)}}),[a]),(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-info nowrap",children:[(0,ae.jsxs)("div",{className:"kubio-admin-col grow",children:[(0,ae.jsx)("h3",{children:(0,g.__)("You are connected to Kubio AI","kubio")}),(0,ae.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,g.sprintf)(// translators: placeholders are for email and number of credits
// translators: placeholders are for email and number of credits
(0,g.__)("You are currently connected as %1$s, and the current account has %2$s AI credits available","kubio"),`<i class="kubio-ai-email">${t}</i>`,`<i class="kubio-ai-credits">${e}</i>`)}})]}),(0,ae.jsxs)("div",{className:"kubio-admin-col kubio-ai-info-actions",children:[(0,ae.jsx)("a",{href:ne(),target:"_blank",className:"button button-primary button-hero",rel:"noreferrer",children:(0,g.__)("Get more credits","kubio")}),l]})]}),(0,ae.jsx)("hr",{}),(0,ae.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-usage",children:[(0,ae.jsx)("div",{className:"kubio-admin-row kubio-ai-account-info",children:(0,ae.jsxs)("div",{className:"kubio-admin-col grow",children:[(0,ae.jsx)("h3",{children:(0,g.__)("Kubio AI credits usage","kubio")}),(0,ae.jsx)("p",{children:(0,g.__)("The table below displays how Kubio AI credits were spent on this site","kubio")})]})}),(0,ae.jsxs)("table",{className:"wp-list-table widefat fixed striped table-view-list pages",children:[(0,ae.jsx)("thead",{children:(0,ae.jsxs)("tr",{children:[(0,ae.jsx)("th",{scope:"col",className:"manage-column r",children:(0,g.__)("Date","kubio")}),(0,ae.jsx)("th",{scope:"col",className:"manage-column r",children:(0,g.__)("Message","kubio")})]})}),(0,ae.jsxs)("tbody",{children:[n&&(0,ae.jsx)("tr",{children:(0,ae.jsx)("td",{className:"no-data",colSpan:2,children:(0,ae.jsx)(oe,{message:(0,g.__)("Retrieving data…","kubio")})})}),!n&&0===s.data.length&&(0,ae.jsx)("tr",{children:(0,ae.jsx)("td",{className:"no-data",colSpan:2,children:(0,ae.jsx)("p",{children:(0,g.__)("Currently there is no usage history for this site","kubio")})})}),!n&&0!==s.data.length&&s.data.map((e=>(0,ae.jsxs)("tr",{children:[(0,ae.jsx)("td",{children:e.created_at}),(0,ae.jsx)("td",{children:e.content})]},e.created_at)))]})]}),(0,ae.jsx)("div",{className:"tablenav bottom",children:(0,ae.jsxs)("div",{className:"tablenav-pages",children:[(0,ae.jsx)("span",{className:"displaying-num",children:(0,g.sprintf)(// translators: %s number of items
// translators: %s number of items
(0,g._n)("%s item","%s items",s.total,"kubio"),s.total)}),(0,ae.jsxs)("span",{className:"pagination-links",children:[(0,ae.jsx)("button",{className:"first-page button","aria-hidden":"true",onClick:()=>i(1),disabled:1===a,children:(0,ae.jsx)("span",{"aria-hidden":"true",children:"«"})}),(0,ae.jsx)("button",{className:"prev-page button","aria-hidden":"true",disabled:1===a,onClick:()=>i((e=>Math.max(1,e-1))),children:(0,ae.jsx)("span",{"aria-hidden":"true",children:"‹"})}),(0,ae.jsx)("span",{className:"paging-input",children:(0,ae.jsx)("span",{className:"tablenav-paging-text",children:(0,g.sprintf)(// translators: %1$s current page, %2$s last page
// translators: %1$s current page, %2$s last page
(0,g.__)("%1$s of %2$s","kubio"),a,s.last_page)})}),(0,ae.jsx)("button",{className:"next-page button",disabled:a===s.last_page,onClick:()=>i((e=>Math.min(s.last_page,e+1))),children:(0,ae.jsx)("span",{"aria-hidden":"true",children:"›"})}),(0,ae.jsx)("button",{className:"last-page button",disabled:a===s.last_page,onClick:()=>i(s.last_page),children:(0,ae.jsx)("span",{"aria-hidden":"true",children:"»"})})]})]})})]})]})},le=()=>{const t=(0,e.first)((0,Q.getBackendData)("kubioCloudUrl").split("?")).replace(/\/+$/,"");return(0,Y.useEffect)((()=>{const e=t=>{const{action:a=null,value:i=null,error:n=null}=t.data||{};"ai_subscription_key"===a&&(window.removeEventListener("message",e),n&&z.Log.error("AI Connect Iframe",n),i||z.Log.error("AI Connect Iframe, no value"),(async()=>{await(0,q.setAIKey)({aiKey:i}),window.location.reload()})())};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,ae.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-info",children:[(0,ae.jsxs)("div",{className:"kubio-admin-col",children:[(0,ae.jsx)("h2",{children:(0,g.__)("You are not connected to Kubio AI","kubio")}),(0,ae.jsx)("p",{children:(0,g.__)("It appears that you haven't fully leveraged the potential of Kubio AI features on your website. By connecting and allowing the AI to assist you, you'll optimize its capabilities and enhance your overall experience. Let the AI do the heavy lifting for you—seamless and efficient.","kubio")})]}),(0,ae.jsx)("div",{className:"kubio-admin-col kubio-ai-info-actions kubio-ai-info-actions__login",children:(0,ae.jsx)(te,{loading:"eager",importance:"high",className:"kubio-connect-iframe",url:`${t}/ui-route/connect-ai`,title:"Kubio AI Connect",sandbox:"allow-popups allow-modals allow-same-origin allow-scripts allow-forms allow-popups-to-escape-sandbox"})})]})};window.aiInfoInit=function(e){ie=e.loader_iframe,e.connected?async function(){try{const{remaining_credits:e=0,account_email:t=30}=await(0,q.getAIInfo)();(0,B.reactRender)((0,ae.jsx)(re,{remainingCredits:e,email:t}),document.querySelector("#kubio-ai-info-content"))}catch(e){(0,B.reactRender)((0,ae.jsx)(se,{message:(0,g.__)("There seems to be an error with the Kubio AI service. Please try again","kubio")}),document.querySelector("#kubio-ai-info-content"))}}():(0,B.reactRender)((0,ae.jsx)(le,{}),document.querySelector("#kubio-ai-info-content"))};const ce=window.kubio.blockPatterns,de=window.kubio.icons,ue=window.wp.components,pe=window.wp.coreData,be=window.wp.data,me=window.wp.apiFetch;var he=a.n(me);const ge=async(e={})=>{await he()({path:(0,w.addQueryArgs)("kubio/v1/3rd_party_themes/import_fresh_site",e)})},we=window.kubio.controls,fe=window.wp.primitives;var ke=(0,ae.jsx)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ae.jsx)(fe.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),_e=(0,ae.jsx)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ae.jsx)(fe.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});const ye=async()=>{await ge({start_with_frontpage:!0}),window.location=(0,Q.getBackendData)("kubioEditorURL")},xe=({onCancel:e})=>{const{nextStep:t}=(0,we.useWizard)();return(0,ae.jsx)("div",{className:"kubio-ai-welcome-step kubio-ai-starter-step",children:(0,ae.jsxs)("div",{className:"kubio-ai-welcome-step__content",children:[(0,ae.jsx)("div",{className:"kubio-ai-welcome-step__close-modal",children:(0,ae.jsx)(ue.Button,{icon:ke,onClick:e})}),(0,ae.jsxs)(ue.Flex,{children:[(0,ae.jsx)(ue.FlexBlock,{className:"kubio-ai-welcome-step__content-column",children:(0,ae.jsxs)("div",{className:"kubio-ai-welcome-step__content-column__content",children:[(0,ae.jsx)(ue.Icon,{icon:de.KubioAI,className:"kubio-ai-logo-colored kubio-ai-logo-animated"}),(0,ae.jsx)("h2",{children:(0,g.__)("Thanks for choosing Kubio!","kubio")}),(0,ae.jsx)("h1",{children:(0,g.__)("Would you like to generate a homepage using AI? It's fast and FREE!","kubio")}),(0,ae.jsx)("p",{children:(0,g.__)("Kubio uses an AI page generator to create a homepage that is adapted to your website. Here’s what you’ll get:","kubio")}),(0,ae.jsxs)("ul",{children:[(0,ae.jsxs)("li",{children:[(0,ae.jsx)(ue.Icon,{icon:_e}),(0,g.__)("A homepage customized for your website","kubio")]}),(0,ae.jsxs)("li",{children:[(0,ae.jsx)(ue.Icon,{icon:_e}),(0,g.__)("Texts and images based on your website subject","kubio")]}),(0,ae.jsxs)("li",{children:[(0,ae.jsx)(ue.Icon,{icon:_e}),(0,g.__)("Matching color scheme and typography","kubio")]}),(0,ae.jsxs)("li",{children:[(0,ae.jsx)(ue.Icon,{icon:_e}),(0,g.__)("Contact form and social media integration","kubio")]})]}),(0,ae.jsxs)(ue.Flex,{justify:"flex-start",gap:4,children:[(0,ae.jsx)(ue.Button,{variant:"primary",onClick:t,className:"kubio-ai-button",children:(0,g.__)("Generate homepage with AI","kubio")}),(0,ae.jsx)(ue.Button,{variant:"link",onClick:ye,children:(0,g.__)("No thanks, install the default homepage","kubio")})]})]})}),(0,ae.jsx)(ue.Flex,{className:"kubio-ai-welcome-step__bg-column",children:(0,ae.jsx)("img",{alt:"welcome",src:(0,Q.staticAssetURL)("ai-assets/welcome.png")})})]})]})})},ve=()=>{window.location=(0,Q.getBackendData)("admin_url")},je=()=>{const[e,t]=(0,Y.useState)(!1),{saveEditedEntityRecord:a}=(0,be.useDispatch)(pe.store),{dirtyEntityRecords:i}=(0,be.useSelect)((e=>{const t=e(pe.store).__experimentalGetDirtyEntityRecords().filter((e=>!("root"===e.kind&&"site"===e.name))),a=e(pe.store).getEntityRecordEdits("root","site"),i=[];for(const e in a)i.push({kind:"root",name:"site",property:e});return{dirtyEntityRecords:[...t,...i]}}),[]);(0,ce.useInitializeCloudPatterns)();const n=(0,Y.useCallback)((e=>[{label:(0,g.__)("Welcome","kubio"),name:"start",component:xe,skipNavigation:!0},...e.filter((e=>["general-info","contact-info","final-step"].includes(e.name)))]),[]),o=(0,Y.useCallback)((async e=>{const{siteContext:n}=e;t(!0),await ge(),await(0,q.saveAiGeneralSettings)(n);for(const e of i)await a(e.kind,e.name,e.key);window.location=(0,w.addQueryArgs)((0,Q.getBackendData)("kubioEditorURL"),{"generate-ai-frontpage":!0})}),[i,a]);return(0,ae.jsxs)(ae.Fragment,{children:[e&&(0,ae.jsx)("div",{className:"kubio-starter-loader",children:(0,ae.jsxs)("div",{className:"kubio-starter-loader_content-wrapper",children:[(0,ae.jsx)(ue.Icon,{icon:de.KubioLoader}),(0,ae.jsx)("p",{children:(0,g.__)("Finishing setup…","kubio")})]})}),!e&&(0,ae.jsx)(q.AIWizard,{isSetup:!1,isFrontPage:!0,stepsFilter:n,startStep:"start",modalTitle:(0,g.__)("Kubio Website starter","kubio"),finishLabel:(0,g.__)("Generate","kubio"),onCancel:ve,onFinish:o})]})},Ne=async(e={})=>{window.kubio.editor.registerEditSiteStore({}),(0,B.reactRender)((0,ae.jsx)(Y.StrictMode,{children:(0,ae.jsx)(je,{})}),document.querySelector("#kubio-website-starter"))},Ae=h("#adminmenu .toplevel_page_kubio");if(Ae.length){const qe=window.location.search,Be=new URLSearchParams(qe);if("kubio-get-started"===Be.get("page")){const We=Be.get("tab");null!==We&&(Ae.find("li.current").removeClass("current"),Ae.find("a[href*='tab="+We+"']").length?Ae.find("a[href*='tab="+We+"']").closest("li").addClass("current"):Ae.find("li.wp-first-item").next().addClass("current"))}Ae.find("a[href*='tab=pro-upgrade']").length&&Ae.find("a[href*='tab=pro-upgrade']").closest("li").addClass("li-pro-upgrade")}setTimeout((()=>{const e=h(".kubio-admin-row.get-started-imported");e.addClass("inline"),h(".get-started-with-kubio").eq(0).prepend(e)}),100);const Ce=window.wp.domReady;var Oe=a.n(Ce);let Ie=Promise.resolve();const Se=e=>{const t=e.getAttribute("data-suggested-plugin-slug");if(!t)return;const a=e.getAttribute("data-plugin-redirect"),i=e.getAttribute("data-plugin-label"),n=e.textContent;function l(t){switch(t){case"queued":e.setAttribute("disabled",!0),e.setAttribute("inert",!0),e.textContent=(0,g.__)("Waiting…","kubio");break;case"installing":e.setAttribute("disabled",!0),e.setAttribute("inert",!0),e.textContent=(0,g.__)("Installing…","kubio");break;case"activating":e.setAttribute("disabled",!0),e.setAttribute("inert",!0),e.textContent=(0,g.__)("Activating…","kubio");break;case"done":a?(e.removeAttribute("disabled"),e.removeAttribute("inert"),e.href=a,e.textContent=i?(0,g.sprintf)(// translators: %s: plugin label.
// translators: %s: plugin label.
(0,g.__)("Go to %s page","kubio"),i):(0,g.__)("Go to plugin page","kubio")):(e.setAttribute("disabled",!0),e.setAttribute("inert",!0),e.textContent=(0,g.__)("Plugin installed","kubio"));break;case"reset":e.removeAttribute("disabled"),e.removeAttribute("inert"),e.textContent=n}}e.addEventListener("click",(a=>{e.dataset.kubioPluginReady||(a.preventDefault(),function(e){const t=Ie.then(e,e);Ie=t.catch((()=>{}))}((async()=>{const a=m(t);l("queued");try{switch(a){case o:return l("done"),e.dataset.kubioPluginReady="1",!0;case s:l("activating"),await _(t);break;case r:l("installing"),await k(t),l("activating"),await _(t)}l("done"),e.dataset.kubioPluginReady="1"}catch(e){l("reset"),window.alert((0,g.__)("An error occurred while installing or activating the plugin.","kubio")),console.error(e)}})))}))},Ee=e=>{e.querySelectorAll(".kubio-remote-notification-buttons [data-suggested-plugin-slug]").forEach(Se)},Pe=e=>{D(e),Oe()((()=>{document.querySelectorAll(".kubio-remote-notification-wrapper[data-has-suggested-plugins]").forEach(Ee)}))}})(),(window.kubio=window.kubio||{}).adminArea=i})();

Hry