1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2071,6999],{4149:function(e,t,n){n.d(t,{Z:function(){return h}});var a=n(20550),i=n(2081),l=n(51403),r=n(16660),s=n(34166),o=n(19226),d=n(65718),c=n(43857),m=n(18895),u=function(e,t){var n;return function(){for(var a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];var r=this;n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(r,i)},t)}},x=n(94511),p=n(95855),f=n(9669),v=n.n(f),_=n(88026);function h(e){var t=(0,c.Z)(),n=t.t;t.lang;var f,h=(0,r.useState)(""),g=h[0],N=h[1],y=(0,r.useState)(""),j=y[0],I=y[1],b=(0,r.useState)(""),w=b[0],E=b[1],A=(0,r.useState)(!1),P=A[0],R=A[1],L=(0,r.useRef)(null);(0,s.Z)(L,e.setEmailPopup);var C,O,F=(f=(0,a.Z)(function(e){return(0,i.__generator)(this,function(t){return I(""),(0,o.o)(e)?N(e):(N(""),I(n("common:LOGIN_MODAL_ERROR_INVALID_EMAIL"))),[2]})}),function(e){return f.apply(this,arguments)}),S=(0,r.useCallback)(u(F,1e3),[]),T=(C=(0,a.Z)(function(){var t,n,a,l,r;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return R(!0),a=(navigator.language||navigator.userLanguage).toLowerCase(),l=Math.random().toString(36).slice(2),[4,(0,m.oO)(g,l,a)];case 1:return(r=i.sent()).error&&(I(r.error),R(!1)),E(null==r?void 0:null===(t=r.data)||void 0===t?void 0:t.subscription_status),(null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.subscription_status)!=="active"&&e.onSubmit(g),R(!1),[2]}})}),function(){return C.apply(this,arguments)}),G=(O=(0,a.Z)(function(){var t,a;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return t="https://magicstudio.com"+v().pathname,[4,(0,m.wd)(g,t)];case 1:if((a=i.sent()).error)return I(n("common:LOGIN_MODAL_ERROR_API")),[2];return v().push({pathname:"/login",query:{requestId:a.data.login_request_id,origin_url:t,email:g,from:e.app}}),[2]}})}),function(){return O.apply(this,arguments)});return(0,l.jsx)("div",{className:"".concat(e.emailOpen?"block":"hidden"," transition-opacity ease-linear overflow-y-auto overflow-x-hidden w-full h-full inset-0 fixed z-40 bg-neutral-900 bg-opacity-90"),children:(0,l.jsx)("div",{className:"h-full md:h-modal transition-transform relative z-50 w-auto max-w-lg md:my-8 mx-auto flex items-center",children:(0,l.jsxs)("div",{ref:L,className:"relative max-h-full bg-white overflow-hidden bg-clip-padding shadow-lg rounded-lg w-full flex flex-col justify-start items-center",children:[(0,l.jsx)("div",{className:(0,_.Z)("bg-gradient-to-r from-".concat(e.app,"-gradient-start via-").concat(e.app,"-gradient-middle to-").concat(e.app,"-gradient-end h-2 w-full"))}),(0,l.jsxs)("div",{className:"py-8 overflow-y-auto px-12 md:px-16 flex flex-col items-center w-full relative",children:[(0,l.jsx)("div",{className:"absolute top-4 right-4 md:top-8 md:right-8 p-2 cursor-pointer hover:bg-neutral-100 rounded-lg",onClick:function(){return e.setEmailPopup(!1)},children:(0,l.jsx)(x.F,{className:"text-primary text-2xl"})}),"active"===w?(0,l.jsxs)("div",{className:"max-w-md w-full flex flex-col items-left mt-4 md:mt-8",children:[(0,l.jsx)("div",{className:"mb-4 relative text-center",children:(0,l.jsx)("img",{src:"https://".concat("meta.magicstudio.com/assets","/pro-crown-sparkles.svg"),className:"w-14 inline-block",alt:"Upgrade"})}),(0,l.jsx)(p.aC,{text:n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_TITLE")}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(p.Cd,{text:"".concat(n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_SUBTITLE_PREFIX")).concat(g).concat(n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_SUBTITLE_SUFFIX"))})}),(0,l.jsx)(d.PrimaryButtonFullWidth,{text:n("common:LOGIN_CTA_BUTTON"),onClick:G,classes:"mt-6"}),(0,l.jsx)(d.SecondaryButtonFullWidth,{text:n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_CHANGE_EMAIL_CTA"),classes:"mt-4",onClick:function(){E(""),N("")}}),(0,l.jsxs)("p",{className:"text-sm antialiased font-medium text-primary mt-6 mb-4 text-center cursor-pointer",onClick:function(){return window.location="mailto:[email protected]"},children:[n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_NEED_HELP")," ",(0,l.jsx)("span",{className:(0,_.Z)("bg-clip-text box-decoration-clone text-transparent bg-gradient-to-r from-".concat(e.app,"-gradient-start via-").concat(e.app,"-gradient-middle to-").concat(e.app,"-gradient-end text-sm font-bold antialiased cursor-pointer whitespace-nowrap")),children:n("common:EMAIL_BEFORE_PAYMENT_MODAL_ALREADY_SUBSCRIBED_CONTACT_CTA")})]})]}):(0,l.jsxs)("div",{className:"w-full flex flex-col items-center mt-4 md:mt-8 relative",children:[(0,l.jsxs)("div",{className:"mb-4 relative -rotate-12",children:[(0,l.jsx)("i",{className:"isax isax-sms text-3xl text-primary"}),(0,l.jsx)("i",{className:(0,_.Z)("icon-sparkles absolute -top-3 -left-5 text-".concat(e.app,"-gradient-end rotate-45 text-sm"))}),(0,l.jsx)("i",{className:(0,_.Z)("icon-sparkles absolute -bottom-1 -right-4 text-".concat(e.app,"-gradient-end rotate-90 text-sm"))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(p.aC,{text:n("common:EMAIL_BEFORE_PAYMENT_MODAL_EMAIL_FORM_TITLE")}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(p.Cd,{text:n("common:EMAIL_BEFORE_PAYMENT_MODAL_EMAIL_FORM_
1SUBTITLE")})}),(0,l.jsx)("input",{id:"email-input",className:"".concat(j?"border-red-400":"border-primary-light"," mb-4 mt-6 border w-full px-6 rounded-lg antialiased text-primary font-normal focus:outline-none py-3 placeholder:font-light"),type:"email",placeholder:n("common:EMAIL_BEFORE_PAYMENT_MODAL_EMAIL_FORM_PLACEHOLDER"),onChange:function(e){return S(e.target.value)},required:!0}),(0,l.jsx)(d.PrimaryButtonFullWidth,{text:n("common:EMAIL_BEFORE_PAYMENT_MODAL_EMAIL_FORM_CTA"),onClick:T,disabled:0===g.length||0!==j.length||P}),(0,l.jsxs)("p",{className:"text-sm antialiased font-medium text-primary mt-6 mb-4 text-center cursor-pointer",onClick:function(){return v().push({pathname:"/login",query:{origin_url:"https://magicstudio.com"+v().pathname,from:e.app}})},children:["active"===w?"You are already on the PRO plan.":n("common:UPGRADE_NUDGE_LOGIN_QUESTION")," ",(0,l.jsx)("span",{className:"bg-clip-text box-decoration-clone text-transparent bg-gradient-to-r from-".concat(e.app||"magicstudio","-gradient-start to-").concat(e.app||"magicstudio","-gradient-end via-").concat(e.app,"-gradient-middle text-sm font-bold antialiased cursor-pointer whitespace-nowrap"),children:n("common:LOGIN_MODAL_BUTTON_CTA")})]}),j&&(0,l.jsx)("p",{className:"text-rose-400 absolute -bottom-5 text-xs antialiased font-medium text-center w-full",children:j})]})]})]})]})})})}},12592:function(e,t,n){n.d(t,{Z:function(){return O}});var a=n(51403),i=n(16660),l=n(94511),r=n(68802),s=n(65718),o=n(95855),d=n(88026),c=n(43857),m=n(9669),u=n.n(m),x=n(80394),p=n(34166),f=n(20550),v=n(2081),_=n(55194),h=n.n(_),g=n(25260),N=n(18895),y=n(35838),j=n(4149),I=n(99122),b=n(6702),w=n(29094),E=function(e,t,n){return null==e?void 0:e.find(function(e){return e[t]===n})};function A(e){var t,n,l,o,m,u,p,_,h,g,y,I,A,P,R,L,C,O,F,S,T=(0,c.Z)(),G=T.t;T.lang;var M,D=(0,i.useState)("12"),U=D[0],k=D[1],B=(0,i.useState)({}),Y=B[0],Z=B[1],X=(0,i.useState)(!1),H=X[0],z=X[1],V=(0,i.useState)(!1),q=V[0],W=V[1],K=(0,i.useState)(null),Q=K[0],$=K[1],J=(0,r.a)().user;(0,i.useEffect)(function(){var t;Z(E(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.plans,"time_period",U))},[U]);var ee,et=(M=(0,f.Z)(function(e,t){var n;return(0,v.__generator)(this,function(a){return(n=localStorage.getItem("email"),J||n)?(en(e,n,t),[2]):(W(!0),$(function(){return function(n){return en(e,n,t)}}),[2])})}),function(e,t){return M.apply(this,arguments)}),en=(ee=(0,f.Z)(function(t,n,a){var i,l;return(0,v.__generator)(this,function(r){switch(r.label){case 0:return console.log(a),console.log(null==e?void 0:e.app),z(!0),[4,(0,N.OS)(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.payment_type,null==t?void 0:t.price_id,null==e?void 0:e.app,n,a)];case 1:if((l=r.sent()).error)return console.log(l.error),z(!1),[2];return(0,x.c)("checkout_started",{currency:null==t?void 0:t.currency_code,amount:null==t?void 0:t.price_value,plan_id:null==t?void 0:t.id,plan_name:null==t?void 0:t.plan_name,subscription_duration:null==t?void 0:t.time_period,source_view:"upgrade-nudge-on-download",payment_frequency:null==t?void 0:t.plan_type,price_id:null==t?void 0:t.price_id,source_tool:null==e?void 0:e.app},[w.C.MS_ANALYTICS]),window.location.href=l.data.checkout_session_url,[2]}})}),function(e,t,n){return ee.apply(this,arguments)});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"hidden md:grid grid-cols-3 gap-4 px-2",children:null==e?void 0:null===(t=e.data)||void 0===t?void 0:null===(n=t.plans)||void 0===n?void 0:n.map(function(t,n){return(0,a.jsxs)("div",{className:(0,d.Z)("".concat(0===n?"border-".concat(e.app?e.app:"magicstudio","-gradient-end"):"border-slate-200"," relative w-full rounded-xl border p-4 flex flex-col bg-white antialiased group ").concat(H?"cursor-not-allowed":"cursor-pointer")),onClick:function(){return et(t,"upgrade-nudge-on-download")},children:[0===n&&(0,a.jsxs)("div",{className:"text-[0.5rem] font-semibold text-white antialiased bg-gradient-end-color px-1.5 py-1 absolute max-w-fit rounded top-0 -translate-y-1/2 left-1/2 -translate-x-1/2 flex items-center justify-center",children:[(0,a.jsx)("i",{className:"isax isax-flash-15 text-[#FFC940] text-[0.625rem] mr-0.5"}),G("common:PRICING_POPULAR_BADGE")]}),(0,a.jsxs)("div",{className:"flex flex-row justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center justify-between",children:[(0,a.jsx)("p",{className:"text-lg antialiased font-bold text-primary",children:t.time_period}),(0,a.jsx)("p",{className:"text-[0.625rem] antialiased text-primary uppercase font-semibold tracking-wider",children:"1"===t.time_period?G("common:PRICING_PACK_MONTH_SUFFIX"):G("common:PRICING_PACK_MONTHS_SUFFIX")})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsxs)("p",{className:"text-lg text-primary font-bold antialiased",children:[null==t?void 0:t.currency," ",null==t?void 0:t.price_value]}),t.monthly_price_value&&(0,a.jsxs)("p",{className:"text-xs text-primary font-normal antialiased",children:[null==t?void 0:t.currency," ",null==t?void 0:t.monthly_price_value," ",G("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")]})]})]}),(0,a.jsxs)("div",{className:"flex flex-row justify-between items-center mt-3",children:[(0,a.jsxs)("p",{className:"".concat(t.discount?"visible":"invisible"," text-[0.625rem] font-medium antialiased text-primary rounded-full bg-caper bg-opacity-80 py-0.5 px-1.5 max-w-fit"),children:[G("common:PRICING_PLAN_SAVE_PREFIX"),t.discount,"%",G("common:PRICING_PLAN_SAVE_SUFFIX")]}),(0,a.jsx)("i",{className:(0,d.Z)("".concat(e.recommended?"text-".concat(e.app?e.app:"magicstudio","-gradient-end"):"text-primary"," text-end isax isax-arrow-right-1 text-xl translate-x-0 group-hover:translate-x-2 transition-transform duration-300"))})]})]},null==t?void 0:t.display_id)})}),(0,a.jsxs)("div",{className:"w-full md:hidden",children:[(0,a.jsxs)("div",{className:"flex flex-row justify-center items-center w-full",children:[(0,a.jsxs)("button",{className:"".concat((null===(o=null==e?void 0:null===(l=e.data)||void 0===l?void 0:l.plans[0])||void 0===o?void 0:o.time_period)===U?"text-white bg-primary":"text-primary"," font-medium antialiased rounded-l-full py-1 px-3 md:py-1.5 md:px-4 text-xs flex items-center justify-center gap-1 border border-primary-light/50 cursor-pointer\n "),onClick:function(){var t,n;return k(null===(n=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.plans[0])||void 0===n?void 0:n.time_period)},children:[(0,a.jsx)("span",{children:null===(u=null==e?void 0:null===(m=e.data)||void 0===m?void 0:m.plans[0])||void 0===u?void 0:u.time_period}),(0,a.jsx)("span",{children:G("common:PRICING_PACK_MONTHS_SUFFIX")}),(null===(_=null==e?void 0:null===(p=e.data)||void 0===p?void 0:p.plans[0])||void 0===_?void 0:_.time_period)===U&&(0,a.jsx)("span",{children:(0,a.jsx)(b.e,{})})]}),(0,a.jsxs)("button",{className:"".concat((null===(g=null==e?void 0:null===(h=e.data)||void 0===h?void 0:h.plans[1])||void 0===g?void 0:g.time_period)===U?"text-white bg-primary":"text-primary"," font-medium antialiased py-1 px-3 md:py-1.5 md:px-4 text-xs flex items-center justify-center gap-1 border-y border-primary-light/50 cursor-pointer\n "),onClick:function(){var t,n;return k(null===(n=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.plans[1])||void 0===n?void 0:n.time_period)},children:[(0,a.jsx)("span",{children:null===(I=null==e?void 0:null===(y=e.data)||void 0===y?void 0:y.plans[1])||void 0===I?void 0:I.time_period}),(0,a.jsx)("span",{children:G("common:PRICING_PACK_MONTHS_SUFFIX")}),(null===(P=null==e?void 0:null===(A=e.data)||void 0===A?void 0:A.plans[1])||void 0===P?void 0:P.time_period)===U&&(0,a.jsx)("span",{children:(0,a.jsx)(b.e,{})})]}),(0,a.jsxs)("button",{className:"".concat((null===(L=null==e?void 0:null===(R=e.data)||void 0===R?void 0:R.plans[2])||void 0===L?void 0:L.time_period)===U?"text-white bg-primary":"text-primary"," font-medium antialiased rounded-r-full py-1 px-3 md:py-1.5 md:px-4 text-xs flex items-center justify-center gap-1 border border-primary-light/50 cursor-pointer\n "),onClick:function(){var t,n;return k(null===(n=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.plans[2])||void 0===n?void 0:n.time_period)},children:[(0,a.jsx)("span",{children:null===(O=null==e?void 0:null===(C=e.data)||void 0===C?void 0:C.plans[2])||void 0===O?void 0:O.time_period}),(0,a.jsx)("span",{children:G("common:PRICING_PACK_MONTHS_SUFFIX")}),(null===(S=null==e?void 0:null===(F=e.data)||void 0===F?void 0:F.plans[2])||void 0===S?void 0:S.time_period)===U&&(0,a.jsx)("span",{children:(0,a.jsx)(b.e,{})})]})]}),(0,a.jsxs)("div",{className:(0,d.Z)("".concat("12"===U?"border-".concat(e.app?e.app:"magicstudio","-gradient-end"):"border-slate-200"," relative border bg-white rounded-xl px-4 py-4 mt-4 max-w-xs w-full mx-auto")),children:["12"===U&&(0,a.jsxs)("div",{className:"text-[0.5rem] font-semibold text-white antialiased bg-gradient-end-color px-1.5 py-1 absolute max-w-fit roun
1ded top-0 -translate-y-1/2 left-1/2 -translate-x-1/2 flex items-center justify-center",children:[(0,a.jsx)("i",{className:"isax isax-flash-15 text-[#FFC940] text-[0.625rem] mr-0.5"}),G("common:PRICING_POPULAR_BADGE")]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("p",{className:"text-xl font-semibold antialiased",children:[null==Y?void 0:Y.currency," ",null==Y?void 0:Y.price_value]}),(null==Y?void 0:Y.monthly_price_value)&&(0,a.jsxs)("p",{className:"text-sm -tracking-[0.006em] text-primary font-nomal antialiased",children:[null==Y?void 0:Y.currency," ",null==Y?void 0:Y.monthly_price_value," ",(0,a.jsx)("span",{className:"text-xs",children:G("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")})]}),(0,a.jsxs)("p",{className:"".concat((null==Y?void 0:Y.discount)?"visible":"invisible"," text-[0.625rem] tracking-[0.01em] md:tracking-normal md:text-xs font-medium antialiased text-primary rounded-full bg-caper bg-opacity-80 p-1 px-2 md:py-1.5 md:px-3 max-w-fit"),children:[G("common:PRICING_PLAN_SAVE_PREFIX"),null==Y?void 0:Y.discount,"%",G("common:PRICING_PLAN_SAVE_SUFFIX")]})]}),(0,a.jsx)(s.StudioPrimaryButtonSmall,{text:G("common:MENU_UPGRADE"),onClick:function(){return et(Y,"upgrade-nudge-on-download")},disabled:H,classes:"mt-4 w-full"}),(0,a.jsx)("p",{className:"text-xs md:text-sm antialiased text-primary mt-4 text-center",children:G("common:ONE_TIME_PAYMENT_TEXT")})]})]}),(0,a.jsx)("div",{className:"mt-4 flex justify-center",children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),G("common:PRICING_PRO_FEATURE1")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),G("common:PRICING_PRO_FEATURE2")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),G("common:PRICING_PRO_FEATURE3")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),G("common:PRICING_PRO_FEATURE6")]})]})}),q&&Q&&(0,a.jsx)(j.Z,{onSubmit:function(e){Q(e)},setEmailPopup:W,emailOpen:q,app:null==e?void 0:e.app})]})}function P(e){var t,n,i,l,r=(0,c.Z)().t;return(0,a.jsxs)("div",{className:"border-primary-light/50 max-w-xs w-full rounded-xl border py-4 px-4 bg-white antialiased group flex flex-col justify-between ".concat(e.isLoading?"cursor-not-allowed":"cursor-pointer"),onClick:e.isLoading?null:e.openCheckout,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,a.jsx)("p",{className:"text-sm -tracking-[0.006em] font-[550] capitalize",children:r("common:PRICING_PERIOD_MONTHLY")}),(null==e?void 0:null===(t=e.plan)||void 0===t?void 0:t.discount)&&(0,a.jsxs)("p",{className:"text-[0.625rem] font-medium antialiased text-primary rounded-full bg-caper bg-opacity-80 py-0.5 px-1.5 max-w-fit",children:[r("common:PRICING_PLAN_SAVE_PREFIX"),null==e?void 0:null===(n=e.plan)||void 0===n?void 0:n.discount,"%",r("common:PRICING_PLAN_SAVE_SUFFIX")]})]}),(0,a.jsx)("div",{className:"md:flex flex-row items-center justify-between mt-2 hidden",children:(0,a.jsxs)("div",{className:"flex flex-row items-baseline",children:[(0,a.jsxs)("p",{className:"text-lg -tracking-[0.014em] text-primary font-bold antialiased",children:[null==e?void 0:e.plan.currency," ",null==e?void 0:e.plan.price_value]}),(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased ml-1",children:r("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")})]})})]}),(0,a.jsxs)("div",{className:"md:flex flex-row items-end justify-between mt-2 hidden",children:[(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased invisible",children:r("common:PRICING_PLAN_YEARLY_BILLING_PREFIX")+(null==e?void 0:null===(i=e.plan)||void 0===i?void 0:i.currency)+" "+(null==e?void 0:null===(l=e.plan)||void 0===l?void 0:l.annual_price_value)+" "+r("common:PRICING_PLAN_YEARLY_BILLING_SUFFIX")}),(0,a.jsx)("i",{className:(0,d.Z)(" text-primary text-end isax isax-arrow-right-1 text-lg translate-x-0 group-hover:translate-x-2 transition-transform duration-300")})]}),(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between mt-2 md:hidden",children:[(0,a.jsxs)("div",{className:"flex flex-row items-baseline",children:[(0,a.jsxs)("p",{className:"text-lg -tracking-[0.014em] text-primary font-bold antialiased",children:[null==e?void 0:e.plan.currency," ",null==e?void 0:e.plan.price_value]}),(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased ml-1",children:r("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")})]}),(0,a.jsx)("i",{className:(0,d.Z)(" text-primary text-end isax isax-arrow-right-1 text-lg translate-x-0 group-hover:translate-x-2 transition-transform duration-300")})]})]})}function R(e){var t,n,i,l,r,s,o=(0,c.Z)().t;return(0,a.jsxs)("div",{className:(0,d.Z)("border-".concat(e.app?e.app:"magicstudio","-gradient-end max-w-xs w-full rounded-xl border py-4 px-4 bg-white antialiased group relative flex flex-col justify-between ").concat(e.isLoading?"curs
1or-not-allowed":"cursor-pointer")),onClick:e.isLoading?null:e.openCheckout,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-[0.5rem] font-semibold text-white antialiased bg-gradient-end-color px-1.5 py-1 absolute max-w-fit rounded top-0 -translate-y-1/2 left-1/2 -translate-x-1/2 flex items-center justify-center",children:[(0,a.jsx)("i",{className:"isax isax-flash-15 text-[#FFC940] text-[0.625rem] mr-0.5"}),o("common:PRICING_POPULAR_BADGE")]}),(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,a.jsx)("p",{className:"text-sm -tracking-[0.006em] font-[550] capitalize",children:o("common:PRICING_PERIOD_YEARLY")}),(null==e?void 0:null===(t=e.plan)||void 0===t?void 0:t.discount)&&(0,a.jsxs)("p",{className:"text-[0.625rem] font-medium antialiased text-primary rounded-full bg-caper bg-opacity-80 py-0.5 px-1.5 max-w-fit",children:[o("common:PRICING_PLAN_SAVE_PREFIX"),null==e?void 0:null===(n=e.plan)||void 0===n?void 0:n.discount,"%",o("common:PRICING_PLAN_SAVE_SUFFIX")]})]}),(0,a.jsx)("div",{className:"flex flex-row items-center justify-between mt-2",children:(0,a.jsxs)("div",{className:"flex flex-row items-baseline",children:[(0,a.jsxs)("p",{className:"text-lg -tracking-[0.014em] text-primary font-bold antialiased",children:[null==e?void 0:null===(i=e.plan)||void 0===i?void 0:i.currency," ",null==e?void 0:null===(l=e.plan)||void 0===l?void 0:l.price_value]}),(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased ml-1",children:o("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")})]})})]}),(0,a.jsxs)("div",{className:"flex flex-row items-end justify-between mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased",children:o("common:PRICING_PLAN_YEARLY_BILLING_PREFIX")+(null==e?void 0:null===(r=e.plan)||void 0===r?void 0:r.currency)+" "+(null==e?void 0:null===(s=e.plan)||void 0===s?void 0:s.annual_price_value)+" "+o("common:PRICING_PLAN_YEARLY_BILLING_SUFFIX")}),(0,a.jsx)("i",{className:(0,d.Z)(" text-".concat(e.app?e.app:"magicstudio","-gradient-end text-end isax isax-arrow-right-1 text-lg translate-x-0 group-hover:translate-x-2 transition-transform duration-300"))})]})]})}function L(e){var t,n,i,l,r,s,o=(0,c.Z)().t;return(0,a.jsxs)("div",{className:"border-primary-light/50 max-w-xs w-full rounded-xl border py-4 px-4 bg-white antialiased group flex flex-col justify-between ".concat(e.isLoading?"cursor-not-allowed":"cursor-pointer"),onClick:e.isLoading?null:e.openCheckout,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,a.jsx)("p",{className:"text-sm -tracking-[0.006em] font-[550] capitalize",children:o("common:PRICING_PERIOD_6_MONTHLY")}),(null==e?void 0:null===(t=e.plan)||void 0===t?void 0:t.discount)&&(0,a.jsxs)("p",{className:"text-[0.625rem] font-medium antialiased text-primary rounded-full bg-caper bg-opacity-80 py-0.5 px-1.5 max-w-fit",children:[o("common:PRICING_PLAN_SAVE_PREFIX"),null==e?void 0:null===(n=e.plan)||void 0===n?void 0:n.discount,"%",o("common:PRICING_PLAN_SAVE_SUFFIX")]})]}),(0,a.jsx)("div",{className:"flex flex-row items-center justify-between mt-2",children:(0,a.jsxs)("div",{className:"flex flex-row items-baseline",children:[(0,a.jsxs)("p",{className:"text-lg -tracking-[0.014em] text-primary font-bold antialiased",children:[null==e?void 0:null===(i=e.plan)||void 0===i?void 0:i.currency," ",null==e?void 0:null===(l=e.plan)||void 0===l?void 0:l.price_value]}),(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased ml-1",children:o("common:PRICING_PLAN_MONTHLY_PRICE_SUFFIX")})]})})]}),(0,a.jsxs)("div",{className:"flex flex-row items-end justify-between mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-primary font-normal antialiased",children:o("common:PRICING_PLAN_6_MONTHLY_BILLING_PREFIX")+(null==e?void 0:null===(r=e.plan)||void 0===r?void 0:r.currency)+" "+(null==e?void 0:null===(s=e.plan)||void 0===s?void 0:s.annual_price_value)+" "+o("common:PRICING_PLAN_6_MONTHLY_BILLING_SUFFIX")}),(0,a.jsx)("i",{className:(0,d.Z)(" text-primary text-end isax isax-arrow-right-1 text-lg translate-x-0 group-hover:translate-x-2 transition-transform duration-300")})]})]})}
1function C(e){var t,n,l,s,m,u=(0,c.Z)(),p=u.t,_=u.lang,C=(0,r.a)().user,O=(0,i.useState)([]),F=(O[0],O[1]),S=(0,i.useState)(!1),T=S[0],G=S[1],M=(0,i.useState)(null),D=M[0],U=M[1],k=(0,i.useState)(!1),B=k[0],Y=k[1],Z=(0,i.useState)("yearly"),X=Z[0],H=Z[1],z=(0,i.useState)(null),V=z[0],q=z[1];(0,i.useEffect)(function(){q(E(null==ei?void 0:ei.plans,"plan_type",X))},[X]);var W,K=(m=(0,f.Z)(function(e,t,n,a,i){var l;return(0,v.__generator)(this,function(r){return(l=localStorage.getItem("email"),C||l)?(Q(e,t,n,l,a,i),[2]):(G(!0),U(function(){return function(l){return Q(e,t,n,l,a,i)}}),[2])})}),function(e,t,n,a,i){return m.apply(this,arguments)}),Q=(W=(0,f.Z)(function(e,t,n,a,i,l){var r;return(0,v.__generator)(this,function(s){switch(s.label){case 0:return console.log(i),console.log(n),Y(!0),[4,(0,N.OS)(e,t,n,a,i)];case 1:if((r=s.sent()).error)return console.log(r.error),Y(!1),[2];return(0,x.c)("checkout_started",{currency:null==l?void 0:l.currency_code,amount:null==l?void 0:l.price_value,plan_id:null==l?void 0:l.id,plan_name:null==l?void 0:l.plan_name,subscription_duration:null==l?void 0:l.time_period,source_view:i,payment_frequency:null==l?void 0:l.plan_type,price_id:null==l?void 0:l.price_id,source_tool:n},[w.C.MS_ANALYTICS]),window.location.href=r.data.checkout_session_url,[2]}})}),function(e,t,n,a,i,l){return W.apply(this,arguments)}),$={locale:_||(navigator.language||navigator.userLanguage).toLowerCase()},J=(0,I.M)();J&&($.cohort=J);var ee,et="".concat("https://api.magicstudio.com/studio","/magicstudio/plans/"),en=(ee=(0,f.Z)(function(e){return(0,v.__generator)(this,function(t){switch(t.label){case 0:return[4,h().get(e,{params:$,headers:{"X-API-Version":"7.0"}}).then(function(e){return e.data})];case 1:return[2,t.sent()]}})}),function(e){return ee.apply(this,arguments)}),ea=(0,g.ZP)(et,en),ei=ea.data;return ea.error,(null==ei?void 0:ei.is_test_applicable)&&localStorage.setItem("isPriceTestEnabled",!0),(0,i.useEffect)(function(){for(var e=[],t=1;t<18;t++)e.push("https://".concat("meta.magicstudio.com/assets","/payment-methods/").concat(t,".svg"));F(e)},[]),(0,a.jsxs)("div",{className:"bg-cover bg-no-repeat bg-[url(/assets/bg-api-mobile-3x.png)] md:bg-[url(/assets/bg-api-3x.png)] rounded-[1.75rem] max-w-2xl w-full py-4",children:[(0,a.jsx)(o.H5,{text:p("common:UPGRADE_PRICING_PLANS_SUBTEXT_TEST2"),classes:"font-[550] text-center"}),(0,a.jsxs)("div",{className:"mt-6",children:[(null==ei?void 0:ei.payment_type)==="one-time"&&(0,a.jsx)(A,{data:ei,app:null==e?void 0:e.app}),(null==ei?void 0:ei.payment_type)==="subscription"&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"md:hidden",children:[(0,a.jsxs)("div",{className:"grid grid-cols-3 md:hidden mb-4 w-fit mx-auto",children:[(0,a.jsx)("div",{className:"".concat("yearly"===X?"text-white bg-primary":"text-primary"," font-medium antialiased rounded-l-full py-1 md:py-1.5 px-5 text-xs flex items-center justify-center border border-slate-200 cursor-pointer"),onClick:function(){return H("yearly")},children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[p("common:PRICING_PERIOD_YEARLY"),(0,a.jsx)(b.e,{className:"text-sm absolute -right-4 ".concat("yearly"===X?"block":"hidden")})]})}),(0,a.jsx)("div",{className:"".concat("6-monthly"===X?"text-white bg-primary":"text-primary"," font-medium antialiased py-1 md:py-1.5 px-5 text-xs flex items-center justify-center border-y border-slate-200 cursor-pointer"),onClick:function(){return H("6-monthly")},children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[p("common:PRICING_PERIOD_6_MONTHLY"),(0,a.jsx)(b.e,{className:"text-sm absolute -right-4 ".concat("6-monthly"===X?"block":"hidden")})]})}),(0,a.jsx)("div",{className:"".concat("monthly"===X?"text-white bg-primary":"text-primary"," font-medium antialiased rounded-r-full py-1 md:py-1.5 px-5 text-xs flex items-center justify-center border border-slate-200 cursor-pointer"),onClick:function(){return H("monthly")},children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[p("common:PRICING_PERIOD_MONTHLY"),(0,a.jsx)(b.e,{className:"text-sm absolute -right-4 ".concat("monthly"===X?"block":"hidden")})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center w-full",children:["yearly"===X&&(0,a.jsx)(R,{app:e.app,plan:V,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==V?void 0:V.price_id,e.app,null==e?void 0:e.source,V)}}),"6-monthly"===X&&(0,a.jsx)(L,{app:e.app,plan:V,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==V?void 0:V.price_id,null==e?void 0:e.app,null==e?void 0:e.source,V)}}),"monthly"===X&&(0,a.jsx)(P,{app:e.app,plan:V,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==V?void 0:V.price_id,e.app,null==e?void 0:e.source,V)}})]})]}),(0,a.jsxs)("div",{className:"hidden md:grid grid-cols-1 md:grid-cols-3 gap-4 px-2 mt-6 md:mt-0",children:[(null==ei?void 0:ei.payment_type)==="subscription"&&(null==ei?void 0:null===(t=ei.plans)||void 0===t?void 0:t.filter(function(e){return"yearly"===e.plan_type}).map(function(t){return(0,a.jsx)(R,{app:e.app,plan:t,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==t?void 0:t.price_id,e.app,null==e?void 0:e.source,t)}},t.display_id)})),(null==ei?void 0:ei.payment_type)==="subscription"&&(null==ei?void 0:null===(n=ei.plans)||void 0===n?void 0:n.filter(function(e){return"6-monthly"===e.plan_type}).map(function(t){return(0,a.jsx)(L,{app:e.app,plan:t,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==t?void 0:t.price_id,null==e?void 0:e.app,null==e?void 0:e.source,t)}},t.display_id)})),(null==ei?void 0:ei.payment_type)==="subscription"&&(null==ei?void 0:null===(l=ei.plans)||void 0===l?void 0:l.filter(function(e){return"monthly"===e.plan_type}).map(function(t){return(0,a.jsx)(P,{app:e.app,plan:t,isLoading:B,openCheckout:function(){K(null==ei?void 0:ei.payment_type,null==t?void 0:t.price_id,e.app,null==e?void 0:e.source,t)}},t.display_id)}))]}),(0,a.jsx)("div",{className:"mt-4 flex justify-center",children:(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),p("common:PRICING_PRO_FEATURE1")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),p("common:PRICING_PRO_FEATURE2")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),p("common:PRICING_PRO_FEATURE3")]}),(0,a.jsxs)("div",{className:"text-primary antialiased text-xs font-normal flex flex-row items-center gap-1.5",children:[(0,a.jsx)(b.e,{className:"text-magiceraser-gradient-end text-sm shrink-0"}),p("common:PRICING_PRO_FEATURE6")]})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center",children:[(0,a.jsx)(y.D,{className:"text-[#FFB800] text-xs"}),(0,a.jsx)(y.D,{className:"text-[#FFB800] text-xs"}),(0,a.jsx)(y.D,{className:"text-[#FFB800] text-xs"}),(0,a.jsx)(y.D,{className:"text-[#FFB800] text-xs"}),(0,a.jsx)(y.D,{className:"text-[#FFB800] text-xs"})]}),(0,a.jsx)("p",{className:(0,d.Z)("text-center md:text-start mt-2 text-xs bg-clip-text box-decoration-clone text-transparent bg-gradient-to-r from-".concat(e.app,"-gradient-start to-").concat(e.app,"-gradient-end font-bold")),children:p("common:PRICING_SOCIAL_PROOF")})]})]}),T&&D&&(0,a.jsx)(j.Z,{onSubmit:function(e){D(e)},setEmailPopup:G,emailOpen:T,app:e.app})]})}var O=function(e){var t=(0,c.Z)(),n=t.t;t.lang,(0,i.useEffect)(function(){(0,x.c)("upgrade_modal_viewed",{source_action:"download",source_tool:e.app},[w.C.MS_ANALYTICS])},[]);var m=(0,r.a)(),f=m.user;m.subscription;var v=(0,i.useRef)(null);return(0,p.Z)(v,e.setIsDownloadModalOpen),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"".concat(e.isDownloadModalOpen?"block":"hidden"," transition-opacity ease-linear overflow-y-auto overflow-x-hidden w-full h-full inset-0 fixed z-40 bg-neutral-900 bg-opacity-90"),children:(0,a.jsx)("div",{className:"h-full md:h-upgrade-nudge transition-transform relative z-50 w-auto max-w-3xl md:my-4 mx-auto flex items-center",children:(0,a.jsx)("div",{ref:v,className:"relative max-h-full bg-white overflow-hidden bg-clip-padding shadow-lg rounded-lg w-full flex flex-col justify-start items-center",children:(0,a.jsxs)("div",{className:"overflow-y-auto px-4 py-8 flex flex-col items-center w-full",children:[(0,a.jsx)("div",{className:"absolute top-4 right-4 md:top-4 md:right-4 p-2 cursor-pointer hover:bg-neutral-100 rounded-lg z-10 bg-white",onClick:function(){return e.setIsDownloadModalOpen(!1)},children:(0,a.jsx)(l.F,{className:"text-primary text-2xl"})}),(0,a.jsx)(C,{app:e.app,source:"upgrade-nudge-on-download"}),(0,a.jsxs)("div",{className:"flex flex-row items-center w-full mt-4",children:[(0,a.jsx)("div",{className:"h-[1px] bg-slate-200 w-full"}),(0,a.jsx)("p",{className:"text-slate-600 antialiased mx-2 text-xs",children:n("common:OR_SEPARATOR")}),(0,a.jsx)("div",{className:"h-[1px] bg-slate-200 w-full"})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center max-w-2xl mt-4",children:[(0,a.jsx)(o.H5,{text:n("common:UPGRADE_NUDGE_DOWNLOAD_BUTTON_CTA"),classes:"font-semibold"}),(0,a.jsxs)("div",{className:"flex flex-row items-start gap-4 justify-between mt-4 w-full",children:[(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("p",{className:"text-sm font-normal text-primary antialiased text-left",children:n("common:UPGRADE_NUDGE_ON_DOWNLOAD_SUBTITLE_TEST1")}),(0,a.jsx)(s.SecondaryButtonSmall,{text:n("common:UPGRADE_NUDGE_DOWNLOAD_BUTTON_CTA"),onClick:e.download,classes:"mt-4 md:block hidden"})]}),(0,a.jsx)("img",{src:e.image,alt:"blurred image",className:"rounded-lg object-contain max-w-[6rem] md:max-w-[8rem] max-h-[6rem] md:max-h-[8rem] blur-[1px] shrink-0"})]}),(0,a.jsx)(s.SecondaryButtonSmall,{text:n("common:UPGRADE_NUDGE_DOWNLOAD_BUTTON_CTA"),onClick:e.download,classes:"mt-4 md:hidden"})]}),(0,a.jsxs)("div",{className:"".concat(f?"hidden":"block"," w-full"),children:[(0,a.jsx)("div",{className:"border-t border-slate-200 my-6 md:my-8 w-full"}),(0,a.jsxs)("p",{className:"text-sm antialiased font-medium text-primary text-center cursor-pointer",onClick:function(){return u().push({pathname:"/login",query:{origin_url:"https://magicstudio.com"+u().pathname,from:e.app}})},children:[n("common:UPGRADE_NUDGE_LOGIN_QUESTION")," ",(0,a.jsx)("span",{className:(0,d.Z)("bg-clip-text box-decoration-clone text-transparent bg-gradient-to-r from-".concat(e.app,"-gradient-start to-").concat(e.app,"-gradient-end text-sm font-bold antialiased cursor-pointer whitespace-nowrap")),children:n("common:LOGIN_MODAL_BUTTON_CTA")})]})]})]})})})})})}},99122:function(e,t,n){n.d(t,{M:function(){return i}});var a=n(41825);function i(){return(0,a.q3)("999-vs-1999-usd-cny-price")}},77022:function(e,t,n){function a(e){for(var t=e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1]),a=[],i=0;i<n.length;i+=1)a.push(n.charCodeAt(i));return new Blob([new Uint8Array(a)],{type:t})}function i(e,t,n,i){var l=n?"image/"+n:e.type,r=new FileReader,s=new Image,o=document.createElement("canvas"),d=function(){var n,r,d=s.width,c=s.height;if(d>c?d>t&&(c*=t/d,d=t):c>t&&(d*=t/c,c=t),d===s.width&&c===s.height)return{file:e,resized:!1,originalWidth:d,originalHeight:c,width:d,height:c};if(o.width=d,o.height=c,!o.getContext("2d"))throw Error("could not get context");null===(n=o.getContext("2d"))||void 0===n||n.drawImage(s,0,0,d,c);try{r=i?o.toDataURL(l,i):o.toDataURL(l)}catch(m){console.error("Error resizing image",m),r=o.toDataURL()}var u=a(r);return{file:new File([u],e.name,{type:null==e?void 0:e.type}),resized:!0,originalWidth:s.width,originalHeight:s.height,width:d,height:c}};return new Promise(function(t,n){if(!(null==e?void 0:e.type.match(/image.*/))){console.log("Here"),n(Error("Not an image"));return}r.onload=function(e){s.onload=function(){return t(d())},s.src=e.target.result}
1,r.readAsDataURL(e)})}n.d(t,{OP:function(){return a},Tu:function(){return i}})},19226:function(e,t,n){n.d(t,{o:function(){return a}});function a(e){return String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.