PageSourceSearch

https://www.haylingua.am/assets/PopupNotification-bac78247.js

js haylingua.am collected 2026-10-04 08:00:53 UTC 3,387 bytes, 2 lines download raw bytes

1import{r,bk as P,j as e,X as E,al as S,c7 as _,cz as A}from"./vendor-2be7022e.js";import{P as I,a as O}from"./PollQuestion-e90ed9f4.js";import{h as R}from"./index-c1583a54.js";const T={}.VITE_API_BASE||"https://haylinguav2.onrender.com";function o(l,a){const n=String(l||"");return n.length>a?n.slice(0,a-1)+"…":n}function B({notification:l,onDismiss:a,onAnswer:n}){const b=r.useRef(null),{id:s,title:c,body:p,cta_label:i,cta_url:g,tracking_token:d,poll:t,image_url:w}=l||{},[N,x]=r.useState(!1),[j,u]=r.useState(""),[y,k]=r.useState(!1);if(r.useEffect(()=>{x(!1),u(""),k(!1)},[s]),r.useEffect(()=>{!d||b.current===s||(b.current=s,new Image().src=`${T}/t/o/${d}.png`)},[s,d]),!l)return null;function m(){a(s)}async function v(h){if(n){x(!0),u("");try{await n(s,h),k(!0),setTimeout(()=>a(s,{answered:!0}),1400)}catch(f){u((f==null?void 0:f.message)||"Couldn't send your answer — try again.")}finally{x(!1)}}}function C(){a(s),g&&(window.location.href=g)}return P.createPortal(e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":c||(t==null?void 0:t.question)||"Announcement",className:"fixed inset-0 z-[99999] flex items-center justify-center bg-slate-900/60 p-4 backdrop-blur-sm",onClick:m,children:e.jsxs("div",{className:"relative w-full max-w-sm overflow-hidden rounded-3xl bg-white p-6 text-center shadow-2xl dark:bg-slate-900",onClick:h=>h.stopPropagation(),children:[e.jsx("button",{type:"button",onClick:m,"aria-label":"Close",className:"absolute right-3 top-3 z-10 rounded-full bg-white/85 p-1.5 text-slate-500 shadow-sm hover:bg-white hover:text-slate-700 dark:bg-slate-900/80 dark:hover:bg-slate-900",children:e.jsx(E,{className:"h-5 w-5"})}),y?e.jsxs("div",{className:"py-6",role:"status",children:[e.jsx(S,{className:"mx-auto h-14 w-14 text-grass-500"}),e.jsx("h2",{className:"mt-3 font-display text-lg font-extrabold text-slate-900 dark:text-white",children:"Thanks for answering!"})]}):e.jsxs(e.Fragment,{children:[w?e.jsx("img",{src:w,alt:"",className:"-mx-6 -mt-6 mb-4 block aspect-[2/1] w-[calc(100%+3rem)] max-w-none object-cover"}):e.jsx("div",{className:"mx-auto mb-3 grid h-14 w-14 place-items-center rounded-2xl bg-brand-500 text-white",children:t?e.jsx(_,{className:"h-7 w-7"}):e.jsx(A,{className:"h-7 w-7"})}),c&&e.jsx("h2",{className:"font-display text-lg font-extrabold text-slate-900 dark:text-white",children:o(c,120)}),p&&e.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm font-semibold text-slate-600 dark:text-stone-300",children:e.jsx(R,{options:I,children:o(p,500)})}),t&&e.jsxs("div",{className:"mt-4 text-left",children:[e.jsx("p",{className:"mb-3 text-center text-base font-extrabold text-slate-900 dark:text-white",children:o(t.question,200)}),e.jsx(O,{poll:t,onSubmit:v,busy:N}),j&&e.jsx("p",{role:"alert",className:"mt-2 text-center text-xs font-bold text-cardinal-600",children:j})]}),e.jsxs("div",{className:"mt-5 flex flex-col gap-2",children:[!t&&i&&e.jsx("button",{type:"button",onClick:C,className:"rounded-2xl bg-brand-500 px-4 py-3 text-sm font-extrabold text-white transition hover:bg-brand-600",children:o(i,40)}),e.jsx("button",{type:"button",onClick:m,className:"rounded-2xl px-4 py-2 text-sm font-bold text-slate-400 transition hover:text-slate-600 dark:hover:text-stone-300",children:t?"Skip":i?"Not now":"Close"})]})]})]})}),document.body)}export{B as default};
2//# sourceMappingURL=PopupNotification-bac78247.js.map

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.