PageSourceSearch

https://bot-one.ai/assets/promotionHandoff-B0O0JUIz.js

js bot-one.ai collected 2026-10-05 15:28:25 UTC 5,399 bytes, 30 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePromotionSystem-C1v_wkyE.js","assets/main-xaUap2mU.js","assets/react-vendor-DgCwdNFP.js","assets/main-De4gvul0.css","assets/promotionDetection-DvvWONFN.js"])))=>i.map(i=>d[i]);
2import{as as u,aq as m,_ as c,l as O}from"./main-xaUap2mU.js";import{trackPromotionClick as y}from"./promotionTracking-FmHj2SRA.js";import"./react-vendor-DgCwdNFP.js";const f=/^\[PROMOTION_HANDOFF:([^\]]+)\]\s*/,E={en:"I’m interested in the “{title}” offer.",fr:"Je suis intéressé(e) par l’offre « {title} ».",es:"Me interesa la oferta «{title}».",pt:"Tenho interesse na oferta “{title}”.",it:"Sono interessato/a all’offerta “{title}”.",de:"Ich interessiere mich für das Angebot „{title}“."},_={en:"I’d like to know more about this offer.",fr:"Je souhaite en savoir plus sur cette offre.",es:"Me gustaría saber más sobre esta oferta.",pt:"Gostaria de saber mais sobre esta oferta.",it:"Vorrei saperne di più su questa offerta.",de:"Ich möchte mehr über dieses Angebot erfahren."};function p(){var e;try{return((e=O.getState().settings)==null?void 0:e.currentLanguage)||"en"}catch{return"en"}}function g(e){const t=u()||"anon";return`promo_engaged:${e}:${t}`}function v(e){try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}function w(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function h(e){return e?v(g(e)):[]}function T(e,t){if(!e||!t)return;const o=h(t);o.includes(e)||w(g(t),[...o,e])}function N(e,t){return h(t).includes(e)}function P(e){const t=e.match(f);if(!t)return{promotionId:null,visibleText:e};const o=e.slice(t[0].length).trim(),i=m(_,p());return{promotionId:t[1],visibleText:o||i}}function A(e){return f.test(e)}function I(e){const o=m(E,p()).replace("{title}",e.title);return`[PROMOTION_HANDOFF:${e.id}] ${o}`}async function M(e,t){var l,d;const{usePromotionSystem:o}=await c(async()=>{const{usePromotionSystem:a}=await import("./usePromotionSystem-C1v_wkyE.js");return{usePromotionSystem:a}},__vite__mapDeps([0,1,2,3]));await o.getState().initialize(t);const i=o.getState().creatives.find(a=>a.id===e);if(!i)return"";const r=((l=i.ai_handoff_prompt)==null?void 0:l.trim())||"Understand the visitor’s need, answer their questions about this offer, collect useful contact details (name, email, phone) when relevant, and propose a meeting if it feels appropriate.";let n=`
3
4`;n+="=".repeat(55)+`
5`,n+=`📣 PROMOTION HANDOFF — THE VISITOR CLICKED THE CTA
6`,n+="=".repeat(55)+`
7
8`,n+=`⛔ FORBIDDEN: NEVER emit [SHOW_PROMOTION:${e}] or any promo card — the visitor already saw it and clicked. Re-showing it would create a loop.
9
10`,n+=`Offer: “${i.title}”
11`,i.description&&(n+=`Description: ${i.description.slice(0,400)}
12`),i.display_context&&(n+=`Context: ${i.display_context.slice(0,200)}
13`);const s=((d=i.metadata)==null?void 0:d.knowledge_base)||[];return s.length>0&&(n+=`
14📚 OFFER KNOWLEDGE BASE (authoritative — use it to answer the visitor’s questions):
15`,s.forEach(a=>{n+=`--- ${a.name} (${a.type}) ---
16${a.content.replace(/\s+/g," ").slice(0,3e3)}
17`})),n+=`
18🎯 MISSION (configured by the client):
19${r}
20
21`,n+=`HOW TO EXECUTE — adapt to the mission:
22`,n+=`- Mission mentions a meeting / appointment / demo / call / consultation → use the Calendly flow (availability, name, email, confirmation).
23`,n+=`- Mission mentions collecting info / contact / quote / qualification → ask ONE question at a time, then collect name, email or phone.
24`,n+=`- Mission mentions sending a promo code / coupon / discount / document BY EMAIL → first ask for the visitor’s email address. Once they share it, confirm and emit on its own line: [SEND_EMAIL:{"subject":"...","body":"..."}] — write subject and body in the VISITOR’S language, include the exact promo code from the mission in the body. The email is sent automatically to the address the visitor shared. Never invent a promo code: only use one explicitly given in the mission.
25`,n+=`- Mission mentions purchase / order / subscription → guide toward conversion, handle objections, summarize the benefits.
26`,n+=`- Reply in the visitor’s language: warm, proactive, concise. No promo card, no CTA button — you lead the conversation now.
27`,n+=`- The creative is already displayed LARGE in the chat above your reply — do not describe it again, move the conversation forward.
28`,n+="=".repeat(55)+`
29
30`,n}async function R(e,t,o="en"){const{usePromotionSystem:i}=await c(async()=>{const{usePromotionSystem:s}=await import("./usePromotionSystem-C1v_wkyE.js");return{usePromotionSystem:s}},__vite__mapDeps([0,1,2,3])),{createPromotionHandoffHeroHtml:r}=await c(async()=>{const{createPromotionHandoffHeroHtml:s}=await import("./promotionDetection-DvvWONFN.js");return{createPromotionHandoffHeroHtml:s}},__vite__mapDeps([4,1,2,3]));await i.getState().initialize(t);const n=i.getState().creatives.find(s=>s.id===e);return n?r(n,o):null}function F(e,t,o="inline"){T(e.id,t),y(e.id,t,u(),o),window.dispatchEvent(new CustomEvent("bot-send-user-message",{detail:{message:I(e)}}))}export{f as PROMOTION_HANDOFF_RE,I as buildPromotionHandoffMessage,F as dispatchPromotionHandoff,h as getEngagedPromotionIds,M as getPromotionHandoffContextForAI,R as getPromotionHandoffHeroHtml,N as isPromotionEngaged,A as isPromotionHandoffMessage,T as markPromotionEngaged,P as parsePromotionHandoffMessage};

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.