1(this["webpackJsonpmaestra-web-prod"]=this["webpackJsonpmaestra-web-prod"]||[]).push([[19],{1004:function(t,e,n){"use strict";var r=n(0),i=n.n(r),s=n(266),o=n.n(s),a=n(23),c=n(1013),u=n(1011),l=(n(1009),n(1));class d extends r.Component{constructor(t){super(t),this.state={}}shouldComponentUpdate(t){return!((null===t||void 0===t?void 0:t.isOpen)===this.props.isOpen&&!this.props.isOpen)}render(){const{isOpen:t,title:e,subtitle:n,name:r,handleModal:s,children:d,customClassName:p,largeGap:h,contentLabel:m,customXButtonClassName:b,onRequestClose:y,ariaHideApp:v,zIndex:j}=this.props;let C=null;return i.a.isValidElement(e)?C=e:e&&(C=Object(l.jsx)(u.a,{title:e,subtitle:n})),Object(l.jsxs)(o.a,{isOpen:t,contentLabel:m,className:"modalContent baseModal ".concat(p||"").concat(h?" largeGap":""),overlayClassName:"modalOverlay",onRequestClose:y||s,ariaHideApp:v,style:{overlay:{zIndex:j||a.I}},children:[(s||C)&&Object(l.jsxs)("div",{className:C?"modalColumn alignStart":"absoluteXButtonContainer",children:[C,s&&Object(l.jsx)(c.a,{name:r,onClick:s,className:b||""})]}),d]})}}e.a=d},1009:function(t,e,n){},1011:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n(0),n(1020);var r=n(1);function i(t){let{title:e,subtitle:n}=t;return Object(r.jsxs)("div",{className:"modalTitleBlock",children:[Object(r.jsx)("h2",{children:e}),n&&Object(r.jsx)("div",{className:"modalTitleBlockSubtitle",children:n})]})}},1013:function(t,e,n){"use strict";n(0);var r=n(265),i=(n(1019),n(1));e.a=function(t){let{name:e,onClick:n,noInitialSize:s,padding:o,className:a,small:c}=t;return Object(i.jsx)("div",{name:e,onClick:n,className:"xButtonContainer centerFlex".concat(s?" noInitialSize":"").concat(a?" ".concat(a):"").concat(c?" small":""),style:{padding:o||0},children:Object(i.jsx)(r.a,{className:"closeIcon xButton"})})}},1019:function(t,e,n){},1020:function(t,e,n){},1028:function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s}));const r="pk_live_Xwic15602dTAZ7dVlEFLrIAy",i=[{country:"Australia",code:"au_abn",description:"Australian Business Number (AU ABN)",number:"12345678912"},{country:"Austria",code:"eu_vat",description:"European VAT number",number:"ATU12345678"},{country:"Belgium",code:"eu_vat",description:"European VAT number",number:"BE0123456789"},{country:"Bulgaria",code:"eu_vat",description:"European VAT number",number:"BG0123456789"},{country:"Canada",code:"ca_bn",description:"Canadian BN",number:"123456789"},{country:"Canada",code:"ca_gst_hst",description:"Canadian GST/HST number",number:"123456789RT0002"},{country:"Canada",code:"ca_pst_bc",description:"Canadian PST number (British Columbia)",number:"PST-1234-5678"},{country:"Canada",code:"ca_pst_mb",description:"Canadian PST number (Manitoba)",number:"123456-7"},{country:"Canada",code:"ca_pst_sk",description:"Canadian PST number (Saskatchewan)",number:"1234567"},{country:"Canada",code:"ca_qst",description:"Canadian QST number (Qu\xe9bec)",number:"1234567890TQ1234"},{country:"Chile",code:"cl_tin",description:"Chilean TIN",number:"12.345.678-K"},{country:"Croatia",code:"eu_vat",description:"European VAT number",number:"HR12345678912"},{country:"Cyprus",code:"eu_vat",description:"European VAT number",number:"CY12345678Z"},{country:"Czech Republic",code:"eu_vat",description:"European VAT number",number:"CZ1234567890"},{country:"Denmark",code:"eu_vat",description:"European VAT number",number:"DK12345678"},{country:"Estonia",code:"eu_vat",description:"European VAT number",number:"EE123456789"},{country:"Finland",code:"eu_vat",description:"European VAT number",number:"FI12345678"},{country:"France",code:"eu_vat",description:"European VAT number",number:"FRAB123456789"},{country:"Germany",code:"eu_vat",description:"European VAT number",number:"DE123456789"},{country:"Greece",code:"eu_vat",description:"European VAT number",number:"EL123456789"},{country:"Hungary",code:"eu_vat",description:"European VAT number",number:"HU12345678"},{country:"Iceland",code:"is_vat",description:"Icelandic VAT",number:"123456"},{country:"India",code:"in_gst",description:"Indian GST number",number:"12ABCDE3456FGZH"},{country:"Ireland",code:"eu_vat",description:"European VAT number",number:"IE1234567AB"},{country:"Italy",code:"eu_vat",description:"European VAT number",number:"IT12345678912"},{country:"Latvia",code:"eu_vat",description:"European VAT number",number:"LV12345678912"},{country:"Lithuania",code:"eu_vat",description:"European VAT number",number:"LT123456789123"},{country:"Luxembourg",code:"eu_vat",description:"European VAT number",number:"LU12345678"},{country:"Malta",code:"eu_vat",description:"European VAT number",number:"MT12345678"},{country:"Mexico",code:"mx_rfc",description:"Mexican RFC number",number:"ABC010203AB9"},{country:"Netherlands",code:"eu_vat",description:"European VAT number",number:"NL123456789B12"},{country:"New Zealand",code:"nz_gst",description:"New Zealand GST number",number:"123456789"},{country:"Norway",code:"no_vat",description:"Norwegian VAT number",number:"123456789MVA"},{country:"Poland",code:"eu_vat",description:"European VAT number",number:"PL1234567890"},{country:"Portugal",code:"eu_vat",description:"European VAT number",number:"PT123456789"},{country:"Romania",code:"eu_vat",description:"European VAT number",number:"RO1234567891"}
1,{country:"Russia",code:"ru_inn",description:"Russian INN",number:"1234567891"},{country:"Russia",code:"ru_kpp",description:"Russian KPP",number:"123456789"},{country:"Saudi Arabia",code:"sa_vat",description:"Saudi Arabia VAT",number:"123456789012345"},{country:"Singapore",code:"sg_gst",description:"Singaporean GST",number:"M12345678X"},{country:"Slovakia",code:"eu_vat",description:"European VAT number",number:"SK1234567891"},{country:"Slovenia",code:"eu_vat",description:"European VAT number",number:"SI12345678"},{country:"South Africa",code:"za_vat",description:"South African VAT number",number:"4123456789"},{country:"South Korea",code:"kr_brn",description:"Korean BRN",number:"123-45-67890"},{country:"Spain",code:"es_cif",description:"Spanish NIF number (previously Spanish CIF number)",number:"A12345678"},{country:"Spain",code:"eu_vat",description:"European VAT number",number:"ESA1234567Z"},{country:"Sweden",code:"eu_vat",description:"European VAT number",number:"SE123456789123"},{country:"Switzerland",code:"ch_vat",description:"Switzerland VAT number",number:"CHE-123.456.789 MWST"},{country:"Thailand",code:"th_vat",description:"Thai VAT",number:"1234567891234"},{country:"Turkey",code:"tr_tin",description:"Turkish Tax Identification Number",number:"0123456789"},{country:"United Arab Emirates",code:"ae_trn",description:"United Arab Emirates TRN",number:"123456789012345"},{country:"United Kingdom",code:"eu_vat",description:"Northern Ireland VAT number",number:"XI123456789"},{country:"United Kingdom",code:"gb_vat",description:"United Kingdom VAT number",number:"GB123456789"}];function s(t){switch(t.toLowerCase()){case"australia":return"en-AU";case"austria":return"de-AT";case"belgium":return"nl-BE";case"bulgaria":return"bg-BG";case"canada":return"en-CA";case"chile":return"es-CL";case"croatia":return"hr-HR";case"cyprus":return"el-CY";case"czech republic":return"cs-CZ";case"denmark":return"da-DK";case"estonia":return"et-EE";case"finland":return"fi-FI";case"france":return"fr-FR";case"germany":return"de-DE";case"greece":return"el-GR";case"hungary":return"hu-HU";case"iceland":return"is-IS";case"india":return"hi-IN";case"ireland":return"en-IE";case"italy":return"it-IT";case"latvia":return"lv-LV";case"lithuania":return"lt-LT";case"luxembourg":return"lb";case"malta":return"mt-MT";case"mexico":return"es-MX";case"netherlands":return"nl-NL";case"new zealand":return"en-NZ";case"norway":return"nb-NO";case"poland":return"pl-PL";case"portugal":return"pt-PT";case"romania":return"ro-RO";case"russia":return"ru-RU";case"saudi arabia":return"ar-SA";case"singapore":return"en-SG";case"slovakia":return"sk-SK";case"slovenia":return"sl-SI";case"south africa":return"en-ZA";case"south korea":return"ko-KR";case"spain":return"es-ES";case"sweden":return"sv-SE";case"switzerland":return"de-CH";case"thailand":return"th-TH";case"turkey":return"tr-TR";case"united arab emirates":return"ar-AE";case"united kingdom":return"en-GB";default:return null}}},1057:function(t,e,n){t.exports=n(1107)},1060:function(t,e,n){},1083:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(0),i=n(182),s=n(23),o=n(1004),a=n(38),c=n(179),u=n(119),l=n(1);const d=t=>{const e=Math.round(t||0),n=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return n?"".concat(n,":").concat(String(r).padStart(2,"0"),":").concat(String(i).padStart(2,"0")):"".concat(r,":").concat(String(i).padStart(2,"0"))};class p extends r.Component{constructor(t){super(t),this.state={thumbUrl:null}}componentDidMount(){const{item:t,editorType:e}=this.props;if(null===t||void 0===t||!t.isVideo||null===t||void 0===t||!t.videoImageName)return;const n="voiceover"===e?"voiceovers":"captions";Object(c.z)(t.transcriptId,n).then((t=>{null!==t&&void 0!==t&&t.url&&this.setState({thumbUrl:t.url})})).catch((()=>{}))}render(){var t;const{item:e,editorType:n,t:r}=this.props;let i=d(e.duration);e.unTrimmedFileDuration&&(i+=" / ".concat(d(e.unTrimmedFileDuration)));const s=Object(a.y)(null===(t=e.configuration)||void 0===t?void 0:t.languageCode),o=s?Object(c.b)(s):null;return Object(l.jsxs)("div",{className:"authEditorPanelInfo",children:[Object(l.jsxs)("div",{className:"authEditorPanelLockup",children:[Object(l.jsx)(u.a,{className:"authLogoContainer"}),Object(l.jsx)("div",{className:"authPageTitle",children:"Maestra"})]}),Object(l.jsx)("div",{className:"authEditorPanelTitle",children:r("editor:editorActionBox.title.".concat(n))}),Object(l.jsx)("div",{className:"authEditorPanelDesc",children:r("editor:topToolbarCreateAccount")}
1),Object(l.jsxs)("div",{className:"authEditorPanelFile",children:[this.state.thumbUrl?Object(l.jsx)("img",{className:"authEditorPanelThumb",src:this.state.thumbUrl,alt:""}):null,Object(l.jsxs)("div",{className:"authEditorPanelFileDetails",children:[Object(l.jsx)("div",{className:"authEditorPanelFilename",children:e.filename}),Object(l.jsxs)("div",{className:"authEditorPanelMeta",children:[Object(l.jsx)("span",{children:i}),o?Object(l.jsx)("span",{children:o}):null]})]})]})]})}}function h(t){let{item:e,editorType:n,t:r,invokedFromEditor:a,isOpen:c,handleModal:u}=t;const d=!!(a&&e&&r),h=Object(l.jsx)(i.a,{invokedFromEditor:a,bare:d,mode:"signup"});return Object(l.jsx)(o.a,{isOpen:c,contentLabel:"Auth",customClassName:d?"authModal editorPanel":"authModal",handleModal:u,zIndex:s.J,children:d?Object(l.jsx)("div",{className:"authBoxOuterContainer",children:Object(l.jsxs)("div",{className:"authEditorPanel",children:[Object(l.jsx)(p,{item:e,editorType:n,t:r}),h]})}):h})}},1084:function(t,e,n){},1085:function(t,e,n){},1095:function(t,e,n){"use strict";var r=n(0),i=n(1031),s=n(1080),o=n(1);var a=Object(r.forwardRef)(((t,e)=>{let{generateDynamicError:n,reportError:s,t:a,setCardReady:c}=t;const u=Object(i.useStripe)(),l=Object(i.useElements)();return Object(r.useImperativeHandle)(e,(()=>({handleSubmit:async()=>new Promise((async(t,e)=>{if(!u||!l)return console.log("Stripe hasn't loaded yet."),void e("Stripe or Elements not loaded");try{await l.submit();const r=await u.createPaymentMethod({elements:l});r.error?(n(a("errors:invalidPaymentInfo")),s("",r.error,"PAYMENT_FIRE_ERROR"),e(r.error)):t(r.paymentMethod)}catch(r){s("",r,"SETUP_INTENT_ERROR"),e(r)}}))}))),Object(o.jsx)("div",{children:Object(o.jsx)(i.PaymentElement,{options:{layout:"tabs",paymentMethodOrder:["card"]},onReady:()=>c(!0)})})})),c=n(1028),u=n(215),l=n(260),d=n(180),p=n(26),h=(n(1084),n(23));const m=c.a.map((t=>({value:t.code,label:"".concat(t.country,": ").concat(t.description),country:t.country,lancode:Object(c.b)(t.country),example:t.number}))),b=Object(u.a)((function(){return{control:t=>({...t,backgroundColor:"var(--cBackgroundEl1)",width:80,height:46,minHeight:36,border:"2px solid var(--cBackgroundEl2)",borderRadius:"0.4rem",fontSize:"var(--text-base-font-size)",fontWeight:600,textOverflow:"clip",transition:"var(--transitionDefault)",boxShadow:(t.isFocused,null),color:"var(--cPrimaryText)",cursor:"pointer","&:hover":{border:"2px solid var(--cBackgroundEl2)"},"&:select":{border:"2px solid ".concat("var(--cBackgroundEl3)"),boxShadow:0}}),option:(t,e)=>({...Object(d.c)(e),fontSize:"var(--text-sm-font-size)"}),menu:t=>({...Object(d.a)(t),width:300}),menuList:t=>({...Object(d.b)(t),maxHeight:180}),dropdownIndicator:t=>({...t,color:"var(--cPrimaryTextO5)",paddingLeft:5,height:23,paddingTop:2}),indicatorSeparator:t=>({...t,display:"none"}),menuPortal:t=>({...t,zIndex:h.N})}}));function y(t){var e;let{label:r,lancode:i}=t;return Object(o.jsxs)("div",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[i&&Object(o.jsx)("img",{loading:"lazy",className:"flagIcon",height:20,width:30,src:null===(e=n(261)("./".concat(i,".svg")))||void 0===e?void 0:e.default}),Object(o.jsx)("div",{className:"styleFormatOptionLabel",style:{flex:1,marginLeft:7},children:r})]})}function v(t){var e;const{vatCountryObj:n}=t,r=!Object(p.bb)(t.value,null===n||void 0===n?void 0:n.value,null===n||void 0===n?void 0:n.lancode)&&t.value?"vatNumberInput invalid":"vatNumberInput";return Object(o.jsxs)("div",{className:"vatNumberContainer",children:[Object(o.jsx)("div",{className:"vatNumberLabel",children:t.t("payment:taxId")}),Object(o.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[Object(o.jsx)(l.a,{styles:b(),menuPortalTarget:document.querySelector("body"),placeholder:"",value:n,menuPlacement:"auto",onChange:e=>{t.setVatCountryObj(e)},formatOptionLabel:y,options:m,theme:t=>({...t,colors:{...t.colors,primary:"var(--cBackgroundEl3)",neutral50:"var(--cTertiaryText)",neutral40:"var(--cTertiaryText)",neutral80:"var(--cPrimaryText)"}})}),Object(o.jsx)("input",{className:r,placeholder:(null===(e=t.vatCountryObj)||void 0===e?void 0:e.example)||t.t("payment:taxId"),type:"text",value:t.value,onChange:e=>t.onChange(e.target.value)})]})]})}var j=function(t){return Object(o.jsx)("form",{children:Object(o.jsxs)("div",{children:[Object(o.jsx)(i.AddressElement,{options:{mode:"billing"}}),Object(o.jsx)(v,{value:t.vatNumber,onChange:t.setVatNumber,theme:t.theme,vatCountryObj:t.vatCountryObj,setVatCountryObj:t.setVatCountryObj,t:t.t})]})})},C=n(104),O=n(216);n(1085);const f=[{cssSrc:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600&display=swap"}];e.a=function(t){const[e,n]=Object(r.useState)(null),[u,l]=Object(r.useState)(!0),[d,p]=Object(r.useState)(null),[h,m]=Object(r.useState)(!1),[b,y]=Object(r.useState)(!1);return Object(r.useEffect)((()=>{!u&&e&&b?t.setPaymentInfoLoading&&t.setPaymentInfoLoading(!1):t.setPaymentInfoLoading&&t.setPaymentInfoLoading(!0)}),[u,e,d,b]),Object(r.useEffect)((()=>{let e=!0;return l(!0),Object(s.a)(c.c).then((t=>{e&&(n(t),l(!1))})).catch((n=>{e&&(p(n),l(!1),t.generateDynamicError(t.t("errors:paymentFormStripeError")),t.reportError(!1,new Error("Error loading Stripe."),"STRIPE_LOAD_ERROR"))})),()=>{e=!1}}),[]),d?Object(o.jsx)("div",{className:"viewBillingInfo viewBillingInfoDescription",children:t.t("payment:paymentFormStripeError")}):!e||u?null:Object(o.jsx)("div",{className:"Stripe",children:Object(o.jsxs)(i.Elements,{stripe:e,options:{fonts:f,mode:t.mode,paymentMethodCreation:"manual",amount:t.amount,currency:"usd",appearance:{variables:{colorBackgroun
1d:Object(C.k)(C.a,t.theme,!0),colorText:Object(C.k)(C.f,t.theme,!0),borderRadius:"0.4rem",fontFamily:"Plus Jakarta Sans, sans-serif",colorDanger:Object(C.k)(C.b,t.theme,!0),colorPrimary:Object(C.k)(C.d,t.theme,!0)},rules:{".Input":{border:"2px solid ".concat(Object(C.k)(C.g,t.theme,!0))},".Tab":{border:"2px solid ".concat(Object(C.k)(C.e,t.theme,!0))},".TermsText":{fontSize:"0.8rem"}}}},children:[Object(o.jsx)(a,{ref:t.paymentRef,generateDynamicError:t.generateDynamicError,reportError:t.reportError,t:t.t,setCardReady:y}),Object(o.jsx)("div",{className:"paymentText",style:{marginTop:7,marginBottom:7},children:Object(o.jsx)(O.a,{text:t.t("payment:includeBillingAddressCheckbox"),checked:h,onClick:()=>{m((t=>!t))}})}),h?Object(o.jsx)(j,{theme:t.theme,vatNumber:t.vatNumber,setVatNumber:t.setVatNumber,vatCountryObj:t.vatCountryObj,setVatCountryObj:t.setVatCountryObj,t:t.t}):null]})})}},1107:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var s=r.createElement("svg",{viewBox:"-2 -5 14 20",height:"100%",width:"100%",style:{position:"absolute",top:0}},r.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"})),o=r.createElement("svg",{height:"100%",width:"100%",viewBox:"-2 -5 17 21",style:{position:"absolute",top:0}},r.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}));function a(t){if(7===t.length)return t;for(var e="#",n=1;n<4;n+=1)e+=t[n]+t[n];return e}function c(t,e,n,r,i){return function(t,e,n,r,i){var s=(t-n)/(e-n);if(0===s)return r;if(1===s)return i;for(var o="#",a=1;a<6;a+=2){var c=parseInt(r.substr(a,2),16),u=parseInt(i.substr(a,2),16),l=Math.round((1-s)*c+s*u).toString(16);1===l.length&&(l="0"+l),o+=l}return o}(t,e,n,a(r),a(i))}var u=function(t){function e(e){t.call(this,e);var n=e.height,r=e.width,i=e.checked;this.t=e.handleDiameter||n-2,this.i=Math.max(r-n,r-(n+this.t)/2),this.o=Math.max(0,(n-this.t)/2),this.state={s:i?this.i:this.o},this.n=0,this.e=0,this.h=this.h.bind(this),this.r=this.r.bind(this),this.a=this.a.bind(this),this.c=this.c.bind(this),this.l=this.l.bind(this),this.u=this.u.bind(this),this.f=this.f.bind(this),this.p=this.p.bind(this),this.b=this.b.bind(this),this.g=this.g.bind(this),this.v=this.v.bind(this),this.w=this.w.bind(this)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.componentDidUpdate=function(t){t.checked!==this.props.checked&&this.setState({s:this.props.checked?this.i:this.o})},e.prototype.k=function(t){this.y.focus(),this.setState({C:t,M:!0,m:Date.now()})},e.prototype.x=function(t){var e=this.state,n=e.C,r=e.s,i=(this.props.checked?this.i:this.o)+t-n;e.R||t===n||this.setState({R:!0});var s=Math.min(this.i,Math.max(this.o,i));s!==r&&this.setState({s:s})}
1,e.prototype.S=function(t){var e=this.state,n=e.s,r=e.R,i=e.m,s=this.props.checked,o=(this.i+this.o)/2,a=Date.now()-i;!r||a<250?this.T(t):s?o<n?this.setState({s:this.i}):this.T(t):n<o?this.setState({s:this.o}):this.T(t),this.setState({R:!1,M:!1}),this.n=Date.now()},e.prototype.h=function(t){t.preventDefault(),"number"==typeof t.button&&0!==t.button||(this.k(t.clientX),window.addEventListener("mousemove",this.r),window.addEventListener("mouseup",this.a))},e.prototype.r=function(t){t.preventDefault(),this.x(t.clientX)},e.prototype.a=function(t){this.S(t),window.removeEventListener("mousemove",this.r),window.removeEventListener("mouseup",this.a)},e.prototype.c=function(t){this.$=null,this.k(t.touches[0].clientX)},e.prototype.l=function(t){this.x(t.touches[0].clientX)},e.prototype.u=function(t){t.preventDefault(),this.S(t)},e.prototype.p=function(t){50<Date.now()-this.n&&(this.T(t),50<Date.now()-this.e&&this.setState({M:!1}))},e.prototype.b=function(){this.e=Date.now()},e.prototype.g=function(){this.setState({M:!0})},e.prototype.v=function(){this.setState({M:!1})},e.prototype.w=function(t){this.y=t},e.prototype.f=function(t){t.preventDefault(),this.y.focus(),this.T(t),this.setState({M:!1})},e.prototype.T=function(t){var e=this.props;(0,e.onChange)(!e.checked,t,e.id)},e.prototype.render=function(){var t=this.props,e=t.disabled,n=t.className,s=t.offColor,o=t.onColor,a=t.offHandleColor,u=t.onHandleColor,l=t.checkedIcon,d=t.uncheckedIcon,p=t.boxShadow,h=t.activeBoxShadow,m=t.height,b=t.width,y=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(t,["disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","boxShadow","activeBoxShadow","height","width","handleDiameter"]),v=this.state,j=v.s,C=v.R,O=v.M,f={position:"relative",display:"inline-block",textAlign:"left",opacity:e?.5:1,direction:"ltr",borderRadius:m/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},g={height:m,width:b,margin:Math.max(0,(this.t-m)/2),position:"relative",background:c(j,this.i,this.o,s,o),borderRadius:m/2,cursor:e?"default":"pointer",WebkitTransition:C?null:"background 0.25s",MozTransition:C?null:"background 0.25s",transition:C?null:"background 0.25s"},x={height:m,width:Math.min(1.5*m,b-(this.t+m)/2+1),position:"relative",opacity:(j-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"},T={height:m,width:Math.min(1.5*m,b-(this.t+m)/2+1),position:"absolute",opacity:1-(j-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"},S={height:this.t,width:this.t,background:c(j,this.i,this.o,a,u),display:"inline-block",cursor:e?"default":"pointer",borderRadius:"50%",position:"absolute",transform:"translateX("+j+"px)",top:Math.max(0,(m-this.t)/2),outline:0,boxShadow:O?h:p,border:0,WebkitTransition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"};return r.createElement("div",{className:n,style:f},r.createElement("div",{className:"react-switch-bg",style:g,onClick:e?null:this.f,onMouseDown:function(t){return t.preventDefault()}},l&&r.createElement("div",{style:x},l),d&&r.createElement("div",{style:T},d)),r.createElement("div",{className:"react-switch-handle",style:S,onClick:function(t){return t.preventDefault()},onMouseDown:e?null:this.h,onTouchStart:e?null:this.c,onTouchMove:e?null:this.l,onTouchEnd:e?null:this.u,onTouchCancel:e?null:this.v}),r.createElement("input",i({},{type:"checkbox",role:"switch",disabled:e,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},y,{ref:this.w,onFocus:this.g,onBlur:this.v,onKeyUp:this.b,onChange:this.p})))},e}(r.Component);u.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:s,checkedIcon:o,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56},e.default=u},1110:function(t,e,n){},1111:function(t,e,n){},1112:function(t,e,n){},1113:function(t,e,n){},1149:function(t,e,n){"use strict";n.r(e);var r=n(44),i=n(51),s=n(78),o=n(0),a=n.n(o),c=n(1080),u=n(157),l=n.n(u),d=n(13),p=n(1045),h=n(26),m=n(1028),b=n(24),y=n(23),v=n(1005),j=n(1096),C=(n(1110),n(1));
1function O(t){let{type:e="text",onChange:n,value:r,placeholder:i,text:s,dynamicWidth:o,onBlur:c,stepCount:u,orderSummaryBox:l}=t;const d=a.a.useRef(),p=a.a.useRef(),h=a.a.useRef(),[m,b]=a.a.useState(39),y=u||1;a.a.useEffect((()=>{if(o&&d.current){const t=10*Math.max(d.current.value.length,i.length)+30;b(t)}}),[r,i,o]);const v=o?"primaryInputParent dynamicWidth":"primaryInputParent";return Object(C.jsxs)("div",{className:"primaryInputContainer",style:{minWidth:l&&72},children:[Object(C.jsxs)("div",{className:v,children:[Object(C.jsx)("input",{type:e,ref:d,className:"primaryInputChild",value:r,placeholder:i,onChange:n,style:{width:m},onBlur:t=>{const{relatedTarget:e}=t;p.current.contains(e)||h.current.contains(e)||c&&c(t)}}),"number"===e&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("div",{className:"primaryInputCustomSpinnerContainer decrement",children:Object(C.jsx)("button",{ref:h,onClick:()=>{let t=(r?parseInt(r,10):0)-y;t=1!==y?Math.round(t/y)*y:t,t>=0&&(c?c({target:{value:t}}):n({target:{value:t}}))},className:"primaryInputCustomSpinner",children:"-"})}),Object(C.jsx)("div",{className:"primaryInputCustomSpinnerContainer increment",children:Object(C.jsx)("button",{ref:p,onClick:()=>{let t=(r?parseInt(r,10):0)+y;t=1!==y?Math.round(t/y)*y:t,c?c({target:{value:t}}):n({target:{value:t}})},className:"primaryInputCustomSpinner",children:"+"})})]})]}),Object(C.jsx)("div",{className:"primaryInputDescription",children:s})]})}var f=n(1010);n(1060);function g(t){let{value:e,onChange:n,text:r,subtext:i,isMinutesText:s,toggleIsMinutes:o,onBlur:a,stepCount:c,orderSummaryBox:u,infoTextId:l,infoText:d,sideText:p}=t;return Object(C.jsxs)("div",{className:"planRequirementInputContainer planReqInput".concat(u?" orderSummaryBox":""),children:[Object(C.jsx)(O,{orderSummaryBox:u,type:"number",value:e,onChange:n,onBlur:a,placeholder:"0",dynamicWidth:!0,stepCount:c}),o&&Object(C.jsx)("div",{className:"paymentMinutesHoursButton",onClick:o,style:{marginRight:"10px",cursor:"pointer"},children:s}),Object(C.jsxs)("div",{className:"paymentInputTextContainer".concat(u?" orderSummaryBox":""),children:[Object(C.jsxs)("div",{className:"paymentInputTextInnerContainer",children:[r,"\xa0",p&&Object(C.jsxs)("span",{className:"planRequirementInputSideText",children:[p,"\xa0"]}),d&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)(f.a,{className:"infoIcon planRequirementInput","data-tip":!0,"data-for":l}),Object(C.jsx)(v.a,{id:l,place:"right",effect:"solid",children:Object(C.jsx)("div",{style:{textAlign:"center",whiteSpace:"pre-line"},children:d})})]})]}),u&&Object(C.jsx)("div",{className:"planRequirementInputSubtext",children:i})]})]})}var x,T,S=n(263),E=n(267);function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},I.apply(null,arguments)}function N(t,e){let{title:n,titleId:r,...i}=t;return o.createElement("svg",I({width:18,height:22,viewBox:"0 0 18 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,"aria-labelledby":r},i),n?o.createElement("title",{id:r},n):null,x||(x=o.createElement("path",{d:"M9 21C9 21 17 17 17 11V4L9 1L1 4V11C1 17 9 21 9 21Z",fill:"currentColor",stroke:"current",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),T||(T=o.createElement("path",{d:"M15 7L7.4375 14L4 10.8182",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}const P=o.forwardRef(N);n.p;var A=n(39),k=n(1052),w=n(1059);n(1111);function _(t){var e,n;let{type:r,paymentProcessing:i,purchaseType:o,isAnnual:a,currentIsAnnual:c,t:u,costType:l,requiredCredits:p,editorType:m,currentHourCount:b,inputMonthlyCredits:y,inputUserCount:O,invokedFromEditor:f,submit:x,fetchingProration:T,invoiceObj:I,subscription:N,setSubInterval:_,setInputMonthlyCredits:M,goBack:R,actualCurrentUserCount:B,setInputUserCount:V,userCount:U,setUserCount:L,hourCount:F,updateMonthlyCredits:D,planInfo:H,selectedProduct:q,isTeamSeatPayment:G,notAvailableFeature:z,pricingVersion:Y,paymentInfoLoading:W}=t,K=!1,X=!1;X=!!i;const Z="SUB"===o?"$".concat(A.a.V1_PLANS.MONTHLY_PER_HOUR).concat(u("payment:additionalHourPriceSub")):0===Y?"$".concat(A.a.V0_PLANS.PAYG_PER_HOUR).concat(u("payment:additionalHourPricePayg")):"$".concat(A.a.V2_PLANS[A.d.PAYG.name].price).concat(u("payment:additionalHourPricePayg")),$=a?"$".concat(A.a.V1_PLANS.ANNUAL_MONTHLY_USER_SEAT).concat(u("payment:additionalUsersPrice")):"$".concat(A.a.V1_PLANS.MONTHLY_USER_SEAT).concat(u("payment:additionalUsersPrice"));
1c&&!a&&(K=!0);const J=I,{minutes:Q}=function(t){if(!t)return[];const e=[],n=[];return t.forEach((t=>{t.minutes?e.push(t):"title"!==t.type&&"divider"!==t.type&&n.push(t)})),{minutes:e,planFeatures:n}}(null===H||void 0===H||null===(e=H.sections)||void 0===e?void 0:e[q]),tt=()=>{let t=u("payment:purchase"),e="";if(i)t=u("payment:processing");else if("SUB"===o){const{dueToday:n,nextInvoice:r}=J;n<=0&&"awaitcancel"===(null===N||void 0===N?void 0:N.status)?t=u("payment:reactivate"):r>=0&&n!==r?(t=u("payment:update"),e=u("payment:dueToday")):(t=u("payment:subscribe"),e=u(a?"payment:slYear":"payment:slMonth"))}return{buttonText:t,rightTextAddition:e}},et=null===H||void 0===H||null===(n=H.sections)||void 0===n?void 0:n[q],nt=(()=>{const t="PAYG"===o,e="new_pricing"===(null===N||void 0===N?void 0:N.plan_name);return t||e})(),rt=Object(A.j)(z,u);return"mobile"===r?(()=>{const{dueToday:t}=J,e=tt();return Object(C.jsxs)("div",{className:"paymentStickyOrderSummaryCardContainer mobile".concat(f?" invokedFromEditor":""),children:[Object(C.jsx)("div",{className:"paymentStickyGradient".concat(f?" invokedFromEditor":""),style:{zIndex:-1}}),Object(C.jsx)("div",{className:"paymentOrderSummaryCardMobileContainer".concat(f?" invokedFromEditor":""),children:Object(C.jsx)("div",{className:"paymentOrderSummaryCard withPurchaseFunction",onClick:()=>x(),children:X?Object(C.jsx)("div",{className:"centerFlex",children:Object(C.jsx)("div",{className:"infiniteLoadingCircle"})}):Object(C.jsxs)("div",{className:"orderSummaryPriceText modalColumn totalDue",children:[Object(C.jsx)("span",{children:null===e||void 0===e?void 0:e.buttonText}),T?Object(C.jsx)("span",{children:u("payment:prorating")}):Object(C.jsxs)("div",{children:[Object(h.H)(t),Object(C.jsx)("span",{className:"small",children:null===e||void 0===e?void 0:e.rightTextAddition})]})]})})})]})})():Object(C.jsxs)("div",{className:"paymentOrderSummaryContainer",children:[!rt&&p>0&&Object(C.jsx)("div",{className:"planRequirementInputSubtext requiredCreditsInfo",children:Object(S.g)(l,p,m)}),rt&&Object(C.jsx)("div",{className:"planRequirementInputSubtext requiredCreditsInfo",children:rt}),"SUB"===o&&!G&&!c&&Object(C.jsx)(j.a,{onChange:()=>{_(!a)},leftText:u("plans:monthlyText"),rightText:Object(C.jsxs)(C.Fragment,{children:[u("plans:yearlyText")," ",Object(C.jsxs)("span",{className:"primaryColor",children:["(",u("plans:yearlySaveText"),")"]})]}),checked:a}),nt&&Object(C.jsxs)("div",{className:"paymentOrderSummaryCard",children:[Object(C.jsx)("div",{style:{marginBottom:7,display:G?"none":"block"},children:Object(C.jsx)(g,{orderSummaryBox:!0,value:y,onChange:t=>{M(t.target.value)},stepCount:60,onBlur:t=>{const e=Object(h.eb)(t.target.value,y);D(e)},text:u("PAYG"===o?"payment:paygCredits":"payment:monthlyCredits"),sideText:"PAYG"!==o&&b>0?"(".concat(u("payment:currentValue",{currentValue:60*b}),")"):null,infoTextId:"monthlyCreditsInfo",infoText:u("payment:monthlyCreditsInfo"),subtext:Z})}),"SUB"===o&&Object(C.jsx)(g,{orderSummaryBox:!0,value:O,onChange:t=>{V(t.target.value)},onBlur:t=>{let e=0;"number"!==typeof t.target.value&&"string"!==typeof t.target.value||(e=parseInt(t.target.value)),e<0&&(e=0),e>1e4&&(e=1e4),/^[1-9]\d*$/.test(e)?(V(e),L(e)):V(U)},sideText:"PAYG"!==o&&B>0?"(".concat(u("payment:currentValue",{currentValue:B}),")"):null,text:u("payment:teamSeats",{count:Object(h.F)(O)}),subtext:$})]}),(()=>{const{dueToday:t,nextInvoice:e}=J,n=tt(),r=(null===H||void 0===H?void 0:H.credits)>0?a?u("plans:plansV2Page.creditsAnnual",{credits:null===H||void 0===H?void 0:H.credits,totalCredits:12*((null===H||void 0===H?void 0:H.credits)||0)}):u("plans:plansV2Page.creditsPerMonth",{credits:null===H||void 0===H?void 0:H.credits}):null;return Object(C.jsx)("div",{className:"paymentStickyOrderSummaryCardContainer".concat(f?" invokedFromEditor":""),children:Object(C.jsxs)("div",{className:"paymentOrderSummaryCard",style:{marginBottom:14,marginTop:nt?14:0},children:[Object(C.jsxs)("div",{children:[Object(C.jsxs)("div",{className:"orderSummaryPriceText modalColumn totalDue",children:[u("payment:totalDueToday"),"\xa0",Object(C.jsx)("span",{children:T?u("payment:prorating"):Object(h.H)(t)})]}),e&&e>0&&t!==e?Object(C.jsxs)("div",{className:"paymentNextInvoiceTextContainer",children:[Object(C.jsx)("div",{className:"paymentSeperator",style:{margin:"7px 0px"}}),Object(C.jsxs)("div",{className:"modalColumn",children:[u("payment:nextInvoice")," ",Object(C.jsx)("span",{children:Object(h.H)(e)})]})]}):null,!nt&&r&&Object(C.jsx)("div",{className:"planRequirementInputSubtext requiredCreditsInfo",children:r})]}),Object(C.jsx)("div",{style:{marginTop:14},children:Object(C.jsx)(E.a,{text:null===n||void 0===n?void 0:n.buttonText,disabled:i||K||!((null===H||void 0===H?void 0:H.planName)!==(null===N||void 0===N?void 0:N.planName)||!(!N||"awaitcancel"!==N.status)||!(!U||U===B)||!(!F||F===b)||"PAYG"===o||a!==c)||W,onClick:()=>x(),isLoading:X})}),Object(C.jsxs)("div",{className:"paymentSecureContainer",children:[Object(C.jsx)(P,{className:"secureIcon"}),u("payment:secureText")]})]})})})(),"PAYG"===o&&Object(C.jsxs)("div",{className:"paymentOrderSummaryCard underStickyPayment",children:[Object(C.jsx)("div",{className:"callToSub",children:Object(C.jsx)(s.a,{components:{colored:Object(C.jsx)("span",{className:"referSubt
1itleText"})},children:u("payment:callToSub")})}),Object(C.jsx)("div",{className:"callToSub callToSubButton",onClick:R,children:u("payment:callToSubButton")})]}),"PAYG"!==o&&!Object(d.isEmpty)(H)&&et&&Object(C.jsxs)("div",{className:"paymentOrderSummaryCard underStickyPayment",children:[Object(C.jsx)("div",{className:"paymentSummaryPlanTitle",children:null===H||void 0===H?void 0:H.label}),Object(C.jsx)("div",{className:"baseSubtitle",children:u("plans:box.whatYouGet")}),Object(C.jsx)("ul",{children:et&&Object.keys(et).map((t=>{const e=et[t];if("includePrevPlan"===e.type){const t=A.b[null===e||void 0===e?void 0:e.text];return Object(C.jsxs)("li",{"data-tip":!0,"data-for":"tooltipPrevPlan",children:[Object(k.b)(e,"baseSubtitle primary",u,"primary"),Object(C.jsx)(v.a,{id:"tooltipPrevPlan",effect:"solid",children:Object.keys(t).map((t=>{var e,n;if(null!==A.c&&void 0!==A.c&&null!==(e=A.c[t])&&void 0!==e&&e.label)return Object(C.jsxs)("div",{children:[Object(C.jsx)(w.a,{}),null===A.c||void 0===A.c||null===(n=A.c[t])||void 0===n?void 0:n.label]})}))})]})}return!e.minutes&&"title"!==e.type&&"divider"!==e.type&&e.text?Object(C.jsx)("li",{children:Object(k.b)(e,"baseSubtitle primary",u)}):"divider"===e.type?Object(C.jsx)("li",{className:"planBoxV2Divider",children:e.text&&Object(C.jsx)("div",{className:"planBoxV2DividerText",children:e.text})}):e.minutes?Object(C.jsxs)("li",{className:"planBoxV2DetailItem",children:[Object(C.jsxs)("div",{className:"planBoxV2DetailItemText maxWidthCheckout",children:[Object(C.jsx)(w.a,{}),e.text]}),Object(C.jsxs)("div",{className:"planBoxV2DetailItemMinutes primaryBg",children:[e.minutes,Object(d.isNumber)(e.minutes)&&" ".concat(u("plans:mins/mo"))]})]}):void 0}))})]})]})}var M,R,B=n(1083),V=n(137);function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(null,arguments)}function L(t,e){let{title:n,titleId:r,...i}=t;return o.createElement("svg",U({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-credit-card",ref:e,"aria-labelledby":r},i),n?o.createElement("title",{id:r},n):null,M||(M=o.createElement("rect",{x:1,y:4,width:22,height:16,rx:2,ry:2})),R||(R=o.createElement("line",{x1:1,y1:10,x2:23,y2:10})))}const F=o.forwardRef(L);n.p,n(1112);function D(t){let{onClick:e,subscription:n,t:r}=t;const i=Object(S.j)(n),s=Object(S.i)(n);return Object(C.jsxs)("div",{className:"viewBillingInfo",children:[Object(C.jsx)("div",{className:"viewBillingInfoDescription",children:i}),Object(C.jsx)(V.a,{onClick:e,value:s,svg:Object(C.jsx)(F,{style:{height:20,width:"auto"}}),width:"100%"}),Object(C.jsx)("div",{className:"viewBillingInfoBottomText",children:r("credits:stripeBillingNewWindowInfo")})]})}var H=n(1095);function q(t){let{sourceInfo:e,t:n,subscription:r,pricingVersion:i,userCount:s,hourCount:a,purchaseType:c,isAnnual:u,currentIsAnnual:l,actualCurrentUserCount:d,currentHourCount:p,prorationObj:h,generateDynamicError:m,invalidTokenError:b,paymentRef:y,submit:v,reportError:j,email:O,theme:f,vatNumber:g,setVatNumber:x,vatCountryObj:T,setVatCountryObj:E,createCustomerPortalSession:I,planInfo:N,setPaymentInfoLoading:P}=t;Object(o.useEffect)((()=>{e&&P(!1)}),[e]);return e?Object(C.jsx)(D,{onClick:async()=>{try{const t=await I();if(!t)return void j(!1,new Error("No response received from createCustomerPortalSession."),"STRIPE_PORTAL_SESSION_ERROR");if(t.portalSessionUrl){const e=window.open(t.portalSessionUrl,"_blank","noopener,noreferrer");e&&(e.opener=null)}else m("No billing history found.")}catch(K){m("No billing history found."),j(!1,new Error("Error creating Stripe portal session."),"STRIPE_PORTAL_SESSION_ERROR")}},t:n,subscription:r}):Object(C.jsx)("div",{children:(()=>{const t=100*Object(S.c)(s,a,c,u,l,d,p,h,N,r,i).dueToday;return Object(C.jsx)(H.a,{mode:"PAYG"===c?"payment":"subscription",amount:t,generateDynamicError:m,invalidTokenError:b,paymentRef:y,submit:v,reportError:j,t:n,email:O,theme:f,vatNumber:g,setVatNumber:x,vatCountryObj:T,setVatCountryObj:E,setPaymentInfoLoading:P})})()})}var G=n(1097);n(1113);class z extends o.Component{constructor(t){var e,n,r,i,s,o,u,p;super(t),this.goBack=()=>{this.props.invokedFromEditor&&this.props.isOnboardingPlanSelected?(this.props.setIsOnboardingPlanSelected(!1),this.setState({planInfo:{}})):this.props.history&&this.props.history.goBack()},this.setVatNumber=t=>{this.setState({vatNumber:t})},this.setVatCountryObj=t=>{this.setState({vatCountryObj:t})},this.toggleIsAnnual=t=>{this.setState((e=>
1({isAnnual:t||!e.isAnnual})))},this.setHourCount=t=>{const e=this.state.prorationObj||{};if(!Object(d.isEmpty)(e))if("processing"===e);else{const{isAnnual:t,monthlyhours:n,useracc:r,...i}=e;Object(d.forOwn)(i,((t,n)=>{"monthlyhours"!==t.type&&"monthlyhours_annu"!==t.type||delete e[n]}))}const n=this.state.failedToCalculate&&!Object(d.isEmpty)(e);this.setState({prorationObj:e,hourCount:t,failedToCalculateProrate:n})},this.setUserCount=t=>{const e=this.state.prorationObj||{};if(!Object(d.isEmpty)(e))if("processing"===e);else{const{isAnnual:t,monthlyhours:n,useracc:r,...i}=e;Object(d.forOwn)(i,((t,n)=>{"useracc"!==t.type&&"useracc_annu"!==t.type||delete e[n]}))}const n=this.state.failedToCalculate&&!Object(d.isEmpty)(e);this.setState({prorationObj:e,userCount:t,failedToCalculateProrate:n})},this.updateMonthlyCredits=t=>{let e=Math.ceil(t/60);e>1e4&&(e=1e4);const n=60*e;/^[1-9]\d*$/.test(e)?(this.setState({inputMonthlyCredits:n}),this.setHourCount(e)):this.setState((t=>({inputMonthlyCredits:60*t.hourCount})))},this.handleModal=t=>{const e=t,n=!this.state[e];this.setState({[e]:n})},this.paymentComplete=t=>{try{const e=t.reduce(((t,e)=>t+e.amount_paid),0);this.props.track("PAYMENT_COMPLETE",{amount_paid:e}),l.a.event({category:"Payment Success",action:"payment capture",value:e}),this.props.trackPayment(e)}catch(K){this.props.reportError("",K,"TRACK_PAYMENT_COMPLETE_ERROR")}this.props.invokedFromEditor?this.props.orderIsComplete(t):this.props.history&&this.props.history.push({pathname:"/ordercomplete",state:{invoices:t,type:"success"}})},this.paymentFailed=()=>{this.props.invokedFromEditor?this.props.orderIsComplete():this.props.history&&this.props.history.push({pathname:"/ordercomplete",state:{type:"failed"}})},this.handle3DSecure=async t=>new Promise((async(e,n)=>{try{var r;const e=Object(c.a)(m.c),n=await e,i=await n.confirmPayment({clientSecret:t[0].pi,redirect:"if_required"});"succeeded"===(null===i||void 0===i||null===(r=i.paymentIntent)||void 0===r?void 0:r.status)?(Object(d.forEach)(t||[],(t=>{t.amount_paid=t.amount_due})),this.paymentComplete(t)):(i.error&&this.props.generateDynamicError("Failed to authenticate your payment method."),this.paymentFailed())}catch(K){n(K)}})),this.submit=async()=>{if(!this.state.paymentProcessing)try{var t,e;this.setState({paymentProcessing:!0});const m=Object(h.X)(this.props.invokedFromEditor);this.props.track("".concat(m,"PAYMENT_SUBMIT_CLICKED"));let b=!1;if(!this.props.sourceInfo&&(b=this.paymentRef&&await this.paymentRef.current.handleSubmit(),!b))return void this.props.generateDynamicError(this.props.t("errors:paymentInvalidInfo",{errorCode:"41.1"}));if((null===(t=this.state.vatNumber)||void 0===t?void 0:t.length)>0&&null!==(e=this.state.vatCountryObj)&&void 0!==e&&e.value){var n,r;var i,s;if(!Object(h.bb)(this.state.vatNumber,null===(n=this.state.vatCountryObj)||void 0===n?void 0:n.value,null===(r=this.state.vatCountryObj)||void 0===r?void 0:r.lancode))return void this.props.generateDynamicError(this.props.t("errors:paymentInvalidTaxId",{errorCode:"41.2",country:null===(i=this.state.vatCountryObj)||void 0===i?void 0:i.country,example:null===(s=this.state.vatCountryObj)||void 0===s?void 0:s.example}))}try{if("PAYG"===this.state.purchaseType){var o,a,c;const t=await this.props.chargePayg(b.id,this.state.hourCount,this.state.couponInput,this.state.vatNumber,null===(o=this.state.vatCountryObj)||void 0===o?void 0:o.value);null!==t&&void 0!==t&&null!==(a=t.invoices)&&void 0!==a&&null!==(c=a[0])&&void 0!==c&&c.pi?await this.handle3DSecure(t.invoices):this.paymentComplete(t.invoices)}else if("SUB"===this.state.purchaseType)if(0===this.state.userCount)this.props.generateDynamicError(this.props.t("errors:paymentAtLeastOneUser",{errorCode:"41.2"}));else{var u,l,d,p;const t=await this.props.chargeSubscription(b.id,this.state.userCount,this.state.hourCount,this.state.isAnnual,this.state.couponInput,this.state.vatNumber,null===(u=this.state.vatCountryObj)||void 0===u?void 0:u.value,null===(l=this.state.planInfo)||void 0===l?void 0:l.planName);null!==t&&void 0!==t&&null!==(d=t.invoices)&&void 0!==d&&null!==(p=d[0])&&void 0!==p&&p.pi?await this.handle3DSecure(t.invoices):this.paymentComplete(t.invoices)}else this.paymentFailed()}catch(K){this.paymentFailed()}}catch(K){this.props.reportError("",K,"CONFIRM_PAYMENT_ERROR")}finally{this.setState({paymentProcessing:!1})}},this.setPaymentInfoLoading=t=>{this.setState({paymentInfoLoading:t})}
1,this.getCreditCard=()=>Object(C.jsx)(q,{sourceInfo:this.props.sourceInfo,t:this.props.t,subscription:this.props.subscription,userCount:this.state.userCount,hourCount:this.state.hourCount,purchaseType:this.state.purchaseType,isAnnual:this.state.isAnnual,currentIsAnnual:this.state.currentIsAnnual,actualCurrentUserCount:this.state.actualCurrentUserCount,currentHourCount:this.state.currentHourCount,prorationObj:this.state.prorationObj,generateDynamicError:this.props.generateDynamicError,invalidTokenError:this.props.invalidTokenError,paymentRef:this.paymentRef,submit:this.submit,reportError:this.props.reportError,email:this.props.email,theme:this.props.theme,vatNumber:this.state.vatNumber,setVatNumber:this.setVatNumber,vatCountryObj:this.state.vatCountryObj,setVatCountryObj:this.setVatCountryObj,createCustomerPortalSession:this.props.createCustomerPortalSession,planInfo:this.state.planInfo,pricingVersion:this.props.pricingVersion,setPaymentInfoLoading:this.setPaymentInfoLoading}),this.setSubInterval=t=>{this.state.currentIsAnnual&&!t||this.setState({isAnnual:t})},this.getUpdateWithProration=async()=>{try{this.setState({prorationObj:"processing"}),this.setState({fetchingProration:!0,failedToCalculateProrate:!1});const t=this.state.hourCount,e=this.state.userCount,n=await this.props.getSubscriptionPreview(this.state.isAnnual,e,t);Object(d.isEmpty)(n)?this.setState({prorationObj:!1}):e===this.state.userCount&&this.state.hourCount===t&&this.setState({prorationObj:n})}catch(K){this.props.reportError("",K,"GET_PRORATION_ERROR"),this.setState({prorationObj:!1,failedToCalculateProrate:!0})}finally{this.setState({fetchingProration:!1})}},this.setInputMonthlyCredits=t=>{this.setState({inputMonthlyCredits:t})},this.setInputUserCount=t=>{this.setState({inputUserCount:t})},this.getDefaultProduct=()=>"lists"===this.props.editorType?"transcription":"caption"===this.props.editorType?"subtitle":"voiceover"===this.props.editorType?"voiceover":null,this.getUserEmailComponent=()=>{const{email:t,isAnonymous:e}=this.props;let n="";return n=t||(e?this.props.t("payment:anonymousSession"):this.props.t("payment:noUser")),Object(C.jsxs)("div",{className:"paymentAccountEmailContainer",children:[Object(C.jsxs)("div",{className:"paymentAccountEmailLabel",children:[this.props.t("payment:account"),":"]}),Object(C.jsx)("div",{className:"paymentAccountEmail",children:n})]})};const b=this.props.duration,v=null===t||void 0===t||null===(e=t.location)||void 0===e?void 0:e.state,j=(null===t||void 0===t||null===(n=t.subscription)||void 0===n?void 0:n.upcomingUserCount)||0,O=(null===t||void 0===t||null===(r=t.subscription)||void 0===r?void 0:r.seat_quantity)||0,f=(null===v||void 0===v?void 0:v.subSeats)||j||(null===t||void 0===t||null===(i=t.subscription)||void 0===i?void 0:i.seat_quantity)||0,g=Object(A.s)(null===t||void 0===t?void 0:t.subscription),x=g||("boolean"===typeof(null===v||void 0===v?void 0:v.subIsAnnual)?null===v||void 0===v?void 0:v.subIsAnnual:!(null!==t&&void 0!==t&&t.isOnboardingPlanSelected)&&2===(null===t||void 0===t?void 0:t.pricingVersion)),T=null!==(s=t.isOnboardingPlanSelected)&&void 0!==s&&s.planName?t.isOnboardingPlanSelected:(null===v||void 0===v?void 0:v.planInfo)||{},S=Y(t.isTiktokAuth,t.invokedFromEditor,T,t.subscription),{requiredHours:E,requiredCredits:I}=function(t,e,n,r){let i=0,s=0;if(t>0)s=t,i=Math.ceil(s/60);else if(e){const t=Math.ceil(e/60),o=n&&Object.keys(n).length>0?Object.keys(n).length-1:0;let a=0;"voiceover"===r&&(a=o>0?o:1);const c=0;s=Object(h.u)(!1,y.S.voiceCloning,!0,t,o,a,c),i=Math.ceil(s/60)}return{requiredHours:i,requiredCredits:s}}(null===t||void 0===t||null===(o=t.cost)||void 0===o?void 0:o.amount,b,this.props.languages,this.props.editorType),N=function(t,e,n,r,i){let s=t&&"PAYG"===e?i||1:(null===n||void 0===n?void 0:n.hour_quantity)||0;(null===r||void 0===r?void 0:r.subHours)>s&&(s=i>r.subHours?i:r.subHours);return s}(t.invokedFromEditor,S,null===t||void 0===t?void 0:t.subscription,v,E),P=(null===t||void 0===t||null===(u=t.subscription)||void 0===u?void 0:u.hour_quantity)||0,k="SUB"===S?E?N+E:N:1;var w;this.state={userCount:f||1,inputUserCount:f||1,hourCount:k,inputMonthlyCredits:60*k,costType:(null===t||void 0===t||null===(p=t.cost)||void 0===p?void 0:p.operationType)||!1,actualCurrentUserCount:O,requiredCredits:I,authModal:!1,currentUserCount:f,currentHourCount:P,currentIsAnnual:g,purchaseType:S,isAnnual
1:x,planInfo:T,selectedProduct:(null===v||void 0===v?void 0:v.selectedProduct)||(w=null===t||void 0===t?void 0:t.editorType,"voiceover"===w?A.e.VOICEOVER:"caption"===w?A.e.SUBTITLE:"lists"===w?A.e.TRANSCRIPTION:null)||A.e.SUBTITLE,vatNumber:"",vatCountryObj:{lancode:"noFlag"},paymentInfoLoading:!0},this.paymentRef=a.a.createRef()}componentDidMount(){if(this.props.user||Object(b.signInAnonymously)(),this.props.isAnonymous&&!this.state.authModal&&this.handleModal("authModal"),this.props.history){this.state.purchaseType||this.props.history.replace("/plans");const t=Object(h.E)(this.props.team,this.props.user);"PAYG"!==this.state.purchaseType&&t&&this.props.history.replace("/plans")}const t=Object(h.X)(this.props.invokedFromEditor);this.props.track("".concat(t,"VIEW_NEW_CHECKOUT_PAGE"))}componentDidUpdate(t,e){var n,r;if(Object(d.isEmpty)(t.subscription)&&!Object(d.isEmpty)(this.props.subscription)){const t={};this.props.subscription.seat_quantity&&(t.userCount=this.props.subscription.seat_quantity||0,t.currentUserCount=this.props.subscription.seat_quantity||0,t.actualCurrentUserCount=this.props.subscription.seat_quantity||0,t.inputUserCount=this.props.subscription.seat_quantity||0),this.props.subscription.hour_quantity&&(t.hourCount=this.props.subscription.hour_quantity||0,t.currentHourCount=this.props.subscription.hour_quantity||0,t.inputMonthlyCredits=60*this.props.subscription.hour_quantity||0);const e=Object(A.s)(this.props.subscription);t.currentIsAnnual=e,t.isAnnual=e||2===this.props.pricingVersion,Object(d.isEmpty)(t)||this.setState({...t})}if(Object(d.isEmpty)(this.props.subscription)||"SUB"!==this.state.purchaseType||(this.state.isAnnual!==e.isAnnual?this.getUpdateWithProration():this.state.currentIsAnnual?this.state.isAnnual&&(e.userCount&&e.userCount!==this.state.userCount&&this.state.userCount>this.state.currentUserCount&&this.getUpdateWithProration(),e.hourCount&&e.hourCount!==this.state.hourCount&&this.state.hourCount>this.state.currentHourCount&&this.getUpdateWithProration()):!this.state.isAnnual&&e.userCount!==this.state.userCount&&this.state.userCount>this.state.currentUserCount&&this.getUpdateWithProration()),null!==(n=this.props.isOnboardingPlanSelected)&&void 0!==n&&n.planName&&(null===(r=this.state.planInfo)||void 0===r||!r.planName)){const t=Y(this.props.isTiktokAuth,this.props.invokedFromEditor,this.props.isOnboardingPlanSelected,this.props.subscription);this.setState({planInfo:this.props.isOnboardingPlanSelected,inputMonthlyCredits:this.props.isOnboardingPlanSelected.credits,purchaseType:t})}!t.user&&this.props.user&&this.props.isAnonymous&&!this.state.authModal&&this.handleModal("authModal")}componentWillUnmount(){const t=Object(h.X)(this.props.invokedFromEditor);this.props.track("".concat(t,"LEAVE_NEW_CHECKOUT_PAGE"))}render(){var t,e,n,r;const i=Object(S.c)(this.state.userCount,this.state.hourCount,this.state.purchaseType,this.state.isAnnual,this.state.currentIsAnnual,this.state.actualCurrentUserCount,this.state.currentHourCount,this.state.prorationObj,this.state.planInfo,this.props.subscription,this.props.pricingVersion),s=this.getDefaultProduct();return Object(C.jsxs)("div",{className:"paymentContainer mobileContainer displayInitial noBottomNavbar",children:[this.props.invokedFromEditor&&!this.props.isOnboardingPlanSelected&&Object(C.jsx)(G.a,{isAnnual:this.state.isAnnual,toggleIsAnnual:this.toggleIsAnnual,t:this.props.t,handlePlanBoxClick:this.props.handlePlanBoxClick,invokedFromEditor:this.props.invokedFromEditor,defaultProduct:s,subscription:this.props.subscription,selectedProduct:this.state.selectedProduct,setSelectedProduct:this.setSelectedProduct,notAvailableFeature:this.props.notAvailableFeature,requiredCredits:this.state.requiredCredits,pricingVersion:this.props.pricingVersion}),(!this.props.invokedFromEditor||this.props.isOnboardingPlanSelected)&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("div",{className:!this.props.invokedFromEditor&&"plansV2GoBackButtonContainer",children:Object(C.jsx)(p.a,{goBack:this.goBack,text:this.props.invokedFromEditor&&this.props.t("payment:seeAllPlans")})}),Object(C.jsx)(B.a,{name:"authModal",isOpen:this.props.isAnonymous&&this.state.authModal,invokedFromEditor:!0}),Object(C.jsxs)("div",{className:"paymentContent",children:[Object(C.jsxs)("div",{className:"paymentColumn right",children:[Object(C.jsx)("div",{className:"paymentColumnTitle paymentColumnInner",children:this.props.t("payment:paymentInformationTitle")}),Object(C.jsx)("div",{className:"paymentColumnBorder"}),Object(C.jsxs)("div",{className:"paymentColumnInner content left",children:[this.getUserEmailComponent(),this.getCredit
1Card()]})]}),Object(C.jsxs)("div",{className:"paymentColumn orderSummary",children:[Object(C.jsx)("div",{className:"paymentColumnTitle paymentColumnInner",children:"PAYG"===this.state.purchaseType?this.props.t("payment:orderDetailsTitle"):this.props.t("payment:subscriptionOrderDetailsTitle")}),Object(C.jsx)("div",{className:"paymentColumnBorder"}),Object(C.jsx)("div",{className:"paymentColumnInner content right",children:Object(C.jsx)(_,{type:"desktop",paymentProcessing:this.state.paymentProcessing,purchaseType:this.state.purchaseType,isAnnual:this.state.isAnnual,currentIsAnnual:this.state.currentIsAnnual,t:this.props.t,costType:this.state.costType,requiredCredits:this.state.requiredCredits,editorType:this.props.editorType,currentHourCount:this.state.currentHourCount,inputMonthlyCredits:this.state.inputMonthlyCredits,inputUserCount:this.state.inputUserCount,invokedFromEditor:this.props.invokedFromEditor,submit:this.submit,fetchingProration:this.state.fetchingProration,invoiceObj:i,subscription:this.props.subscription,getCreditCard:this.getCreditCard,setSubInterval:this.setSubInterval,setInputMonthlyCredits:this.setInputMonthlyCredits,setInputUserCount:this.setInputUserCount,goBack:this.goBack,actualCurrentUserCount:this.state.actualCurrentUserCount,userCount:this.state.userCount,setUserCount:this.setUserCount,hourCount:this.state.hourCount,updateMonthlyCredits:this.updateMonthlyCredits,planInfo:this.state.planInfo,selectedProduct:this.state.selectedProduct,isTeamSeatPayment:null===(t=this.props.location)||void 0===t||null===(e=t.state)||void 0===e?void 0:e.isTeamSeatPayment,notAvailableFeature:this.props.notAvailableFeature,pricingVersion:this.props.pricingVersion,paymentInfoLoading:this.state.paymentInfoLoading})})]})]}),Object(C.jsx)(_,{type:"mobile",paymentProcessing:this.state.paymentProcessing,purchaseType:this.state.purchaseType,isAnnual:this.state.isAnnual,currentIsAnnual:this.state.currentIsAnnual,t:this.props.t,costType:this.state.costType,requiredCredits:this.state.requiredCredits,editorType:this.props.editorType,currentHourCount:this.state.currentHourCount,inputMonthlyCredits:this.state.inputMonthlyCredits,inputUserCount:this.state.inputUserCount,invokedFromEditor:this.props.invokedFromEditor,submit:this.submit,fetchingProration:this.state.fetchingProration,invoiceObj:i,subscription:this.props.subscription,getCreditCard:this.getCreditCard,setSubInterval:this.setSubInterval,setInputMonthlyCredits:this.setInputMonthlyCredits,setInputUserCount:this.setInputUserCount,goBack:this.goBack,actualCurrentUserCount:this.state.actualCurrentUserCount,userCount:this.state.userCount,setUserCount:this.setUserCount,hourCount:this.state.hourCount,updateMonthlyCredits:this.updateMonthlyCredits,planInfo:this.state.planInfo,selectedProduct:this.state.selectedProduct,isTeamSeatPayment:null===(n=this.props.location)||void 0===n||null===(r=n.state)||void 0===r?void 0:r.isTeamSeatPayment,notAvailableFeature:this.props.notAvailableFeature,pricingVersion:this.props.pricingVersion,paymentInfoLoading:this.state.paymentInfoLoading})]})]})}}function Y(t,e,n,r){return"payg"===(null===n||void 0===n?void 0:n.type)||t&&e?"PAYG":"subscription"!==(null===n||void 0===n?void 0:n.type)&&Object(d.isEmpty)(r)?e?"PAYG":null===n||void 0===n?void 0:n.purchaseType:"SUB"}var W=n(50),K=n(5),X=n(14),Z=n(140),$=n(139),J=n(91);e.default=Object(r.d)((function(t,e){return{user:t.auth.user,email:t.auth.email,payment:t.payment,isTiktokAuth:t.auth.isTiktokAuth,isAnonymous:Object(J.b)(t.auth),sourceInfo:t.payment.paymentShort,team:t.team,subscription:t.subscription,response:t.response,inform:t.inform,error:t.error,blurredBackground:t.blurredBackground,invokedFromEditor:e.invokedFromEditor,selectedPurpose:e.selectedPurpose,isPlansPage:e.isPlansPage,cost:e.cost,theme:t.theme,pricingVersion:t.auth.pricingVersion}}),(function(t){return Object(i.b)({...W,...K,...Z,...$,...X},t)}))(Object(s.d)(["payment","errors"])(z))}}]); 2//# sourceMappingURL=19.267aa8df.chunk.js.map
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.