PageSourceSearch

https://hoghogh.ai/assets/CoachMarks-YHWRbR0l.js

js hoghogh.ai collected 2026-10-05 14:41:28 UTC 9,534 bytes, 1 lines download raw bytes

1import{a as J,r as n,j as e}from"./vendor-react-2K49FsAP.js";import{g as H,d as Z}from"./lib-utils-wtEBHdmq.js";import"./auth-store-Dg3F6UAs.js";import{u as ee,c as te}from"./index-CCguaWnS.js";import{bz as se,D as ne}from"./public-runtime-BdZjC6sM.js";import{f as ie,b as O,e as oe,t as L,l as X,h as re,i as ae,j as le,k as K,p as de,n as ce,o as ue,q,u as F,A as pe}from"./Walkthrough-Defa3akU.js";import{h as he}from"./firstMessageMark-CV3zfjpz.js";import{ao as me,X as fe}from"./vendor-utils-BOLI4KNR.js";import{A as Q,m as y}from"./vendor-motion-C7yP8PcU.js";import"./api-client-Df0aTNm3.js";import"./api-base-CVG4m-4D.js";import"./runtime-leaves-CLfW7HT3.js";import"./platform-Cj-fGGZZ.js";import"./query-client-BtlDnSI_.js";import"./vendor-query-wZlBI5mv.js";import"./public-config-D-K3B6qI.js";import"./corpusStats-qQq-UHtj.js";const xe=2,ge=1200,we=4e3;function be(p){return p==="/app"||p==="/app/"||p.startsWith("/app/chat")}const R="cm-spotlight-mask";function ye(){var m,w;if(typeof document=="undefined")return!1;const p=document.activeElement;if(p){const v=p.tagName;if(v==="INPUT"||v==="TEXTAREA"||p.isContentEditable)return!0}return((w=(m=document.body)==null?void 0:m.dataset)==null?void 0:w.aiStreaming)==="1"}let I=0;function Ye(){I=0}function He(){var z;const m=J().pathname,w=ie(m),v=be(m),T=n.useRef(m);T.current=m;const E=ee(),$=se("tour_before_first_message"),d=ne(),[f,k]=n.useState([]),[b,j]=n.useState(0),[S,D]=n.useState(!1),[l,A]=n.useState(null),V=n.useRef(new Set),N=n.useRef(null),_=n.useRef(void 0),C=n.useRef(null);n.useEffect(()=>{const s=()=>{D(!0),k([])},i=()=>D(!1);return window.addEventListener("apptour:open",s),window.addEventListener("apptour:close",i),window.addEventListener("walkthrough:open",s),window.addEventListener("walkthrough:close",i),()=>{window.removeEventListener("apptour:open",s),window.removeEventListener("apptour:close",i),window.removeEventListener("walkthrough:open",s),window.removeEventListener("walkthrough:close",i)}},[]),n.useEffect(()=>{if(clearTimeout(_.current),k([]),j(0),S)return;const s=()=>{const i=H();if(!i)return;const u=X(),W=O(i,E),B=ce(T.current,W).filter(a=>!u.seen[a.id]).filter(a=>a.route!=="*"||ue(T.current)).filter(a=>!u.dismissedAll||q(a.sinceVersion)).filter(a=>!a.anchor||F(a.anchor)!=null).filter(()=>$!=="hold_until_first_message"||!v?!0:he()),Y=xe-I;if(Y<=0||B.length===0)return;if(ye()){_.current=setTimeout(s,we);return}const G=B.slice(0,Y).map(a=>({step:a,isNew:q(a.sinceVersion)}));k(G),j(0)};return _.current=setTimeout(s,ge),()=>clearTimeout(_.current)},[w,v,S,E,$]);const t=te("coachmark:".concat(w),{priority:60,wants:f.length>0&&!S})&&(z=f[b])!=null?z:null,x=n.useMemo(()=>O(H(),E),[E,t==null?void 0:t.step.id]);n.useEffect(()=>{if(!t){A(null);return}if(!t.step.anchor){A(null);return}const s=()=>A(F(t.step.anchor));return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[t==null?void 0:t.step.id]),n.useEffect(()=>{if(!(!t||V.current.has(t.step.id))&&(V.current.add(t.step.id),I++,oe(t.step.id),L("coachmark_shown",x,t.step.id),N.current={id:t.step.id,aud:x},t.isNew)){const s=X();re(x).filter(u=>!s.seen[u.id]&&ae(u.sinceVersion,s.lastSpotlightVersion)>0).length===0&&le(pe)}},[t==null?void 0:t.step.id]);
1const c=n.useCallback((s="dismiss")=>{t&&L("coachmark_dismissed",x,t.step.id,s),N.current=null,k([]),j(0)},[t,x]);n.useEffect(()=>()=>{const s=N.current;s&&L("coachmark_dismissed",s.aud,s.id,"navigated_away"),N.current=null},[w]);const P=n.useCallback(()=>{t&&(L("coachmark_clicked",x,t.step.id),b<f.length-1?j(b+1):c("complete"))},[t,x,b,f.length,c]);if(n.useEffect(()=>{if(!t)return;const s=i=>{i.key==="Escape"&&(i.stopPropagation(),c("dismiss"))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,c]),n.useEffect(()=>{if(!(t!=null&&t.step.anchor))return;const s=document.querySelector('[data-tour="'.concat(t.step.anchor,'"]'));if(!s)return;const i=u=>{u.target instanceof Node&&s.contains(u.target)&&P()};return document.addEventListener("pointerdown",i,!0),()=>document.removeEventListener("pointerdown",i,!0)},[t==null?void 0:t.step.id,t==null?void 0:t.step.anchor,P]),!t||S)return null;const h=t.step,U=b>=f.length-1?"متوجه شدم":"بعدی",M=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-500 flex items-center justify-center shrink-0 shadow-lg shadow-indigo-500/25",children:e.jsx(me,{className:"w-4.5 h-4.5 text-white",style:{width:18,height:18}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-sm font-bold text-foreground leading-tight",children:h.title}),t.isNew&&e.jsx("span",{className:"text-[10px] font-bold text-white bg-gradient-to-l from-indigo-500 to-violet-500 rounded-full px-2 py-0.5 leading-none",children:"جدید"})]}),f.length>1&&e.jsxs("span",{className:"text-[10px] text-muted-foreground font-medium",children:[K(b+1)," از ",K(f.length)]})]}),e.jsx("button",{onClick:()=>c("dismiss"),className:"p-1.5 rounded-lg text-muted-foreground/60 hover:text-foreground hover:bg-muted/80 transition-colors shrink-0","aria-label":"بستن",children:e.jsx(fe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed mt-2.5 mb-3.5",children:h.desc}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("button",{onClick:()=>c("skip"),className:"text-xs font-medium text-muted-foreground hover:text-foreground px-3 py-2 rounded-lg hover:bg-muted/80 transition-colors",children:"رد شدن"}),e.jsx("button",{onClick:P,className:"text-xs font-bold text-white bg-primary hover:opacity-90 px-5 py-2 rounded-lg shadow-sm transition-all",children:U})]})]}),o=l?{top:l.top-8,left:l.left-8,width:l.width+16,height:l.height+16}:null,g=l!=null&&l.top+l.height>(typeof window!="undefined"?window.innerHeight:0)-260;if(E)return e.jsx(Q,{children:e.jsxs(y.div,{className:"fixed inset-0 z-[9990]",dir:"rtl",style:{pointerEvents:"none"},children:[e.jsxs(y.svg,{className:"absolute inset-0 h-full w-full",style:{pointerEvents:"none"},initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},children:[e.jsx("defs",{children:e.jsxs("mask",{id:"".concat(R,"-m"),children:[e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),o&&e.jsx("rect",{x:o.left,y:o.top,width:o.width,height:o.height,rx:14,fill:"black"})]})}),e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"rgba(0,0,0,0.25)",mask:"url(#".concat(R,"-m)"),style:{pointerEvents:"auto"},onClick:()=>c("outside_click")})]}),o&&e.jsx(y.div,{initial:{opacity:0,scale:d?1:.94},animate:{opacity:1,scale:1},transition:{duration:.3},className:"pointer-events-none absolute rounded-2xl",style:{top:o.top,left:o.left,width:o.width,height:o.height,boxShadow:"0 0 0 2.5px rgba(99,102,241,0.55), 0 0 18px rgba(99,102,241,0.25)"}},"cm-ring-m-".concat(h.id)),e.jsx(y.div,{role:"dialog","aria-label":h.title,className:Z("absolute inset-x-0 bg-card shadow-2xl px-5 pt-3 pb-4",g?"inset-x-3 border border-border/80 rounded-3xl":"bottom-0 border-t border-border/80 rounded-t-3xl"),style:g&&l?{pointerEvents:"auto",bottom:window.innerHeight-l.top+16}:{pointerEvents:"auto",paddingBottom:"calc(16px + env(safe-area-inset-bottom, 0px))"},initial:d?{opacity:0}:{y:g?24:"100%",opacity:g?0:1},animate:d?{opacity:1}:{y:0,opacity:1},exit:d?{opacity:0}:{y:g?24:"100%",opacity:g?0:1},transition:{type:"spring",stiffness:380,damping:34},onTouchStart:s=>{C.current=s.touches[0].clientY},onTouchEnd:s=>{const i=C.current;if(C.current=null,i==null)return;s.changedTouches[0].clientY-i>60&&c("dismiss")},children:g?e.jsx("div",{className:"pt-3 pb-1",children:M}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto w-10 h-1 rounded-full bg-muted-foreground/25 mb-3"}),M]})})]},"cm-sheet-".concat(h.id))});const r=o;return e.jsxs("div",{className:"fixed inset-0 z-[9990]",dir:"rtl",style:{pointerEvents:"none"},children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full",style:{pointerEvents:"none"},children:[e.jsx("defs",{children:e.jsxs("mask",{id:R,children:[e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),r&&e.jsx("rect",{x:r.left,y:r.top,width:r.width,height:r.height,rx:14,fill:"black"})]})}),e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"rgba(0,0,0,0.45)",mask:"url(#".concat(R,")"),style:{pointerEvents:"auto"},onClick:()=>c("outside_click")})]}),r&&e.jsx(y.div,{initial:{opacity:0,scale:d?1:.96},animate:{opacity:1,scale:1},transition:{duration:.3},className:"absolute pointer-events-none rounded-2xl",style:{top:r.top,left:r.left,width:r.width,height:r.height,boxShadow:"0 0 0 2.5px rgba(99,102,241,0.55), 0 0 18px rgba(99,102,241,0.25)"}},"cm-ring-".concat(h.id)),e.jsx(Q,{mode:"wait",children:e.jsx(y.div,{role:"dialog","aria-label":h.title,initial:{opacity:0,y:d?0:10,scale:d?1:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:d?0:-8,scale:d?1:.97},transition:{duration:.3},className:"absolute z-10",style:{...de(r),pointerEvents:"auto"},children:e.jsx("div",{className:"bg-card supports-[backdrop-filter]:bg-card/95 supports-[backdrop-filter]:backdrop-blur-xl border border-border/80 rounded-2xl shadow-2xl shadow-black/20 p-4",children:M})},"cm-card-".concat(h.id))})]})}export{He as CoachMarks,Ye as __resetCoachmarkSession,He 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.