PageSourceSearch

https://technoguru.in/_next/static/chunks/5564.fadf6a3c5bcb35d8.js

js technoguru.in collected 2026-10-08 07:11:14 UTC 8,741 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5564],{18085:(e,t,a)=>{a.d(t,{A:()=>r});let r=(0,a(71847).A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},55564:(e,t,a)=>{a.r(t),a.d(t,{AiLauncher:()=>p});var r=a(95155),s=a(12115),n=a(95740),o=a(65229),i=a(18085);let l="tg-ai-thread",c=["What does TechnoGuru do?","Do you work in my city?","How do you cost a project?","What's an AMC?","Show me your reference projects"],d={role:"assistant",content:"Hello — I'm the TechnoGuru assistant. I can help with questions on automation, AV, ELV, BMS, AMC, brand selection, NBC/IS compliance, our process and our reach. What can I help you with?"};function p(){let[e,t]=(0,s.useState)(!1),[a,p]=(0,s.useState)(""),[u,h]=(0,s.useState)(!1),[x,m]=(0,s.useState)([d]),[b,f]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),k=(0,s.useRef)(null),w=(0,s.useRef)(null),j=(0,s.useRef)(null),v=(0,s.useRef)(null);async function N(e){if(!e.trim()||u)return;let t=[...x,{role:"user",content:e}];m(t),p(""),h(!0),f("");try{let e=await fetch("/api/ai?stream=1",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t,pageUrl:window.location.pathname})});if(!e.ok||!e.body)throw Error("AI not available");let a=e.body.getReader(),r=new TextDecoder,s="",n="",o=!1;for(;!o;){let{value:e,done:t}=await a.read();if(t)break;let i=(s+=r.decode(e,{stream:!0})).split("\n");for(let e of(s=i.pop()||"",i)){if(!e.startsWith("data:"))continue;let t=e.slice(5).trim();if(t)try{let e=JSON.parse(t);if(e.delta&&(n+=e.delta,f(n)),e.done){o=!0;break}}catch(e){}}}let i=n.trim()||"I can't reach my reasoning layer right now. For an immediate response, write to [email protected] or use WhatsApp at +91 88110 34444 — we reply within two working days.";m(e=>[...e,{role:"assistant",content:i}]),f("")}catch(e){m(e=>[...e,{role:"assistant",content:"I can't connect to the assistant right now. For an immediate response, write to [email protected] or use WhatsApp at +91 88110 34444 — we reply within two working days."}]),f("")}finally{h(!1)}}return(0,s.useEffect)(()=>{let e=setTimeout(()=>y(!0),2200);return()=>clearTimeout(e)},[]),(0,s.useEffect)(()=>{try{let e=sessionStorage.getItem(l);if(e){let t=JSON.parse(e);Array.isArray(t)&&t.length&&m(t)}}catch(e){}},[]),(0,s.useEffect)(()=>{try{sessionStorage.setItem(l,JSON.stringify(x))}catch(e){}},[x]),(0,s.useEffect)(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[x,b]),(0,s.useEffect)(()=>{var t;if(e){let e=setTimeout(()=>{var e;return null==(e=j.current)?void 0:e.focus()},50);return()=>clearTimeout(e)}null==(t=v.current)||t.focus()},[e]),(0,s.useEffect)(()=>{if(e)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a);function a(e){if("Escape"===e.key){e.preventDefault(),t(!1);return}if("Tab"===e.key&&w.current){let t=w.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;let a=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===a?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),a.focus())}}},[e]),(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsxs)("button",{ref:v,type:"button",onClick:()=>t(!0),"aria-label":"Ask TechnoGuru — open the AI assistant","aria-expanded":e,"aria-haspopup":"dialog",className:"fixed bottom-6 right-6 z-[60] hidden h-14 items-center gap-2.5 rounded-full border border-gold-400/55 bg-paper-0/90 px-5 text-gold-300 shadow-[0_15px_30px_-8px_rgba(0,0,0,0.5)] backdrop-blur transition hover:border-gold-300 hover:bg-paper-0 sm:flex",children:[(0,r.jsx)(n.A,{className:"h-4 w-4","aria-hidden":!0}),(0,r.jsx)("span",{className:"text-[13px] font-medium uppercase tracking-[0.22em]",children:"Ask TechnoGuru"})]}),g&&(0,r.jsx)("button",{type:"button",onClick:()=>t(!0),"aria-label":"Ask TechnoGuru — open the AI assistant","aria-expanded":e,"aria-haspopup":"dialog",className:"fixed bottom-6 right-6 z-[60] flex h-12 w-12 items-center justify-center rounded-full border border-gold-400/55 bg-paper-0/90 text-gold-300 shadow-[0_15px_30px_-8px_rgba(0,0,0,0.5)] backdrop-blur transition hover:border-gold-300 hover:bg-paper-0 sm:hidden",children:(0,r.jsx)(n.A,{className:"h-5 w-5","aria-hidden":!0})}),e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"aria-hidden":!0,onClick:()=>t(!1),className:"fixed inset-0 z-[59] bg-paper-0/70 backdrop-blur-sm"}),(0,r.jsxs)("div",{ref:w,role:"dialog","aria-modal":"true","aria-label":"TechnoGuru AI assistant — Ask TechnoGuru",className:"fixed inset-x-0 bottom-0 z-[60] flex max-h-[88dvh] w-full flex-col border-t border-gold-400/30 bg-paper-0 shadow-[0_-30px_60px_-12px_rgba(0,0,0,0.6)] backdrop-blur-md sm:bottom-24 sm:right-6 sm:left-auto sm:max-h-[72dvh] sm:w-[440px] sm:border sm:border-gold-400/30",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-ink-300/15 px-5 py-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-mono-tight text-[11.5px] uppercase tracking-[0.30em] text-gold-300",children:"TechnoGuru \xb7 Ask TechnoGuru"}
1),(0,r.jsx)("p",{className:"font-geist font-medium mt-0.5 text-base italic text-ink-bright",children:"A quiet, knowledgeable assistant."})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[x.length>1&&(0,r.jsx)("button",{type:"button",onClick:function(){m([d]),f("");try{sessionStorage.removeItem(l)}catch(e){}},className:"text-[11.5px] uppercase tracking-[0.22em] text-ink-200 transition hover:text-gold-300","aria-label":"Clear conversation",children:"Clear"}),(0,r.jsx)("button",{type:"button",onClick:()=>t(!1),"aria-label":"Close assistant",className:"text-ink-200 transition hover:text-gold-300",children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("div",{ref:k,className:"flex-1 space-y-4 overflow-y-auto px-5 py-4",children:[x.map((e,t)=>(0,r.jsx)("div",{className:"flex ".concat("user"===e.role?"justify-end":"justify-start"),children:(0,r.jsx)("div",{className:"max-w-[85%] whitespace-pre-wrap px-4 py-2.5 text-[13px] leading-relaxed ".concat("user"===e.role?"bg-gold-300/15 text-ink-bright":"border-l-2 border-gold-400/55 bg-paper-section text-ink-200"),children:e.content})},t)),u&&b&&(0,r.jsx)("div",{className:"flex justify-start",children:(0,r.jsx)("div",{className:"max-w-[85%] whitespace-pre-wrap border-l-2 border-gold-400/55 bg-paper-section px-4 py-2.5 text-[13px] leading-relaxed text-ink-200",children:b})}),u&&!b&&(0,r.jsx)("div",{className:"flex justify-start",children:(0,r.jsx)("div",{className:"border-l-2 border-gold-400/55 bg-paper-section px-4 py-2.5 text-[13px] text-ink-200",children:(0,r.jsxs)("span",{className:"inline-flex gap-1",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-gold-300",style:{animationDelay:"0ms"}}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-gold-300",style:{animationDelay:"200ms"}}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-gold-300",style:{animationDelay:"400ms"}})]})})})]}),x.length<=1&&(0,r.jsxs)("div",{className:"border-t border-ink-300/10 px-5 py-3",children:[(0,r.jsx)("p",{className:"font-mono-tight text-[11px] uppercase tracking-[0.30em] text-gold-300/85",children:"Try asking"}),(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:c.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>N(e),className:"border border-ink-300/15 bg-paper-section px-2.5 py-1 text-left text-[11px] leading-snug text-ink-200 transition hover:border-gold-400/40 hover:text-gold-300",children:e},e))})]}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),N(a)},className:"flex gap-2 border-t border-ink-300/15 px-3 py-3",children:[(0,r.jsx)("input",{ref:j,type:"text",value:a,onChange:e=>p(e.target.value),placeholder:"Ask the assistant…","aria-label":"Your question",className:"flex-1 border border-ink-300/20 bg-paper-section px-3 py-2 text-sm text-ink-bright placeholder:text-ink-200/40 focus:border-gold-400/60 focus:outline-none"}),(0,r.jsx)("button",{type:"submit",disabled:u||!a.trim(),className:"flex shrink-0 items-center justify-center border border-gold-400/55 bg-paper-0/40 px-3 py-2 text-gold-300 transition hover:border-gold-300 hover:bg-paper-0/60 disabled:opacity-40","aria-label":"Send",children:(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("p",{className:"border-t border-ink-300/10 px-5 py-2 text-[11px] uppercase tracking-[0.22em] text-ink-200/60",children:"For commercial decisions, always confirm with the practice directly."})]})]})]})}}}]);

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.