(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3140],{7714:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clinic_register",function(){return a(107)}])},4293:function(e,t,a){"use strict";a.d(t,{K:function(){return r}});let i={directory:["Full portal access for one doctor","Access to bookings, patient chat, and e-consultations","Access to patient history and consultation notes","Secure video consultations","Unlimited appointments – no cap on usage","Flexible scheduling tools","Automated appointment reminders for patients","20% service charge per successful appointment"],basic:["Access to all Virtual Triage features","One practitioner profile included","Patient records and consultation history saved automatically","Secure video consultations and encrypted chat","Unlimited appointments – no restrictions","Advanced appointment management","Automated reminders and follow-up tools","3–5% service charge per appointment (lower service charge)"],clinic:["Dedicated clinic portal for multi-doctor practices","Ability to add upto 5 practitioners under one account","Centralized dashboard to manage all appointments in one place","Advanced clinic scheduling system for multiple doctors","Access to all Virtual Triage features for every practitioner","Unlimited appointments across the entire clinic","Shared patient records and clinic-wide history tracking","Secure, HIPAA/GDPR-compliant video consultations","Automated reminders and notifications for patients","Optimized for high patient volume clinics"]},r=e=>{if(e.includes("Directory"))return i.directory;if(e.includes("Basic"));else if(e.includes("Clinic"))return i.clinic;return i.basic}},107:function(e,t,a){"use strict";a.r(t);var i=a(5893),r=a(7294),n=a(7555),s=a.n(n),o=a(6455),l=a.n(o),c=a(5346),d=a(1163);a(1376);var p=a(4293);t.default=function(){let e=(0,d.useRouter)(),[t,a]=(0,r.useState)(null),[n,o]=(0,r.useState)(!0),[u,m]=(0,r.useState)("password"),[h,g]=(0,r.useState)(""),[f,x]=(0,r.useState)({hasLow:!1,hasCap:!1,hasNumber:!1,hasSpecial:!1,isMinLength:!1}),[y,v]=(0,r.useState)(""),[j,w]=(0,r.useState)(""),[k,N]=(0,r.useState)(""),[b,S]=(0,r.useState)(""),[C,P]=(0,r.useState)(""),[A,_]=(0,r.useState)(!1),[E,q]=(0,r.useState)(""),[I,D]=(0,r.useState)("");(0,r.useEffect)(()=>{D(new Date().toISOString()),(async()=>{try{let e=await fetch("https://api.ipify.org?format=json"),t=await e.json();(null==t?void 0:t.ip)&&q(t.ip)}catch(e){console.error("IP fetch failed",e)}})()},[]),(0,r.useEffect)(()=>{let e=document.createElement("script");return e.src="https://js.stripe.com/v3/",e.async=!0,e.onload=()=>{},e.onerror=()=>{console.error("Failed to load Stripe script")},document.head.appendChild(e),()=>{let e=document.querySelector('script[src="https://js.stripe.com/v3/"]');e&&document.head.removeChild(e)}},[]),(0,r.useEffect)(()=>{var t;(null===(t=e.query)||void 0===t?void 0:t.packageDetails)&&a({id:e.query.packageDetails,name:e.query.packageName,price:e.query.packagePrice,description:e.query.packageDescription}),o(!1)},[]);let L=()=>f.hasLow&&f.hasCap&&f.hasNumber&&f.hasSpecial&&f.isMinLength,T=()=>""!==y.trim()&&""!==j.trim()&&""!==k.trim()&&""!==b.trim()&&""!==h.trim()&&L()&&""!==C.trim()&&null!==t&&A,B=async e=>{e.preventDefault();let a=new Date().toISOString();if(D(a),!L()){l().fire({icon:"error",title:"Invalid Password",html:'\n <p style="text-align: left; margin-bottom: 10px;">Your password must meet all of the following requirements:</p>\n <ul style="text-align: left; margin: 10px 0; padding-left: 20px;">\n <li style="margin-bottom: 5px;">At least 8 characters long</li>\n <li style="margin-bottom: 5px;">At least one lowercase letter (a-z)</li>\n <li style="margin-bottom: 5px;">At least one uppercase letter (A-Z)</li>\n <li style="margin-bottom: 5px;">At least one number (0-9)</li>\n <li style="margin-bottom: 5px;">At least one special character (!@#$%^&*(),.?":{}|<>)</li>\n </ul>\n '});return}if(!t||!t.id){l().fire({icon:"error",title:"Package Not Selected",text:"Please select a package before proceeding to payment."});return}localStorage.setItem("clinicFormData",JSON.stringify({clinicName:y,email:j,phone:b,password:h,country:C}));try{if(!window.Stripe)throw Error("Stripe not loaded yet");if("function"!=typeof window.Stripe)throw Error("Stripe is not properly loaded");let e=window.Stripe("pk_live_51MkDNUKx0rXRL6v7CPCCeukNvoyvRBJJC8igLsmC1wR3BN4qx9BrAZ6VnZiy7Hqg0E3m4jg0esk8qFejT5HMRN3h00CCt4iMlG");if(!e||"function"!=typeof e.redirectToCheckout)throw Error("Stripe object not properly initialized");if(!t.id||"string"!=typeof t.id)throw Error("Invalid package configuration");let i={accepted_at_client:a,ip_address:E,user_agent:navigator.userAgent,terms_version:"v1.0",role:"clinic"};localStorage.setItem("clinic_terms_acceptance",JSON.stringify(i));let{error:r}=await e.redirectToCheckout({lineItems:[{price:t.id,quantity:1}],mode:"subscription",successUrl:window.location.origin+"/clinic-signup-success",cancelUrl:window.location.origin+"/clinic_register",...j&&{customerEmail:j}});if(r){if(console.error("Stripe checkout error:",r),"card_error"===r.type||"validation_error"===r.type)throw Error(r.message);if("api_error"===r.type)throw Error("Payment system error. Please try again later.");if("authentication_error"===r.type)throw Error("Payment authentication failed. Please contact support.");if("integration_error"===r.type)throw Error("Payment integration error. Please contact support.");else throw Error(r.message||"Payment failed. Please try again.")}}catch(t){console.error("❌ Error creating checkout session:",t);let e="Failed to initiate checkout. Please try again.";t.message&&(e=t.message.includes("Invalid price")?"Invalid package selected. Please try again.":t.message.includes("Invalid email")?"Please enter a valid email address.":t.message.includes("Stripe not loaded")?"Payment system is loading. Please wait a moment and try again.":t.message.includes("authentication")?"Payment system authentication error. Please contact support.":t.message.includes("401")||t.message.includes("Unauthorized")?"Payment system configuration error. Please contact support.":t.message.includes("IntegrationError")||t.message.includes("integration")?"Payment integration error. Please contact support.":t.message),l().fire({icon:"error",title:"Checkout Error",text:e})}};return n?(0,i.jsx)("div",{className:"signup-page",children:(0,i.jsx)("div",{className:"signup-container",children:(0,i.jsx)("div",{className:"package-loading",children:(0,i.jsx)("h3",{children:"Loading package details..."})})})}):(0,i.jsx)("div",{className:"signup-page",children:(0,i.jsxs)("div",{className:"signup-container",children:[(0,i.jsxs)("div",{className:"package-details-section",children:[(0,i.jsxs)("div",{className:"package-header",children:[(0,i.jsx)("img",{src:"https://virtualtraige.nyc3.cdn.digitaloceanspaces.com/Logo.jpg",alt:"Virtual Triage",className:"package-logo"}),(0,i.jsx)("h2",{className:"package-title",children:"Chosen Plan"}),(0,i.jsx)("p",{className:"package-subtitle",children:"Join Virtual Triage to streamline your clinic's patient management and provide better healthcare services."})]}),(0,i.jsx)("div",{className:"package-cards",children:t?(0,i.jsxs)("div",{className:"package-card selected",children:[(0,i.jsxs)("div",{className:"package-card-header",children:[(0,i.jsx)("h3",{className:"package-name",children:t.name}),(0,i.jsxs)("div",{className:"package-price",children:[(0,i.jsxs)("span",{className:"price-amount",children:["\xa3",t.price]}),(0,i.jsxs)("div",{className:"price-period",children:["/",t.price>998?"year":"month"]})]})]}),(0,i.jsx)("p",{className:"package-description",children:t.description||"Complete clinic management solution with patient scheduling, virtual consultations, and administrative tools."}),(0,i.jsx)("ul",{className:"package-features",children:(0,p.K)(t.name).map((e,t)=>(0,i.jsxs)("li",{children:[(0,i.jsx)(c.FJM,{className:"package-feature-icon"})," ",e]},t))})]}):(0,i.jsxs)("div",{className:"package-loading",children:[(0,i.jsx)("h3",{children:"Package details not available"}),(0,i.jsx)("p",{children:"Please select a package from the pricing page."})]})})]}),(0,i.jsx)("div",{className:"signup-form-section",children:(0,i.jsxs)("div",{className:"form-container",children:[(0,i.jsx)("h3",{className:"form-title",children:"Create Clinic Account"}),(0,i.jsx)("p",{className:"form-subtitle",children:"Enter your clinic details to get started with Virtual Triage"}),(0,i.jsxs)("form",{children:[(0,i.jsxs)("div",{className:"inputBox",children:[(0,i.jsx)("input",{className:"input-field",type:"text",name:"ClinicName",placeholder:"Enter Your Clinic Name",value:y,onChange:e=>v(e.target.value),required:!0}),(0,i.jsx)("input",{className:"input-field",type:"email",name:"Email",placeholder:"Enter Your Email",value:j,onChange:e=>w(e.target.value),required:!0}),(0,i.jsx)("input",{className:"input-field",type:"text",name:"Address",placeholder:"Enter Your Address",value:k,onChange:e=>N(e.target.value),required:!0}),(0,i.jsx)(s(),{country:"us",value:b,onChange:e=>S(e),inputStyle:{width:"100%"},inputProps:{name:"phone",required:!0}}),(0,i.jsxs)("div",{className:"input-group",children:[(0,i.jsx)("input",{className:"input-field",type:u,onChange:e=>{g(e.target.value),x({hasLow:/[a-z]/.test(e.target.value),hasCap:/[A-Z]/.test(e.target.value),hasNumber:/\d/.test(e.target.value),hasSpecial:/[!@#$%^&*(),.?":{}|<>]/.test(e.target.value),isMinLength:e.target.value.length>=8})},value:h,name:"password",placeholder:"Password",required:!0}),(0,i.jsx)("button",{type:"button",className:"eyebtn",onClick:()=>{m("password"===u?"text":"password")},"aria-label":"password"===u?"Show password":"Hide password",children:"password"===u?(0,i.jsx)(c.tgn,{}):(0,i.jsx)(c.dSq,{})})]}),h&&(0,i.jsxs)("div",{className:"password-requirements",style:{marginTop:"8px",padding:"12px",backgroundColor:"#f8f9fa",borderRadius:"8px",fontSize:"13px",textAlign:"left"},children:[(0,i.jsx)("p",{style:{margin:"0 0 8px 0",fontWeight:"600",color:"#333"},children:"Password Requirements:"}),(0,i.jsxs)("ul",{style:{margin:"0",paddingLeft:"20px",listStyle:"none"},children:[(0,i.jsxs)("li",{style:{color:f.isMinLength?"#28a745":"#dc3545",marginBottom:"4px"},children:[f.isMinLength?"✓":"✗"," At least 8 characters"]}),(0,i.jsxs)("li",{style:{color:f.hasLow?"#28a745":"#dc3545",marginBottom:"4px"},children:[f.hasLow?"✓":"✗"," At least one lowercase letter"]}),(0,i.jsxs)("li",{style:{color:f.hasCap?"#28a745":"#dc3545",marginBottom:"4px"},children:[f.hasCap?"✓":"✗"," At least one uppercase letter"]}),(0,i.jsxs)("li",{style:{color:f.hasNumber?"#28a745":"#dc3545",marginBottom:"4px"},children:[f.hasNumber?"✓":"✗"," At least one number"]}),(0,i.jsxs)("li",{style:{color:f.hasSpecial?"#28a745":"#dc3545",marginBottom:"4px"},children:[f.hasSpecial?"✓":"✗",' At least one special character (!@#$%^&*(),.?":',"|<>)"]})]})]}),(0,i.jsxs)("select",{className:"form-select",value:C,onChange:e=>P(e.target.value),required:!0,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:"Select Country"}),(0,i.jsx)("option",{value:"United Kingdom",children:"United Kingdom"}),(0,i.jsx)("option",{value:"Canada",children:"Canada"}),(0,i.jsx)("option",{value:"United States",children:"United States"}),(0,i.jsx)("option",{value:"Pakistan",children:"Pakistan"})]})]}),(0,i.jsx)("div",{className:"terms-checkbox-container",style:{marginTop:"20px",marginBottom:"20px"},children:(0,i.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",cursor:"pointer",fontSize:"14px",color:"#333"},children:[(0,i.jsx)("input",{type:"checkbox",checked:A,onChange:e=>_(e.target.checked),required:!0,style:{marginRight:"10px",marginTop:"3px",cursor:"pointer"}}),(0,i.jsxs)("span",{style:{textAlign:"left"},children:["I confirm that I have read, understood and agree to the"," ",(0,i.jsx)("a",{href:"/terms-and-conditions",target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:"Terms & Conditions"}),","," ",(0,i.jsx)("a",{href:"/privacy-notice",target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:"Privacy Notice"}),","," ",(0,i.jsx)("a",{href:"/cookie-policy",target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:"Cookie Policy"}),", and"," ",(0,i.jsx)("a",{href:"/clinician-provider-agreement",target:"_blank",rel:"noopener noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:"Clinician Provider Agreement"}),", and that I am legally authorised and appropriately insured to provide clinical services."]})]})}),(0,i.jsx)("div",{className:"text-center",children:(0,i.jsx)("button",{type:"button",className:"submit-button ".concat(T()?"":"disabled"),onClick:B,disabled:!T(),children:"Proceed to Checkout"})})]})]})})]})})}}},function(e){e.O(0,[8166,7555,2888,9774,179],function(){return e(e.s=7714)}),_N_E=e.O()}]);