1import{j as e,r as h}from"./ui-CPW3-RCR.js";import{u as bt}from"./useSmartScroll-Da1xVHwy.js";import{a0 as yt,aR as wt,e as lt,aF as vt,bo as jt,d as A,b as qe,S as _t,U as Nt,c8 as St,D as kt,R as $t,a9 as tt,ap as st,bB as Ct,P as Tt,s as ae,W as Et,bK as Pt,a2 as Mt,ao as Rt,a as Lt,g as Dt,u as Ot,bD as at,M as It,N as Ft,j as At,X as He,V as Wt,a6 as zt,k as Ht,L as Bt,ae as qt,a5 as Gt}from"./index-BraPXa8T.js";import{S as nt}from"./scroll-area-BQtXZnuf.js";import{t as Ut}from"./autoLearn-CRnZuHOE.js";import{M as Kt}from"./MermaidChart-DbehVDVk.js";import{S as Vt}from"./SendToTaskManager-ChKH7nnt.js";import{C as Jt}from"./ChatThreadSidebar-CfZe0DLw.js";import{u as Yt}from"./useChatThreads-C2aQZPDf.js";import{D as Qt}from"./DepartmentBrainPanel-BXjmvOXs.js";import{G as Xt}from"./gauge-xKz5X1-Y.js";import{S as Zt}from"./SavedResponses-DzznSC2_.js";import{r as es,u as ts}from"./xlsx-DLNWaC59.js";import{F as ct}from"./file-down-Chqz42zT.js";import{K as ss}from"./key-DLfwGZpn.js";import{B as Ue}from"./bookmark-D69rIKXw.js";import{M as as}from"./index-BfRVBusC.js";import{r as ns}from"./index-CbedGEwf.js";import"./supabase-B2z4OhLQ.js";import"./charts-DCB9_QAo.js";import"./vendor-CIXof4MH.js";import"./index-BdQq_4o_.js";import"./TaskCreateDialog-DKBsfrRz.js";import"./AdvancedDatePicker-ChPu-U4D.js";import"./tag-BX6YVh3F.js";import"./arrow-up-down-CCRYX6WW.js";import"./calendar-Cw1MR1gK.js";import"./en-US-CmMcNpXQ.js";import"./endOfMonth-F9aO6iN7.js";import"./format-DAGnYLwh.js";import"./startOfWeek-Dx_XlaWC.js";import"./isSameYear-CisLDsou.js";import"./subDays-B6CEP03R.js";import"./pt-XXd_e7HC.js";import"./it-Bv9SfiiA.js";import"./he-CneTJ2uI.js";import"./repeat-Bzyo7NvJ.js";import"./useTaskInlineHelpers-C6iIbF2m.js";import"./confetti.module-B5JVzsfH.js";import"./collapsible-CHuAoMFW.js";import"./index-DkD4heWV.js";import"./RichTextEditor-CJcYExHW.js";import"./index-CVizilC1.js";import"./with-selector-BvZ9_Y0X.js";import"./index-BP6EXeue.js";import"./index-BwRZ_Ozi.js";import"./dropdown-menu-ByQNdDT1.js";import"./circle-Bi-mZyos.js";import"./unlink-CAyXBby2.js";import"./heading-2-DPmEGPQt.js";import"./quote-BPj_Y_e6.js";import"./minus-CCCsL8N7.js";import"./table-CUdv-10Z.js";import"./strikethrough-DJ9SUok4.js";import"./link-BKA0FtFv.js";import"./select-DubWVshT.js";import"./formatDistanceToNow-DrARF4Rk.js";import"./constructNow-DBola7tm.js";import"./endOfDay-DBxpZW_E.js";import"./useDemoLocale-COy7_g6Y.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const rs=yt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),is={speed:"speed",wordpress:"wp_error",security:"security",seo:"seo_technical",images:"images",server:"server"},rt={he:[{key:"speed",label:"×××קת ×××ר×ת",prompt:"××תר ×©× ×××§×× × ××¢× ×××. ×ª×¢×©× × ×ת×× ×××ר×ת ×××: Core Web Vitals, ×××× ×ª××× ×ת, caching, CDN, minification, render-blocking resources, ×-TTFB. ×ª× ×¦'×§×××¡× ×ס××ר ×¢× ×¢××פ×××ת."},{key:"wordpress",label:"תק×ת ××ר×פרס",prompt:"×ש ש×××× ××תר ××ר×פרס. ת×ר×× ×××ª× ×©×× ××ר ש×× ×××××× ×פתר××: ×××קת ×××××, × ××ר×× ×ª×ספ××, ×××קת ער×ת × ×ש×, ×××קת PHP errors, ××××קת .htaccess."},{key:"security",label:"××××ת ×תר",prompt:"×ª×¢×©× ×¡×¨×קת ××××× ××תר ××ר×פרס: ×¢×××× × ×××× ×ת×ספ××, hardening, ×סרת ת×ספ×× ×××תר××, 2FA, ××× ×ª brute force, file permissions, database prefix, ×-SSL. ×ª× ××× ×¢× ×¢××פ×××ת."},{key:"seo",label:"SEO ××× ×",prompt:"ת××××§ SEO ××× × ××תר: schema markup, sitemap.xml, robots.txt, canonical tags, redirect chains, broken links, hreflang, Open Graph, ×-structured data. ×ª× ××× ×פ××¨× ×¢× ×××צ×ת."},{key:"images",label:"××פ×××××צ××ת ת××× ×ת",prompt:"תע××ר ×× ××צע ××פ×××××צ××ת ת××× ×ת ××××: ×××¨× ×-WebP/AVIF, ×××ס×, lazy loading, srcset ×-sizes, CDN ×ת××× ×ת, ×-placeholder blurry. ×ª× ×¦'×§×××¡× ×עש×."},{key:"server",label:"שרת/××ס××",prompt:"צר×× ×¢××¨× ××××ר×ת שרת: ×רסת PHP, ×××ר×ת MySQL, cPanel, migration ××× ×©×¨×ª××, DNS, email configuration, ×-SSL certificates. ת×ר×× ×××ª× ×©×× ××ר ש××."}],en:[{key:"speed",label:"Speed Audit",prompt:"The client's site loads slowly. Run a full speed analysis: Core Web Vitals, image sizes, caching, CDN, minification, render-blocking resources, and TTFB. Give me a prioritized checklist."},{key:"wordpress",label:"WordPress Issue",prompt:"There is a WordPress site error. Guide me step by step to diagnose and fix it: check logs, disable plugins, inspect the theme, review PHP errors, and verify .htaccess."},{key:"security",label:"Site Security",prompt:"Run a WordPress security review: core and plugin updates, hardening, remov
6ing unnecessary plugins, 2FA, brute-force protection, file permissions, database prefix, and SSL. Return a prioritized report."},{key:"seo",label:"Technical SEO",prompt:"Review the site's technical SEO: schema markup, sitemap.xml, robots.txt, canonical tags, redirect chains, broken links, hreflang, Open Graph, and structured data. Give me a detailed report with recommendations."},{key:"images",label:"Image Optimization",prompt:"Help me run full image optimization: convert to WebP/AVIF, compress assets, add lazy loading, configure srcset and sizes, use an image CDN, and add blurry placeholders. Give me an actionable checklist."},{key:"server",label:"Server / Hosting",prompt:"I need help with server setup: PHP version, MySQL settings, cPanel, migrations between hosts, DNS, email configuration, and SSL certificates. Walk me through it step by step."}],it:[{key:"speed",label:"Audit Velocità ",prompt:"Il sito del cliente è lento. Esegui un'analisi completa della velocità : Core Web Vitals, dimensioni immagini, caching, CDN, minificazione, risorse bloccanti e TTFB. Dammi una checklist con priorità ."},{key:"wordpress",label:"Problema WordPress",prompt:"C'è un errore su un sito WordPress. Guidami passo dopo passo per diagnosticarlo e risolverlo: controlla i log, disattiva i plugin, verifica il tema, gli errori PHP e il file .htaccess."},{key:"security",label:"Sicurezza Sito",prompt:"Esegui una revisione della sicurezza WordPress: aggiornamenti core e plugin, hardening, rimozione plugin inutili, 2FA, protezione brute force, permessi file, prefisso database e SSL. Restituisci un report con priorità ."},{key:"seo",label:"SEO Tecnico",prompt:"Controlla il SEO tecnico del sito: schema markup, sitemap.xml, robots.txt, canonical tag, catene di redirect, link rotti, hreflang, Open Graph e structured data. Dammi un report dettagliato con consigli."},{key:"images",label:"Ottimizzazione Immagini",prompt:"Aiutami a fare un'ottimizzazione completa delle immagini: conversione in WebP/AVIF, compressione, lazy loading, srcset e sizes, CDN immagini e placeholder sfocati. Dammi una checklist pratica."},{key:"server",label:"Server / Hosting",prompt:"Mi serve aiuto con la configurazione del server: versione PHP, impostazioni MySQL, cPanel, migrazione tra server, DNS, configurazione email e certificati SSL. Guidami passo dopo passo."}],fr:[{key:"speed",label:"Audit Vitesse",prompt:"Le site du client est lent. Fais une analyse complète des performances : Core Web Vitals, taille des images, cache, CDN, minification, ressources bloquantes et TTFB. Donne-moi une checklist priorisée."},{key:"wordpress",label:"Problème WordPress",prompt:"Il y a une erreur sur un site WordPress. Guide-moi étape par étape pour l'identifier et la corriger : vérifier les logs, désactiver les plugins, inspecter le thème, les erreurs PHP et .htaccess."},{key:"security",label:"Sécurité du Site",prompt:"Fais un audit sécurité WordPress : mises à jour du core et des plugins, hardening, suppression des plugins inutiles, 2FA, protection brute force, permissions fichiers, préfixe base de données et SSL. Donne-moi un rapport priorisé."},{key:"seo",label:"SEO Technique",prompt:"Vérifie le SEO technique du site : schema markup, sitemap.xml, robots.txt, balises canoniques, chaînes de redirection, liens cassés, hreflang, Open Graph et structured data. Donne-moi un rapport détaillé avec recommandations."},{key:"images",label:"Optimisation des Images",prompt:"Aide-moi à faire une optimisation complète des images : conversion WebP/AVIF, compression, lazy loading, srcset et sizes, CDN d'images et placeholders flous. Donne-moi une checklist concrète."},{key:"server",label:"Serveur / Hébergement",prompt:"J'ai besoin d'aide pour la configuration serveur : version PHP, réglages MySQL, cPanel, migration entre serveurs, DNS, configuration email et certificats SSL. Guide-moi étape par étape."}],pt:[{key:"speed",label:"Auditoria de Velocidade",prompt:"O site do cliente está lento. Faça uma análise completa de velocidade: Core Web Vitals, tamanho de imagens, cache, CDN, minificação, recursos que bloqueiam renderização e TTFB. Me entregue uma checklist priorizada."},{key:"wordpress",label:"Problema WordPress",prompt:"Há um erro em um site WordPress. Me guie passo a passo para diagnosticar e corrigir: verificar logs, desativar plugins, revisar o tema, erros de PHP e o arquivo .htaccess."}
6,{key:"security",label:"Segurança do Site",prompt:"Faça uma revisão de segurança do WordPress: atualizações do core e plugins, hardening, remoção de plugins desnecessários, 2FA, proteção contra brute force, permissões de arquivo, prefixo do banco e SSL. Retorne um relatório priorizado."},{key:"seo",label:"SEO Técnico",prompt:"Revise o SEO técnico do site: schema markup, sitemap.xml, robots.txt, canonical tags, cadeias de redirecionamento, links quebrados, hreflang, Open Graph e structured data. Me entregue um relatório detalhado com recomendações."},{key:"images",label:"Otimização de Imagens",prompt:"Me ajude a fazer uma otimização completa de imagens: conversão para WebP/AVIF, compressão, lazy loading, srcset e sizes, CDN de imagens e placeholders borrados. Me entregue uma checklist prática."},{key:"server",label:"Servidor / Hospedagem",prompt:"Preciso de ajuda com configuração de servidor: versão do PHP, ajustes de MySQL, cPanel, migração entre servidores, DNS, configuração de e-mail e certificados SSL. Me guie passo a passo."}]},os={speed:e.jsx(Xt,{className:"w-4 h-4"}),wordpress:e.jsx(jt,{className:"w-4 h-4"}),security:e.jsx(vt,{className:"w-4 h-4"}),seo:e.jsx(lt,{className:"w-4 h-4"}),images:e.jsx(wt,{className:"w-4 h-4"}),server:e.jsx(rs,{className:"w-4 h-4"})};function ls(t){return(rt[t]??rt.en).map(u=>({key:is[u.key]??u.key,label:u.label,prompt:u.prompt,icon:os[u.key]}))}const Ke=ls("he"),Be="tamir_vault_pass_v1";async function Re(t,m={},u={}){const{data:d,error:x}=await ae.functions.invoke("tamir-vault",{body:{action:t,...m},headers:u});if(x)throw new Error(x.message||"vault call failed");return d}function cs(){const[t,m]=h.useState(()=>sessionStorage.getItem(Be)),[u,d]=h.useState(""),[x,S]=h.useState(!1),[r,f]=h.useState([]),[g,j]=h.useState(!1),[W,Z]=h.useState(""),[ee,re]=h.useState(!1),[ie,oe]=h.useState({}),[pe,V]=h.useState({}),[le,be]=h.useState(null),[Se,fe]=h.useState({}),c=h.useRef(new Set),[L,T]=h.useState(!1),[M,l]=h.useState({}),D={service_name:"×©× ×× ×ס",website_url:"××× ×§ ××תר",login_url:"××× ×§ ×× ×ס×",username:"×©× ×שת×ש",password:"ס×ס××"},de=(i,n,p)=>{V(v=>({...v,[i]:{...v[i],[n]:p}})),l(v=>{var R;return(R=v[i])!=null&&R.includes(n)?{...v,[i]:v[i].filter(N=>N!==n)}:v})},me=(i,n)=>{var p;return(p=M[i])!=null&&p.includes(n)?"ring-1 ring-rose-500/70":""},[te,je]=h.useState(null),Ae=h.useRef(null),ue=t?{"x-vault-pass":t}:{},_e=h.useCallback(async()=>{if(t){j(!0);try{const i=await Re("list",{},ue);f(i.rows||[])}catch(i){String(i.message).includes("vault_locked")&&(sessionStorage.removeItem(Be),m(null)),A.error(i.message||"ש×××× ×××¢×× ×")}finally{j(!1)}}},[t]);h.useEffect(()=>{_e()},[_e]),h.useEffect(()=>{r.length&&fe(i=>{var v;let n=i,p=!1;for(const R of r)c.current.has(R.client_id)||(c.current.add(R.client_id),(((v=R.credentials)==null?void 0:v.length)||0)>0&&i[R.client_id]===void 0&&(p||(n={...i},p=!0),n[R.client_id]=!0));return p?n:i})},[r]);const We=async i=>{var n;i.preventDefault(),S(!0);try{const p=await Re("unlock",{code:u});p!=null&&p.ok&&(p!=null&&p.pass)?(sessionStorage.setItem(Be,p.pass),m(p.pass),d(""),A.success("××ספת × ×¤×ª××")):A.error("×§×× ×©×××")}catch(p){A.error((n=p.message)!=null&&n.includes("forbidden")?"××× ×רש×× (ס×××× 1 ××××)":"×§×× ×©×××")}finally{S(!1)}},Ge=()=>{sessionStorage.removeItem(Be),m(null),oe({}),V({})},Le=async i=>{if(ie[i]){oe(n=>{const p={...n};return delete p[i],p});return}try{const n=await Re("decrypt",{credential_id:i},ue);oe(p=>({...p,[i]:n.password||""}))}catch(n){A.error("ש×××× ××¤×¢× ××: "+(n.message||""))}},ke=(i,n)=>{const p=(n==null?void 0:n.id)||`new::${i}`;V(v=>({...v,[p]:n?{id:n.id,service_name:n.service_name,website_url:n.website_url||"",login_url:n.login_url||"",username:n.username||"",missing_note:n.missing_note||"",notes:n.notes||"",password:""}:{service_name:"×תר / WordPress",website_url:"",login_url:"",username:"",missing_note:"",notes:"",password:""}}))},$e=i=>{V(n=>{const p={...n};return delete p[i],p}),l(n=>{const p={...n};return delete p[i],p})},De=async(i,n,p)=>{const v=pe[n];if(!v)return;
6const R=[],a=!v.id||!(p!=null&&p.has_password),E=[["service_name",v.service_name],["website_url",v.website_url],["login_url",v.login_url],["username",v.username]];a&&E.push(["password",v.password]);for(const[I,se]of E)(!se||!String(se).trim())&&R.push(I);if(R.length>0){l(I=>({...I,[n]:R})),A.error("×× × ××ª× ×ש××ר â ×סר×× ×©××ת ××××",{description:`×ש ××××: ${R.map(I=>D[I]).join(" · ")}`,duration:5e3});return}be(n);try{const I={id:v.id,client_id:i,service_name:v.service_name,website_url:v.website_url||null,login_url:v.login_url||null,username:v.username||null,missing_note:v.missing_note||null,notes:v.notes||null};v.password&&v.password.length>0&&(I.password=v.password),await Re("upsert",I,ue),A.success("× ×©×ר"),$e(n),_e()}catch(I){A.error(I.message||"ש×××× ×ש××ר×")}finally{be(null)}},Ce=async(i,n=!1)=>{try{if(i==="full"&&n&&!confirm("××× ××ª× ×××× ×©×רצ×× × ××××¦× ×§×××¥ ×¢× ×¡×ס×××ת ×××××ת? פע××× ×× × ×¨×©×ת ××××× ×××ש×."))return;const p=await Re("export",{mode:i,include_passwords:n},ue),v=atob(p.b64),R=new Uint8Array(v.length);for(let I=0;I<v.length;I++)R[I]=v.charCodeAt(I);const N=new Blob([R],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),a=URL.createObjectURL(N),E=document.createElement("a");E.href=a,E.download=p.filename,E.click(),URL.revokeObjectURL(a)}catch(p){A.error("ש×××× ×××צ××: "+(p.message||""))}},U=async i=>{try{const n=await i.arrayBuffer(),p=es(n,{type:"array"}),v=p.Sheets[p.SheetNames[0]],N=ts.sheet_to_json(v,{defval:""}).map(a=>({client_name:a["×©× ×××§××"]??a.client_name??"",service_name:a.ש×ר×ת??a.service??"",website_url:a["××× ×§ ××תר"]??a.website_url??"",login_url:a["××× ×§ ×× ××¡× ××תר"]??a.login_url??"",username:a["×©× ×שת×ש"]??a.username??"",password:a.ס×ס××??a.ס×ס××??a.password??"",missing_note:a["××¢×¨× (×סר/××ר)"]??a.×ער×??a.note??""})).filter(a=>String(a.client_name).trim().length>0);if(N.length===0){A.error("××§×××¥ ר××§ ×× ×©×× × ×צ×× ×¢×××ת '×©× ×××§××'");return}je({rows:N,file_name:i.name})}catch(n){A.error("ש×××× ×קר××ת ××§×××¥: "+(n.message||""))}},ce=async()=>{var i;if(te)try{const n=await Re("import",{rows:te.rows},ue);A.success(`×××× ××צ×××: ${n.created} ××ש, ${n.updated} ×¢×××× ×, ${n.skipped} ×××××${(i=n.unmatched)!=null&&i.length?`, ${n.unmatched.length} ×× ××××`:""}`),je(null),_e()}catch(n){A.error("ש×××× ××××××: "+(n.message||""))}},Te=r.filter(i=>!(W&&!i.client_name.toLowerCase().includes(W.toLowerCase())||ee&&i.credentials.length>0&&i.credentials.some(n=>n.has_password||n.username||n.login_url)));return t?e.jsxs("div",{className:"p-4 space-y-4",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_t,{className:"w-5 h-5 text-emerald-500"}),e.jsx("h2",{className:"text-base font-semibold",children:"×××ר×ת ××ספת"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",Te.length," ××§×××ת)"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("button",{onClick:()=>{var i;return(i=Ae.current)==null?void 0:i.click()},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs bg-secondary hover:bg-secondary/80 transition-colors",children:[e.jsx(Nt,{className:"w-3.5 h-3.5"})," ××××× Excel"]}),e.jsx("input",{ref:Ae,type:"file",accept:".xlsx,.xls",hidden:!0,onChange:i=>{var p;const n=(p=i.target.files)==null?void 0:p[0];n&&U(n),i.target.value=""}}),e.jsxs("button",{onClick:()=>Ce("template"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs bg-secondary hover:bg-secondary/80 transition-colors",children:[e.jsx(St,{className:"w-3.5 h-3.5"})," ××צ×× ×××××"]}),e.jsxs("button",{onClick:()=>Ce("full",!1),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs bg-secondary hover:bg-secondary/80 transition-colors",children:[e.jsx(kt,{className:"w-3.5 h-3.5"})," ××צ×× ××× (××× ×¡×ס×××ת)"]}),e.jsxs("button",{onClick:()=>Ce("full",!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs bg-rose-500/10 text-rose-600 hover:bg-rose-500/20 transition-colors",children:[e.jsx(ct,{className:"w-3.5 h-3.5"})," ××צ×× ××× ×¢× ×¡×ס×××ת"]}),e.jsx("button",{onClick:_e,className:"p-1.5 rounded-md hover:bg-secondary transition-colors",title:"×¨×¢× ×",children:e.jsx($t,{className:`w-4 h-4 ${g?"animate-spin":""}`})}),e.jsxs("button",{onClick:Ge,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs bg-secondary hover:bg-secondary/80 transition-colors",children:[e.jsx(qe,{className:"w-3.5 h-3.5"})," × ×¢×"]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(lt,{className:"w-4 h-4 absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{value:W,onChange:i=>Z(i.target.value),placeholder:"××פ×ש ××§××...",className:"w-full bg-secondary rounded-lg pr-9 pl-3 py-2 text-sm outline-none"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:ee,onChange:i=>re(i.target.checked),className:"rounded"}),"רק ××¡×¨× ×¤×¨×××"]})]}),te&&e.jsxs("div",{className:"border border-amber-500/30 bg-amber-500/5 rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm font-medium",children:["תצ××× ××§×××× â ",te.file_name,"
6(",te.rows.length," ש×ר×ת)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:ce,className:"px-3 py-1.5 rounded-md text-xs bg-emerald-500 text-white",children:"××ש×ר ×××××"}),e.jsx("button",{onClick:()=>je(null),className:"px-3 py-1.5 rounded-md text-xs bg-secondary",children:"×××××"})]})]}),e.jsxs("div",{className:"max-h-48 overflow-auto text-xs",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"text-muted-foreground sticky top-0 bg-card",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-right p-1",children:"××§××"}),e.jsx("th",{className:"text-right p-1",children:"××× ×§ ×תר"}),e.jsx("th",{className:"text-right p-1",children:"×שת×ש"}),e.jsx("th",{className:"text-right p-1",children:"ס×ס××"})]})}),e.jsx("tbody",{children:te.rows.slice(0,20).map((i,n)=>e.jsxs("tr",{className:"border-t border-border/50",children:[e.jsx("td",{className:"p-1",children:i.client_name}),e.jsx("td",{className:"p-1 truncate max-w-[200px]",children:i.website_url}),e.jsx("td",{className:"p-1",children:i.username}),e.jsx("td",{className:"p-1",children:i.password?"â¢â¢â¢":"â"})]},n))})]}),te.rows.length>20&&e.jsxs("div",{className:"text-muted-foreground p-1",children:["+ ",te.rows.length-20," × ×ספ×ת..."]})]})]}),(()=>{const i=Te.filter(N=>N.credentials.length>0),n=Te.filter(N=>N.credentials.length===0),p=N=>fe(a=>({...a,[N]:!a[N]})),v=(N,a,E,I=!1)=>{const se=pe[E],he=!!se;return e.jsxs("div",{className:`relative pr-6 py-2.5 border-t border-border/40 ${I?"bg-blue-500/5":"hover:bg-secondary/20"}`,children:[e.jsx("div",{className:"absolute right-2 top-0 bottom-0 w-px bg-border/60"}),e.jsx("div",{className:"absolute right-2 top-5 w-3 h-px bg-border/60"}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 items-start",children:[e.jsxs("div",{className:"col-span-3 flex items-center gap-1.5 min-w-0",children:[e.jsx(ss,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0"}),he?e.jsx("input",{value:se.service_name||"",onChange:J=>de(E,"service_name",J.target.value),placeholder:"* ×©× ×× ×ס (×תר/××¤× × ××ת×/××× ×¡××ר×...)",className:`w-full bg-secondary rounded px-2 py-1 text-xs ${me(E,"service_name")}`}):e.jsx("span",{className:"text-xs font-medium truncate",title:(a==null?void 0:a.service_name)||"",children:(a==null?void 0:a.service_name)||(I?"× ×ס ××ש":"â")})]}),e.jsx("div",{className:"col-span-3 min-w-0 space-y-1",children:he?e.jsxs(e.Fragment,{children:[e.jsx("input",{value:se.website_url||"",onChange:J=>de(E,"website_url",J.target.value),placeholder:"* ××× ×§ ××תר",className:`w-full bg-secondary rounded px-2 py-1 text-xs ${me(E,"website_url")}`}),e.jsx("input",{value:se.login_url||"",onChange:J=>de(E,"login_url",J.target.value),placeholder:"* ××× ×§ ×× ×ס×",className:`w-full bg-secondary rounded px-2 py-1 text-xs ${me(E,"login_url")}`})]}):e.jsxs(e.Fragment,{children:[a!=null&&a.website_url?e.jsxs("a",{href:a.website_url,target:"_blank",rel:"noreferrer",className:"text-[11px] text-blue-500 hover:underline inline-flex items-center gap-1 truncate max-w-full",children:[e.jsx(Et,{className:"w-3 h-3 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a.website_url})]}):e.jsx("div",{className:"text-[11px] text-muted-foreground",children:"â"}),(a==null?void 0:a.login_url)&&e.jsxs("a",{href:a.login_url,target:"_blank",rel:"noreferrer",className:"text-[11px] text-muted-foreground hover:text-blue-500 truncate block",children:["×× ×ס×: ",a.login_url]})]})}),e.jsx("div",{className:"col-span-2 min-w-0",children:he?e.jsx("input",{value:se.username||"",onChange:J=>de(E,"username",J.target.value),placeholder:"* ×©× ×שת×ש",className:`w-full bg-secondary rounded px-2 py-1 text-xs ${me(E,"username")}`}):e.jsx("span",{className:"text-xs truncate block",title:(a==null?void 0:a.username)||"",children:(a==null?void 0:a.username)||"â"})}),e.jsx("div",{className:"col-span-2 min-w-0",children:he?e.jsx("input",{type:"password",value:se.password||"",placeholder:a!=null&&a.has_password?"(ר××§ = ××× ×©×× ××)":"* ס×ס××",onChange:J=>de(E,"password",J.target.value),className:`w-full bg-secondary rounded px-2 py-1 text-xs ${me(E,"password")}`}):a!=null&&a.has_password?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"text-xs font-mono truncate",children:ie[a.id]??"â¢â¢â¢â¢â¢â¢â¢â¢"}),e.jsx("button",{onClick:()=>Le(a.id),className:"p-1 hover:bg-secondary rounded flex-shrink-0",title:ie[a.id]?"×סתר":"×צ×",children:ie[a.id]?e.jsx(Pt,{className:"w-3 h-3"}):e.jsx(Mt,{className:"w-3 h-3"})})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})}),e.jsx("div",{className:"col-span-2 flex items-start justify-end gap-1",children:he?e.jsxs(e.Fragment,{children:[e.jsx("input",{value:se.missing_note||"",onChange:J=>V(Ee=>({...Ee,[E]:{...se,missing_note:J.target.value}})),placeholder:"×ער×",className:"flex-1 bg-secondary rounded px-2 py-1 text-xs min-w-0"}),e.jsx("button",{disabled:le===E,onClick:()=>De(N.client_id,E,a),className:"p-1.5 bg-emerald-500 text-white rounded flex-shrink-0",title:"ש××ר",children:e.jsx(Rt,{className:"w-3 h-3"})}),e.jsx("button",{onClick:()=>$e(E),className:"px-2 py-1 bg-secondary rounded text-[11px] flex-shrink-0",children:"×××××"})]}):e.jsxs(e.Fragment,{children:[((a==null?void 0:a.missing_note)||(a==null?void 0:a.notes))&&e.jsx("span",{className:"text-[11px] text-muted-foreground truncate flex-1",title:(a==null?void 0:a.missing_note)||(a==null?void 0:a.notes)||"",children:(a==null?void 0:a.missing_note)||(a==null?void 0:a.notes)}),e.jsx("button",{onClick:()=>ke(N.client_id,a),className:"text-[11px] text-blue-500 hover:underline px-2 flex-shrink-0",children:"ער××"})]})})]})]},E)},R=N=>{const a=Se[N.client_id],E=`new::${N.client_id}`,I=pe[E],se=N.credentials.length,he=se===0;return e.jsxs("div",{className:"border rounded-xl bg-card overflow-hidden",children:[e.jsxs("div",{className:`flex items-center justify-between gap-2 px-4 py-2.5 ${he?"bg-amber-500/5":"bg-secondary/30"}`,children:[e.jsxs("button",{onClick:()=>p(N.client_id),className:"flex items-center gap-2.5 flex-1 min-w-0 text-right",children:[e.jsx(st,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-300 ${a?"-rotate-90":"rotate-0"}`}),N.logo_url&&e.jsx("img",{src:N.logo_url,alt:"",className:"w-6 h-6 rounded object-contain bg-white/5 flex-shrink-0"}),e.jsx("span",{className:"font-semibold text-sm truncate",children:N.client_name}),he?e.jsx("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 px-1.5 py-0.5 rounded font-medium flex-shrink-0",children:"×סר פר×× ××ש×"}):e.jsxs("span",{className:"text-[10px] bg-emerald-500/15 text-emerald-600 px-1.5 py-0.5 rounded font-medium flex-shrink-0",children:[se," ",se===1?"× ×ס":"× ×ס××"]})]}),e.jsxs("button",{onClick:()=>{fe(J=>({...J,[N.client_id]:!1})),ke(N.client_id,null)},className:"flex items-center gap-1 px-2.5 py-1 rounded-md text-xs bg-blue-500 text-white hover:bg-blue-600 transition-colors flex-shrink-0",title:"××סף × ×ס/פר×× ×××©× ×××§××",children:[e.jsx(Tt,{className:"w-3.5 h-3.5"})," ",he?"××סף × ×ס ר×ש××":"××סף × ×ס"]})]}),e.jsx("div",{className:`grid transition-all duration-300 ease-in-out ${a?"grid-rows-[0fr] opacity-0":"grid-rows-[1fr] opacity-100"}`,children:e.jsxs("div",{className:"overflow-hidden",children:[he&&!I&&e.jsx("div",{className:"px-4 py-6 text-center text-xs text-muted-foreground",children:'×××§×× ×× ××× ×¤×¨×× ×××©× ×¢×××× Â· ×××¥ "××סף × ×ס ר×ש××" ××× ××ת×××'}),N.credentials.map(J=>v(N,J,J.id)),I&&v(N,null,E,!0)]})})]},N.client_id)};return e.jsxs("div",{className:"space-y-3",children:[i.map(R),n.length>0&&e.jsxs("div",{className:"border border-dashed rounded-xl bg-card/50",children:[e.jsxs("button",{onClick:()=>T(N=>!N),className:"w-full flex items-center justify-between px-4 py-2.5 text-xs text-muted-foreground hover:bg-secondary/20 rounded-xl",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-3.5 h-3.5 text-amber-500"}),n.length," ××§×××ת ××× ×¤×¨×× ××ש×"]}),L?e.jsx(st,{className:"w-4 h-4"}):e.jsx(Ct,{className:"w-4 h-4"})]}),L&&e.jsx("div",{className:"space-y-2 p-2 pt-0",children:n.map(R)})]}),!g&&Te.length===0&&e.jsx("div",{className:"border rounded-xl p-8 text-center text-sm text-muted-foreground",children:"×× × ×צ×× ××§×××ת"})]})})(),e.jsxs("div",{className:"text-[11px] text-muted-foreground flex items-center gap-1.5",children:[e.jsx(tt,{className:"w-3 h-3"}),"×× ×ס×ס×××ת ×××¦×¤× ×ת (pgp_sym_encrypt). ×× ×¤×¢× ××/××צ×× × ×¨×©× ××××× ×××©× (vault_access_log)."]})]}):e.jsx("div",{className:"flex items-center justify-center min-h-[60vh] p-6",dir:"rtl",children:e.jsxs("form",{onSubmit:We,className:"bg-card border rounded-xl p-8 max-w-md w-full shadow-lg",children:[e.jsxs("div",{className:"flex flex-col items-center text-center mb-6",children:[e.jsx("div",{className:"w-14 h-14 roun
6ded-2xl bg-gradient-to-br from-amber-500 to-rose-600 flex items-center justify-center mb-3",children:e.jsx(qe,{className:"w-7 h-7 text-white"})}),e.jsx("h2",{className:"text-lg font-semibold",children:"×ספת פר×× ×××©× â ××¡× ×××ר×ת"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1.5",children:"×××©× ×ס×××× 1 ×××× Â· × ×רש ×§×× ××ש×"})]}),e.jsx("input",{type:"password",value:u,onChange:i=>d(i.target.value),placeholder:"×קש ×§×× ××ש×",autoFocus:!0,className:"w-full bg-secondary rounded-lg px-4 py-3 text-sm outline-none focus:ring-2 focus:ring-amber-500/40 mb-3"}),e.jsx("button",{type:"submit",disabled:x||!u,className:"w-full bg-gradient-to-r from-amber-500 to-rose-600 text-white rounded-lg px-4 py-2.5 text-sm font-medium disabled:opacity-50",children:x?"פ×ת×...":"×¤×ª× ×ספת"})]})})}const Ie=[{lang:"php · wp-config",lines:["<?php","define('WP_DEBUG', false);","define('DISALLOW_FILE_EDIT', true);","define('WP_AUTO_UPDATE_CORE', 'minor');","$table_prefix = 'wp_';"]},{lang:"php · wp hook",lines:["add_action('init', function () {"," if (!is_user_logged_in()) {"," remove_action('wp_head', 'wp_generator');"," }","});"]},{lang:"javascript · edge fn",lines:["export default async (req) => {"," const { id } = await req.json();"," const r = await fetch(`/api/${id}`);"," return Response.json(await r.json());","};"]},{lang:"typescript · fetch",lines:["const res = await fetch(url, {"," method: 'POST',"," headers: { 'Content-Type': 'application/json' },"," body: JSON.stringify(payload),","});"]},{lang:"python · webhook",lines:["import requests","def notify(lead):"," r = requests.post(WEBHOOK, json=lead)"," return r.status_code == 200"]},{lang:"python · lambda",lines:["def lambda_handler(event, ctx):"," body = json.loads(event['body'])"," return { 'statusCode': 200,"," 'body': json.dumps(body) }"]},{lang:"css · animation",lines:["@keyframes pulse {"," 0% { opacity: .4; }"," 50% { opacity: 1; }"," 100% { opacity: .4; }","}"]},{lang:"html · meta",lines:['<meta charset="utf-8" />','<meta name="viewport"',' content="width=device-width,initial-scale=1" />','<link rel="canonical" href="â¦" />']},{lang:"zapier · zap",lines:["# Zap: New Lead â CRM","trigger: Webhooks (Catch Hook)","filter: only if email is set","action 1: Pipedrive â Create Person","action 2: Slack â Post to #leads"]},{lang:"make.com · scenario",lines:["[Webhook] ââ⺠[Router]"," ââ⺠[HTTP POST] ââ⺠CRM"," ââ⺠[Slack: #leads]"," ââ⺠[Google Sheets: append row]"]},{lang:"sql · join",lines:["SELECT c.name, COUNT(l.id) AS leads","FROM clients c","LEFT JOIN leads l ON l.client_id = c.id","WHERE l.created_at > now() - interval '7d'","GROUP BY 1 ORDER BY 2 DESC;"]},{lang:"shell · deploy",lines:["$ curl -X POST https://api/deploy \\"," -H 'Authorization: Bearer â®â®â®' \\",` -d '{"env":"prod"}'`,"# â 200 OK build ready in 42s"]},{lang:"nginx · cache",lines:["location ~* \\.(jpg|webp|css|js)$ {"," expires 30d;",' add_header Cache-Control "public";',"}"]},{lang:"json · webhook",lines:["{",' "event": "lead.created",',' "source": "facebook_ads",',' "value": 1200,',' "currency": "ILS"',"}"]}],ds=new Set(["function","const","let","var","return","await","async","import","export","from","default","if","else","for","while","try","catch","new","class","def","lambda","import","True","False","None","SELECT","FROM","WHERE","JOIN","LEFT","GROUP","ORDER","BY","AS","INSERT","UPDATE","DELETE","add_action","apply_filters","define","require","include","public","private","static","location","add_header","expires","trigger","filter","action","event","source"]),Fe=14,it=20,Ve=12.5,ot=18;function ms(t){let m=Ie[Math.floor(Math.random()*Ie.length)];if(t&&t.size<Ie.length){let u=0;for(;t.has(m)&&u<8;)m=Ie[Math.floor(Math.random()*Ie.length)],u++}return m}function us(t,m){return ds.has(t)?`rgba(110, 231, 183, ${m})`:/^["'`].*["'`]?$/.test(t)||/^["']/.test(t)?`rgba(252, 211, 77, ${m*.95})`:/^\/\/|^#/.test(t)?`rgba(120, 144, 130, ${m*.8})`:/^[<>]/.test(t)||/^<\w/.test(t)?`rgba(125, 211, 252, ${m})`:/^\d/.test(t)?`rgba(244, 114, 182, ${m*.9})`:`rgba(148, 197, 162, ${m})`}function ps(t,m,u,d,x){const S=m.trimStart();if(S.startsWith("//")||S.startsWith("#")){t.fillStyle=`rgba(120, 144, 130, ${x*.8})`,t.fillText(m,u,d);return}const r=m.split(/(\s+|[(){}\[\];,.:])/);let f=u;for(const g of r)g&&(t.fillStyle=us(g,x),t.fillText(g,f,d),f+=t.measureText(g).width)}function hs(t,m,u,d,x,S){const r=Math.min(S,d/2,x/2);t.beginPath(),t.moveTo(m+r,u),t.lineTo(m+d-r,u),t.quadraticCurveTo(m+d,u,m+d,u+r),t.lineTo(m+d,u+x-r),t.quadraticCurveTo(m+d,u+x,m+d-r,u+x),t.lineTo(m+r,u+x),t.quadraticCurveTo(m,u+x,m,u+x-r),t.lineTo(m,u+r),t.quadraticCurveTo(m,u,m+r,u),t.closePath()}function xs(){const t=h.useRef(null);h.useEffect(()=>{const u=t.current;if(!u)return;const d=u.getContext("2d");if(!d)return;const x=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=Math.min(window.devicePixelRatio||1,2);let r=0,f=0,g=[],j=[];function W(c){return c.lines.reduce((L,T)=>L+T.length,0)+(c.lines.length-1)}function Z(c){d.font=`${Ve}px ui-monospace, SFMono-Regular, Menlo, monospace`;const L=Math.max(...c.lines.map(M=>d.measureText(M).width)),T=ot+c.lines.length*it;return{w:L+Fe*2,h:T+Fe}}function ee(){return r>=1200?Math.min(380,Math.floor(r*.26)):r>=900?Math.min(320,Math.floor(r*.28)):Math.floor(r*.46)}function re(){let c;r>=1200?c=2:(r>=700,c=1);const L=[],T=r>=700?["left","right"]:["left"];for(const M of T)for(let l=0;l<c;l++){const D=c===1?.5:.28+l*.44;L.push({id:`${M}-${l}`,side:M,yFrac:D})}j=L}function ie(c,L){const{w:T,h:M}=Z(c),l=ee();let D;
6L.side==="left"?(D=Math.max(10,Math.min(l-T-10,14)),l-T-10<14&&(D=10)):(D=Math.max(r-l+10,r-T-14),D+T>r-10&&(D=r-T-10));const de=L.yFrac*f;let me=Math.round(de-M/2);return me=Math.max(10,Math.min(f-M-10,me)),{x:D,y:me,w:T,h:M}}function oe(c,L){const T=new Set(g.filter(D=>D.phase!=="gone").map(D=>D.snippet)),M=ms(T),l=ie(M,c);return{snippet:M,slotId:c.id,x:l.x,y:l.y,w:l.w,h:l.h,revealed:0,totalChars:W(M),phase:"typing",phaseStart:L,holdMs:6e3+Math.random()*3e3,alpha:0,cps:16+Math.random()*8}}function pe(){r=u.clientWidth,f=u.clientHeight,u.width=Math.floor(r*S),u.height=Math.floor(f*S),d.setTransform(S,0,0,S,0,0),re(),g=[];const c=performance.now(),L=Math.max(1,Math.floor(j.length/2)),T=[...j].sort(()=>Math.random()-.5);for(let M=0;M<L;M++){const l=oe(T[M],c);l&&(l.revealed=l.totalChars*(.3+Math.random()*.4),l.alpha=.9,g.push(l))}}pe();const V=new ResizeObserver(pe);V.observe(u);let le=0,be=performance.now();function Se(c){hs(d,c.x-6,c.y-6,c.w+12,c.h+12,8),d.fillStyle=`rgba(15, 22, 30, ${.32*c.alpha})`,d.fill(),d.lineWidth=1,d.strokeStyle=`rgba(125, 211, 252, ${.1*c.alpha})`,d.stroke(),d.font="11px ui-monospace, SFMono-Regular, Menlo, monospace",d.textBaseline="top",d.fillStyle=`rgba(125, 211, 252, ${.55*c.alpha})`,d.fillText(`// ${c.snippet.lang}`,c.x+Fe,c.y),d.font=`${Ve}px ui-monospace, SFMono-Regular, Menlo, monospace`;let L=Math.floor(c.revealed),T=c.y+ot+4;for(let M=0;M<c.snippet.lines.length&&!(L<=0);M++){const l=c.snippet.lines[M],D=Math.min(l.length,L),de=l.slice(0,D);if(ps(d,de,c.x+Fe,T,.88*c.alpha),c.phase==="typing"&&D<l.length&&Math.floor(performance.now()/600)%2===0){const te=c.x+Fe+d.measureText(de).width;d.fillStyle=`rgba(186, 230, 253, ${.5*c.alpha})`,d.fillRect(te+1,T+1,1.5,Ve)}L-=D,D===l.length&&(L-=1),T+=it}}const fe=c=>{const L=Math.min(80,c-be);be=c,d.clearRect(0,0,r,f);const T=[],M=new Set;for(const l of g)l.phase==="typing"?(l.alpha=Math.min(1,l.alpha+L/600),l.revealed+=l.cps*L/1e3,l.revealed>=l.totalChars&&(l.revealed=l.totalChars,l.phase="hold",l.phaseStart=c)):l.phase==="hold"?(l.alpha=1,c-l.phaseStart>l.holdMs&&(l.phase="fadeout",l.phaseStart=c)):l.phase==="fadeout"&&(l.alpha=Math.max(0,1-(c-l.phaseStart)/2800),l.alpha<=0&&(l.phase="gone")),l.phase!=="gone"&&(Se(l),T.push(l),M.add(l.slotId));g=T;for(const l of j)if(!M.has(l.id)&&Math.random()<.012){const D=oe(l,c);D&&g.push(D)}le=requestAnimationFrame(fe)};if(!x)le=requestAnimationFrame(fe);else{d.clearRect(0,0,r,f);for(const c of g)c.revealed=c.totalChars,c.alpha=1,c.phase="hold",Se(c)}return()=>{cancelAnimationFrame(le),V.disconnect()}},[]);const m="linear-gradient(to right, black 0%, black 18%, transparent 32%, transparent 68%, black 82%, black 100%)";return e.jsx("canvas",{ref:t,"aria-hidden":!0,className:"pointer-events-none absolute inset-0 h-full w-full opacity-[0.20] dark:opacity-[0.28]",style:{zIndex:0,WebkitMaskImage:m,maskImage:m}})}const fs="https://ecrgkarlfnflbtpqsmun.supabase.co/functions/v1/tamir-chat",gs=["××תר ×©× ×××§×× × ××¢× ××× â ×× ×צע××× ×ר×ש×× ×× ×ש×פ×ר ×××ר×ת?","×ש ש×××× 500 ××תר ××ר×פרס ×××¨× ×¢×××× ×ª×סף â ×× ×¢×ש××?","××× ××ס×פ×× Google Tag Manager ××תר ×××× ××ר ×צ××¨× × ××× ×?","×צ××× ×©× Core Web Vitals × ××× â ×××¤× ×ת×××××?"];function bs({children:t,className:m}){const[u,d]=h.useState(!1),x=()=>{navigator.clipboard.writeText(t),d(!0),setTimeout(()=>d(!1),2e3)};return e.jsxs("div",{className:"relative group",children:[e.jsx("button",{onClick:x,className:"absolute top-2 left-2 p-1 rounded bg-secondary/80 text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity z-10",title:"×עתק ×§××",children:u?e.jsx(qt,{className:"w-3.5 h-3.5 text-emerald-500"}):e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsx("pre",{className:m,children:e.jsx("code",{children:t})})]})}function ys({req:t}){const[m,u]=h.useState(null),[d,x]=h.useState({}),S=h.useRef(!1),r=h.useCallback(async f=>{const g=`${f.type}:${f.id||f.service_name||"main"}`;u(g);try{const{data:j,error:W}=await ae.functions.invoke("tamir-create-credential-link",{body:{client_id:t.client_id,target_type:f.type,target_id:f.id,service_name:f.service_name,service_filter:f.service_name?[f.service_name]:void 0}});if(W)throw W;x(Z=>({...Z,[g]:{url:j.url,expires_in_minutes:j.expires_in_minutes}}));try{window.open(j.url,"_blank","noopener,noreferrer")}catch{}}catch(j){x(W=>({...W,[g]:{error:(j==null?void 0:j.message)||"ש×××× ××צ×רת ×××× ×§"}}))}finally{u(null)}},[t.client_id]);return h.useEffect(()=>{t.auto&&t.sites.length===1&&!S.current&&(S.current=!0,r(t.sites[0]))},[t.auto,t.sites,r]),!t.sites||t.sites.length===0?e.jsx("div",{className:"text-sm text-amber-500 my-2",children:"×× × ×צ×× ×תר×× ×¤×¢×××× ×××§××. ××ר ××§×× ××ר ×× ××סף ×תר ר××©× ××ר××ס ×××§××."}):e.jsxs("div",{dir:"rtl",className:"my-3 space-y-2 border border-border rounded-lg p-3 bg-secondary/30",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"××ר ×ת ××תר ש×××× ××ª× ×¦×¨×× ××ש×. ×××× ×§ ×××× ×ª×§×£ ×צפ××× ××ת ×××× ×××©× 15 ××§×ת."}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.sites.map(f=>{const g=`${f.type}:${f.id||f.service_name||"main"}`,j=d[g];return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("button",{onClick:()=>r(f),disabled:m===g,className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm hover:opacity-90 disabled:opacity-50",children:[m===g?e.jsx(Bt,{className:"w-3.5 h-3.5 animate-spin"}):null,f.label,f.url?e.jsxs("span",{className:"text-xs opacity-70",children:["â ",f.url]}):null]}),j&&"url"in j&&e.jsx("a",{href:j.url,target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline truncate max-w-[300px]",children:"××× ×§ × ×צר â ×××¥ ×פת××× (תקף 15 ×ק׳)"}),j&&"error"in j&&e.jsx("div",{className:"text-xs text-destructive",children:j.error})]},g)})})]})}function ws({mode:t,staffName:m,clientName:u}){const d=m||"××",x=t==="credential"?u?`××פש ××××ר ×©× ${u} ××× ×¨××¢×× ××× ×צ×× ${d}`:`××פש ××××ר ××× ×¨××¢×× ××× ×צ×× ${d}`:`×××©× ×××ר ××××ר ×× ×ª×©××× ${d}`;return e.jsx("div",{className:"flex justify-start",dir:"rtl",children:e.jsxs("div",{className:"max-w-[80%] rounded-2xl rounded-bl-sm bg-secondary/60 border border-border px-4 py-2.5 text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{children:x}),e.jsxs("span",{className:"inline-flex gap-0.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500/70 animate-pulse",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500/70 animate-pulse",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500/70 animate-pulse",style:{animationDelay:"300ms"}})]})]})})}async function vs(t,m){const[u,d]=await Promise.all([ae.from("client_credentials").select("service_name, website_url, credential_kind").eq("client_id",t).eq("is_active",!0),ae.from("landing_pages").select("id, name, slug").eq("client_id",t)]),x=u.data||[],S=d.data||[],r=[],f=new Set;for(const g of x){const j=g.service_name||"",W=j.toLowerCase(),Z=/mini|××× ×/.test(W),ee=j||m;if(g.credential_kind==="website"){const re=`w:${ee}`;if(f.has(re))continue;f.add(re),r.push({kindKey:"main_site",label:ee,url:g.website_url,promptText:`×× ×¤×¨×× ××××©× ×${ee}?`})}else if(g.credential_kind==="landing_page"){const re=`l:${ee}`;if(f.has(re))continue;f.add(re),r.push({kindKey:Z?"mini_site":"landing_page",label:ee,url:g.website_url,promptText:`×× ×¤×¨×× ××××©× ×${ee}?`})}else{const re=`s:${ee}`;if(f.has(re))continue;f.add(re),r.push({kindKey:"service",label:ee,promptText:`×× ×¤×¨×× ××××©× ×${ee}?`})}}for(const g of S)r.some(j=>j.label.toLowerCase()===g.name.toLowerCase())||r.push({kindKey:"landing_page",label:g.name,url:`/lp/${g.slug}`,promptText:`×× ×¤×¨×× ××××©× ×${g.name}?`});return r}function js({content:t}){const m=[],u=/```(mermaid|access-request)\n([\s\S]*?)```/g;let d=0,x;for(;(x=u.exec(t))!==null;)x.index>d&&m.push({type:"text",content:t.slice(d,x.index)}),m.push({type:x[1]==="mermaid"?"mermaid":"access",content:x[2].trim()}),d=x.index+x[0].length;return d<t.length&&m.push({type:"text",content:t.slice(d)}),e.jsx(e.Fragment,{children:m.map((S,r)=>{if(S.type==="mermaid")return e.jsx(Kt,{chart:S.content},r);if(S.type==="access")try{const f=JSON.parse(S.content);return e.jsx(ys,{req:f},r)}catch{return e.jsx("div",{className:"text-xs text-destructive",children:"××××§ access-request ×× ×ª×§××
6"},r)}return e.jsx("div",{dir:"rtl",className:"prose prose-sm prose-invert max-w-none text-right [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_li]:text-right [&_p]:text-right [&_h1]:text-right [&_h2]:text-right [&_h3]:text-right [&_h4]:text-right [&_ol]:pr-4 [&_ul]:pr-4 [&_table]:w-full [&_table]:border-collapse [&_th]:border [&_th]:border-border [&_th]:px-3 [&_th]:py-1.5 [&_th]:bg-secondary/60 [&_th]:text-right [&_td]:border [&_td]:border-border [&_td]:px-3 [&_td]:py-1.5 [&_td]:text-right",children:e.jsx(as,{remarkPlugins:[ns],components:{pre:({children:f})=>e.jsx(e.Fragment,{children:f}),code:({children:f,className:g})=>(g==null?void 0:g.includes("language-"))?e.jsx(bs,{className:g,children:String(f).replace(/\n$/,"")}):e.jsx("code",{className:g,children:f})},children:S.content})},r)})})}function Ta(){var Xe,Ze,et;const{selectedClient:t}=Lt(),{language:m}=Dt(),u=Yt({chatType:"tamir",clientId:(t==null?void 0:t.id)||null}),{threads:d,activeThreadId:x,messages:S,setMessages:r,loadingThreads:f,selectThread:g,createThread:j,persistMessage:W,saveAssistantDebounced:Z,startNewChat:ee,deleteThread:re}=u,[ie,oe]=h.useState(""),[pe,V]=h.useState(!1),[le,be]=h.useState([]),[Se,fe]=h.useState(!1),[c,L]=h.useState(""),[T,M]=h.useState("ס×××× â ×ת××ר"),[l,D]=h.useState(""),[de,me]=h.useState(!1),[te,je]=h.useState("chat"),{clearanceLevel:Ae,user:ue}=Ot(),_e=((Xe=ue==null?void 0:ue.user_metadata)==null?void 0:Xe.full_name)||(ue!=null&&ue.email?ue.email.split("@")[0]:null),We=Ae===1,[Ge,Le]=h.useState(null),[ke,$e]=h.useState(""),[De,Ce]=h.useState(null),[U,ce]=h.useState(null),[Te,i]=h.useState("technical"),[n,p]=h.useState([]),[v,R]=h.useState(!1),{bottomRef:N}=bt([S]),a=h.useRef(null),E=s=>new Promise((o,w)=>{const b=new FileReader;b.onload=()=>o(b.result),b.onerror=w,b.readAsText(s)}),I=async s=>{const o=s.target.files;if(!o)return;const w=[];for(const b of Array.from(o))try{if(["text/","application/json","application/xml","application/csv",".txt",".md",".csv",".json",".xml",".yaml",".yml",".html",".css",".js",".ts",".php"].some(_=>b.type.includes(_)||b.name.endsWith(_.replace(".","")))||b.size<5e5){const _=await E(b);w.push({name:b.name,content:_.slice(0,5e4)})}else w.push({name:b.name,content:`[×§×××¥ ××× ×ר×: ${b.name}, ××××: ${(b.size/1024).toFixed(0)}KB]`});A.success(`××§×××¥ ${b.name} ×××¢××`)}catch{A.error(`ש×××× ×קר××ת ${b.name}`)}be(b=>[...b,...w]),a.current&&(a.current.value="")},se=s=>be(o=>o.filter((w,b)=>b!==s));h.useEffect(()=>{if(!(t!=null&&t.id)){p([]);return}let s=!1;return vs(t.id,t.name).then(o=>{s||p(o)}).catch(()=>{s||p([])}),()=>{s=!0}},[t==null?void 0:t.id,t==null?void 0:t.name]),h.useEffect(()=>{/פר×× ××ש×|×××©× ×|ס×ס×/.test(ie)?R(!0):R(!1)},[ie]);const he=s=>{const o=s.toLowerCase();return["פר×× ××ש×","פר××× ××תר","×××©× ××תר","×××©× ×××£","ס×ס××","ס×ס××","×××ר","×©× ×שת×ש","wp-admin","×× ××¡× ××תר","××××× ×¡ ××תר","credentials","login details","access to","password"].some(b=>o.includes(b))},J=s=>{const o=s.toLowerCase();if(/(wp-?admin|wordpress|××ר×פרס|×תר ר×ש×|××תר|×©× ××תר|website)/.test(o))return{hint:"main_site"};if(/(××£ × ××ת×|××¤× × ××ת×|×× ××× ×|landing)/.test(o))return{hint:"landing_page"};const w=[[/(activetrail|××§×××\s*×ר×××)/,"ActiveTrail"],[/(mailchimp|××××צ'?××פ)/,"Mailchimp"],[/(zapier|××פ××ר)/,"Zapier"],[/(cloudflare|×§××××פ×××ר)/,"Cloudflare"],[/(google\s*ads|××××\s*××ס)/,"Google Ads"],[/(facebook|meta|פ××ס×××§|×××)/,"Meta"],[/(tiktok|×××§×××§)/,"TikTok"],[/(linkedin|××× ×§××××)/,"LinkedIn"],[/(smoove|ס×××)/,"Smoove"],[/(hubspot|×××ספ××)/,"HubSpot"]];for(const[b,Y]of w)if(b.test(o))return{hint:"service",serviceName:Y};return{hint:"unknown"}},Ee=async(s,o)=>{const w={role:"user",content:s},b={role:"assistant",content:o};r(F=>[...F,w,b]);let Y=x;Y||(Y=await j(s)),Y&&(W(Y,"user",s),Z(Y,o))},dt=`## ××××ת ×תר ××ר×פרס â ××ר×× ××¢×©× 7 8### ת×ספ×× ××××צ×× 9| ת×סף | ××× ×× | ×תש××× | ××× | 10| --- | --- | --- | --- | 11| **Wordfence** | â | â Premium | ×××ת ×ש + סר×קת ×××××ר â ××× ××§××£ | 12| **Solid Security** (×שע×ר iThemes) | â | â Pro | Hardening + 2FA + ×סתרת wp-login | 13| **Sucuri Security** | â | â Firewall | סר××§× + × ××§×× + WAF ××¢× × |
14| **WPS Hide Login** | â | â | ××©× × ×ת ×ת××ת ×-wp-admin | 15| **Limit Login Attempts Reloaded** | â | â | ××× ×ª brute force | 16| **All-In-One WP Migration** | â | â Unlimited | ××××××× ×××¢×ר×ת | 17 18> ×××¨× ××× ×ספ××§ Wordfence Free + WPS Hide Login + Limit Login Attempts. ××ª×¨× ×× ×ת/××××× ×××××× â ש×ר×× ×-Wordfence Premium ×× Sucuri Firewall. 19 20### צ'×§×××¡× Hardening â ××¤× ×¡×ר ×¢××פ×ת 211. **×¢×××× ×××× + ת×ספ×× + ת×× ×ת** â ×× ×©×××¢, ××× ×סרת ת×ספ×× ×× ×ש×××ש. 222. **ס×ס×× ×××§× ×-admin + 2FA** (××¨× Wordfence/Solid Security). 233. **ש×× ×× ×©× ×שת×ש ×-\`admin\`** ××ש×× ×× ×ר×ר + ××××ת × ×¡××× ×ת ×× ×ס×. 244. **×סתרת \`wp-login.php\`** (WPS Hide Login). 255. **××××ת XML-RPC** (\`/xmlrpc.php\`) ×× ×× ×שת×ש×× ×-Jetpack/×פ××קצ××. 266. **\`wp-config.php\`**: ××סף \`define('DISALLOW_FILE_EDIT', true);\` ××× ××ס×× ×¢××¨× ×ª×ספ××. 277. **File permissions**: 644 ××§×צ××, 755 ×ת××§××ת, 600 ×-\`wp-config.php\`. 288. **ש×× ×× \`wp_\` prefix ×©× ××××××ת** (רק ×××§×× â ×× ××ר××¥ ×¢× ×תר ×× ××× ×××××). 299. **SSL** פע×× ××× ××פ×× + redirect ×-http ×-https. 3010. **××××× ××××** ××××××× (ת×סף ×× ×©×¨×ª) â ×פ××ת 7 ×רס××ת ×××ר×. 3111. **× ×××ר uptime** (UptimeRobot ××× ×× / Better Uptime). 3212. **×סתרת ×רסת WP** ××ת×× ×ת.`,mt=`## ××פ×××××צ××ת ת××× ×ת â ××××× ×××××צ×× 33 34### 1. [Compressimage.io](https://compressimage.io/) â **××× ×××××¥** â 35ת×ת **××××§×× ××××ר×ת** âï¸ â ×××ר: 36- **Image Quality** = \`70\` 37- **Max Width or Height (px)** = \`1920\` 38- **Convert to WebP** = \`ON\` 39 40> ×ש×××× ××× × ××ª× ×××¨× ××× **70-85% ××ס×××** ××× ×¤×××¢× × ×¨××ת ×××××ת, ×××××× ×©×× ×ת××× ×ת ××תר ×-WebP â ×× ×©×שפר ×ש×ר×ת ×ת Core Web Vitals (LCP). 41 42### 2. [TinyPNG](https://tinypng.com/) 43××××¤× ×צ××× ×ª, ×××§× ×××××× ×-PNG ×¢× ×©×§×פ×ת. ×¢× 20 ת××× ×ת ××-××× ×ת ×××× ×. 44 45### עקר×× ×ת ××× 46- **×× ×××¢××ת ת××× × ×××××ת** ×××ר×פרס ××¤× × ××××¡× â ××× ×¢× ×ש××× ×שרת. 47- **×× ×ת××× × × ×©×רת JPG/PNG** â ת×סף ××× \`ShortPixel\` ×× \`Smush\` ×××× ××××ס ××××¢××. 48- **××××× ××ר** â ××××ת "Lazy Load" ×©× ×××× ××ר ×××פע×× ×ת ×× ×©× ××ר×פרס ××××× × (××רת ×× ×פ××).`,ut=async s=>{var o,w,b,Y;if(!pe){if(s==="security"){await Ee("×קש ×××צ×ת ××××× ××תר ××ר×פרס",dt);return}if(s==="images"){await Ee("××× ××צע ××פ×××××צ××ת ת××× ×ת?",mt);return}if(s==="wp_error"){ce({kind:"wp_error",code:"",details:""});return}if(s==="speed"){if(!(t!=null&&t.id)){await Ee("תר××¥ ×××קת ×××ר×ת","××× ××ר××¥ ×××קת ×××ר×ת ×× × ×¦×¨×× ××עת ×××× ××§××. ××ר ××§×× ×××ר ×××ר ×× × ×¡× ×©××.");return}const F=`תר××¥ ×××קת ×××ר×ת ××תר ×©× ${t.name}`;r(_=>[..._,{role:"user",content:F}]),i("technical"),V(!0);try{const{data:_}=await ae.from("clients").select("website_url").eq("id",t.id).maybeSingle();let Q=(_==null?void 0:_.website_url)||null;if(!Q){const{data:H}=await ae.from("client_credentials").select("website_url, credential_kind").eq("client_id",t.id).eq("is_active",!0),y=(H||[]).find(P=>P.credential_kind==="website"&&P.website_url);y&&(Q=y.website_url)}if(!Q){const H=`**××× ×××××× ××××ר ×¢××ר ${t.name}.** 49 50××× ××ר××¥ ×××קת ×××ר×ת (Google PageSpeed Insights) צר×× ×§××× ×××××ר ×ת ×ת××ת ××תר â 51×××× ×¡ ×-**SEO â ×××קת ×תר** ××××ר ×ת ×××××××, ×× ××סף ×××ª× ××ספת ת×ת "×תר ר×ש×", ××××ר ×× ×.`,y={role:"assistant",content:H};r(B=>[...B,y]);let P=x;P||(P=await j(F)),P&&(W(P,"user",F),Z(P,H));return}const{data:C}=await ae.from("site_audit_scans").select("site_health, errors_count, warnings_count, notices_count, summary, completed_at, website_url").eq("client_id",t.id).eq("status","completed").order("completed_at",{ascending:!1}).limit(1).maybeSingle();let z;if(C){const H=C.summary||{}
51,y=H.thematic_scores||H,P=new Date(C.completed_at).toLocaleString("he-IL");z=`## ×××קת ×××ר×ת â ${t.name} 52**×תר:** \`${C.website_url}\` â × ××× ×-Google PageSpeed Insights ×-${P}. 53 54| ××× | צ××× | 55| --- | --- | 56| Site Health | **${C.site_health??"â"}/100** | 57| Performance (Mobile) | ${y.mobile_performance??y.performance??"â"}/100 | 58| Performance (Desktop) | ${y.desktop_performance??"â"}/100 | 59| Core Web Vitals | ${y.core_web_vitals??"â"}/100 | 60| SEO | ${y.seo??"â"}/100 | 61| Accessibility | ${y.accessibility??"â"}/100 | 62| Best Practices | ${y.best_practices??"â"}/100 | 63 64**××¢××ת ש××××:** ${C.errors_count||0} ש××××ת · ${C.warnings_count||0} ×××ר×ת · ${C.notices_count||0} ×ער×ת. 65 66> ××רצת סר××§× ×¢××× ×ת â ×××× ×¡ ×-**SEO â ×××קת ×תר â ×רץ סר××§×**. ×× ×ª×× ×× ×תע××× × ×××××××ת ×× ×××.`}else z=`**××× ×¢×××× ×¡×¨×קת ×××ר×ת ×¢××ר ${t.name}** (×תר: \`${Q}\`). 67 68××× ××§×× ×ספר×× ××××ת×× â ×××× ×¡ ×-**SEO â ×××קת ×תר** ××××¥ "×רץ סר××§×". ×× ×××§× ~30 ×©× ××ת (PageSpeed Insights ×-Google), ××× ×××× ××צ×× ××× Site Health, Core Web Vitals, ××צ××¢×× ××××××× ×××סק××פ.`;const ye={role:"assistant",content:z};r(H=>[...H,ye]);let $=x;$||($=await j(F)),$&&(W($,"user",F),Z($,z))}catch(_){r(Q=>[...Q,{role:"assistant",content:`â ש×××× ×ש××פת ×××קת ××××ר×ת: ${(_==null?void 0:_.message)||_}`}])}finally{V(!1)}return}if(s==="server"){if(!(t!=null&&t.id)){await Ee("×××קת שרת/××ס××","××× ×××××§ ×ת ×××ס×× ×××××××× ×× × ×¦×¨×× ××עת ×××× ××§××. ××ר ××§×× ×××ר ×××ר ×× × ×¡× ×©××.");return}const F=`××××§ ×× ×ת ×××ס×× ×××××××× ×©× ${t.name}`;r(_=>[..._,{role:"user",content:F}]),i("technical"),V(!0);try{const{data:{session:_}}=await ae.auth.getSession(),Q=_==null?void 0:_.access_token;if(!Q)throw new Error("×ש ××ת××ר ×××ש");const{data:C,error:z}=await ae.functions.invoke("tamir-whois",{headers:{Authorization:`Bearer ${Q}`},body:{client_id:t.id}});if((C==null?void 0:C.error)==="no_domain"||/no_domain/i.test((z==null?void 0:z.message)||"")||/no_domain/i.test(((o=z==null?void 0:z.context)==null?void 0:o.responseText)||"")){const O=`## שרת / ××ס×× â ${t.name} 69 70> ð **פר×× ××××××× ××סתר×× â ×× ××××ר ×××××× ×××§××** 71> 72> ××× ××צ×× Registrar / NS / ××ס×× / פר×× ×§×©×¨, ×× × ×¦×¨×× ××עת ×× ××××××× ×©× ×××§××. 73> 74> **ס××ת ××סתר×:** ×× ×§×××ת רש××× ×¤×¢××× ×ס×× \`website\` ××ספת ×××§××, ××× ×ש×× \`website_url\` ××ר××ס ×××§×× ×ש×× ×¨××§. ××× ×××
74 ××××¤× ×ש×××£ × ×ª×× × RDAP/WHOIS. 75> 76> **××× ××ª×§× ××:** 77> 1. ×ספת ×××§×× â ××סף רש××× ×ס×× "×תר" ×¢× ××××××× (×××©× \`example.co.il\`). 78> 2. ××: ×ר××ס ×××§×× â ××× ×ת ש×× \`website_url\`. 79> 3. × ×¡× ×©×× ×ת ××פת×ר "×××קת שרת/××ס××".`;r(k=>[...k,{role:"assistant",content:O}]);let xe=x;xe||(xe=await j(F)),xe&&(W(xe,"user",F),Z(xe,O));return}if(z)throw z;if(C!=null&&C.error)throw new Error(C.message||C.error);const $=C,H=O=>O?new Date(O).toLocaleDateString("he-IL"):"â",y=($.ns||[]).map(O=>`- \`${O}\``).join(` 80`)||"_×× × ×צ×× ×¨×©×××ת NS._",P=($.contacts||[]).filter(O=>O.role!=="registrar"),B=$.rdap_status==="unavailable"?`### ð פר×× ××××××× 81> ð **פר×× ××××××× ×× ×××× ××** 82> 83> ${$.rdap_reason}`:`### ð פר×× ××××××× 84| ש×× | ×¢×¨× | 85| --- | --- | 86| Registrar | ${$.registrar||"â"} | 87| × ×¨×©× | ${H($.created)} | 88| תפ××× | ${H($.expires)} | 89| ×¢×××× | ${H($.updated)} | 90| ס×××ס | ${($.status||[]).join(", ")||"â"} |`,Ne=$.contacts_status==="redacted"?`### ð פר×× ×§×©×¨ 91> ð ${$.contacts_reason}`:P.length?`### ð פר×× ×§×©×¨ 92| תפק×× | ×©× / ×ר××× | ×××××× | 93| --- | --- | --- | 94${P.map(O=>`| ${O.role} | ${O.name||O.org||"â"} | ${O.email||(O.redacted?"_××סתר (GDPR)_":"â")} |`).join(` 95`)}`:`### ð פר×× ×§×©×¨ 96> ð ×× ×¤×¨×× ×קשר ××סתר×× ×¢×´× ××¨×©× (Privacy/GDPR).`,we=$.registrar_url,ne=we?/^https?:\/\//i.test(we)?we:`https://${we}`:void 0,Oe=ne?ne.replace(/^https?:\/\//i,"").replace(/\/$/,""):"",X=$.registrar||ne?`### ð·ï¸ ספק ××××××× (Registrar) 97**ש×:** ${$.registrar||"â"}${ne?` 98**×תר ×רש×:** [${Oe}](${ne})`:""}`:`### ð·ï¸ ספק ××××××× (Registrar) 99> ×× × ××¦× ×××¨×©× â [××××§× ××× ×ת ×-whois.com](https://www.whois.com/whois/${$.domain})`,q=`## שרת / ××ס×× â ${t.name} 100**××××××:** \`${$.domain}\` 101 102${B} 103 104${X} 105 106### ð¥ï¸ ××ס×× (××¤× NS) 107**ספק ×××××:** ${((w=$.hosting)==null?void 0:w.provider)||"×× ×××××"} _(××××××: ${((b=$.hosting)==null?void 0:b.confidence)||"â"})_${(Y=$.hosting)!=null&&Y.note?` 108 109> â ï¸ ${$.hosting.note}`:""} 110 111**רש×××ת NS:** 112${y} 113 114${Ne}`,G={role:"assistant",content:q};r(O=>[...O,G]);let K=x;K||(K=await j(F)),K&&(W(K,"user",F),Z(K,q))}catch(_){r(Q=>[...Q,{role:"assistant",content:`â ש×××× ××××קת ×שרת: ${(_==null?void 0:_.message)||_}`}])}finally{V(!1)}return}if(s==="seo_technical"){if(!(t!=null&&t.id)){ce({kind:"seo_technical",issue:""});return}const F=`ש×××£ ×ת ××¢××ת ×-SEO ×××× × ×©× ${t.name}`;r(_=>[..._,{role:"user",content:F}]),V(!0);try{const{data:_}=await ae.from("site_audit_scans").select("id, completed_at").eq("client_id",t.id).eq("status","completed").order("completed_at",{ascending:!1}).limit(1).maybeSingle();if(!_){ce({kind:"seo_technical",issue:""}),r(y=>y.slice(0,-1));return}const{data:Q}=await ae.from("site_audit_issues").select("id, title, severity, category, description, how_to_fix").eq("scan_id",_.id).eq("status","open").order("severity",{ascending:!0}).limit(40),C=Q||[];if(C.length===0){const y=`××× ××¢××ת SEO פת×××ת ×סר××§× ×××ר×× × ×©× ${t.name}. â¨`,P={role:"assistant",content:y};r(Ne=>[...Ne,P]);let B=x;B||(B=await j(F)),B&&(W(B,"user",F),Z(B,y));return}const z=C.map((y,P)=>{const B=y.severity==="error"?"ð´":y.severity==="warning"?"ð¡":"ðµ";return`${P+1}. ${B} **${y.title}** â _${y.category||"general"}_`}).join(` 115`),ye=`## ××¢××ת SEO ××× × â ${t.name} 116× ×צ×× **${C.length}** ××¢××ת פת×××ת ×סר××§× ×××ר×× ×. רש×× ×צ'×× "×ס×ר ×¢× ××¢×× #N" ××× × ×ס××ר ×××ª× ×××× ×תק×. 117 118${z}`,$={role:"assistant",content:ye};r(y=>[...y,$]);let H=x;H||(H=await j(F)),H&&(W(H,"user",F),Z(H,ye))}catch(_){r(Q=>[...Q,{role:"assistant",content:`â ש×××× ×ש××פת ×××¢××ת: ${(_==null?void 0:_.message)||_}`}])}finally{V(!1)}return}}},Pe=async s=>{var ye,$,H;if(!s.trim()&&le.length===0||pe)return;let o=s.trim();const w=he(o),b=w?"credential_access":void 0;if(w&&!(t!=null&&t.id)){const y={role:"user",content:o},P={role:"assistant",content:"××× ××ש×× ×¤×¨×× ×××©× ×× × ×¦×¨×× ××עת ×××× ××§××. ××ר ×§××× ××§×× ××פ×××ר ×××ר ××¢×××× ××× ×©×× ×©××, ××× × ×××צר ×× ××× ×§ ×× ×¤×¢×× ×פר×× ×××ש×."};r(B=>[...B,y,P]),oe("");return}if(w&&(t!=null&&t.id)){const y={role:"user",content:o};r(k=>[...k,y]),oe(""),i("credential"),V(!0);const{hint:P,serviceName:B}=J(o),[Ne,we]=await Promise.all([ae.from("client_credentials").select("service_name, website_url, login_url, username, credential_kind").eq("client_id",t.id).eq("is_active",!0),ae.from("landing_pages").select("id, name, slug, status").eq("client_id",t.id)]),ne=Ne.data||[],Oe=we.data||[],X=[],q=new Set;for(const k of ne){const ge=k.service_name||"",ze=k.credential_kind||"",ft=ge.toLowerCase(),gt=/mini|××× ×/.test(ft),Me=ge||t.name;if(ze==="website"){const ve=`website:${Me}`;if(q.has(ve))continue;q.add(ve),X.push({kindKey:"main_site",type:"main_site",label:Me,url:k.website_url||void 0,service_name:ge||void 0})}else if(ze==="landing_page"){const ve=`lp:${Me}`;if(q.has(ve))continue;q.add(ve),X.push({kindKey:gt?"mini_site":"landing_page",type:"service",service_name:ge,label:Me,url:k.website_url||void 0})}else{const ve=`svc:${Me}`;if(q.has(ve))continue;q.add(ve),X.push({kindKey:"service",type:"service",service_name:ge,label:Me})}}for(const k of Oe){const ge=`lpid:${k.id}`;q.has(ge)||(q.add(ge),!X.some(ze=>(ze.label||"").toLowerCase()===k.name.toLowerCase())&&X.push({kindKey:"landing_page",type:"landing_page",id:k.id,label:k.name,url:`/lp/${k.slug}`}))}let G=X;if(P==="main_site")G=X.filter(k=>k.kindKey==="main_site");else if(P==="landing_page")G=X.filter(k=>k.kindKey==="landing_page"||k.kindKey==="mini_site");else if(P==="service"&&B){const k=B.toLowerCase();G=X.filter(ge=>(ge.service_name||"").toLowerCase().includes(k))}G.length===0&&(G=X);let K;if(G.length===0)K="×× × ×צ×× ×¤×¨×× ×××©× ×××§×× ××× ××ספת. ×קש ×ת××ר ××× ××©× ×××ס××£ ××ת×.";else if(G.length===1){const k={client_id:t.id,auto:!0,sites:[G[0]]};K=`×××× ×¤×¨×× ××××©× â ×××× ×§ ××âפע×× ××פ×× ××¢×× 15 ××§×ת. 119 120\`\`\`access-request 121${JSON.stringify(k)} 122\`\`\``}
122else{const k={client_id:t.id,auto:!1,sites:G};K=`××ר ×ת ×× ×ס ש×××× ××ª× ×¦×¨×× ×¤×¨×× ×××©× (${G.length} × ×ס×× ×××× ××): 123 124\`\`\`access-request 125${JSON.stringify(k)} 126\`\`\``}await new Promise(k=>setTimeout(k,2200));const O={role:"assistant",content:K};r(k=>[...k,O]),V(!1);let xe=x;xe||(xe=await j(o)),xe&&(W(xe,"user",o),Z(xe,O.content));return}const Y=Ke.find(y=>y.key===De);Y&&(o=`${Y.prompt} 127 128×ער×ת × ×ספ×ת ×××שת×ש: ${o||"(×××)"}`,Ce(null)),le.length>0&&(o+=` 129 130[×§×צ×× ×צ×רפ××: ${le.map(y=>y.name).join(", ")}]`);const F={role:"user",content:o};r(y=>[...y,F]),oe(""),i("technical"),V(!0);const _=Date.now()+1800;let Q=!1,C=x;C||(C=await j(o)),C&&W(C,"user",o);let z="";try{const{data:{session:y}}=await ae.auth.getSession(),P=y==null?void 0:y.access_token;if(!P)throw new Error("×× ××××ר â ×ש ××ת××ר ×××ש");const B=await fetch(fs,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${P}`},body:JSON.stringify({messages:[...S,F],fileContents:le.length>0?le:void 0,client_id:(t==null?void 0:t.id)||null,language:m,intent:b})});if(be([]),!B.ok||!B.body){const X=await B.json().catch(()=>({}));throw new Error(X.error||`HTTP ${B.status}`)}const Ne=B.body.getReader(),we=new TextDecoder;let ne="";const Oe=async X=>{if(!Q){Q=!0;const q=_-Date.now();q>0&&await new Promise(G=>setTimeout(G,q))}z+=X,r(q=>{const G=q[q.length-1];return(G==null?void 0:G.role)==="assistant"?q.map((K,O)=>O===q.length-1?{...K,content:z}:K):[...q,{role:"assistant",content:z}]})};for(;;){const{done:X,value:q}=await Ne.read();if(X)break;ne+=we.decode(q,{stream:!0});let G;for(;(G=ne.indexOf(` 131`))!==-1;){let K=ne.slice(0,G);if(ne=ne.slice(G+1),K.endsWith("\r")&&(K=K.slice(0,-1)),!K.startsWith("data: "))continue;const O=K.slice(6).trim();if(O==="[DONE]")break;try{const k=(H=($=(ye=JSON.parse(O).choices)==null?void 0:ye[0])==null?void 0:$.delta)==null?void 0:H.content;k&&await Oe(k)}catch{ne=K+` 132`+ne;break}}}C&&z&&Z(C,z),Ut({userMessage:o,aiResponse:z,clientId:t==null?void 0:t.id,chatSource:"tamir-chat"})}catch(y){console.error("Tamir Chat error:",y),r(P=>[...P,{role:"assistant",content:`â ש××××: ${y.message}`}])}finally{V(!1)}},Je=async s=>{const o=S[s];if(!(!o||o.role!=="assistant")){if(!ke.trim()){A.error("× × ××××× ××תרת");return}try{const{data:{session:w}}=await ae.auth.getSession();if(!(w!=null&&w.user))throw new Error("×× ××××ר");const{error:b}=await ae.from("saved_copywriter_responses").insert({user_id:w.user.id,client_id:(t==null?void 0:t.id)||null,content:o.content,title:ke.trim(),template_type:"tamir"});if(b)throw b;A.success("× ×©×ר ××××¢×פ×× â"),Le(null),$e("")}catch(w){A.error(`ש××××: ${w.message}`)}}},Ye=h.useCallback(()=>{const s=S.filter(o=>o.role==="assistant");return s.length===0?(A.error("××× ×ª×©×××ת ×ס××××"),""):s.map((o,w)=>`## תש××× ${w+1} 133 134${o.content}`).join(` 135 136--- 137 138`)},[S]),pt=()=>{const s=Ye();if(!s)return;const o=new Blob([s],{type:"text/markdown;charset=utf-8"}),w=URL.createObjectURL(o),b=document.createElement("a");b.href=w,b.download=`tamir-report-${new Date().toISOString().slice(0,10)}.md`,b.click(),URL.revokeObjectURL(w),A.success("×××× ×××¦× ××צ×××")},ht=()=>{const s=Ye();s&&(D(s),fe(!0))},xt=async()=>{if(!c.trim()){A.error("××× ×¡ ×ת××ת ××××");return}me(!0);try{const s=l.replace(/## (.*)/g,"<h2>$1</h2>").replace(/### (.*)/g,"<h3>$1</h3>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\n/g,"<br/>"),{data:o,error:w}=await ae.functions.invoke("josephs-send-email",{body:{to:c,subject:T,htmlBody:s}});if(w)throw w;if(o!=null&&o.formattedHtml){const b=window.open("","_blank");b&&(b.document.write(o.formattedHtml),b.document.close())}A.success("×××× ×××× ×× ×¤×ª× ××××× ××ש"),fe(!1)}catch(s){A.error(`ש××××: ${s.message}`)}finally{me(!1)}},Qe=S.length>0;return e.jsxs("div",{className:"flex h-[calc(100vh-80px)] overflow-x-hidden",children:[e.jsx(Jt,{threads:d,activeThreadId:x,onSelect:g,onNew:ee,onDelete:re,loading:f}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-border mb-0 px-4 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center",children:e.jsx(at,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold",children:"×ת××ר"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"××××× ×¤×ת×× ××תר×× â ××ר×פרס, ×××× ××ר, ×××ר×ת ×××¢××ת ××× ××ת"})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-0.5 bg-secondary/60 rounded-lg p-0.5 mr-2",children:[e.jsx("button",{onClick:()=>je("chat"),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${te==="chat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"צ'××"}),e.jsxs("button",{onClick:()=>je("favorites"),className:`flex items-center gap-1 px-3 py-1 rounded-md text-xs font-medium transition-colors ${te==="favorites"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(Ue,{className:"w-3 h-3"})," ×××¢×פ××"]}),We&&e.jsxs("button",{onClick:()=>je("vault"),className:`flex items-center gap-1 px-3 py-1 rounded-md text-xs font-medium transition-colors ${te==="vault"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(qe,{className:"w-3 h-3"})," ×××ר×ת ×ספת"]})]}),Qe&&te==="chat"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:pt,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",title:"××צ×× ×××",children:[e.jsx(ct,{className:"w-3.5 h-3.5"})," ×××"]}),e.jsxs("button",{onClick:ht,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",title:"ש×× ×××××",children:[e.jsx(It,{className:"w-3.5 h-3.5"})," ××××"]}),e.jsxs("button",{onClick:ee,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:[e.jsx(Ft,{className:"w-3.5 h-3.5"})," ××ש"]})]})]})]}),te==="favorites"?e.jsx(Zt,{clientId:t==null?void 0:t.id}):te==="vault"&&We?e.jsx(nt,{className:"flex-1 min-h-0",children:e.jsx(cs,{})}):e.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[e.jsx(xs,{}),e.jsxs("div",{className:"relative z-10 flex-1 flex flex-col min-h-0",children:[e.jsx(nt,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"max-w-3xl mx-auto py-6 px-2 space-y-4",children:[!Qe&&e.jsxs("div",{className:"flex flex-col items-center justify-center pt-16 pb-8 text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center mb-5",children:e.jsx(at,{className:"w-8 h-8 text-white"})}),e.jsx("h2",{className:"text-base font-semibold mb-1",dir:"rtl",children:t?`ש×××, ×× × ×ת××ר ð» â ×× ×××¢×× ×××× ×ת ×©× ${t.name}?`:"ש×××, ×× × ×ת××ר ð»"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mb-4",dir:"rtl",children:t?`×× × ×××× ××¢××ר ×¢× ××ר×פרס, ×××× ××ר, ×××ר×ת, ××¢××ת ××× ××ת, ××× ××ש×× ×× ×¤×¨×× ×××©× ××תר ×©× ${t.name} ×××× ×§ ×× ×¤×¢××.`:"××××× ××ר×פרס, ×××× ××ר, ש×פ××¨× ×××ר×ת ×××¢××ת ××× ××ת. ××ר ××§×× ××××ר ××× ×©×××× ××ש×× ×× ×× ×¤×¨×× ×××©× ××תר."}),t&&e.jsx("div",{className:"mb-6 flex flex-wrap gap-2 justify-center",children:e.jsxs("button",{onClick:()=>Pe(`×× ×¤×¨×× ××××©× ××תר ×©× ${t.name}?`),dir:"rtl",className:"text-xs px-4 py-2 rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 text-white font-medium hover:opacity-90 transition-opacity",children:["ð פר×× ×××©× ××תר ×©× ",t.name]})}),e.jsxs("div",{className:"w-full max-w-lg mb-6",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-2 font-medium",children:"ת×× ××ת ×××ר×ת:"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ke.map(s=>e.jsxs("button",{onClick:()=>ut(s.key),className:"flex flex-col items-center gap-1.5 p-3 rounded-lg border border-border bg-secondary/40 hover:bg-secondary hover:border-cyan-500/30 transition-all text-center",children:[e.jsx("div",{className:"text-cyan-500",children:s.icon}),e.jsx("span",{className:"text-[11px] font-medium",children:s.label})]},s.key))})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 w-full max-w-lg",children:gs.map(s=>e.jsx("button",{onClick:()=>Pe(s),dir:"rtl",className:"text-right text-xs px-4 py-3 rounded-lg border border-border bg-secondary/50 hover:bg-secondary text-muted-foreground hover:text-foreground transition-colors",children:s},s))})]}),S.map((s,o)=>{const w=s.role==="user",b=new Intl.DateTimeFormat("he-IL",{hour:"2-digit",minute:"2-digit"}).format(new Date);return e.jsx("div",{className:`flex ${w?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:"flex flex-col max-w-[80%]",children:[e.jsx("div",{dir:"rtl",className:`rounded-2xl px-4 py-3 text-sm leading-relaxed shadow-sm ${w?"bg-gradient-to-r from-cyan-500 to-blue-600 text-white rounded-br-sm":"bg-secondary/60 border border-border rounded-bl-sm"}`,children:w?s.content:e.jsxs("div",{children:[e.jsx(js,{content:s.content}),e.jsxs("div",{className:"mt-2 flex justify-end gap-1 items-center",children:[e.jsx(Vt,{context:s.content}),Ge===o?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:ke,onChange:Y=>$e(Y.target.value),placeholder:"××תרת...",className:"bg-background rounded px-2 py-1 text-[11px] outline-none border border-border w-36",dir:"rtl",onKeyDown:Y=>Y.key==="Enter"&&Je(o),autoFocus:!0}),e.jsx("button",{onClick:()=>Je(o),className:"text-cyan-500 hover:text-cyan-400",children:e.jsx(Ue,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>{Le(null),$e("")},className:"text-muted-foreground hover:text-foreground text-[10px]",children:"â"})]}):e.jsxs("button",{onClick:()=>Le(o),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-cyan-500 transition-colors",children:[e.jsx(Ue,{className:"w-3 h-3"})," ש××ר"]})]})]})}),e.jsx("span",{className:`text-[10px] text-muted-foreground mt-1 ${w?"text-left":"text-right"} px-1`,dir:"ltr",children:b})]})},o)}),pe&&((Ze=S[S.length-1])==null?void 0:Ze.role)!=="assistant"&&e.jsx(ws,{mode:Te||"technical",staffName:_e,clientName:(t==null?void 0:t.name)||null}),e.jsx("div",{ref:N})]})}),e.jsx("div",{className:"px-4 pb-1",children:e.jsx("div",{className:"max-w-3xl mx-auto",children:e.jsx(Qt,{sectionKey:"tamir"})})}),le.length>0&&e.jsx("div",{className:"border-t border-border px-4 py-2",children:e.jsx("div",{className:"max-w-3xl mx-auto flex flex-wrap gap-2",children:le.map((s,o)=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-400 text-[11px] font-medium",children:[e.jsx(At,{className:"w-3 h-3"})," ",s.name,e.jsx("button",{onClick:()=>se(o),className:"hover:text-destructive",children:e.jsx(He,{className:"w-3 h-3"})})]},o))})}),De&&e.jsx("div",{className:"px-4 pb-1",children:e.jsxs("div",{className:"max-w-3xl mx-auto flex items-center gap-2",children:[e.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded bg-cyan-500/10 text-cyan-500 font-medium",children:["ת×× ×ת: ",(et=Ke.find(s=>
138s.key===De))==null?void 0:et.label]}),e.jsx("button",{onClick:()=>Ce(null),className:"text-muted-foreground hover:text-foreground text-xs",children:"â"})]})}),(U==null?void 0:U.kind)==="wp_error"&&e.jsx("div",{className:"px-4 pb-2",children:e.jsxs("div",{className:"max-w-3xl mx-auto bg-card border border-cyan-500/30 rounded-lg p-3 space-y-2",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-cyan-400",children:"תק×ת ××ר×פרס â ת×××ר ×××¢××"}),e.jsx("button",{onClick:()=>ce(null),className:"text-muted-foreground hover:text-foreground",children:e.jsx(He,{className:"w-4 h-4"})})]}),e.jsx("input",{value:U.code,onChange:s=>ce({...U,code:s.target.value}),placeholder:"×§×× ×©×××× (××ש×: 500, 404, ERR_TOO_MANY_REDIRECTS, White Screen)",className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-cyan-500"}),e.jsx("textarea",{value:U.details,onChange:s=>ce({...U,details:s.target.value}),placeholder:"ת×××ר × ×סף â ××ª× ×§×ר×, ×× × ×ס×ת, ×××× ×ª×סף ×¢××× ×ª ×××ר×× ×...",rows:2,className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-cyan-500 resize-none"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>ce(null),className:"px-3 py-1.5 text-xs rounded-md hover:bg-secondary",children:"×××××"}),e.jsx("button",{disabled:!U.code.trim()&&!U.details.trim(),onClick:()=>{const s=U.code.trim(),o=U.details.trim(),w=`×ס×ר תק×ת WordPress: ${s?`×§××/×©× ×ª×§××: ${s}.`:""} ${o?`ת×××ר: ${o}.`:""} ×× ××××¨× ×ש×××, ××× ××××× ×××× ×פת×ר צע×-××ר-צע×.`;ce(null),Pe(w)},className:"px-3 py-1.5 text-xs rounded-md bg-gradient-to-r from-cyan-500 to-blue-600 text-white disabled:opacity-50",children:"× ×ª× ×ª×§××"})]})]})}),(U==null?void 0:U.kind)==="seo_technical"&&e.jsx("div",{className:"px-4 pb-2",children:e.jsxs("div",{className:"max-w-3xl mx-auto bg-card border border-cyan-500/30 rounded-lg p-3 space-y-2",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-cyan-400",children:"SEO ××× × â ×× ×××¢××?"}),e.jsx("button",{onClick:()=>ce(null),className:"text-muted-foreground hover:text-foreground",children:e.jsx(He,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t!=null&&t.id?"××× ×¡×¨×קת SEO פע××× ×××§×× â ת×ר ×ת ×××¢×× ××××××§.":"××× ××§×× × ××ר â ת×ר ×ת ×××¢×× ×××× ×ת ××× × ×ס×××¢."}),e.jsx("textarea",{value:U.issue,onChange:s=>ce({...U,issue:s.target.value}),placeholder:"××××××: ××£ ×××ת ×× ×ת×× ×קס, robots.txt ××ס×, sitemap ×× × ××¢×, ×××ר×ת × ×××× ×××××××...",rows:3,className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-cyan-500 resize-none"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>ce(null),className:"px-3 py-1.5 text-xs rounded-md hover:bg-secondary",children:"×××××"}),e.jsx("button",{disabled:!U.issue.trim(),onClick:()=>{const o=`××¢××ת SEO ××× ×: ${U.issue.trim()}. ×ס×ר ××ר××× ×פשר×××, ××××× ×××××§, ×פתר×× ×¦×¢×-××ר-×¦×¢× ×¢××ר ×תר ××ר×פרס.`;ce(null),Pe(o)},className:"px-3 py-1.5 text-xs rounded-md bg-gradient-to-r from-cyan-500 to-blue-600 text-white disabled:opacity-50",children:"× ×ª× ××¢××"})]})]})}),e.jsx("div",{className:"border-t border-border pt-3 pb-2 px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"relative flex items-center gap-2",children:[e.jsx(Wt,{onTranscript:s=>oe(s)}),e.jsx("button",{onClick:()=>{var s;return(s=a.current)==null?void 0:s.click()},className:"p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",title:"צרף ×§×××¥",children:e.jsx(zt,{className:"w-4 h-4"})}),e.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:I,accept:"*/*"}),e.jsx("input",{value:ie,onChange:s=>oe(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),Pe(ie))},onFocus:()=>{/פר×× ××ש×|×××©× ×|ס×ס×/.test(ie)&&R(!0)},onBlur:()=>setTimeout(()=>R(!1),150),placeholder:"ש×× ×ת ×ת××ר â ××ר×פרס, ×××ר×ת, ××¢××ת ××× ××ת...",className:"flex-1 bg-secondary rounded-md px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-cyan-500",disabled:pe,dir:"rtl"}),e.jsx("button",{onClick:()=>Pe(ie),disabled:pe||!ie.trim()&&le.length===0,className:"p-2 rounded-md bg-gradient-to-r from-cyan-500 to-blue-600 text-white hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx(Ht,{className:"w-4 h-4"})}),v&&e.jsx("div",{dir:"rtl",className:"absolute bottom-full left-0 right-0 mb-2 bg-card border border-border rounded-lg shadow-lg p-2 z-30 animate-in fade-in slide-in-from-bottom-2 duration-200",children:t?n.length===0?e.jsxs("div",{className:"text-xs text-muted-foreground px-2 py-1.5",children:["×××
138 פר×× ×××©× ×©××ר×× ×",t.name]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[10px] text-muted-foreground px-2 pb-1.5",children:"×××× ×¤×¨×× ××ש×?"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map((s,o)=>e.jsx("button",{onMouseDown:w=>w.preventDefault(),onClick:()=>{oe(s.promptText),R(!1)},className:"text-xs px-3 py-1.5 rounded-md bg-secondary hover:bg-secondary/70 border border-border text-foreground transition-colors",children:s.label},o))})]}):e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5",children:"××ר ××§×× ××× ×ר××ת × ×ס×× ×××× ××"})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-1.5 px-1",children:[e.jsxs("button",{type:"button",onClick:()=>{oe("פר×× ×××©× ×"),R(!0)},className:"text-[11px] text-cyan-500 hover:text-cyan-400 transition-colors flex items-center gap-1",children:[e.jsx(qe,{className:"w-3 h-3"})," ",t?`צר×× ×¤×¨×× ×××©× ××תר×× ×©× ${t.name}?`:"צר×× ×¤×¨×× ×××©× ××תר××?"]}),t&&n.length>0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[n.length," × ×ס×× ×××× ××"]})]})]})})]})]}),Se&&e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-background border border-border rounded-xl max-w-2xl w-full max-h-[80vh] overflow-y-auto p-6 space-y-4",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"ש×××ת ס×××× ×××××"}),e.jsx("button",{onClick:()=>fe(!1),className:"text-muted-foreground hover:text-foreground",children:e.jsx(He,{className:"w-5 h-5"})})]}),e.jsx("input",{value:c,onChange:s=>L(s.target.value),placeholder:"×ת××ת ××××",className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none"}),e.jsx("input",{value:T,onChange:s=>M(s.target.value),placeholder:"× ×ש×",className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none"}),e.jsx("textarea",{value:l,onChange:s=>D(s.target.value),rows:12,className:"w-full bg-secondary rounded-md px-3 py-2 text-sm outline-none resize-y"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>fe(!1),className:"px-4 py-2 rounded-md text-sm text-muted-foreground hover:bg-secondary",children:"×××××"}),e.jsx("button",{onClick:xt,disabled:de,className:"px-4 py-2 rounded-md text-sm bg-gradient-to-r from-cyan-500 to-blue-600 text-white hover:opacity-90 disabled:opacity-50",children:de?"ש×××...":"ש××"})]})]})})]})]})}export{Ta as default};
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.