@aikaara/chat-sdk 1.4.3 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AikaaraLinkButton-B3Jkp2ud.cjs → AikaaraLinkButton-8noYZU6k.cjs} +1 -1
- package/dist/{AikaaraLinkButton-BmRLTcf0.mjs → AikaaraLinkButton-Bu-_kC4m.mjs} +1 -1
- package/dist/AikaaraPaymentLink-Bdhq7MOy.cjs +1 -0
- package/dist/{AikaaraPaymentLink-BO_xsu0g.mjs → AikaaraPaymentLink-Bt-ZcRQQ.mjs} +60 -60
- package/dist/{MountTenant-Cz65F4Gu.cjs → MountTenant-DeboVbWw.cjs} +3 -3
- package/dist/{MountTenant-hMAB6fqS.mjs → MountTenant-b6kTA3yk.mjs} +5 -5
- package/dist/cdn/aikaara-chat.iife.js +10 -10
- package/dist/headless.cjs +1 -1
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/AikaaraPaymentLink-BJ3AyrtO.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./MountTenant-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./MountTenant-DeboVbWw.cjs");class l extends HTMLElement{shadow;payload=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render()}setPayload(e){this.payload=e,this.render()}render(){const e=this.payload;this.shadow.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host { display: block; margin-top: 8px; }
|
|
4
4
|
button {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y="https://checkout.razorpay.com/v1/checkout.js";let f=null;function u(){return window}class h extends HTMLElement{shadow;payloadData=[];message="";paidIdx={};constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}setPayload(r,t){this.payloadData=Array.isArray(r)?r:[],this.message=t??"",this.render()}render(){const r=this.payloadData.filter(e=>!!e&&typeof e=="object"&&e.type==="link"&&typeof e.url=="string"),t=r.map((e,a)=>{const i=e.name||"Open link",o=!!this.paidIdx[a];return`<button class="link${o?" paid":""}" data-i="${a}" type="button"${o?" disabled":""}><span class="lbl">${k(o?"Paid":i)}</span>`+(o?'<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8.5 L7 12 L13 5"/></svg>':'<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 11 L11 5 M6 5 H11 V10"/></svg>')+"</button>"}).join("");this.shadow.innerHTML="<style>:host { display:block; margin:6px 0; font-family:inherit; }.bubble { padding:12px 16px; border-radius:14px; background:var(--aikaara-bot-bubble-bg, #d8e5f5); color:var(--aikaara-bot-bubble-text, #1a2845); font-size:14px; line-height:1.55; margin-bottom:10px; }.links { display:flex; flex-direction:column; gap:8px; }.link { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 22px; border:1.5px solid var(--aikaara-primary, #1849a9); background:var(--aikaara-primary, #1849a9); color:var(--aikaara-primary-contrast, #fff); border-radius:24px; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; text-decoration:none; transition: filter 120ms; width:150px; align-self:flex-start; }.link:hover:not(:disabled) { filter: brightness(0.94); }.link.paid, .link:disabled { background:#e7f5ec; color:#0e7c3a; border-color:#0e7c3a; cursor:default; }.icon { width:13px; height:13px; }</style>"+(this.message?`<div class="bubble">${this.message}</div>`:"")+`<div class="links">${t}</div>`,this.shadow.querySelectorAll(".link").forEach(e=>{e.addEventListener("click",()=>{if(e.disabled)return;const a=Number(e.dataset.i||0),i=r[a];i&&this.handleClick(a,i)})})}handleClick(r,t){const e=b(t),a=u().__aikaara_descriptor__?.razorpay;if(!e||!a?.keyId){_(t.url,t.name||"Pay"),this.dispatchEvent(new CustomEvent("template-action",{detail:{text:t.name||"link-click",attributes:{action:{type:"link",url:t.url,orderId:e||t.orderId,openedIn:"modal"}}},bubbles:!0,composed:!0}));return}w(a.preferredBanksUrl,e,a.preferredBanksMethod,a.preferredBanksHeaders).catch(i=>(console.warn("[payment_link] preferred-banks fetch failed; continuing with default UI",i),[])).then(i=>g().then(()=>this.openRazorpay(r,e,a,i))).catch(i=>{console.error("[payment_link] Razorpay launch failed",i)})}openRazorpay(r,t,e,a){const i=u(),o=i.__aikaara_runtime__?.identity??{},c={key:e.keyId,order_id:t,name:e.name||i.__aikaara_descriptor__?.title||"Payment",prefill:{},handler:()=>{this.paidIdx[r]=!0,this.render()},modal:{ondismiss:()=>{}}};typeof o.mobile=="string"?c.prefill.contact=o.mobile:typeof o.phone=="string"&&(c.prefill.contact=o.phone),typeof o.email=="string"&&(c.prefill.email=o.email),typeof o.name=="string"?c.prefill.name=o.name:typeof o.userName=="string"&&(c.prefill.name=o.userName),Array.isArray(a)&&a.length&&(c.config={display:{blocks:{preferred_banks:{name:"Preferred Netbanking",instruments:a}},sequence:["block.preferred_banks","netbanking","card","upi"],preferences:{show_default_blocks:!0}}});const d=i.Razorpay;if(typeof d!="function")throw new Error("Razorpay Checkout script not available");const s=new d(c);s.on("payment.failed",l=>{console.warn("[payment_link] payment.failed",l?.error)}),s.open()}}function k(n){return String(n??"").replace(/[&<>]/g,r=>r==="&"?"&":r==="<"?"<":">")}function b(n){if(typeof n.orderId=="string"&&n.orderId)return n.orderId;try{const r=new URL(n.url,window.location.origin),t=r.searchParams.get("orderId")||r.searchParams.get("order_id");if(t)return t;if(r.hash&&r.hash.length>1){const e=new URLSearchParams(r.hash.replace(/^#/,"")),a=e.get("orderId")||e.get("order_id");if(a)return a}}catch{}return null}function g(){return typeof u().Razorpay=="function"?Promise.resolve():f||(f=new Promise((n,r)=>{const t=document.querySelector('script[data-aikaara-razorpay="1"]');if(t){t.addEventListener("load",()=>n()),t.addEventListener("error",()=>r(new Error("checkout.js failed to load")));return}const e=document.createElement("script");e.src=y,e.async=!0,e.dataset.aikaaraRazorpay="1",e.onload=()=>n(),e.onerror=()=>{f=null,r(new Error("checkout.js failed to load"))},document.head.appendChild(e)}),f)}function w(n,r,t,e){if(!n)return Promise.resolve([]);const a=String(t||"GET").toUpperCase()==="POST"?"POST":"GET",i=n.includes("{orderId}")?n.replace("{orderId}",encodeURIComponent(r)):n+(n.includes("?")?"&":"?")+"orderId="+encodeURIComponent(r),o=u().__aikaara_runtime__??{};return(typeof o.getSessionToken=="function"?o.getSessionToken():typeof o.getChatJwt=="function"?o.getChatJwt():Promise.resolve(null)).then(d=>{const s={Accept:"application/json",...e??{}};d&&(s.Authorization=`Bearer ${d}`);const l={method:a,headers:s,credentials:"omit"};return a==="POST"&&(s["Content-Type"]="application/json",l.body=JSON.stringify({orderId:r})),fetch(i,l)}).then(d=>{if(!d.ok)throw new Error(`preferred-banks ${d.status}`);return d.json()}).then(d=>{const s=d,l=s?.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:null;return(Array.isArray(d)?d:Array.isArray(s?.banks)?s.banks:Array.isArray(s?.data)?s.data:Array.isArray(l?.preferredPaymentBank)?l.preferredPaymentBank:Array.isArray(l?.banks)?l.banks:[]).map(p=>{if(typeof p=="string")return p;if(p&&typeof p=="object"){const m=p;return m.code||m.bankCode||m.bank_code||null}return null}).filter(p=>!!p)})}function _(n,r){if(!n)return;let t=document.querySelector("aikaara-link-modal");t||(t=document.createElement("aikaara-link-modal"),document.body.appendChild(t)),typeof t.show=="function"?t.show(n,r):window.open(n,"_blank","noopener,noreferrer")}function x(){typeof customElements>"u"||customElements.get("aikaara-template-payment-link")||customElements.define("aikaara-template-payment-link",h)}exports.AikaaraPaymentLink=h;exports.registerAikaaraPaymentLink=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
function
|
|
1
|
+
const h = "https://checkout.razorpay.com/v1/checkout.js";
|
|
2
|
+
let f = null;
|
|
3
|
+
function u() {
|
|
4
4
|
return window;
|
|
5
5
|
}
|
|
6
6
|
class y extends HTMLElement {
|
|
@@ -19,22 +19,22 @@ class y extends HTMLElement {
|
|
|
19
19
|
render() {
|
|
20
20
|
const r = this.payloadData.filter(
|
|
21
21
|
(e) => !!e && typeof e == "object" && e.type === "link" && typeof e.url == "string"
|
|
22
|
-
), t = r.map((e,
|
|
23
|
-
const i = e.name || "Open link", o = !!this.paidIdx[
|
|
24
|
-
return `<button class="link${o ? " paid" : ""}" data-i="${
|
|
22
|
+
), t = r.map((e, a) => {
|
|
23
|
+
const i = e.name || "Open link", o = !!this.paidIdx[a];
|
|
24
|
+
return `<button class="link${o ? " paid" : ""}" data-i="${a}" type="button"${o ? " disabled" : ""}><span class="lbl">${k(o ? "Paid" : i)}</span>` + (o ? '<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8.5 L7 12 L13 5"/></svg>' : '<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 11 L11 5 M6 5 H11 V10"/></svg>') + "</button>";
|
|
25
25
|
}).join("");
|
|
26
26
|
this.shadow.innerHTML = "<style>:host { display:block; margin:6px 0; font-family:inherit; }.bubble { padding:12px 16px; border-radius:14px; background:var(--aikaara-bot-bubble-bg, #d8e5f5); color:var(--aikaara-bot-bubble-text, #1a2845); font-size:14px; line-height:1.55; margin-bottom:10px; }.links { display:flex; flex-direction:column; gap:8px; }.link { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 22px; border:1.5px solid var(--aikaara-primary, #1849a9); background:var(--aikaara-primary, #1849a9); color:var(--aikaara-primary-contrast, #fff); border-radius:24px; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; text-decoration:none; transition: filter 120ms; width:150px; align-self:flex-start; }.link:hover:not(:disabled) { filter: brightness(0.94); }.link.paid, .link:disabled { background:#e7f5ec; color:#0e7c3a; border-color:#0e7c3a; cursor:default; }.icon { width:13px; height:13px; }</style>" + (this.message ? `<div class="bubble">${this.message}</div>` : "") + `<div class="links">${t}</div>`, this.shadow.querySelectorAll(".link").forEach((e) => {
|
|
27
27
|
e.addEventListener("click", () => {
|
|
28
28
|
if (e.disabled) return;
|
|
29
|
-
const
|
|
30
|
-
i && this.handleClick(
|
|
29
|
+
const a = Number(e.dataset.i || 0), i = r[a];
|
|
30
|
+
i && this.handleClick(a, i);
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
handleClick(r, t) {
|
|
35
|
-
const e = b(t),
|
|
36
|
-
if (!e || !
|
|
37
|
-
|
|
35
|
+
const e = b(t), a = u().__aikaara_descriptor__?.razorpay;
|
|
36
|
+
if (!e || !a?.keyId) {
|
|
37
|
+
_(t.url, t.name || "Pay"), this.dispatchEvent(
|
|
38
38
|
new CustomEvent("template-action", {
|
|
39
39
|
detail: {
|
|
40
40
|
text: t.name || "link-click",
|
|
@@ -48,12 +48,12 @@ class y extends HTMLElement {
|
|
|
48
48
|
);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
w(
|
|
51
|
+
w(a.preferredBanksUrl, e, a.preferredBanksMethod, a.preferredBanksHeaders).catch((i) => (console.warn("[payment_link] preferred-banks fetch failed; continuing with default UI", i), [])).then((i) => g().then(() => this.openRazorpay(r, e, a, i))).catch((i) => {
|
|
52
52
|
console.error("[payment_link] Razorpay launch failed", i);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
openRazorpay(r, t, e,
|
|
56
|
-
const i =
|
|
55
|
+
openRazorpay(r, t, e, a) {
|
|
56
|
+
const i = u(), o = i.__aikaara_runtime__?.identity ?? {}, c = {
|
|
57
57
|
key: e.keyId,
|
|
58
58
|
order_id: t,
|
|
59
59
|
name: e.name || i.__aikaara_descriptor__?.title || "Payment",
|
|
@@ -68,88 +68,88 @@ class y extends HTMLElement {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
typeof o.mobile == "string" ?
|
|
71
|
+
typeof o.mobile == "string" ? c.prefill.contact = o.mobile : typeof o.phone == "string" && (c.prefill.contact = o.phone), typeof o.email == "string" && (c.prefill.email = o.email), typeof o.name == "string" ? c.prefill.name = o.name : typeof o.userName == "string" && (c.prefill.name = o.userName), Array.isArray(a) && a.length && (c.config = {
|
|
72
72
|
display: {
|
|
73
73
|
blocks: {
|
|
74
|
-
|
|
74
|
+
preferred_banks: {
|
|
75
75
|
name: "Preferred Netbanking",
|
|
76
|
-
instruments:
|
|
76
|
+
instruments: a
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
sequence: ["block.
|
|
79
|
+
sequence: ["block.preferred_banks", "netbanking", "card", "upi"],
|
|
80
80
|
preferences: { show_default_blocks: !0 }
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
const
|
|
84
|
-
if (typeof
|
|
83
|
+
const d = i.Razorpay;
|
|
84
|
+
if (typeof d != "function")
|
|
85
85
|
throw new Error("Razorpay Checkout script not available");
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
console.warn("[payment_link] payment.failed",
|
|
89
|
-
}),
|
|
86
|
+
const s = new d(c);
|
|
87
|
+
s.on("payment.failed", (l) => {
|
|
88
|
+
console.warn("[payment_link] payment.failed", l?.error);
|
|
89
|
+
}), s.open();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function k(
|
|
93
|
-
return String(
|
|
92
|
+
function k(n) {
|
|
93
|
+
return String(n ?? "").replace(/[&<>]/g, (r) => r === "&" ? "&" : r === "<" ? "<" : ">");
|
|
94
94
|
}
|
|
95
|
-
function b(
|
|
96
|
-
if (typeof
|
|
95
|
+
function b(n) {
|
|
96
|
+
if (typeof n.orderId == "string" && n.orderId) return n.orderId;
|
|
97
97
|
try {
|
|
98
|
-
const r = new URL(
|
|
98
|
+
const r = new URL(n.url, window.location.origin), t = r.searchParams.get("orderId") || r.searchParams.get("order_id");
|
|
99
99
|
if (t) return t;
|
|
100
100
|
if (r.hash && r.hash.length > 1) {
|
|
101
|
-
const e = new URLSearchParams(r.hash.replace(/^#/, "")),
|
|
102
|
-
if (
|
|
101
|
+
const e = new URLSearchParams(r.hash.replace(/^#/, "")), a = e.get("orderId") || e.get("order_id");
|
|
102
|
+
if (a) return a;
|
|
103
103
|
}
|
|
104
104
|
} catch {
|
|
105
105
|
}
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
108
108
|
function g() {
|
|
109
|
-
return typeof
|
|
109
|
+
return typeof u().Razorpay == "function" ? Promise.resolve() : f || (f = new Promise((n, r) => {
|
|
110
110
|
const t = document.querySelector('script[data-aikaara-razorpay="1"]');
|
|
111
111
|
if (t) {
|
|
112
|
-
t.addEventListener("load", () =>
|
|
112
|
+
t.addEventListener("load", () => n()), t.addEventListener("error", () => r(new Error("checkout.js failed to load")));
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
const e = document.createElement("script");
|
|
116
|
-
e.src =
|
|
117
|
-
|
|
116
|
+
e.src = h, e.async = !0, e.dataset.aikaaraRazorpay = "1", e.onload = () => n(), e.onerror = () => {
|
|
117
|
+
f = null, r(new Error("checkout.js failed to load"));
|
|
118
118
|
}, document.head.appendChild(e);
|
|
119
|
-
}),
|
|
119
|
+
}), f);
|
|
120
120
|
}
|
|
121
|
-
function w(
|
|
122
|
-
if (!
|
|
123
|
-
const
|
|
124
|
-
return (typeof o.getSessionToken == "function" ? o.getSessionToken() : typeof o.getChatJwt == "function" ? o.getChatJwt() : Promise.resolve(null)).then((
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
return
|
|
129
|
-
}).then((
|
|
130
|
-
if (!
|
|
131
|
-
return
|
|
132
|
-
}).then((
|
|
133
|
-
const d = s;
|
|
134
|
-
return (Array.isArray(
|
|
135
|
-
if (typeof
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
return
|
|
121
|
+
function w(n, r, t, e) {
|
|
122
|
+
if (!n) return Promise.resolve([]);
|
|
123
|
+
const a = String(t || "GET").toUpperCase() === "POST" ? "POST" : "GET", i = n.includes("{orderId}") ? n.replace("{orderId}", encodeURIComponent(r)) : n + (n.includes("?") ? "&" : "?") + "orderId=" + encodeURIComponent(r), o = u().__aikaara_runtime__ ?? {};
|
|
124
|
+
return (typeof o.getSessionToken == "function" ? o.getSessionToken() : typeof o.getChatJwt == "function" ? o.getChatJwt() : Promise.resolve(null)).then((d) => {
|
|
125
|
+
const s = { Accept: "application/json", ...e ?? {} };
|
|
126
|
+
d && (s.Authorization = `Bearer ${d}`);
|
|
127
|
+
const l = { method: a, headers: s, credentials: "omit" };
|
|
128
|
+
return a === "POST" && (s["Content-Type"] = "application/json", l.body = JSON.stringify({ orderId: r })), fetch(i, l);
|
|
129
|
+
}).then((d) => {
|
|
130
|
+
if (!d.ok) throw new Error(`preferred-banks ${d.status}`);
|
|
131
|
+
return d.json();
|
|
132
|
+
}).then((d) => {
|
|
133
|
+
const s = d, l = s?.data && typeof s.data == "object" && !Array.isArray(s.data) ? s.data : null;
|
|
134
|
+
return (Array.isArray(d) ? d : Array.isArray(s?.banks) ? s.banks : Array.isArray(s?.data) ? s.data : Array.isArray(l?.preferredPaymentBank) ? l.preferredPaymentBank : Array.isArray(l?.banks) ? l.banks : []).map((p) => {
|
|
135
|
+
if (typeof p == "string") return p;
|
|
136
|
+
if (p && typeof p == "object") {
|
|
137
|
+
const m = p;
|
|
138
|
+
return m.code || m.bankCode || m.bank_code || null;
|
|
139
139
|
}
|
|
140
140
|
return null;
|
|
141
|
-
}).filter((
|
|
141
|
+
}).filter((p) => !!p);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
if (!
|
|
144
|
+
function _(n, r) {
|
|
145
|
+
if (!n) return;
|
|
146
146
|
let t = document.querySelector("aikaara-link-modal");
|
|
147
|
-
t || (t = document.createElement("aikaara-link-modal"), document.body.appendChild(t)), typeof t.show == "function" ? t.show(
|
|
147
|
+
t || (t = document.createElement("aikaara-link-modal"), document.body.appendChild(t)), typeof t.show == "function" ? t.show(n, r) : window.open(n, "_blank", "noopener,noreferrer");
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function v() {
|
|
150
150
|
typeof customElements > "u" || customElements.get("aikaara-template-payment-link") || customElements.define("aikaara-template-payment-link", y);
|
|
151
151
|
}
|
|
152
152
|
export {
|
|
153
153
|
y as AikaaraPaymentLink,
|
|
154
|
-
|
|
154
|
+
v as registerAikaaraPaymentLink
|
|
155
155
|
};
|
|
@@ -314,7 +314,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
314
314
|
</button>
|
|
315
315
|
</div>
|
|
316
316
|
</div>
|
|
317
|
-
`}setStatus(e){this.setAttribute("status",e)}}const Sd=/<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|pre)\b/i,Ed=/&(quot|apos|amp|lt|gt|nbsp|#\d+|#x[0-9a-f]+);/i,Ad={""":'"',"'":"'","<":"<",">":">","&":"&"," ":" "};function Id(a){return a.replace(/&(quot|apos|lt|gt|nbsp);/gi,e=>Ad[e.toLowerCase()]??e).replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/&/gi,"&")}function Ut(a){if(Sd.test(a))return a;const e=Ed.test(a)?Id(a):a;let t=Td(e);return t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(r,o,n)=>`<pre><code>${n.trim()}</code></pre>`),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" rel="noopener noreferrer">$1</a>'),t=t.replace(/(^|[^"'>=(])(https?:\/\/[^\s<]+)/g,(r,o,n)=>{const i=/[.,!?;:]+$/.exec(n),s=i?i[0]:"",l=s?n.slice(0,n.length-s.length):n;return`${o}<a href="${l}" rel="noopener noreferrer">${l}</a>${s}`}),t=t.replace(/\n/g,"<br>"),t}function Td(a){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return a.replace(/[&<>"']/g,t=>e[t])}const Cd=new Set(["p","br","hr","strong","em","b","i","u","s","small","sub","sup","code","pre","a","img","ul","ol","li","blockquote","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td"]),Od={a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),code:new Set(["class"]),pre:new Set(["class"]),span:new Set(["class"]),div:new Set(["class"])};function Bt(a){const e=document.createElement("template");return e.innerHTML=a,$l(e.content),e.innerHTML}function $l(a){const e=Array.from(a.childNodes);for(const t of e)if(t.nodeType===Node.ELEMENT_NODE){const r=t,o=r.tagName.toLowerCase();if(!Cd.has(o)){const s=document.createTextNode(r.textContent||"");a.replaceChild(s,t);continue}const n=Od[o]||new Set,i=Array.from(r.attributes);for(const s of i)n.has(s.name)||r.removeAttribute(s.name);if(r.hasAttribute("href")){const s=r.getAttribute("href")||"";!s.startsWith("http://")&&!s.startsWith("https://")&&!s.startsWith("/")&&r.removeAttribute("href")}$l(t)}}function ql(a,e={}){const{width:t=600,height:r=700,closeOnTypes:o}=e,n=Math.round(window.screenX+(window.outerWidth-t)/2),i=Math.round(window.screenY+(window.outerHeight-r)/2),s=window.open(a,"aikaara_popup",`width=${t},height=${r},left=${n},top=${i},resizable=yes,scrollbars=yes,status=yes`);if(!s)return null;const l=u=>{if(u.source!==s)return;const h=u.data?.type;o&&typeof h=="string"&&!o.includes(h)||(s.close(),window.removeEventListener("message",l))};window.addEventListener("message",l);const c=setInterval(()=>{s.closed&&(window.removeEventListener("message",l),clearInterval(c))},500);return s}function Pd(a){const e=Date.now()-a.getTime(),t=Math.round(e/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const r=Math.round(t/60);if(r<60)return`${r} min ago`;const o=Math.round(r/60);if(o<24)return`${o} hr ago`;const n=Math.round(o/24);return n===1?"Yesterday":n<7?`${n} d ago`:a.toLocaleDateString(void 0,{month:"short",day:"2-digit"})}class Hl extends HTMLElement{shadow;container;welcomeMessage="";showTimestamps=!0;timestampFormat="time";hideSystemMessages=[];linkHandlers=[];getLinkBearer=null;setHideSystemMessages(e){this.hideSystemMessages=(e??[]).map(t=>t.toLowerCase())}setTimestampFormat(e){this.timestampFormat=e,e==="none"&&(this.showTimestamps=!1)}templateLayout="inside";setTemplateLayout(e){this.templateLayout=e}shouldHideMessage(e){if(e.template?.contentType)return!1;const t=e.content;if(!t)return!1;const r=t.trim().toLowerCase();return r==="chat_initiated"||r==="group created"||r==="file_uploaded"||r==="file_upload"?!0:this.hideSystemMessages.length?this.hideSystemMessages.some(o=>r.includes(o)):!1}setLinkConfig(e,t){this.linkHandlers=e,this.getLinkBearer=t??null}constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.addEventListener("template-action",e=>{const t=e.detail;this.dispatchEvent(new CustomEvent("message-action",{detail:t,bubbles:!0,composed:!0}))}),this.addEventListener("click",e=>{const t=e.composedPath?.()??[],r=t.find(n=>n&&n.tagName==="A");!r||!r.href||r.dataset.noModal!==void 0||r.target==="_blank"||r.classList.contains("attachment")||t.some(n=>{if(!n||!n.classList)return!1;const i=n.classList;return i.contains("bubble")&&i.contains("user")})||/^https?:\/\//i.test(r.href)&&(e.preventDefault(),this.handleLinkClick(r.href,r.textContent?.trim()||void 0))}),this.shadow.innerHTML=`
|
|
317
|
+
`}setStatus(e){this.setAttribute("status",e)}}const Sd=/<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|pre)\b/i,Ed=/&(quot|apos|amp|lt|gt|nbsp|#\d+|#x[0-9a-f]+);/i,Ad={""":'"',"'":"'","<":"<",">":">","&":"&"," ":" "};function Id(a){return a.replace(/&(quot|apos|lt|gt|nbsp);/gi,e=>Ad[e.toLowerCase()]??e).replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t,10))).replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/&/gi,"&")}function Ut(a){if(Sd.test(a))return a;const e=Ed.test(a)?Id(a):a;let t=Td(e);return t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(r,o,n)=>`<pre><code>${n.trim()}</code></pre>`),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_self" rel="noopener noreferrer">$1</a>'),t=t.replace(/(^|[^"'>=(])(https?:\/\/[^\s<]+)/g,(r,o,n)=>{const i=/[.,!?;:]+$/.exec(n),s=i?i[0]:"",l=s?n.slice(0,n.length-s.length):n;return`${o}<a href="${l}" target="_self" rel="noopener noreferrer">${l}</a>${s}`}),t=t.replace(/\n/g,"<br>"),t}function Td(a){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return a.replace(/[&<>"']/g,t=>e[t])}const Cd=new Set(["p","br","hr","strong","em","b","i","u","s","small","sub","sup","code","pre","a","img","ul","ol","li","blockquote","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td"]),Od={a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),code:new Set(["class"]),pre:new Set(["class"]),span:new Set(["class"]),div:new Set(["class"])};function Bt(a){const e=document.createElement("template");return e.innerHTML=a,$l(e.content),e.innerHTML}function $l(a){const e=Array.from(a.childNodes);for(const t of e)if(t.nodeType===Node.ELEMENT_NODE){const r=t,o=r.tagName.toLowerCase();if(!Cd.has(o)){const s=document.createTextNode(r.textContent||"");a.replaceChild(s,t);continue}const n=Od[o]||new Set,i=Array.from(r.attributes);for(const s of i)n.has(s.name)||r.removeAttribute(s.name);if(r.hasAttribute("href")){const s=r.getAttribute("href")||"";!s.startsWith("http://")&&!s.startsWith("https://")&&!s.startsWith("/")&&r.removeAttribute("href")}$l(t)}}function ql(a,e={}){const{width:t=600,height:r=700,closeOnTypes:o}=e,n=Math.round(window.screenX+(window.outerWidth-t)/2),i=Math.round(window.screenY+(window.outerHeight-r)/2),s=window.open(a,"aikaara_popup",`width=${t},height=${r},left=${n},top=${i},resizable=yes,scrollbars=yes,status=yes`);if(!s)return null;const l=u=>{if(u.source!==s)return;const h=u.data?.type;o&&typeof h=="string"&&!o.includes(h)||(s.close(),window.removeEventListener("message",l))};window.addEventListener("message",l);const c=setInterval(()=>{s.closed&&(window.removeEventListener("message",l),clearInterval(c))},500);return s}function Pd(a){const e=Date.now()-a.getTime(),t=Math.round(e/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const r=Math.round(t/60);if(r<60)return`${r} min ago`;const o=Math.round(r/60);if(o<24)return`${o} hr ago`;const n=Math.round(o/24);return n===1?"Yesterday":n<7?`${n} d ago`:a.toLocaleDateString(void 0,{month:"short",day:"2-digit"})}class Hl extends HTMLElement{shadow;container;welcomeMessage="";showTimestamps=!0;timestampFormat="time";hideSystemMessages=[];linkHandlers=[];getLinkBearer=null;setHideSystemMessages(e){this.hideSystemMessages=(e??[]).map(t=>t.toLowerCase())}setTimestampFormat(e){this.timestampFormat=e,e==="none"&&(this.showTimestamps=!1)}templateLayout="inside";setTemplateLayout(e){this.templateLayout=e}shouldHideMessage(e){if(e.template?.contentType)return!1;const t=e.content;if(!t)return!1;const r=t.trim().toLowerCase();return r==="chat_initiated"||r==="group created"||r==="file_uploaded"||r==="file_upload"?!0:this.hideSystemMessages.length?this.hideSystemMessages.some(o=>r.includes(o)):!1}setLinkConfig(e,t){this.linkHandlers=e,this.getLinkBearer=t??null}constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.addEventListener("template-action",e=>{const t=e.detail;this.dispatchEvent(new CustomEvent("message-action",{detail:t,bubbles:!0,composed:!0}))}),this.addEventListener("click",e=>{const t=e.composedPath?.()??[],r=t.find(n=>n&&n.tagName==="A");!r||!r.href||r.dataset.noModal!==void 0||r.target==="_blank"||r.target==="_self"||r.classList.contains("attachment")||t.some(n=>{if(!n||!n.classList)return!1;const i=n.classList;return i.contains("bubble")&&i.contains("user")})||/^https?:\/\//i.test(r.href)&&(e.preventDefault(),this.handleLinkClick(r.href,r.textContent?.trim()||void 0))}),this.shadow.innerHTML=`
|
|
318
318
|
<style>
|
|
319
319
|
:host {
|
|
320
320
|
display: flex;
|
|
@@ -743,7 +743,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
743
743
|
<span class="message"></span>
|
|
744
744
|
<button class="dismiss">Dismiss</button>
|
|
745
745
|
</div>
|
|
746
|
-
`,this.container=this.shadow.querySelector(".banner"),this.shadow.querySelector(".dismiss")?.addEventListener("click",()=>this.hide())}show(e,t){const r=this.container.querySelector(".message");r&&(r.textContent=e),this.container.classList.add("visible"),this.dismissTimer&&clearTimeout(this.dismissTimer),t&&(this.dismissTimer=setTimeout(()=>this.hide(),t))}hide(){this.container.classList.remove("visible"),this.dismissTimer&&(clearTimeout(this.dismissTimer),this.dismissTimer=null)}}const Jr=new Map;function Ql(a){const e=Jr.get(a);if(e)return e;const t=new Promise((r,o)=>{const n=document.querySelector(`script[data-aikaara-src="${CSS.escape(a)}"]`);if(n){n.dataset.aikaaraReady==="1"?r():(n.addEventListener("load",()=>r(),{once:!0}),n.addEventListener("error",()=>o(new Error(`Failed to load ${a}`)),{once:!0}));return}const i=document.createElement("script");i.src=a,i.async=!0,i.crossOrigin="anonymous",i.dataset.aikaaraSrc=a,i.addEventListener("load",()=>{i.dataset.aikaaraReady="1",r()},{once:!0}),i.addEventListener("error",()=>{Jr.delete(a),o(new Error(`Failed to load ${a}`))},{once:!0}),document.head.appendChild(i)});return Jr.set(a,t),t}function Nd(a,e=5e3){return new Promise((t,r)=>{const o=setTimeout(()=>r(new Error(`Custom element <${a}> not registered within ${e}ms`)),e);customElements.whenDefined(a).then(()=>{clearTimeout(o),t()})})}const Ud={"aikaara-template-payment-link":()=>Promise.resolve().then(()=>require("./AikaaraPaymentLink-
|
|
746
|
+
`,this.container=this.shadow.querySelector(".banner"),this.shadow.querySelector(".dismiss")?.addEventListener("click",()=>this.hide())}show(e,t){const r=this.container.querySelector(".message");r&&(r.textContent=e),this.container.classList.add("visible"),this.dismissTimer&&clearTimeout(this.dismissTimer),t&&(this.dismissTimer=setTimeout(()=>this.hide(),t))}hide(){this.container.classList.remove("visible"),this.dismissTimer&&(clearTimeout(this.dismissTimer),this.dismissTimer=null)}}const Jr=new Map;function Ql(a){const e=Jr.get(a);if(e)return e;const t=new Promise((r,o)=>{const n=document.querySelector(`script[data-aikaara-src="${CSS.escape(a)}"]`);if(n){n.dataset.aikaaraReady==="1"?r():(n.addEventListener("load",()=>r(),{once:!0}),n.addEventListener("error",()=>o(new Error(`Failed to load ${a}`)),{once:!0}));return}const i=document.createElement("script");i.src=a,i.async=!0,i.crossOrigin="anonymous",i.dataset.aikaaraSrc=a,i.addEventListener("load",()=>{i.dataset.aikaaraReady="1",r()},{once:!0}),i.addEventListener("error",()=>{Jr.delete(a),o(new Error(`Failed to load ${a}`))},{once:!0}),document.head.appendChild(i)});return Jr.set(a,t),t}function Nd(a,e=5e3){return new Promise((t,r)=>{const o=setTimeout(()=>r(new Error(`Custom element <${a}> not registered within ${e}ms`)),e);customElements.whenDefined(a).then(()=>{clearTimeout(o),t()})})}const Ud={"aikaara-template-payment-link":()=>Promise.resolve().then(()=>require("./AikaaraPaymentLink-Bdhq7MOy.cjs")).then(({registerAikaaraPaymentLink:a})=>a())};function Bd(a){const e=`template:${a}`,t=window.__aikaara_descriptor__?.components?.[e];return t&&t.kind==="iife-element"?{render:t.tag,scriptUrl:t.scriptUrl,props:t.props}:window.__aikaara_descriptor__?.templates?.[a]}class Jl extends HTMLElement{shadow;payloadData=null;innerMessage="";renderGen=0;_consumedValues=null;static get observedAttributes(){return["content-type","template-id","message-id"]}constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.addEventListener("template-action",e=>{const t=e.detail,r=this.getAttribute("message-id");if(r&&t?.attributes?.action){const o=$d(t.attributes.action);if(Object.keys(o).length>0)try{localStorage.setItem(`aikaara_form:${r}`,JSON.stringify(o))}catch{}}this.dataset.consumed="true",this._applyConsumedToChildren()})}attributeChangedCallback(){this.render()}setPayload(e,t){this.payloadData=e,t!==void 0&&(this.innerMessage=t),this.render()}setConsumedValues(e){this._consumedValues=e,this._applyConsumedToChildren()}_applyConsumedToChildren(){let e=this._consumedValues;if(!e){const r=this.getAttribute("message-id");if(r)try{const o=localStorage.getItem(`aikaara_form:${r}`);o&&(e=JSON.parse(o))}catch{}}if(e){const r=e;this.querySelectorAll("aikaara-option-list").forEach(o=>{const n=o,i=n.getName?.();i&&r[i]?.length&&n.setPreSelected?.(r[i])})}this.querySelectorAll("aikaara-submit-action, aikaara-modal-action, aikaara-link-button").forEach(r=>{r.style.display="none"});const t=new Set(["aikaara-option-list","aikaara-submit-action","aikaara-modal-action","aikaara-link-button"]);this.querySelectorAll("*").forEach(r=>{if(t.has(r.tagName.toLowerCase()))return;e&&r.setConsumedValues?.(e),r.dataset.consumed="true"})}render(){const e=this.getAttribute("content-type")??"",t=this.getAttribute("template-id")??"";for(this.renderGen+=1,this.shadow.innerHTML=`
|
|
747
747
|
<style>
|
|
748
748
|
:host { display: block; }
|
|
749
749
|
::slotted(*) { display: block; }
|
|
@@ -757,7 +757,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
757
757
|
}
|
|
758
758
|
</style>
|
|
759
759
|
<slot></slot>
|
|
760
|
-
`;this.firstChild;)this.removeChild(this.firstChild);if(!e)return;const r=t?Bd(t):void 0,o=r?.render??(t?`aikaara-template-${t}`:`aikaara-template-${e}`),n=Ud[o];if(n&&!customElements.get(o)?n().then(()=>this.render()).catch(i=>console.warn(`[aikaara-template-renderer] native template ${o} failed to load`,i)):r?.scriptUrl&&!customElements.get(o)&&Ql(r.scriptUrl).then(()=>Nd(o)).then(()=>this.render()).catch(i=>console.warn(`[aikaara-template-renderer] failed to lazy-load ${r.scriptUrl}`,i)),customElements.get(o)){const i=document.createElement(o);if(r?.props){for(const[s,l]of Object.entries(r.props))if(typeof i[s]=="function")try{i[s](l)}catch(c){console.warn(`[aikaara-template-renderer] props.${s} threw on <${o}>`,c)}}i.setPayload?.(this.payloadData,this.innerMessage),this.appendChild(i),this.dataset.consumed==="true"&&(this._consumedValues&&Object.keys(this._consumedValues).length>0&&i.setConsumedValues?.(this._consumedValues),i.dataset.consumed="true");return}if(Array.isArray(this.payloadData)){const i=this.payloadData;if(i.length>0&&i.every(l=>l&&typeof l=="object"&&!Array.isArray(l)&&!("type"in l)&&!("data"in l)&&typeof l.message=="string")){const l=document.createElement("aikaara-option-list");l.setPayload({name:"quick-reply",type:"button",options:i.map(c=>{const u=typeof c.title=="string"?c.title:"",h=c.message;return{label:u||h,value:h}})}),this.appendChild(l);return}for(const l of i)this.mountField(l)}else if(this.payloadData&&typeof this.payloadData=="object"){const i=this.payloadData;typeof i.message=="string"&&(i.okLabel||i.action||i.ok)&&this.mountModal(i)}this.dataset.consumed==="true"&&this._applyConsumedToChildren()}mountField(e){if(!e||typeof e!="object")return;const t=e.type??e.data?.type;if(t==="link"){this.mountLinkButton(e);return}const r=e.data;if(r){if(t==="checkbox"||t==="radio"||t==="button"){const o=document.createElement("aikaara-option-list");o.setPayload({name:r.name??"",title:r.title,options:r.options??[],type:t}),this.appendChild(o);return}if(t==="submit"){const o=document.createElement("aikaara-submit-action"),n=this.getAttribute("message-id")??void 0;o.setPayload({name:r.name??"Submit",action:r.action??{message:r.name??"Submit"},messageId:n}),this.appendChild(o);return}t==="modal"&&this.mountModal({message:r.message??"",okLabel:r.okLabel,cancelLabel:r.cancelLabel,action:r.action})}}mountLinkButton(e){const t=this.renderGen;Promise.resolve().then(()=>require("./AikaaraLinkButton-
|
|
760
|
+
`;this.firstChild;)this.removeChild(this.firstChild);if(!e)return;const r=t?Bd(t):void 0,o=r?.render??(t?`aikaara-template-${t}`:`aikaara-template-${e}`),n=Ud[o];if(n&&!customElements.get(o)?n().then(()=>this.render()).catch(i=>console.warn(`[aikaara-template-renderer] native template ${o} failed to load`,i)):r?.scriptUrl&&!customElements.get(o)&&Ql(r.scriptUrl).then(()=>Nd(o)).then(()=>this.render()).catch(i=>console.warn(`[aikaara-template-renderer] failed to lazy-load ${r.scriptUrl}`,i)),customElements.get(o)){const i=document.createElement(o);if(r?.props){for(const[s,l]of Object.entries(r.props))if(typeof i[s]=="function")try{i[s](l)}catch(c){console.warn(`[aikaara-template-renderer] props.${s} threw on <${o}>`,c)}}i.setPayload?.(this.payloadData,this.innerMessage),this.appendChild(i),this.dataset.consumed==="true"&&(this._consumedValues&&Object.keys(this._consumedValues).length>0&&i.setConsumedValues?.(this._consumedValues),i.dataset.consumed="true");return}if(Array.isArray(this.payloadData)){const i=this.payloadData;if(i.length>0&&i.every(l=>l&&typeof l=="object"&&!Array.isArray(l)&&!("type"in l)&&!("data"in l)&&typeof l.message=="string")){const l=document.createElement("aikaara-option-list");l.setPayload({name:"quick-reply",type:"button",options:i.map(c=>{const u=typeof c.title=="string"?c.title:"",h=c.message;return{label:u||h,value:h}})}),this.appendChild(l);return}for(const l of i)this.mountField(l)}else if(this.payloadData&&typeof this.payloadData=="object"){const i=this.payloadData;typeof i.message=="string"&&(i.okLabel||i.action||i.ok)&&this.mountModal(i)}this.dataset.consumed==="true"&&this._applyConsumedToChildren()}mountField(e){if(!e||typeof e!="object")return;const t=e.type??e.data?.type;if(t==="link"){this.mountLinkButton(e);return}const r=e.data;if(r){if(t==="checkbox"||t==="radio"||t==="button"){const o=document.createElement("aikaara-option-list");o.setPayload({name:r.name??"",title:r.title,options:r.options??[],type:t}),this.appendChild(o);return}if(t==="submit"){const o=document.createElement("aikaara-submit-action"),n=this.getAttribute("message-id")??void 0;o.setPayload({name:r.name??"Submit",action:r.action??{message:r.name??"Submit"},messageId:n}),this.appendChild(o);return}t==="modal"&&this.mountModal({message:r.message??"",okLabel:r.okLabel,cancelLabel:r.cancelLabel,action:r.action})}}mountLinkButton(e){const t=this.renderGen;Promise.resolve().then(()=>require("./AikaaraLinkButton-8noYZU6k.cjs")).then(({registerAikaaraLinkButton:r,AikaaraLinkButton:o})=>{if(t!==this.renderGen)return;r();const n=document.createElement("aikaara-link-button");n.setPayload({name:e.name??"Open",url:e.url??"",openLinkInNewTab:e.openLinkInNewTab,orderId:e.orderId,extra:Fd(e),messageId:this.getAttribute("message-id")??void 0}),this.appendChild(n)})}mountModal(e){const t=document.createElement("aikaara-modal-action");t.setPayload(e),this.appendChild(t)}}const Dd=new Set(["type","url","name","openLinkInNewTab","orderId"]);function Fd(a){const e={};for(const[t,r]of Object.entries(a))Dd.has(t)||(e[t]=r);return e}function $d(a){const e=new Set(["message_id","formAction","requestType","serviceType"]),t={};for(const[r,o]of Object.entries(a))e.has(r)||(Array.isArray(o)&&o.every(n=>typeof n=="string")?t[r]=o:typeof o=="string"&&(t[r]=[o]));return t}class Xl extends HTMLElement{shadow;static get observedAttributes(){return["text","subtext"]}constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const e=this.getAttribute("text")??this.textContent??"",t=this.getAttribute("subtext")??"";this.shadow.innerHTML=`
|
|
761
761
|
<style>
|
|
762
762
|
:host {
|
|
763
763
|
display: flex;
|
|
@@ -13270,12 +13270,12 @@ function Ut(a) {
|
|
|
13270
13270
|
let t = nd(e);
|
|
13271
13271
|
return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (r, o, n) => `<pre><code>${n.trim()}</code></pre>`), t = t.replace(/`([^`]+)`/g, "<code>$1</code>"), t = t.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/\*(.+?)\*/g, "<em>$1</em>"), t = t.replace(
|
|
13272
13272
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
13273
|
-
'<a href="$2" rel="noopener noreferrer">$1</a>'
|
|
13273
|
+
'<a href="$2" target="_self" rel="noopener noreferrer">$1</a>'
|
|
13274
13274
|
), t = t.replace(
|
|
13275
13275
|
/(^|[^"'>=(])(https?:\/\/[^\s<]+)/g,
|
|
13276
13276
|
(r, o, n) => {
|
|
13277
13277
|
const i = /[.,!?;:]+$/.exec(n), s = i ? i[0] : "", l = s ? n.slice(0, n.length - s.length) : n;
|
|
13278
|
-
return `${o}<a href="${l}" rel="noopener noreferrer">${l}</a>${s}`;
|
|
13278
|
+
return `${o}<a href="${l}" target="_self" rel="noopener noreferrer">${l}</a>${s}`;
|
|
13279
13279
|
}
|
|
13280
13280
|
), t = t.replace(/\n/g, "<br>"), t;
|
|
13281
13281
|
}
|
|
@@ -13434,7 +13434,7 @@ class ld extends HTMLElement {
|
|
|
13434
13434
|
const t = e.composedPath?.() ?? [], r = t.find(
|
|
13435
13435
|
(n) => n && n.tagName === "A"
|
|
13436
13436
|
);
|
|
13437
|
-
!r || !r.href || r.dataset.noModal !== void 0 || r.target === "_blank" || r.classList.contains("attachment") || t.some((n) => {
|
|
13437
|
+
!r || !r.href || r.dataset.noModal !== void 0 || r.target === "_blank" || r.target === "_self" || r.classList.contains("attachment") || t.some((n) => {
|
|
13438
13438
|
if (!n || !n.classList) return !1;
|
|
13439
13439
|
const i = n.classList;
|
|
13440
13440
|
return i.contains("bubble") && i.contains("user");
|
|
@@ -14361,7 +14361,7 @@ function yd(a, e = 5e3) {
|
|
|
14361
14361
|
});
|
|
14362
14362
|
}
|
|
14363
14363
|
const vd = {
|
|
14364
|
-
"aikaara-template-payment-link": () => import("./AikaaraPaymentLink-
|
|
14364
|
+
"aikaara-template-payment-link": () => import("./AikaaraPaymentLink-Bt-ZcRQQ.mjs").then(({ registerAikaaraPaymentLink: a }) => a())
|
|
14365
14365
|
};
|
|
14366
14366
|
function wd(a) {
|
|
14367
14367
|
const e = `template:${a}`, t = window.__aikaara_descriptor__?.components?.[e];
|
|
@@ -14550,7 +14550,7 @@ class _d extends HTMLElement {
|
|
|
14550
14550
|
*/
|
|
14551
14551
|
mountLinkButton(e) {
|
|
14552
14552
|
const t = this.renderGen;
|
|
14553
|
-
import("./AikaaraLinkButton-
|
|
14553
|
+
import("./AikaaraLinkButton-Bu-_kC4m.mjs").then(({ registerAikaaraLinkButton: r, AikaaraLinkButton: o }) => {
|
|
14554
14554
|
if (t !== this.renderGen) return;
|
|
14555
14555
|
r();
|
|
14556
14556
|
const n = document.createElement("aikaara-link-button");
|