PageSourceSearch

https://www.doctorscabin.com/static/js/57055.acb2bc6e.chunk.js

js doctorscabin.com collected 2026-09-25 09:35:34 UTC 14,132 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpurplehealth_whitelabel_20_0=self.webpackChunkpurplehealth_whitelabel_20_0||[]).push([[35192,57055,59457],{2954(e,t,s){s.r(t),s.d(t,{default:()=>g});var o=s(9950),a=s(10300),i=(s(76123),s(24006)),n=s(16243),r=s(59457),c=s(16339),l=s(27770),d=s(32898),h=s(34695),p=s(87568),u=s(50228),m=s(44414);const g=e=>{let{isOpen:t,toggleChat:s}=e;const g=(0,a.wA)(),[f,x]=(0,o.useState)("What can I do for you?"),[v,j]=(0,o.useState)(""),[b,_]=(0,o.useState)([]),[y,w]=(0,o.useState)(0);let I=(0,o.useRef)(null);const[N,C]=(0,o.useState)([]),[S,k]=(0,o.useState)(0),[O,P]=(0,o.useState)(null),[A,D]=(0,o.useState)(!1),[F,T]=(0,o.useState)(null),[E,W]=(0,o.useState)(!1),[V,H]=(0,o.useState)(null),[L,q]=(0,o.useState)(0),[z,B]=(0,o.useState)(""),[J,M]=(0,o.useState)({}),R=window.location.origin.toString(),[Y,G]=(0,o.useState)(!0),{siteId:K,siteName:Q,footerhospitalData:U,contactEmailId:X,googleReviewLink:Z}=(0,a.d4)(e=>e.site),{userId:$}=(0,a.d4)(e=>e.authentication),ee=U||[];(0,o.useEffect)(()=>{se(),te()},[]);const te=()=>{const e={method:"POST",body:JSON.stringify({functionName:"headerLinksDetails",siteId:K})};(0,i.apiCallingWithoutToken)(e).then(e=>{"1"===e.success?M(e.headerLinkContent):M({})})};(0,o.useEffect)(()=>{v.trim().length>1&&ie(0,24)},[v]);const se=async()=>{try{D(!0),await ae()}catch(e){console.error("Initialization error:",e),T("Failed to initialize chatbot.")}finally{D(!1)}},oe=e=>{var t;const s=document.createElement("p");s.textContent=e,s.className="msg",null===(t=I.current)||void 0===t||t.appendChild(s),I.current&&(I.current.scrollTop=I.current.scrollHeight)},ae=async()=>{try{const e={method:"POST",body:JSON.stringify({functionName:"groupService",siteId:K})},t=await(0,i.apiCallingWithoutToken)(e);if("1"===t.success&&t.service){const e=t.service.map(e=>e.serviceId.toString());_(e)}}catch(e){console.error("Error fetching doctor services:",e)}},ie=async(e,t,s,o)=>{D(!0),T(null),H(s),q(2);try{var a,r;const e=[{term:{site_id:K}},{term:{"section_type.keyword":"DOCTORBYHOSPITAL"}}];o&&e.push({term:{[o]:"1"}});const t=v.trim(),s={query:{function_score:{query:{bool:{should:[{multi_match:{query:t,type:"best_fields",fields:["search_field"],fuzziness:"AUTO"}},{match_phrase_prefix:{search_field:{query:t}}}],filter:{bool:{must:e}}}},functions:[{filter:{term:{"search_field.keyword":t.toLowerCase()}},weight:10}],boost_mode:"sum",score_mode:"max"}},sort:[{_script:{type:"number",order:"desc",script:{source:"\n            def exact = 0;\n            if (doc['search_field.keyword'].size() > 0 && \n                doc['search_field.keyword'].value.equalsIgnoreCase(params.query)) {\n              exact = 100;\n            }\n            return _score + exact;\n          ",params:{query:t}}}}]},c={index:(0,n.elasticLink)(),offset:0,max:24,searchBody:s},l=await(0,i.elasticSearchApicall)(c),d=(null===l||void 0===l||null===(a=l.result)||void 0===a||null===(r=a.hits)||void 0===r?void 0:r.hits)||[];d.length>0?(C(d),k(l.result.hits.total.value),G(!0)):(C([]),k(0),G(!1))}catch(c){console.error("Error fetching doctors:",c),T("Failed to fetch doctor data. Please try again.")}finally{D(!1)}},ne=()=>{let e=!0;return $||d.authHelper.isAuthenticated()||((0,l.A)("#ForgotPasswordWrap").hide(),(0,l.A)("#SignupWrap").hide(),(0,l.A)("#signInWrapDiv").hide(),e=!1),e};(0,o.useEffect)(()=>{E||z||q(0)},[E,z]);const re=(e,t,s,o)=>{(0,l.A)(".loader").show();const a={method:"POST",body:JSON.stringify({functionName:"messageChatFree",chatDoctorPanelId:s,memberId:$,doctorId:e,hospitalId:t})};(0,i.apiCallingWithoutToken)(a).then(a=>{"1"===a.success?(g((0,p.setCommunicationDetails)({apiKey:a.API_KEY,sessionId:a.sessionId,token:a.token,appDocId:e,appHosId:t,chatDoctorPanelId:a.chatGroupId})),window.location.href="/chat/chatmessage"):re(e,t,s,o)})},ce=(e,t,s,o,a)=>{var i,n,r,c;H(s),"m"===s?b.messaging_cost>0?(i=b.section_id,n=b.hospital_id,r=b.chatdoctorpanelid,c=b.messaging_cost,!0===ne()?(g((0,h.setAppointmentDetails)({doctorId:i,hospitalId:n,flagOption:V,chatDoctorPanelId:r,messaging_cost:c,appDocId:i,appHosId:n})),window.location.href="/patient/textchatpayment"):(g((0,u.setPostLoginAction)("TextChatPay")),g((0,h.setAppointmentDetails)({doctorId:i,hospitalId:n,flagOption:V,chatDoctorPanelId:r,messaging_cost:c,loginValidate:"TextChatPay",appDocId:i,appHosId:n})),(0,l.A)("#ForgotPasswordWrap").hide(),(0,l.A)("#SignupWrap").hide(),(0,l.A)("#signInWrapDiv").show())):((e,t,s,o)=>{!0===ne()?re(e,t,s,o):(g((0,u.setPostLoginAction)("TextChatFree")),g((0,h.setAppointmentDetails)({doctorId:e,hospitalId:t,chatDoctorPanelId:s,loginValidate:"TextChatFree",appDocId:e,appHosId:t})),(0,l.A)("#ForgotPasswordWrap").hide(),(0,l.A)("#SignupWrap").hide(),(0,l.A)("#signInWrapDiv").show())})(b.section_id,b.hospital_id,b.chatdoctorpanelid,b.messaging_cost):((e,t,s,o,a)=>{let i=a.slug+" ";i=i.toString(),i=i.split("|").join("-"),i=i.split(" ").join("-"),i=i.split(" ").join("-"),i=i.split(".-").join("."),i=i.split("--").join("-"),i=i.slice(0,-1)+"",!0===ne()?(g((0,u.setPostLoginAction)("book")),g((0,h.setAppointmentDetails)({doctorId:e,hospitalId:t,flagOption:V,loginValidate:"book",IDASlug:i,appDocId:e,appHosId:t})),"1"==K?i&&(window.location.href="/Doctor-"+i):window.location.href="/patient/bookappointment"):(g((0,u.setPostLoginAction)("book")),g((0,h.setAppointmentDetails)({doctorId:e,hospitalId:t,flagOption:V,loginValidate:"book",IDASlug:i,appDocId:e,appHosId:t})),(0,l.A)("#ForgotPasswordWrap").hide(),(0,l.A)("#SignupWrap").hide(),(0,l.A)("#signInWrapDiv").show())})(b.section_id,b.hospital_id,0,0,a)};return(0,m.jsxs)("div",{className:"chatbot-parent",children:[(0,m.jsx)("div",{className:"chatbot-desc",children:t?(0,m.jsx)("div",{className:"chatbot-close  chat-position",onClick:s,children:(0,m.jsx)(c.yGN,{})}):(0,m.jsx)("img",{onClick:s,title:"Medical Chatbot",src:r,alt:"Chatbot Icon",width:50,height:50,className:"img-fluid chat-box-icon chat-position"})}),t&&(0,m.jsxs)("div",{className:"chatbot-window",children:[(0,m.jsxs)("div",{className:"chatbot-header",children:[L?(0,m.jsx)(c.YPh,{onClick:()=>{return e=1,B(""),void(L-e===0?(q(1),W(!1)):L-e===1?(q(1),W(!1),P(null),k(0),C([]),I.current&&(I.current.innerHTML="")):L-e===2?(q(2),W(!0),P(null),k(0),C([]),I.current&&(I.current.innerHTML="")):L-e===3&&(q(2),C([]),P(null),I.current&&(I.current.innerHTML="")));var e},className:"back-button"}):"",(0,m.jsx)(c.q_G,{onClick:s,className:"ml-auto"})]}),E||z?"":(0,m.jsxs)("div",{className:"welcome-message",children:[(0,m.jsxs)("h2",{children:["Welcome to ",Q]}),(0,m.jsx)("h3",{className:"mt-1",children:"How Can We Assist You?"}),(0,m.jsxs)("div",{className:"welcome-btns mt-3",children:[(0,m.jsx)("button",{onClick:()=>{W(!0),q(1)},children:"Book Appointment"}),(0,m.jsx)("button",{onClick:()=>{window.location.href="/HealthInfo"},children:"Blog"}),Z?(0,m.jsx)("button",{onClick:()=>{window.open(Z,"_blank")},children:"Reviews"}):"",1!=K&&(null===ee||void 0===ee?void 0:ee.map(e=>{let t=e.phone;return t?(0,m.jsx)("button",{onClick:()=>(e=>{q(1),B(e)})(t),children:"Contact Us"}):null})),J.length&&(null===J||void 0===J?void 0:J.filter(e=>!0===e.isActive).map(e=>{var t;return"faq"===(null===e||void 0===e||null===(t=e.url)||void 0===t?void 0:t.split("-")[0])?(0,m.jsx)("button",{onClick:()=>window.location.href="".concat(R,"/").concat(e.url),children:e.headerlinkName},e.url):null}))]})]}),z&&(0,m.jsx)("div",{className:"welcome-message",children:""!=X||z?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h2",{children:"Find As Here"}),z?(0,m.jsxs)("span",{className:"searchServiceIcon",title:"Click To Call",children:[(0,m.jsx)(c.PCV,{}),(0,m.jsx)("div",{className:"searchServic-text",children:(0,m.jsxs)("a",{href:"tel:".concat(z),children:[" ",z]})})]}):"",X&&""!=X?(0,m.jsxs)("span",{className:"searchServiceIcon",title:"Click To Mail",children:[(0,m.jsx)(c.pHD,{}),(0,m.jsx)("div",{className:"searchServic-text",children:(0,m.jsx)("a",{href:"mailto:".concat(X),children:X})})]}):""]}):""},z),!O&&E?(0,m.jsxs)("div",{className:"welcome-message",children:[E&&!O?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("span",{onClick:()=>ie(b.section_id,b.hospital_id,"p","ishosonline"),title:"Book Appointment",className:"searchServiceIcon",children:[(0,m.jsx)(c.JXP,{}),"  Inperson Appoinment",(0,m.jsx)(c.dyV,{className:"ml-auto"})]}),1!=K&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("span",{title:"Video Chat",onClick:()=>ie(b.section_id,b.hospital_id,"v","is_video_enabled"),className:"searchServiceIcon",children:[(0,m.jsx)(c.pVQ,{})," Video Appoinment",(0,m.jsx)(c.dyV,{className:"ml-auto"})]}),(0,m.jsxs)("span",{title:"Call A Doctor",onClick:()=>ie(b.section_id,b.hospital_id,"c","is_call_enabled"),className:"searchServiceIcon",children:[(0,m.jsx)(c.wnV,{})," Audio Call",(0,m.jsx)(c.dyV,{className:"ml-auto"})]}),(0,m.jsxs)("span",{onClick:()=>ie(b.section_id,b.hospital_id,"m","is_chat_enabled"),title:"Doctor Chat",className:"searchServiceIcon",children:[(0,m.jsx)(c.mEP,{})," Text Chat",(0,m.jsx)(c.dyV,{className:"ml-auto"})]})]})]}):"",!Y&&v.length>0&&(0,m.jsx)("p",{children:"No doctors available for the criteria."}),null===O&&N.length>0&&E&&(0,m.jsxs)("div",{className:"search-results-dropdown",children:[(0,m.jsx)("input",{type:"text",className:"chatbot-search",placeholder:"Search doctor...",value:v,onCh
1ange:e=>j(e.target.value)}),N.map(e=>{const t=e._source;return(0,m.jsxs)("div",{className:"search-result-item",title:"Click To Select",onClick:()=>{return P(e=t),q(3),oe("Selected Doctor: ".concat(e.section_name)),C([]),void _(e);var e},children:[t.section_name," - ",t.sub_section_name]},t.section_id)})]})]}):"",b&&O?(0,m.jsxs)("div",{className:"chatbox-select-div",children:["1"===b.ishosonline&&O?(0,m.jsxs)("span",{title:"Inperson ",onClick:e=>ce(b.section_id,b.hospital_id,"p",0,O),className:"searchServiceIcon ".concat("p"===V?"text-danger":""),children:[(0,m.jsx)(c.JXP,{}),"Inperson | ",(0,m.jsxs)("span",{className:"search-bold",children:[" ","0.00"!==parseFloat(b.consultation_price).toFixed(2)?"\u20b9 "+parseFloat(b.consultation_price).toFixed(2):"Free"]}),(0,m.jsx)(c.fNe,{className:"ml-auto"})]}):"","1"===b.is_video_enabled&&O?(0,m.jsxs)("span",{title:"Video Chat",onClick:e=>ce(b.section_id,b.hospital_id,"v"),className:"searchServiceIcon ".concat("v"===V?"text-danger":""),children:[(0,m.jsx)(c.pVQ,{}),"Video | ",(0,m.jsxs)("span",{className:"search-bold",children:[" ","0.00"!==parseFloat(b.rate_per_session).toFixed(2)?"\u20b9 "+parseFloat(b.rate_per_session).toFixed(2):"Free"]}),(0,m.jsx)(c.fNe,{className:"ml-auto"})]}):"","1"===b.is_call_enabled&&O?(0,m.jsxs)("span",{title:"Call A Doctor",onClick:e=>ce(b.section_id,b.hospital_id,"c"),className:"searchServiceIcon ".concat("c"===V?"text-danger":""),children:[(0,m.jsx)(c.wnV,{}),"Audio  | ",(0,m.jsxs)("span",{className:"search-bold",children:[" ","0.00"!=parseFloat(b.phone_consult_price).toFixed(2)?"\u20b9 "+parseFloat(b.phone_consult_price).toFixed(2):"Free"]}),(0,m.jsx)(c.fNe,{className:"ml-auto"})]}):"","1"===b.is_chat_enabled&&O?(0,m.jsxs)("span",{onClick:e=>ce(b.section_id,b.hospital_id,"m"),title:"Doctor Chat",className:"searchServiceIcon ".concat("m"===V?"text-danger":""),children:[(0,m.jsx)(c.mEP,{}),"Text Chat |  ",(0,m.jsx)("span",{className:"search-bold",children:"0.00"!=parseFloat(b.messaging_cost).toFixed(2)?"\u20b9 "+parseFloat(b.messaging_cost).toFixed(2):"Free"}),(0,m.jsx)(c.fNe,{className:"ml-auto",onClick:e=>{}})]}):""]}):"",O?(0,m.jsxs)("div",{className:"chatbot-messages",children:["Selected Doctor :",O.section_name]},O):"",F&&(0,m.jsx)("p",{className:"error-message",children:F})]})]})}},59457(e,t,s){e.exports=s.p+"static/media/botimg.96b9a7796b59b79c944c.png"},35192(e,t,s){s.d(t,{k5:()=>u});var o=s(9950),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},i=o.createContext&&o.createContext(a),n=["attr","size","title"];function r(e,t){if(null==e)return{};var s,o,a=function(e,t){if(null==e)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;s[o]=e[o]}return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],t.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(a[s]=e[s])}return a}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o])}return e},c.apply(this,arguments)}function l(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,o)}return s}function d(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?l(Object(s),!0).forEach(function(t){h(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function h(e,t,s){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var o=s.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function p(e){return e&&e.map((e,t)=>o.createElement(e.tag,d({key:t},e.attr),p(e.child)))}function u(e){return t=>o.createElement(m,c({attr:d({},e.attr)},t),p(e.child))}function m(e){var t=t=>{var s,{attr:a,size:i,title:l}=e,h=r(e,n),p=i||t.size||"1em";return t.className&&(s=t.className),e.className&&(s=(s?s+" ":"")+e.className),o.createElement("svg",c({stroke:"currentColor",fill:"
1currentColor",strokeWidth:"0"},t.attr,a,h,{className:s,style:d(d({color:e.color||t.color},t.style),e.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),l&&o.createElement("title",null,l),e.children)};return void 0!==i?o.createElement(i.Consumer,null,e=>t(e)):t(a)}}}]);

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.