arcy.js 0.1.0 → 0.1.2
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/arcy.chat.39921845e233.js +1271 -0
- package/dist/arcy.legacy.7037dec7a67f.js +568 -0
- package/dist/arcy.loader.js +1 -1
- package/dist/arcy.modern.0ffea3108a8d.js +568 -0
- package/dist/arcy.picker.73f47221b73c.js +59 -0
- package/dist/chat-IU4IJMGO.js +3860 -0
- package/dist/chunk-7VVKR3AO.js +122 -0
- package/dist/chunk-CQ2DESAJ.js +263 -0
- package/dist/chunk-DKYMIAYF.js +7 -0
- package/dist/chunk-DW3GUQ6J.js +234 -0
- package/dist/chunk-FR6SJSDU.js +220 -0
- package/dist/chunk-LGWYJSYX.js +271 -0
- package/dist/chunk-NIHUDSWK.js +155 -0
- package/dist/chunk-NY3NXM2V.js +213 -0
- package/dist/design-mode.js +2 -127
- package/dist/flow-M7W3H3C5.js +1422 -0
- package/dist/index.cjs +9915 -1158
- package/dist/index.d.ts +44 -8
- package/dist/index.js +799 -1157
- package/dist/picker-JPESE6JJ.js +2134 -0
- package/package.json +1 -1
- package/dist/arcy.chat.ab181cf5a84b.js +0 -1258
- package/dist/arcy.legacy.ab4e9266b657.js +0 -567
- package/dist/arcy.modern.60faeffc62a2.js +0 -567
- package/dist/arcy.picker.c598a581d964.js +0 -59
- package/dist/design-mode.d.cts +0 -197
- package/dist/index.d.cts +0 -133
- package/dist/snippet.d.cts +0 -39
|
@@ -0,0 +1,1271 @@
|
|
|
1
|
+
(function(exports){'use strict';/* arcy.js — https://arcyai.com */
|
|
2
|
+
var _t="__arcyChat";var St=["image/png","image/jpeg","image/webp"],Lt="--_arcy-font-key",It="arcy-chat-policy",Rt="arcy-bar-tray",Mt={historyTitle:"Recent chats",historyEmpty:"No conversations yet.",newChat:"New chat",flowsTitle:"What I can do",flowsEmpty:"Nothing to run yet.",collapse:"Collapse",back:"Back",closeSheet:"Close",settingsTitle:"Settings",dockChat:"Dock to the corner",dockChatHint:"Shrink ARCY to a button in the bottom-right corner.",language:"Language",openChat:"Open chat",moveBar:"Move the chat bar",send:"Send",flowRunning:"Running",flowStep:"Step {step} of {total}",flowStop:"Stop",flowFailed:"Sorry, I could not finish that for you this time. You can ask me here and I will help you do it.",attachMenu:"Add",attachImage:"Attach an image",removeImage:"Remove image",imageTooLarge:"That image is too large. Each image must be under 5 MB.",imageWrongType:"That file type is not supported. Use PNG, JPEG or WEBP.",imageTooMany:"You can attach up to 3 images.",imageFailed:"That image could not be uploaded. Please try again.",likeAnswer:"Good answer",dislikeAnswer:"Bad answer",answering:"Answering",aiDisclaimer:"{app} is AI and can make mistakes",consentNotice:"Your messages are processed to answer your question.",consentWithPolicy:"{policy}",disclaimerJoin:" \xB7 ",privacyPolicy:"Privacy Policy",poweredBy:"Powered by ARCY",genericError:"Something went wrong. Please try again.",userCapReached:"You've reached today's limit for questions. Please try again tomorrow.",imageConversation:"Image",searchedSourcesLabel:"Searched {count} sources",sourcesLabel:"Sources:",flowOfferHint:"You can do this in one click with the Quick Flow below.",fillConfirm:"Confirm",fillYes:"Yes",fillNo:"No",fillRequired:"This field needs an answer.",fillInvalidNumber:"Please enter a number.",fillNumberTooSmall:"Please enter {min} or more.",fillNumberTooLarge:"Please enter {max} or less.",fillInvalidEmail:"Please enter a valid email address.",fillInvalidUrl:"Please enter a valid link.",fillInvalidDate:"Please enter a valid date.",fillInvalidTime:"Please enter a valid time.",fillDateTooEarly:"Please pick {min} or later.",fillDateTooLate:"Please pick {max} or earlier.",fillTooLong:"Please keep it under {max} characters.",fillInvalidOption:"Please pick one of the options.",fillInvalid:"That does not look right. Please try again."};function Ye(e){let t=e.dataTransfer;if(!t)return false;let n=t.types;if(!n)return false;for(let r=0;r<n.length;r+=1)if(n[r]==="Files")return true;return false}function Ft(e){let t=e.dataTransfer;return Array.from(t?.files??[])}var Pt=`
|
|
3
|
+
[data-tip] {
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[data-tip]::after {
|
|
8
|
+
content: attr(data-tip);
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: 50%;
|
|
11
|
+
bottom: calc(100% + 6px);
|
|
12
|
+
transform: translateX(-50%);
|
|
13
|
+
z-index: 2;
|
|
14
|
+
padding: 4px 8px;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
background: var(--_arcy-main-text, #101828);
|
|
17
|
+
color: var(--_arcy-main-bg, #ffffff);
|
|
18
|
+
font-size: 11px;
|
|
19
|
+
line-height: 1.3;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
opacity: 0;
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
transition: opacity 120ms ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-tip][data-tip-placement="below"]::after {
|
|
28
|
+
bottom: auto;
|
|
29
|
+
top: calc(100% + 6px);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Alignment, for a control near an edge the panel clips (D895). Centring a
|
|
33
|
+
bubble on the leftmost header icon puts half of it outside the panel, and
|
|
34
|
+
the panel clips its overflow, so the half outside is simply gone. No
|
|
35
|
+
z-index can fix that: the bubble is not behind anything, it is cut off.
|
|
36
|
+
These pin the bubble to the control's own edge instead. */
|
|
37
|
+
[data-tip][data-tip-align="start"]::after {
|
|
38
|
+
left: 0;
|
|
39
|
+
transform: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-tip][data-tip-align="end"]::after {
|
|
43
|
+
left: auto;
|
|
44
|
+
right: 0;
|
|
45
|
+
transform: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-tip]:hover::after,
|
|
49
|
+
[data-tip]:focus-visible::after {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
visibility: visible;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* A coarse pointer has no hover: the tooltip would latch open on tap and
|
|
55
|
+
sit over the thing the visitor just pressed. */
|
|
56
|
+
@media (hover: none) {
|
|
57
|
+
[data-tip]::after {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
[data-tip]::after {
|
|
64
|
+
transition: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;function Nt(e){typeof console<"u"&&console.warn&&console.warn(`[arcy] ${e}`);}function Yn(e){try{let n=e.currentScript?.nonce;if(typeof n=="string"&&n.length>0)return n;let r=e.getElementsByTagName("script");for(let o=0;o<r.length;o++){let i=r[o].nonce;if(typeof i=="string"&&i.length>0)return i}return null}catch{return null}}var Kn=typeof document<"u"?Yn(document):null;function Xn(){return Kn}function Le(e){let t=Xn();if(t)try{e.nonce=t,e.setAttribute("nonce",t);}catch{}}var $t="data-arcy-style";function Ke(e,t){if(!e.isolated)return false;try{let n=e.root.querySelector(`[${$t}]`);if(n)return n.textContent=`${n.textContent??""}
|
|
68
|
+
${t}`,!0;let r=e.host.ownerDocument.createElement("style");return Le(r),r.setAttribute($t,""),r.textContent=t,e.root.appendChild(r),!0}catch(n){return Nt(`The widget could not apply its styles. ${String(n)}`),false}}var Qn=/^(#{1,3})\s+(.*)$/,Jn=/^[-*]\s+(.*)$/,Zn=/^\d+\.\s+(.*)$/;var Ot=/`([^`]+)`|\*\*(.+?)\*\*|\*(.+?)\*|\[([^\]]+)\]\(([^)]+)\)/g;function er(e){return /^https?:\/\//i.test(e)}function Ie(e,t,n){let r=0;Ot.lastIndex=0;let o;for(;o=Ot.exec(n);){o.index>r&&t.appendChild(e.createTextNode(n.slice(r,o.index)));let[i,s,h,C,g,c]=o;if(s!==void 0){let l=e.createElement("code");l.textContent=s,t.appendChild(l);}else if(h!==void 0){let l=e.createElement("strong");l.textContent=h,t.appendChild(l);}else if(C!==void 0){let l=e.createElement("em");l.textContent=C,t.appendChild(l);}else if(g!==void 0&&c!==void 0)if(er(c)){let l=e.createElement("a");l.setAttribute("href",c),l.setAttribute("target","_blank"),l.setAttribute("rel","noopener noreferrer"),l.textContent=g,t.appendChild(l);}else t.appendChild(e.createTextNode(g));r=o.index+i.length;}r<n.length&&t.appendChild(e.createTextNode(n.slice(r)));}function tr(e){let t=[],n=false;for(let r of e){if(!r.includes("```")){t.push(r);continue}r.split("```").forEach((i,s)=>{s>0&&(t.push("```"),n=!n),!(n&&s>0&&/^\s*[A-Za-z0-9+#-]*\s*$/.test(i))&&i!==""&&t.push(i);});}return t}function Dt(e,t,n){try{for(;t.firstChild;)t.removeChild(t.firstChild);let r=tr(n.split(`
|
|
69
|
+
`)),o=[],i=null,s=null,h=()=>{if(o.length===0)return;let c=e.createElement("p");Ie(e,c,o.join(" ")),t.appendChild(c),o=[];},C=()=>{i=null;},g=()=>{if(s===null)return;let c=e.createElement("pre"),l=e.createElement("code");for(;s.length>0&&s[0].trim()==="";)s.shift();for(;s.length>0&&s[s.length-1].trim()==="";)s.pop();l.textContent=s.join(`
|
|
70
|
+
`),c.appendChild(l),t.appendChild(c),s=null;};for(let c of r){if(c.trim()==="```"){s===null?(h(),C(),s=[]):g();continue}if(s!==null){s.push(c);continue}let l=c.trim();if(l===""){h(),C();continue}let v=Qn.exec(l);if(v){h(),C();let w=Math.max(2,v[1].length),m=e.createElement(`h${w}`);Ie(e,m,v[2]),t.appendChild(m);continue}let d=Jn.exec(l);if(d){h(),(!i||i.kind!=="ul")&&(i={kind:"ul",el:e.createElement("ul")},t.appendChild(i.el));let w=e.createElement("li");Ie(e,w,d[1]),i.el.appendChild(w);continue}let u=Zn.exec(l);if(u){h(),(!i||i.kind!=="ol")&&(i={kind:"ol",el:e.createElement("ol")},t.appendChild(i.el));let w=e.createElement("li");Ie(e,w,u[1]),i.el.appendChild(w);continue}C(),o.push(l);}g(),h();}catch{}}var Ht="arcy-flow-offer",Ut="arcy-flow-offer-hint",ae="arcy-flow-offer-button",zt="arcy-flow-offer-icon",Bt="http://www.w3.org/2000/svg",nr="M13 3L5 14h6l-1 7 8-11h-6l1-7z";function rr(e){let t=e.createElementNS(Bt,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.setAttribute("width","15"),t.setAttribute("height","15"),t.setAttribute("class",zt);let n=e.createElementNS(Bt,"path");return n.setAttribute("d",nr),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),t.appendChild(n),t}var Vt=`
|
|
71
|
+
.${Ht} {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
align-items: flex-start;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
margin-top: 10px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.${Ut} {
|
|
80
|
+
font-size: 13px;
|
|
81
|
+
line-height: 1.4;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Filled in the operator's brand, not outlined: this is the one control in
|
|
85
|
+
the answer, and an outlined chip beside a filled user bubble reads as
|
|
86
|
+
secondary to the very thing it is offering to do. */
|
|
87
|
+
.${ae} {
|
|
88
|
+
appearance: none;
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 7px;
|
|
92
|
+
border: 0;
|
|
93
|
+
border-radius: 999px;
|
|
94
|
+
padding: 8px 14px;
|
|
95
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
96
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
97
|
+
font: inherit;
|
|
98
|
+
font-size: 13px;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
line-height: 1.2;
|
|
101
|
+
text-align: left;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
-webkit-tap-highlight-color: transparent;
|
|
104
|
+
transition: background 120ms ease;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.${zt} {
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.${ae}:hover {
|
|
112
|
+
background: var(--_arcy-brand-bg-hover, var(--_arcy-brand-bg, #101828));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.${ae}:active {
|
|
116
|
+
background: var(--_arcy-brand-bg-active, var(--_arcy-brand-bg, #101828));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.${ae}:focus-visible {
|
|
120
|
+
outline: 2px solid var(--_arcy-brand-bg, #101828);
|
|
121
|
+
outline-offset: 2px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (prefers-reduced-motion: reduce) {
|
|
125
|
+
.${ae} {
|
|
126
|
+
transition: none;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;function Wt(e,t,n,r){if(t.length===0)return null;let o=e.createElement("div");if(o.className=Ht,n){let i=e.createElement("div");i.className=Ut,i.textContent=n,o.appendChild(i);}for(let i of t.slice(0,1)){let s=e.createElement("button");s.type="button",s.className=ae,s.appendChild(rr(e));let h=e.createElement("span");h.textContent=i.publicName??"Start",s.appendChild(h),s.addEventListener("click",()=>{s.disabled=true;try{r(i.flowCvid);}catch{}}),o.appendChild(s);}return o}var Gt="arcy-chat-list",M="arcy-chat-msg",Yt="arcy-chat-msg-images",qe="arcy-chat-msg-thumbs",Kt="arcy-chat-msg-meta",qt="arcy-chat-msg-time",se="arcy-chat-rate",le="arcy-chat-msg-group",Xt="arcy-chat-citations",me="arcy-chat-citation-link",Qt="arcy-chat-citation-label",ce="arcy-chat-pending",or="M7 10v10H4V10zM7 10l4.5-7a2 2 0 0 1 3.4 2L13.5 9H19a2 2 0 0 1 2 2.3l-1 6A2 2 0 0 1 18 19H7",ir="M7 14V4H4v10zM7 14l4.5 7a2 2 0 0 0 3.4-2L13.5 15H19a2 2 0 0 0 2-2.3l-1-6A2 2 0 0 0 18 5H7",jt="http://www.w3.org/2000/svg";function ar(e,t){let n=e.createElementNS(jt,"svg");n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("aria-hidden","true"),n.setAttribute("width","14"),n.setAttribute("height","14");let r=e.createElementNS(jt,"path");return r.setAttribute("d",t),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","2"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),n.appendChild(r),n}function sr(e){try{return e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return ""}}var Jt=`
|
|
130
|
+
.${Gt} {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
gap: 8px;
|
|
134
|
+
padding: 12px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.${M} {
|
|
138
|
+
max-width: 85%;
|
|
139
|
+
padding: 8px 12px;
|
|
140
|
+
border-radius: 12px;
|
|
141
|
+
font-size: 13px;
|
|
142
|
+
line-height: 1.4;
|
|
143
|
+
white-space: pre-wrap;
|
|
144
|
+
overflow-wrap: break-word;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.${M}[data-role="assistant"],
|
|
148
|
+
.${M}[data-role="system"] {
|
|
149
|
+
align-self: flex-start;
|
|
150
|
+
background: var(--_arcy-assistant-bg, #f2f4f7);
|
|
151
|
+
color: var(--_arcy-main-text, #101828);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* \u2500\u2500 Rendered markdown inside an answer (D1023, ADR 0129; D1034) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
155
|
+
|
|
156
|
+
/* The bubble is a chat message, not a document. Browser defaults give an h2
|
|
157
|
+
a 1.5em face and a full blank line above and below it, which turns a
|
|
158
|
+
three-step answer into something that reads like a landing page. These
|
|
159
|
+
rules keep every block on the bubble's own scale. */
|
|
160
|
+
.${M} > :first-child {
|
|
161
|
+
margin-top: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.${M} > :last-child {
|
|
165
|
+
margin-bottom: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.${M} p {
|
|
169
|
+
margin: 0 0 8px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.${M} h2,
|
|
173
|
+
.${M} h3 {
|
|
174
|
+
margin: 12px 0 6px;
|
|
175
|
+
line-height: 1.3;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.${M} h2 {
|
|
180
|
+
font-size: 15px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.${M} h3 {
|
|
184
|
+
font-size: 13px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.${M} ul,
|
|
188
|
+
.${M} ol {
|
|
189
|
+
margin: 0 0 8px;
|
|
190
|
+
padding-left: 20px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.${M} li {
|
|
194
|
+
margin: 2px 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* D1034: code. The agent answers install questions with real snippets, so
|
|
198
|
+
these have to read as code rather than as a sentence with backticks in
|
|
199
|
+
it. The block scrolls on its own rather than widening the bubble, since a
|
|
200
|
+
long line would otherwise push the panel sideways. */
|
|
201
|
+
.${M} code {
|
|
202
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
203
|
+
font-size: 0.9em;
|
|
204
|
+
padding: 1px 4px;
|
|
205
|
+
border-radius: 4px;
|
|
206
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
207
|
+
white-space: pre-wrap;
|
|
208
|
+
overflow-wrap: break-word;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.${M} pre {
|
|
212
|
+
margin: 0 0 8px;
|
|
213
|
+
padding: 10px 12px;
|
|
214
|
+
border-radius: 8px;
|
|
215
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 6%, transparent);
|
|
216
|
+
border: 1px solid color-mix(in srgb, var(--_arcy-main-text, #101828) 10%, transparent);
|
|
217
|
+
overflow-x: auto;
|
|
218
|
+
white-space: pre;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.${M} pre code {
|
|
222
|
+
padding: 0;
|
|
223
|
+
background: none;
|
|
224
|
+
white-space: pre;
|
|
225
|
+
overflow-wrap: normal;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Above the bubble, as a sibling of it: see addMessage(). */
|
|
229
|
+
.${Yt} {
|
|
230
|
+
display: block;
|
|
231
|
+
font-size: 11px;
|
|
232
|
+
opacity: 0.75;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.${qe} {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-wrap: wrap;
|
|
238
|
+
gap: 4px;
|
|
239
|
+
max-width: 100%;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Sized by height, the width left to the picture: a fixed square cropped
|
|
243
|
+
every screenshot to its middle. */
|
|
244
|
+
.${qe} img {
|
|
245
|
+
display: block;
|
|
246
|
+
width: auto;
|
|
247
|
+
height: 120px;
|
|
248
|
+
max-width: 100%;
|
|
249
|
+
object-fit: cover;
|
|
250
|
+
border-radius: 12px;
|
|
251
|
+
border: 1px solid
|
|
252
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 12%, transparent);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.${M}[data-role="user"] {
|
|
256
|
+
align-self: flex-end;
|
|
257
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
258
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* One turn: the bubble, then its meta row. The group carries the alignment
|
|
262
|
+
so the row sits under the bubble's own edge rather than the panel's. */
|
|
263
|
+
.${le} {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
gap: 4px;
|
|
267
|
+
max-width: 85%;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.${le}[data-role="user"] {
|
|
271
|
+
align-self: flex-end;
|
|
272
|
+
align-items: flex-end;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.${le}[data-role="assistant"],
|
|
276
|
+
.${le}[data-role="system"] {
|
|
277
|
+
align-self: flex-start;
|
|
278
|
+
align-items: flex-start;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* The bubble is the whole width of its group now, so its own alignment
|
|
282
|
+
would fight the group's. */
|
|
283
|
+
.${le} .${M} {
|
|
284
|
+
max-width: 100%;
|
|
285
|
+
align-self: auto;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.${Kt} {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 2px;
|
|
292
|
+
padding: 0 4px;
|
|
293
|
+
min-height: 20px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.${qt} {
|
|
297
|
+
font-size: 11px;
|
|
298
|
+
line-height: 1;
|
|
299
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 45%, transparent);
|
|
300
|
+
font-variant-numeric: tabular-nums;
|
|
301
|
+
margin-right: 4px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* No background at rest, one on hover. The rating controls sit under every
|
|
305
|
+
answer, and two filled chips per turn would read as buttons the visitor
|
|
306
|
+
is expected to press. */
|
|
307
|
+
.${se} {
|
|
308
|
+
appearance: none;
|
|
309
|
+
border: 0;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
font: inherit;
|
|
312
|
+
display: flex;
|
|
313
|
+
align-items: center;
|
|
314
|
+
justify-content: center;
|
|
315
|
+
padding: 4px;
|
|
316
|
+
border-radius: 6px;
|
|
317
|
+
background: transparent;
|
|
318
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 45%, transparent);
|
|
319
|
+
-webkit-tap-highlight-color: transparent;
|
|
320
|
+
transition: background 120ms ease, color 120ms ease;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.${se}:hover {
|
|
324
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
325
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 80%, transparent);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.${se}[aria-pressed="true"] {
|
|
329
|
+
color: var(--_arcy-brand-bg, #101828);
|
|
330
|
+
background: color-mix(in srgb, var(--_arcy-brand-bg, #101828) 12%, transparent);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.${se}:focus-visible {
|
|
334
|
+
outline: 2px solid currentColor;
|
|
335
|
+
outline-offset: 1px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
@media (prefers-reduced-motion: reduce) {
|
|
339
|
+
.${se} {
|
|
340
|
+
transition: none;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* \u2500\u2500 Citations (D1023, ADR 0129) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
345
|
+
|
|
346
|
+
.${Xt} {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-wrap: wrap;
|
|
349
|
+
gap: 6px;
|
|
350
|
+
padding: 0 4px;
|
|
351
|
+
font-size: 11px;
|
|
352
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 55%, transparent);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.${Qt} {
|
|
356
|
+
font-weight: 600;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* D1034: a citation is a link, so it has to answer the pointer like one.
|
|
360
|
+
At rest it stays quiet enough not to compete with the answer above it. */
|
|
361
|
+
.${me} {
|
|
362
|
+
color: inherit;
|
|
363
|
+
text-decoration: underline;
|
|
364
|
+
text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
|
|
365
|
+
text-underline-offset: 2px;
|
|
366
|
+
border-radius: 3px;
|
|
367
|
+
transition: color 120ms ease, text-decoration-color 120ms ease;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.${me}:hover {
|
|
371
|
+
color: var(--_arcy-main-text, #101828);
|
|
372
|
+
text-decoration-color: currentColor;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.${me}:focus-visible {
|
|
376
|
+
outline: 2px solid currentColor;
|
|
377
|
+
outline-offset: 2px;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@media (prefers-reduced-motion: reduce) {
|
|
381
|
+
.${me} {
|
|
382
|
+
transition: none;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* \u2500\u2500 "The agent is answering" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
387
|
+
|
|
388
|
+
/* Deliberately the assistant bubble's own background and corner, at the
|
|
389
|
+
assistant's own alignment: the answer replaces this in place, so the
|
|
390
|
+
surface should not move when it lands. */
|
|
391
|
+
.${ce} {
|
|
392
|
+
align-self: flex-start;
|
|
393
|
+
display: flex;
|
|
394
|
+
align-items: center;
|
|
395
|
+
gap: 4px;
|
|
396
|
+
padding: 12px;
|
|
397
|
+
border-radius: 12px;
|
|
398
|
+
background: var(--_arcy-assistant-bg, #f2f4f7);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.${ce} span {
|
|
402
|
+
width: 6px;
|
|
403
|
+
height: 6px;
|
|
404
|
+
border-radius: 999px;
|
|
405
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 45%, transparent);
|
|
406
|
+
animation: arcy-chat-typing 1.2s ease-in-out infinite;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.${ce} span:nth-child(2) {
|
|
410
|
+
animation-delay: 0.15s;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.${ce} span:nth-child(3) {
|
|
414
|
+
animation-delay: 0.3s;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
@keyframes arcy-chat-typing {
|
|
418
|
+
0%, 60%, 100% {
|
|
419
|
+
opacity: 0.35;
|
|
420
|
+
transform: translateY(0);
|
|
421
|
+
}
|
|
422
|
+
30% {
|
|
423
|
+
opacity: 1;
|
|
424
|
+
transform: translateY(-3px);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Reduced motion keeps the bubble, and with it the answer to "is anything
|
|
429
|
+
happening", and drops only the movement. */
|
|
430
|
+
@media (prefers-reduced-motion: reduce) {
|
|
431
|
+
.${ce} span {
|
|
432
|
+
animation: none;
|
|
433
|
+
opacity: 0.55;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
`;function Zt(e,t,n={}){let r=t.createElement("div");r.className=Gt,e.appendChild(r);let o=false,i=[];function s(){for(;i.length>0;){let u=i.pop();if(u)try{URL.revokeObjectURL(u);}catch{}}}function h(){try{e.scrollTop=e.scrollHeight;}catch{}}let C=0,g=null;function c(u){if(!o)try{if(!u){g?.remove(),g=null;return}if(g)return;let w=t.createElement("div");w.className=ce,w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.setAttribute("aria-label",n.answeringLabel?.()??"Answering");for(let m=0;m<3;m+=1)w.appendChild(t.createElement("span"));r.appendChild(w),g=w,h();}catch{}}function l(u,w,m){let x=n.labels;if(!x)return;let A=m,E=(N,U,$)=>{let y=t.createElement("button");return y.type="button",y.className=se,y.setAttribute("aria-label",U),y.setAttribute("data-tip",U),y.setAttribute("aria-pressed",m===N?"true":"false"),y.appendChild(ar(t,$)),y.addEventListener("click",()=>{try{A=A===N?null:N,L.setAttribute("aria-pressed",A==="up"?"true":"false"),H.setAttribute("aria-pressed",A==="down"?"true":"false"),n.onFeedback?.(A,w);}catch{}}),y},L=E("up",x.likeAnswer,or),H=E("down",x.dislikeAnswer,ir);u.appendChild(L),u.appendChild(H);}function v(u,w){let m=n.searchedSourcesLabel;if(!m||w.length===0)return;let x=t.createElement("div");if(x.className=Xt,n.sourcesLabel){let E=t.createElement("span");E.className=Qt,E.textContent=n.sourcesLabel,x.appendChild(E);}let A=0;for(let E of w)if(E.sourceUrl){let L=t.createElement("a");L.className=me,L.setAttribute("href",E.sourceUrl),L.setAttribute("target","_blank"),L.setAttribute("rel","noopener noreferrer"),L.textContent=E.title,x.appendChild(L);}else A+=1;if(A>0){let E=t.createElement("span");E.textContent=m.replace("{count}",String(A)),x.appendChild(E);}u.appendChild(x);}function d(u,w,m={}){if(!o)try{let{images:x=0,imageUrls:A=[],at:E,messageId:L=null,feedback:H=null,citedSources:N=[],flowOffers:U=[]}=m,$=t.createElement("div");$.className=le,$.setAttribute("data-role",u);let y=t.createElement("div");y.className=M,y.setAttribute("data-role",u),u==="assistant"?Dt(t,y,w):y.textContent=w;let k=null;if(A.length>0){k=t.createElement("div"),k.className=qe;for(let T of A){let I=t.createElement("img");I.src=T,I.alt="",k.appendChild(I),i.push(T);}}else x>0&&(k=t.createElement("div"),k.className=Yt,k.textContent=x===1?"1 image":`${x} images`);if(k&&$.appendChild(k),u==="assistant"&&U.length>0&&n.onStartFlow){let T=n.onStartFlow.bind(n),I=Wt(t,U,n.flowOfferHint?.(),T);I&&y.appendChild(I);}if((w!==""||!k)&&$.appendChild(y),u==="assistant"&&N.length>0&&v($,N),u!=="system"){let T=t.createElement("div");T.className=Kt;let I=t.createElement("span");I.className=qt,I.textContent=sr(E??n.now?.()??new Date),T.appendChild(I),u==="assistant"&&l(T,L,H),$.appendChild(T);}r.insertBefore($,g),C+=1,h();}catch{}}return {addMessage:d,setPending:c,isEmpty:()=>C===0,scrollToEnd:h,clear(){if(!o)try{for(;r.firstChild;)r.removeChild(r.firstChild);s(),C=0,g=null;}catch{}},destroy(){if(!o){o=true;try{s(),r.remove();}catch{}}}}}var be="arcy-drawer",Re="arcy-drawer-scrim",tn="arcy-drawer-header",Xe="arcy-drawer-back",Qe="arcy-drawer-close",nn="arcy-drawer-title",rn="arcy-drawer-list",Me="arcy-drawer-item",on="arcy-drawer-item-title",an="arcy-drawer-item-sub",ye="arcy-drawer-item-tip",sn="arcy-drawer-item-icon",ln="arcy-drawer-item-text",cn="arcy-drawer-empty",Je="arcy-drawer-action",Ze="arcy-drawer-footer",dn=`
|
|
437
|
+
/* A sheet over PART of the panel, sliding in from the left (D899). It used
|
|
438
|
+
to be inset:0 and appear instantly, so opening Recent chats replaced the
|
|
439
|
+
whole surface with no sense of where the conversation went or how to get
|
|
440
|
+
back. Covering part of the panel keeps the conversation visible behind it,
|
|
441
|
+
which is what makes the back gesture obvious. */
|
|
442
|
+
.${be} {
|
|
443
|
+
position: absolute;
|
|
444
|
+
top: 0;
|
|
445
|
+
bottom: 0;
|
|
446
|
+
left: 0;
|
|
447
|
+
width: min(78%, 320px);
|
|
448
|
+
display: flex;
|
|
449
|
+
flex-direction: column;
|
|
450
|
+
background: var(--_arcy-main-bg, #ffffff);
|
|
451
|
+
color: var(--_arcy-main-text, #101828);
|
|
452
|
+
border-right: 1px solid
|
|
453
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 10%, transparent);
|
|
454
|
+
z-index: 2;
|
|
455
|
+
transform: translateX(-101%);
|
|
456
|
+
visibility: hidden;
|
|
457
|
+
transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1),
|
|
458
|
+
visibility 0s linear 220ms;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* The same sheet, hinged on the other edge. Only the three properties that
|
|
462
|
+
name a side change: everything about how it looks and animates is shared,
|
|
463
|
+
so the two can never drift. */
|
|
464
|
+
.${be}[data-side="right"] {
|
|
465
|
+
left: auto;
|
|
466
|
+
right: 0;
|
|
467
|
+
border-right: 0;
|
|
468
|
+
border-left: 1px solid
|
|
469
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 10%, transparent);
|
|
470
|
+
transform: translateX(101%);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.${be}[data-open] {
|
|
474
|
+
transform: translateX(0);
|
|
475
|
+
visibility: visible;
|
|
476
|
+
transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1),
|
|
477
|
+
visibility 0s;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/* The rest of the panel, dimmed while the sheet is over it. Tapping it is
|
|
481
|
+
the same as pressing back, which is what every sheet on a phone does. */
|
|
482
|
+
.${Re} {
|
|
483
|
+
position: absolute;
|
|
484
|
+
inset: 0;
|
|
485
|
+
z-index: 1;
|
|
486
|
+
appearance: none;
|
|
487
|
+
border: 0;
|
|
488
|
+
padding: 0;
|
|
489
|
+
cursor: pointer;
|
|
490
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 22%, transparent);
|
|
491
|
+
opacity: 0;
|
|
492
|
+
visibility: hidden;
|
|
493
|
+
transition: opacity 220ms ease, visibility 0s linear 220ms;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.${Re}[data-open] {
|
|
497
|
+
opacity: 1;
|
|
498
|
+
visibility: visible;
|
|
499
|
+
transition: opacity 220ms ease, visibility 0s;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
@media (prefers-reduced-motion: reduce) {
|
|
503
|
+
.${be},
|
|
504
|
+
.${Re} {
|
|
505
|
+
transition: none;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.${tn} {
|
|
510
|
+
display: flex;
|
|
511
|
+
align-items: center;
|
|
512
|
+
gap: 8px;
|
|
513
|
+
padding: 10px 10px 10px 12px;
|
|
514
|
+
flex: 0 0 auto;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.${Xe},
|
|
518
|
+
.${Qe} {
|
|
519
|
+
appearance: none;
|
|
520
|
+
border: 0;
|
|
521
|
+
background: transparent;
|
|
522
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 70%, transparent);
|
|
523
|
+
cursor: pointer;
|
|
524
|
+
padding: 5px;
|
|
525
|
+
border-radius: 999px;
|
|
526
|
+
display: flex;
|
|
527
|
+
align-items: center;
|
|
528
|
+
flex: 0 0 auto;
|
|
529
|
+
-webkit-tap-highlight-color: transparent;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.${Xe}:hover,
|
|
533
|
+
.${Qe}:hover {
|
|
534
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.${nn} {
|
|
538
|
+
font-weight: 600;
|
|
539
|
+
font-size: 14px;
|
|
540
|
+
min-width: 0;
|
|
541
|
+
flex: 1 1 auto;
|
|
542
|
+
overflow: hidden;
|
|
543
|
+
text-overflow: ellipsis;
|
|
544
|
+
white-space: nowrap;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.${rn} {
|
|
548
|
+
flex: 1 1 auto;
|
|
549
|
+
min-height: 0;
|
|
550
|
+
overflow: auto;
|
|
551
|
+
display: flex;
|
|
552
|
+
flex-direction: column;
|
|
553
|
+
gap: 4px;
|
|
554
|
+
padding: 0 8px 8px;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/* A row, laid out left to right: the optional mark, then the text column.
|
|
558
|
+
A drawer with no mark renders one child and reads exactly as it did when
|
|
559
|
+
the row was the text column itself. */
|
|
560
|
+
.${Me} {
|
|
561
|
+
appearance: none;
|
|
562
|
+
border: 0;
|
|
563
|
+
cursor: pointer;
|
|
564
|
+
text-align: left;
|
|
565
|
+
font: inherit;
|
|
566
|
+
display: flex;
|
|
567
|
+
flex-direction: row;
|
|
568
|
+
align-items: center;
|
|
569
|
+
gap: 10px;
|
|
570
|
+
padding: 9px 10px;
|
|
571
|
+
border-radius: 10px;
|
|
572
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 4%, transparent);
|
|
573
|
+
color: inherit;
|
|
574
|
+
-webkit-tap-highlight-color: transparent;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.${Me}:hover {
|
|
578
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 9%, transparent);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/* The conversation the visitor is reading. Darker than hover so it still
|
|
582
|
+
reads as selected while the pointer is over another row, and carrying an
|
|
583
|
+
inset marker so the state is not colour alone. */
|
|
584
|
+
.${Me}[data-active] {
|
|
585
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 12%, transparent);
|
|
586
|
+
box-shadow: inset 2px 0 0 var(--_arcy-brand-bg, #101828);
|
|
587
|
+
font-weight: 600;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/* Dimmer than the title it sits beside: it labels the kind of row, and a
|
|
591
|
+
mark at full strength competes with the name a visitor is reading. */
|
|
592
|
+
.${sn} {
|
|
593
|
+
flex: 0 0 auto;
|
|
594
|
+
display: flex;
|
|
595
|
+
align-items: center;
|
|
596
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 60%, transparent);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/* The min-width: 0 is what keeps the ellipsis working: without it a flex
|
|
600
|
+
item refuses to shrink below its content, and a long flow name pushes the
|
|
601
|
+
row wider than the sheet instead of truncating. */
|
|
602
|
+
.${ln} {
|
|
603
|
+
display: flex;
|
|
604
|
+
flex-direction: column;
|
|
605
|
+
gap: 2px;
|
|
606
|
+
min-width: 0;
|
|
607
|
+
flex: 1 1 auto;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.${on} {
|
|
611
|
+
font-size: 13px;
|
|
612
|
+
overflow: hidden;
|
|
613
|
+
text-overflow: ellipsis;
|
|
614
|
+
white-space: nowrap;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.${an} {
|
|
618
|
+
font-size: 11.5px;
|
|
619
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 55%, transparent);
|
|
620
|
+
overflow: hidden;
|
|
621
|
+
text-overflow: ellipsis;
|
|
622
|
+
white-space: nowrap;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/* The whole subtitle, for a row whose subtitle is a flow's summary and does
|
|
626
|
+
not fit on one line (D1265). A single bubble reused by every row, and a
|
|
627
|
+
child of the SHEET rather than of the row it describes: the list scrolls
|
|
628
|
+
(overflow: auto above), and a bubble painted from inside a scrolling box
|
|
629
|
+
is cut off at that box's edge instead of hanging past it.
|
|
630
|
+
|
|
631
|
+
Position is set in script, because it is the one thing CSS cannot do from
|
|
632
|
+
here: the bubble sits beside the sheet, so it has to know how tall the row
|
|
633
|
+
is and how much room the panel has left. Everything else is here. */
|
|
634
|
+
.${ye} {
|
|
635
|
+
position: absolute;
|
|
636
|
+
z-index: 3;
|
|
637
|
+
/* Sized from its own text, not from the room left inside the sheet. The
|
|
638
|
+
bubble is placed BESIDE the sheet, but the sheet is what it is
|
|
639
|
+
positioned against, so the space between its left edge and the sheet's
|
|
640
|
+
right edge is zero. Left to shrink to fit, the box takes that zero as
|
|
641
|
+
its available width and falls back to the narrowest it can legally be,
|
|
642
|
+
which with the overflow-wrap: anywhere below is one character: the
|
|
643
|
+
summary comes out as a column of single letters. max-content sizes it
|
|
644
|
+
to the sentence instead, and the max-width under it does the wrapping. */
|
|
645
|
+
width: max-content;
|
|
646
|
+
box-sizing: border-box;
|
|
647
|
+
padding: 6px 9px;
|
|
648
|
+
border-radius: 6px;
|
|
649
|
+
background: var(--_arcy-main-text, #101828);
|
|
650
|
+
color: var(--_arcy-main-bg, #ffffff);
|
|
651
|
+
font-size: 11px;
|
|
652
|
+
line-height: 1.35;
|
|
653
|
+
/* Wraps, unlike the header tooltips: a summary is a sentence, and a
|
|
654
|
+
sentence on one line is the truncation this bubble exists to undo. */
|
|
655
|
+
white-space: normal;
|
|
656
|
+
overflow-wrap: anywhere;
|
|
657
|
+
pointer-events: none;
|
|
658
|
+
opacity: 0;
|
|
659
|
+
visibility: hidden;
|
|
660
|
+
transition: opacity 120ms ease;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.${ye}[data-open] {
|
|
664
|
+
opacity: 1;
|
|
665
|
+
visibility: visible;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* Same reason as the header tooltips: a coarse pointer has no hover, so the
|
|
669
|
+
bubble would latch open over the row the visitor just pressed. */
|
|
670
|
+
@media (hover: none) {
|
|
671
|
+
.${ye} {
|
|
672
|
+
display: none;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
@media (prefers-reduced-motion: reduce) {
|
|
677
|
+
.${ye} {
|
|
678
|
+
transition: none;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.${cn} {
|
|
683
|
+
flex: 1 1 auto;
|
|
684
|
+
display: flex;
|
|
685
|
+
flex-direction: column;
|
|
686
|
+
align-items: center;
|
|
687
|
+
justify-content: center;
|
|
688
|
+
gap: 10px;
|
|
689
|
+
padding: 16px;
|
|
690
|
+
text-align: center;
|
|
691
|
+
font-size: 13px;
|
|
692
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 60%, transparent);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.${Je} {
|
|
696
|
+
appearance: none;
|
|
697
|
+
border: 0;
|
|
698
|
+
cursor: pointer;
|
|
699
|
+
font: inherit;
|
|
700
|
+
font-size: 13px;
|
|
701
|
+
display: flex;
|
|
702
|
+
align-items: center;
|
|
703
|
+
justify-content: center;
|
|
704
|
+
gap: 6px;
|
|
705
|
+
padding: 9px 14px;
|
|
706
|
+
border-radius: 999px;
|
|
707
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
708
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
709
|
+
-webkit-tap-highlight-color: transparent;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/* The pinned "New chat" action, once the list is populated (D979): appended
|
|
713
|
+
as a footer sibling of the scrollable list rather than its last row, so it
|
|
714
|
+
never scrolls out of reach on a drawer with many conversations. */
|
|
715
|
+
.${Ze} {
|
|
716
|
+
flex: 0 0 auto;
|
|
717
|
+
padding: 10px;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.${Ze} .${Je} {
|
|
721
|
+
width: 100%;
|
|
722
|
+
}
|
|
723
|
+
`,en="http://www.w3.org/2000/svg",ge=8,lr=240,cr=120;function et(e,t,n,r=2){let o=e.createElementNS(en,"svg");o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.setAttribute("aria-hidden","true");for(let i of t){let s=e.createElementNS(en,"path");s.setAttribute("d",i),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("stroke-width",String(r)),s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),o.appendChild(s);}return o}function dr(e,t){return et(e,[t==="right"?"M9 5l7 7-7 7":"M15 5l-7 7 7 7"],16)}function pr(e){return et(e,["M18 6L6 18","M6 6l12 12"],16)}function ur(e){return et(e,["M12 5v14M5 12h14"],14,2.5)}function Fe(e,t,n){let r=n.emptyText??"",o=n.actionLabel??null,i=[],s=false,h=n.side??"left",C=n.subtitleTips!==false,g=t.createElement("div");g.className=be,g.setAttribute("role","group"),g.setAttribute("data-side",h);let c=t.createElement("div");c.className=tn;let l=t.createElement("button");l.type="button",l.className=Xe,l.setAttribute("aria-label",n.backLabel),l.setAttribute("data-tip",n.backLabel),l.setAttribute("data-tip-placement","below"),l.setAttribute("data-tip-align","start"),l.appendChild(dr(t,h));let v=t.createElement("span");v.className=nn,v.textContent=n.title;let d=t.createElement("button");d.type="button",d.className=Qe,d.setAttribute("aria-label",n.closeLabel),d.setAttribute("data-tip",n.closeLabel),d.setAttribute("data-tip-placement","below"),d.setAttribute("data-tip-align","end"),d.appendChild(pr(t)),c.appendChild(l),c.appendChild(v),c.appendChild(d);let u=t.createElement("div");u.className=rn,g.appendChild(c),g.appendChild(u);let w=t.createElement("button");w.type="button",w.className=Re,w.setAttribute("aria-hidden","true"),w.tabIndex=-1,e.appendChild(w),e.appendChild(g);let m=t.createElement("div");m.className=ye,m.setAttribute("aria-hidden","true"),g.appendChild(m);function x(){m.removeAttribute("data-open");}function A(y,k){try{let T=g.getBoundingClientRect(),I=e.getBoundingClientRect(),q=y.getBoundingClientRect();if(T.width===0||I.width===0)return;let W=(h==="right"?T.left-I.left:I.right-T.right)-ge*2;if(W<cr){x();return}m.textContent=k,m.style.maxWidth=`${Math.min(lr,W)}px`;let j=`${T.width+ge}px`;m.style.left=h==="right"?"auto":j,m.style.right=h==="right"?j:"auto",m.style.top="0px";let pe=m.offsetHeight,P=q.top-T.top,z=Math.max(ge,T.height-pe-ge);m.style.top=`${Math.min(Math.max(P,ge),z)}px`,m.setAttribute("data-open","");}catch{x();}}u.addEventListener("scroll",x);let E=()=>{try{n.onBack();}catch{}};l.addEventListener("click",E),d.addEventListener("click",E),w.addEventListener("click",E);let L=null;function H(){L?.remove(),L=null;}function N(){if(!s){for(x();u.firstChild;)u.removeChild(u.firstChild);if(H(),i.length===0){let y=t.createElement("div");y.className=cn;let k=t.createElement("span");k.textContent=r,y.appendChild(k),o&&y.appendChild(U(false)),u.appendChild(y);return}for(let y of i){let k=t.createElement("button");k.type="button",k.className=Me,y.active&&(k.setAttribute("data-active",""),k.setAttribute("aria-current","true"));let T=y.icon??n.itemIcon;if(T)try{let W=T(t);if(W){let j=t.createElement("span");j.className=sn,j.appendChild(W),k.appendChild(j);}}catch{}let I=t.createElement("span");I.className=ln;let q=t.createElement("span");if(q.className=on,q.textContent=y.title,I.appendChild(q),y.subtitle){let W=t.createElement("span");W.className=an,W.textContent=y.subtitle,I.appendChild(W);let j=y.subtitle;C&&(k.addEventListener("mouseenter",()=>A(k,j)),k.addEventListener("focus",()=>A(k,j)),k.addEventListener("mouseleave",x),k.addEventListener("blur",x));}k.appendChild(I),k.addEventListener("click",()=>{try{n.onSelect(y.id);}catch{}}),u.appendChild(k);}o&&(L=t.createElement("div"),L.className=Ze,L.appendChild(U(true)),g.appendChild(L));}}function U(y){let k=t.createElement("button");return k.type="button",k.className=Je,y&&k.appendChild(ur(t)),k.appendChild(t.createTextNode(o??"")),k.addEventListener("click",()=>{try{n.onAction?.();}catch{}}),k}N();function $(y){try{for(let k of Array.from(e.children))k===g||k===w||(y?k.setAttribute("inert",""):k.removeAttribute("inert"));}catch{}}return {open(){if(!s){g.setAttribute("data-open",""),w.setAttribute("data-open",""),$(true);try{l.focus();}catch{}}},close(){s||(x(),g.removeAttribute("data-open"),w.removeAttribute("data-open"),$(false));},isOpen:()=>g.hasAttribute("data-open"),setItems(y){i=y,N();},setTitle(y){v.textContent=y;},setTexts(y){y.emptyText!==void 0&&(r=y.emptyText),y.actionLabel!==void 0&&(o=y.actionLabel),y.backLabel!==void 0&&(l.setAttribute("aria-label",y.backLabel),l.setAttribute("data-tip",y.backLabel)),y.closeLabel!==void 0&&(d.setAttribute("aria-label",y.closeLabel),d.setAttribute("data-tip",y.closeLabel)),N();},destroy(){if(!s){s=true;try{$(!1),u.removeEventListener("scroll",x),l.removeEventListener("click",E),d.removeEventListener("click",E),w.removeEventListener("click",E),m.remove(),g.remove(),w.remove();}catch{}}}}}var Pe=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:0;var fr=560,hr=640;function Ne(e,t){let n=Pe(t.width);if(!n)return fr;if(n<640)return Math.max(0,n-24);let r=Math.round(e/100*n);return Math.min(r,n-32)}function pn(e,t,n){let r=Pe(t);if(!r)return hr;let o=Math.round(e/100*r),i=r-n-16;return Math.max(0,Math.min(o,i))}function we(e){return e.x===0&&e.y===0?"none":`translate(${e.x}px, ${e.y}px)`}function $e(e,t,n){let r=Pe(n);if(!r)return e;let o=Math.max(0,(r-Pe(t))/2);return Math.min(o,Math.max(-o,e))}var S="arcy-fill-card",un=`
|
|
724
|
+
.${S} {
|
|
725
|
+
position: absolute;
|
|
726
|
+
display: flex;
|
|
727
|
+
flex-direction: column;
|
|
728
|
+
gap: 10px;
|
|
729
|
+
box-sizing: border-box;
|
|
730
|
+
padding: 14px 16px;
|
|
731
|
+
border-radius: var(--arcy-chat-radius, 16px);
|
|
732
|
+
background: var(--_arcy-main-bg, #ffffff);
|
|
733
|
+
color: var(--_arcy-main-text, #101828);
|
|
734
|
+
border: var(--_arcy-border-width, 0px) solid
|
|
735
|
+
var(--_arcy-border-color, color-mix(in srgb, var(--_arcy-main-text, #101828) 15%, transparent));
|
|
736
|
+
box-shadow: var(--arcy-chat-shadow, 0 12px 32px rgba(16, 24, 40, 0.24));
|
|
737
|
+
font-family: inherit;
|
|
738
|
+
visibility: hidden;
|
|
739
|
+
opacity: 0;
|
|
740
|
+
transform-origin: bottom center;
|
|
741
|
+
transition: opacity 200ms ease, visibility 200ms ease;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.${S}[data-open] {
|
|
745
|
+
visibility: visible;
|
|
746
|
+
opacity: 1;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.${S}-question {
|
|
750
|
+
font-size: 14px;
|
|
751
|
+
line-height: 1.45;
|
|
752
|
+
overflow-wrap: anywhere;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.${S}-error {
|
|
756
|
+
font-size: 12.5px;
|
|
757
|
+
line-height: 1.4;
|
|
758
|
+
color: var(--_arcy-error-text, #b42318);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.${S}-controls {
|
|
762
|
+
display: flex;
|
|
763
|
+
flex-wrap: wrap;
|
|
764
|
+
align-items: center;
|
|
765
|
+
gap: 8px;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.${S}-controls:empty {
|
|
769
|
+
display: none;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.${S}-pill {
|
|
773
|
+
appearance: none;
|
|
774
|
+
border: 1px solid
|
|
775
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 18%, transparent);
|
|
776
|
+
background: transparent;
|
|
777
|
+
color: inherit;
|
|
778
|
+
font: inherit;
|
|
779
|
+
font-size: 13px;
|
|
780
|
+
padding: 7px 14px;
|
|
781
|
+
border-radius: 999px;
|
|
782
|
+
cursor: pointer;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.${S}-pill:hover {
|
|
786
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.${S}-input {
|
|
790
|
+
flex: 1 1 auto;
|
|
791
|
+
min-width: 0;
|
|
792
|
+
box-sizing: border-box;
|
|
793
|
+
border: 1px solid
|
|
794
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 18%, transparent);
|
|
795
|
+
border-radius: 10px;
|
|
796
|
+
background: transparent;
|
|
797
|
+
color: inherit;
|
|
798
|
+
font: inherit;
|
|
799
|
+
font-size: 13px;
|
|
800
|
+
padding: 8px 10px;
|
|
801
|
+
outline: none;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.${S}-input:focus-visible {
|
|
805
|
+
border-color: var(--_arcy-brand-bg, #101828);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.${S}-range {
|
|
809
|
+
flex: 1 1 auto;
|
|
810
|
+
min-width: 0;
|
|
811
|
+
accent-color: var(--_arcy-brand-bg, #101828);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.${S}-range-value {
|
|
815
|
+
flex: 0 0 auto;
|
|
816
|
+
font-size: 13px;
|
|
817
|
+
font-variant-numeric: tabular-nums;
|
|
818
|
+
min-width: 2.5em;
|
|
819
|
+
text-align: right;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
.${S}-confirm {
|
|
823
|
+
flex: 0 0 auto;
|
|
824
|
+
appearance: none;
|
|
825
|
+
border: 0;
|
|
826
|
+
border-radius: 999px;
|
|
827
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
828
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
829
|
+
font: inherit;
|
|
830
|
+
font-size: 13px;
|
|
831
|
+
padding: 8px 16px;
|
|
832
|
+
cursor: pointer;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
@media (prefers-reduced-motion: reduce) {
|
|
836
|
+
.${S} {
|
|
837
|
+
transition: none;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
`,mr={required:"fillRequired",invalid_number:"fillInvalidNumber",number_too_small:"fillNumberTooSmall",number_too_large:"fillNumberTooLarge",invalid_email:"fillInvalidEmail",invalid_url:"fillInvalidUrl",invalid_date:"fillInvalidDate",invalid_time:"fillInvalidTime",date_too_early:"fillDateTooEarly",date_too_late:"fillDateTooLate",too_long:"fillTooLong",invalid_option:"fillInvalidOption",invalid:"fillInvalid"},gr={date:"date",time:"time",datetime:"datetime-local",month:"month",week:"week"};function fn(e,t){let n=e.host.ownerDocument,r=n.createElement("div");r.className=S,r.setAttribute("role","dialog");let o=n.createElement("div");o.className=`${S}-question`;let i=n.createElement("div");i.className=`${S}-error`,i.setAttribute("role","alert"),i.style.setProperty("display","none");let s=n.createElement("div");s.className=`${S}-controls`,r.appendChild(o),r.appendChild(i),r.appendChild(s),e.root.appendChild(r);let h=null;function C(l){let d=t()[mr[l]];return (typeof d=="string"?d:"").replace("{min}",h?.min??"").replace("{max}",h?.max??String(h?.maxLength??""))}function g(){let l;try{l=e.bar.getMetrics();}catch{return}let v=l.bottomOffset+l.keyboardOffset+l.height+8,d=r.style;if(d.setProperty("bottom",`${v}px`),d.setProperty("left","50%"),d.setProperty("translate","-50%"),l.isMobile){d.setProperty("width",`calc(100% - ${24}px)`),d.setProperty("max-width","none"),d.setProperty("transform","none");return}let u=Ne(l.widthPercent,{width:l.viewportWidth,height:l.viewportHeight});d.setProperty("width",`${u}px`),d.setProperty("max-width",`calc(100vw - ${32}px)`),d.setProperty("transform",we({x:$e(l.offset.x,u,l.viewportWidth),y:l.offset.y}));}function c(l,v){s.textContent="";let d=t(),u=(m,x)=>{let A=n.createElement("button");A.type="button",A.className=`${S}-pill`,A.textContent=m,A.addEventListener("click",()=>v.onAnswer(x)),s.appendChild(A);},w=(m,x)=>{let A=n.createElement("button");A.type="button",A.className=`${S}-confirm`,A.textContent=d.fillConfirm,A.addEventListener("click",()=>v.onAnswer(x())),m.addEventListener("keydown",E=>{E.key==="Enter"&&(E.preventDefault(),v.onAnswer(x()));}),s.appendChild(m),s.appendChild(A);};switch(l.kind){case "select":case "radio":{for(let m of l.options??[])u(m.label,m.value);return}case "checkbox":{u(d.fillYes,"true"),u(d.fillNo,"false");return}case "range":{let m=n.createElement("input");m.type="range",m.className=`${S}-range`,l.min!==null&&(m.min=l.min),l.max!==null&&(m.max=l.max),l.step!==null&&(m.step=l.step);let x=n.createElement("span");x.className=`${S}-range-value`,x.textContent=m.value,m.addEventListener("input",()=>{x.textContent=m.value;});let A=n.createElement("button");A.type="button",A.className=`${S}-confirm`,A.textContent=d.fillConfirm,A.addEventListener("click",()=>v.onAnswer(m.value)),s.appendChild(m),s.appendChild(x),s.appendChild(A);return}case "password":{let m=n.createElement("input");m.type="password",m.className=`${S}-input`,m.autocomplete="off",w(m,()=>m.value);try{m.focus();}catch{}return}default:{let m=gr[l.kind];if(!m)return;let x=n.createElement("input");x.type=m,x.className=`${S}-input`,l.min!==null&&(x.min=l.min),l.max!==null&&(x.max=l.max),l.step!==null&&(x.step=l.step),w(x,()=>x.value);}}}return {show(l,v){h=l,o.textContent=l.question,c(l,v),this.setError(l.errorCode),g(),r.setAttribute("data-open","");},setError(l){l===null?(i.textContent="",i.style.setProperty("display","none")):(i.textContent=C(l),i.style.setProperty("display","block")),r.hasAttribute("data-open")&&g();},hide(){h=null,r.removeAttribute("data-open"),s.textContent="",i.textContent="",i.style.setProperty("display","none");},reposition(){r.hasAttribute("data-open")&&g();},isVisible:()=>r.hasAttribute("data-open"),destroy(){try{r.remove();}catch{}}}}var br=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,yr=/^\d{4}-\d{2}-\d{2}$/,wr=/^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/,vr=/^\d{4}-\d{2}-\d{2}T([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/,xr=/^\d{4}-\d{2}$/,Cr=/^\d{4}-W\d{2}$/,kr=/^\+?[\d\s().-]{3,}$/;function Ar(e){let t=Date.parse(e);return Number.isFinite(t)}function Er(e,t){if(t.min!==null){let n=Number(t.min);if(Number.isFinite(n)&&e<n)return "number_too_small"}if(t.max!==null){let n=Number(t.max);if(Number.isFinite(n)&&e>n)return "number_too_large"}return null}function rt(e){return /^\d:/.test(e)?`0${e}`:e}function ve(e,t){return t.min!==null&&t.min.length>0&&e<t.min?"date_too_early":t.max!==null&&t.max.length>0&&e>t.max?"date_too_late":null}function hn(e,t){let n=t.kind==="password"?e:e.trim();if(n.length===0)return t.required?"required":null;if(t.maxLength!==null&&n.length>t.maxLength)return "too_long";switch(t.kind){case "number":case "range":{let r=Number(n);return Number.isFinite(r)?Er(r,t):"invalid_number"}case "email":return br.test(n)?null:"invalid_email";case "url":try{let r=new URL(n);return r.protocol==="http:"||r.protocol==="https:"?null:"invalid_url"}catch{return "invalid_url"}case "tel":return kr.test(n)?null:"invalid";case "date":return !yr.test(n)||!Ar(n)?"invalid_date":ve(n,t);case "datetime":return vr.test(n)?ve(n,t):"invalid_date";case "month":return xr.test(n)?ve(n,t):"invalid_date";case "week":return Cr.test(n)?ve(n,t):"invalid_date";case "time":return wr.test(n)?ve(rt(n),{...t,min:t.min!==null?rt(t.min):null,max:t.max!==null?rt(t.max):null}):"invalid_time";case "select":case "radio":return (t.options??[]).some(o=>o.value===n)?null:"invalid_option";case "checkbox":return n==="true"||n==="false"?null:"invalid_option";default:{if(t.pattern)try{if(!new RegExp(`^(?:${t.pattern})$`).test(n))return "invalid"}catch{}return null}}}function mn(e,t){if(!t||t.length===0)return e;let n=e.trim();if(t.some(i=>i.value===n))return n;let r=n.toLowerCase(),o=t.find(i=>i.label.trim().toLowerCase()===r);return o?o.value:e}var Tr="https://api.arcyai.com",_r="/api/v1/sdk/flows/catalog";function Sr(e){return e!==void 0?e:typeof fetch<"u"?fetch.bind(globalThis):null}function Lr(e,t,n,r){return new Promise(o=>{let i=false,s=h=>{i||(i=true,o(h));};e.then(s,()=>s(r));try{n(()=>s(r),t);}catch{}})}function Ir(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.cvid=="string"&&(t.publicName===null||typeof t.publicName=="string")&&(t.summary===null||typeof t.summary=="string")&&(t.firstStepRoute===void 0||t.firstStepRoute===null||typeof t.firstStepRoute=="string")}function Rr(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.cvid=="string"&&typeof t.publicName=="string"&&t.publicName.trim().length>0&&(t.summary===null||t.summary===void 0||typeof t.summary=="string")}function Mr(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.flows;if(!Array.isArray(t))return null;let n=[];for(let i of t)Ir(i)&&n.push({...i,firstStepRoute:i.firstStepRoute??null});let r=e.starterFlows,o=Array.isArray(r)?r.filter(Rr).map(i=>({cvid:i.cvid,publicName:i.publicName,summary:i.summary??null})):[];return {flows:n,starterFlows:o}}function Fr(e){return {"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function gn(e){let{apiBase:t=Tr,sessionToken:n,sessionId:r,setTimeoutImpl:o=(C,g)=>setTimeout(C,g),timeoutMs:i=8e3}=e,s=Sr(e.fetchImpl);if(!s)return {ok:false,reason:"unusable"};let h=(async()=>{let C;try{C=await s(`${t}${_r}`,{method:"POST",headers:Fr(n),body:JSON.stringify(r?{sessionId:r}:{}),credentials:"omit"});}catch{return {ok:false,reason:"network"}}if(!C.ok)return {ok:false,reason:"rejected"};let g;try{g=await C.json();}catch{return {ok:false,reason:"unusable"}}let c=Mr(g);return c?{ok:true,...c}:{ok:false,reason:"unusable"}})();return Lr(h,i,o,{ok:false,reason:"network"})}function bn(e){let t=[];for(let n of e){let r=n.publicName?.trim()??"";r&&t.push({...n,publicName:r});}return t}var D="https://api.arcyai.com",Pr="/api/v1/sdk/agent/query";function Nr(e){return e!==void 0?e:typeof fetch<"u"?fetch.bind(globalThis):null}function $r(e,t,n,r){return new Promise(o=>{let i=false,s=h=>{i||(i=true,o(h));};e.then(s,()=>s(r));try{n(()=>s(r),t);}catch{}})}var Or=new Set(["credits_exhausted","lapsed","org_cap_exceeded","user_cap_exceeded","anon_org_cap_exceeded","anon_user_cap_exceeded"]);function Dr(e){return typeof e=="string"&&Or.has(e)}function Br(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.responseType!=="chat")return null;let n=t.chatResponse;if(!n||typeof n!="object"||Array.isArray(n))return null;let r=n;if(typeof r.message!="string")return null;let o=[];if(Array.isArray(r.flowsOffered))for(let s of r.flowsOffered){if(!s||typeof s!="object"||Array.isArray(s))continue;let h=s;typeof h.flowCvid=="string"&&(h.publicName!==null&&typeof h.publicName!="string"||o.push({flowCvid:h.flowCvid,publicName:h.publicName??null}));}let i=[];if(Array.isArray(r.citedSources))for(let s of r.citedSources){if(!s||typeof s!="object"||Array.isArray(s))continue;let h=s;typeof h.documentId!="string"||typeof h.title!="string"||h.sourceUrl!==null&&typeof h.sourceUrl!="string"||i.push({documentId:h.documentId,title:h.title,sourceUrl:h.sourceUrl??null});}return {ok:true,message:r.message,messageId:typeof r.messageId=="string"&&r.messageId.length>0?r.messageId:null,isFallback:r.isFallback===true,flowsOffered:o,citedSources:i}}function Hr(e){return {"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function yn(e){let{apiBase:t=D,publicKey:n,sessionId:r,sessionToken:o,query:i,route:s,conversationId:h,attachments:C=[],setTimeoutImpl:g=(d,u)=>setTimeout(d,u),timeoutMs:c=2e4}=e,l=Nr(e.fetchImpl);if(!l)return {ok:false,reason:"unusable"};let v=(async()=>{let d;try{d=await l(`${t}${Pr}`,{method:"POST",headers:Hr(o),body:JSON.stringify({publicKey:n,sessionId:r,query:i,route:s,conversationId:h,...C.length>0?{attachments:C}:{}}),credentials:"omit"});}catch{return {ok:false,reason:"network"}}if(d.status===402){let m;try{m=await d.json();}catch{return {ok:false,reason:"unusable"}}let x=m&&typeof m=="object"&&!Array.isArray(m)?m.reason:void 0;return Dr(x)?{ok:false,reason:"cap_denied",capReason:x}:{ok:false,reason:"unusable"}}if(!d.ok)return {ok:false,reason:"rejected"};let u;try{u=await d.json();}catch{return {ok:false,reason:"unusable"}}return Br(u)??{ok:false,reason:"unusable"}})();return $r(v,c,g,{ok:false,reason:"network"})}var Ur="https://api.arcyai.com";function zr(e){return typeof e!="string"||e.length===0||e.length>2048?false:/^https:\/\//i.test(e)?true:e.startsWith("/")&&!e.startsWith("//")}function ot(e,t){return zr(e)?/^https:\/\//i.test(e)?e:`${(t??Ur).replace(/\/+$/,"")}${e}`:null}var vn='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';function V(e,t=vn){return {family:e,fallback:t,stack:`"${e}", ${t}`}}var xn={system:{stack:vn},serif:{stack:'Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif'},mono:{stack:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace'},humanist:{stack:'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", sans-serif'},rounded:{stack:'ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, "Arial Rounded MT Bold", Calibri, sans-serif'},inter:V("Inter"),roboto:V("Roboto"),"open-sans":V("Open Sans"),lato:V("Lato"),poppins:V("Poppins"),montserrat:V("Montserrat"),nunito:V("Nunito"),"source-sans-3":V("Source Sans 3"),"work-sans":V("Work Sans"),"dm-sans":V("DM Sans"),manrope:V("Manrope"),"playfair-display":V("Playfair Display","Georgia, serif"),"ibm-plex-sans":V("IBM Plex Sans")},Vr=[["latin","U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"],["latin-ext","U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF"]];var De="--_arcy-font",wn="data-arcy-font";function Wr(e,t=D){let n=xn[e];return n?.family?Vr.map(([r,o])=>`@font-face{font-family:"${n.family}";font-style:normal;font-weight:400;font-display:swap;src:url("${t}/fonts/${e}-${r}.woff2") format("woff2");unicode-range:${o};}`).join(`
|
|
841
|
+
`):""}function it(e,t,n=D){try{let r=e.style.getPropertyValue(Lt).trim(),o=r?xn[r]:void 0;if(!o){e.style.removeProperty(De);return}if(e.style.setProperty(De,o.stack),!o.family)return;let i=t.head||t.documentElement;if(!i||i.querySelector(`style[${wn}="${r}"]`))return;let s=t.createElement("style");Le(s),s.setAttribute(wn,r),s.textContent=Wr(r,n),i.appendChild(s);}catch{}}var jr="/api/v1/sdk/conversations",Gr=15e3,Yr=20,Cn=60;function Kr(e){return e!==void 0?e:typeof fetch<"u"?fetch.bind(globalThis):null}function qr(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.conversations;if(!Array.isArray(t))return null;let n=[];for(let r of t){if(n.length>=Yr)break;if(!r||typeof r!="object"||Array.isArray(r))continue;let o=r;if(typeof o.id!="string"||o.id.length===0)continue;let i=o.lastMessageAt,s=typeof i=="number"&&Number.isFinite(i)?i:typeof i=="string"?Date.parse(i):NaN;n.push({id:o.id,firstMessage:typeof o.firstMessage=="string"&&o.firstMessage.length>0?o.firstMessage:null,hasImage:o.hasImage===true,lastMessageAt:Number.isFinite(s)?s:0});}return n}function kn(e){if(!e)return "";try{return new Date(e).toLocaleDateString()}catch{return ""}}function Xr(e,t){let n=e.firstMessage?.trim()??"";if(n.length>0)return n.length>Cn?`${n.slice(0,Cn-1).trimEnd()}\u2026`:n;let r=kn(e.lastMessageAt);return e.hasImage?r?`${t} ${r}`:t:r||t}function at(e,t,n){return e.map(r=>({id:r.id,title:Xr(r,t),subtitle:kn(r.lastMessageAt),active:!!(n&&r.id===n)}))}async function An(e){let{apiBase:t=D,sessionToken:n,visitorId:r,setTimeoutImpl:o=(C,g)=>setTimeout(C,g),timeoutMs:i=Gr}=e,s=Kr(e.fetchImpl);if(!s||!n||!r)return {ok:false};let h=(async()=>{let C;try{C=await s(`${t}${jr}?visitorId=${encodeURIComponent(r)}`,{method:"GET",headers:{Authorization:`Bearer ${n}`},credentials:"omit"});}catch{return {ok:false}}if(!C.ok)return {ok:false};let g;try{g=await C.json();}catch{return {ok:false}}let c=qr(g);return c?{ok:true,conversations:c}:{ok:false}})();return new Promise(C=>{let g=false,c=l=>{g||(g=true,C(l));};h.then(c,()=>c({ok:false}));try{o(()=>c({ok:!1}),i);}catch{}})}var Qr="/api/v1/sdk/conversations/{conversationId}/messages",Jr=15e3,Zr=200;function eo(e){return e!==void 0?e:typeof fetch<"u"?fetch.bind(globalThis):null}function to(e){return Qr.replace("{conversationId}",encodeURIComponent(e))}function En(e){return e==="agent"?"assistant":"user"}function no(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.messages;if(!Array.isArray(t))return null;let n=[];for(let r of t){if(n.length>=Zr)break;if(!r||typeof r!="object"||Array.isArray(r))continue;let o=r;if(typeof o.id!="string"||o.id.length===0||o.role!=="user"&&o.role!=="agent"||typeof o.text!="string")continue;let i=o.occurredAt,s=typeof i=="number"&&Number.isFinite(i)?i:typeof i=="string"?Date.parse(i):NaN,h=typeof o.images=="number"&&Number.isFinite(o.images)?Math.max(0,Math.floor(o.images)):0;n.push({id:o.id,role:o.role,text:o.text,occurredAt:Number.isFinite(s)?s:0,images:h,feedback:o.feedback==="up"||o.feedback==="down"?o.feedback:null});}return n}async function Tn(e){let{apiBase:t=D,sessionToken:n,conversationId:r,visitorId:o,setTimeoutImpl:i=(g,c)=>setTimeout(g,c),timeoutMs:s=Jr}=e,h=eo(e.fetchImpl);if(!h||!n||!r)return {ok:false};let C=(async()=>{let g;try{let v=o?`?visitorId=${encodeURIComponent(o)}`:"";g=await h(`${t}${to(r)}${v}`,{method:"GET",headers:{Authorization:`Bearer ${n}`},credentials:"omit"});}catch{return {ok:false}}if(!g.ok)return {ok:false};let c;try{c=await g.json();}catch{return {ok:false}}let l=no(c);return l?{ok:true,messages:l}:{ok:false}})();return new Promise(g=>{let c=false,l=v=>{c||(c=true,g(v));};C.then(l,()=>l({ok:false}));try{i(()=>l({ok:!1}),s);}catch{}})}var ro="/api/v1/sdk/conversations/{conversationId}/messages/{messageId}/feedback",oo=1e4;function io(e){return e!==void 0?e:typeof fetch<"u"?fetch.bind(globalThis):null}function ao(e,t){return ro.replace("{conversationId}",encodeURIComponent(e)).replace("{messageId}",encodeURIComponent(t))}async function _n(e){let{apiBase:t=D,sessionToken:n,conversationId:r,messageId:o,value:i,visitorId:s,setTimeoutImpl:h=(l,v)=>setTimeout(l,v),timeoutMs:C=oo}=e,g=io(e.fetchImpl);if(!g||!n||!r||!o)return {ok:false};let c=(async()=>{try{let l=s?`?visitorId=${encodeURIComponent(s)}`:"";return {ok:(await g(`${t}${ao(r,o)}${l}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({value:i}),credentials:"omit"})).ok}}catch{return {ok:false}}})();return new Promise(l=>{let v=false,d=u=>{v||(v=true,l(u));};c.then(d,()=>d({ok:false}));try{h(()=>d({ok:!1}),C);}catch{}})}var so="<svg width='476' height='139' viewBox='0 0 476 139' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M0 24.69C0 11.0541 11.0541 0 24.69 0H451.311C464.946 0 476 11.0537 476 24.6892V114.311C476 127.946 464.946 139 451.311 139H24.69C11.0541 139 0 127.946 0 114.31V24.69Z' fill='#12161A'/><path d='M132.047 84.6159L108.384 42.3014C101.224 29.4986 82.7988 29.502 75.6456 42.3116L52.0065 84.6362C43.8531 99.2299 63.7247 113.114 74.6251 100.436C83.7854 89.7891 100.271 89.7857 109.435 100.429C120.342 113.1 140.207 99.2096 132.047 84.6159Z' stroke='white' stroke-width='9.11833'/><path d='M232.67 100H221.885V85.398H183.969V100H173.183V70.2567C173.183 65.9148 173.93 61.9186 175.424 58.2681C176.917 54.6176 178.991 51.4787 181.646 48.8514C184.301 46.2242 187.44 44.1777 191.063 42.7119C194.685 41.2462 198.64 40.5133 202.927 40.5133H227.236C227.983 40.5133 228.688 40.6516 229.351 40.9282C230.015 41.2047 230.596 41.5919 231.094 42.0897C231.592 42.5875 231.979 43.1682 232.255 43.832C232.532 44.4957 232.67 45.2009 232.67 45.9476V100ZM183.969 74.6124H221.885V51.2989H202.927C202.595 51.2989 201.89 51.3542 200.811 51.4649C199.76 51.5478 198.53 51.7829 197.119 52.1701C195.736 52.5572 194.271 53.1518 192.722 53.9538C191.173 54.7558 189.749 55.8621 188.449 57.2725C187.149 58.6829 186.071 60.4528 185.214 62.5823C184.384 64.6841 183.969 67.2422 183.969 70.2567V74.6124ZM304.685 60.5082C304.685 62.9695 304.38 65.1681 303.772 67.104C303.164 69.0398 302.334 70.7545 301.283 72.2479C300.26 73.7136 299.071 74.9719 297.716 76.0228C296.36 77.0737 294.936 77.9449 293.443 78.6362C291.977 79.3 290.484 79.7839 288.963 80.0881C287.469 80.3924 286.059 80.5445 284.731 80.5445L307.257 100H290.58L268.097 80.5445H260.339V69.7589H284.731C286.086 69.6482 287.317 69.3717 288.423 68.9292C289.557 68.4591 290.525 67.8368 291.327 67.0625C292.157 66.2881 292.793 65.3617 293.235 64.2831C293.678 63.1769 293.899 61.9186 293.899 60.5082V53.7049C293.899 53.0965 293.816 52.6402 293.65 52.336C293.512 52.0041 293.318 51.7691 293.069 51.6308C292.848 51.4649 292.599 51.3681 292.323 51.3404C292.074 51.3128 291.839 51.2989 291.617 51.2989H256.025V100H245.239V45.9476C245.239 45.2009 245.378 44.4957 245.654 43.832C245.931 43.1682 246.304 42.5875 246.774 42.0897C247.272 41.5919 247.853 41.2047 248.517 40.9282C249.18 40.6516 249.899 40.5133 250.674 40.5133H291.617C294.024 40.5133 296.056 40.9558 297.716 41.8408C299.375 42.6981 300.716 43.7905 301.739 45.118C302.79 46.4178 303.537 47.8282 303.979 49.3492C304.45 50.8703 304.685 52.2945 304.685 53.622V60.5082ZM368.776 100H329.865C328.869 100 327.791 99.8894 326.629 99.6681C325.495 99.4192 324.361 99.0459 323.228 98.5481C322.121 98.0503 321.057 97.4142 320.033 96.6399C319.01 95.8379 318.098 94.8838 317.295 93.7775C316.521 92.6437 315.899 91.3439 315.429 89.8781C314.959 88.3848 314.724 86.7116 314.724 84.8587V55.6546C314.724 54.659 314.834 53.5943 315.055 52.4604C315.304 51.2989 315.678 50.1651 316.175 49.0588C316.673 47.925 317.323 46.8464 318.125 45.8232C318.927 44.7999 319.881 43.9011 320.987 43.1268C322.121 42.3248 323.421 41.6887 324.887 41.2185C326.353 40.7484 328.012 40.5133 329.865 40.5133H368.776V51.2989H329.865C328.454 51.2989 327.376 51.6723 326.629 52.419C325.882 53.1657 325.509 54.2719 325.509 55.7376V84.8587C325.509 86.2415 325.882 87.32 326.629 88.0944C327.404 88.8411 328.482 89.2144 329.865 89.2144H368.776V100ZM435.647 60.4252C435.647 62.8865 435.329 65.0851 434.692 67.021C434.084 68.9569 433.268 70.6715 432.245 72.1649C431.222 73.6306 430.019 74.8889 428.636 75.9398C427.281 76.9907 425.87 77.8619 424.405 78.5533C422.939 79.217 421.446 79.701 419.925 80.0052C418.431 80.3094 417.021 80.4615 415.693 80.4615H411.338V100H400.469V80.4615H396.155C394.827 80.4615 393.403 80.3094 391.882 80.0052C390.389 79.701 388.895 79.217 387.402 78.5533C385.936 77.8619 384.526 76.9907 383.171 75.9398C381.815 74.8889 380.612 73.6306 379.562 72.1649C378.538 70.6715 377.709 68.9569 377.073 67.021C376.464 65.0575 376.16 62.8589 376.16 60.4252V40.5133H386.946V60.4252C386.946 61.8356 387.167 63.1078 387.609 64.2416C388.052 65.3478 388.674 66.302 389.476 67.104C390.278 67.906 391.246 68.5282 392.38 68.9707C393.541 69.3855 394.827 69.5929 396.238 69.5929H415.693C416.716 69.427 417.767 69.2196 418.846 68.9707C419.925 68.6941 420.906 68.2378 421.791 67.6018C422.676 66.9657 423.409 66.0807 423.99 64.9468C424.571 63.813 424.861 62.3058 424.861 60.4252V40.5133H435.647V60.4252Z' fill='white'/></svg>";function Sn(e){try{let n=new DOMParser().parseFromString(so,"image/svg+xml").documentElement;if(!n||n.nodeName==="parsererror")return null;let r=e.importNode(n,!0);return r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r}catch{return null}}var lo="/api/v1/sdk/uploads",co="/api/v1/sdk/uploads/discard",po=3,uo=5*1024*1024,fo=1568,ho=St,mo=3e4;function st(e,t){return ho.includes(e.type)?e.size>uo?{ok:false,reason:"size"}:t>=po?{ok:false,reason:"count"}:{ok:true}:{ok:false,reason:"type"}}function go(e,t,n=fo){let r=Math.max(e,t);if(!(r>n)||!(r>0))return {width:Math.round(e),height:Math.round(t)};let o=n/r;return {width:Math.max(1,Math.round(e*o)),height:Math.max(1,Math.round(t*o))}}function Ln(e,t=typeof fetch<"u"?fetch.bind(globalThis):null){return {createImageBitmap:n=>createImageBitmap(n),createCanvas(n,r){let o=e.createElement("canvas");o.width=n,o.height=r;let i=o.getContext("2d");return {drawImage(s,h,C){i?.drawImage(s,0,0,h,C);},toBlob(s,h){return new Promise(C=>{try{o.toBlob(g=>C(g),s,h);}catch{C(null);}})}}},fetchImpl:t}}async function bo(e,t){let n={blob:e,contentType:e.type,width:0,height:0};try{let r=await t.createImageBitmap(e),o=go(r.width,r.height);if(o.width===r.width&&o.height===r.height)return r.close?.(),{...n,width:r.width,height:r.height};let i=t.createCanvas(o.width,o.height);i.drawImage(r,o.width,o.height);let s=await i.toBlob("image/jpeg",.85);return r.close?.(),s?{blob:s,contentType:"image/jpeg",width:o.width,height:o.height}:n}catch{return n}}function yo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.objectKey;return typeof t=="string"&&t.length>0?t:null}function wo(e,t,n,r){return new Promise(o=>{let i=false,s=h=>{i||(i=true,o(h));};e.then(s,()=>s(r));try{n(()=>s(r),t);}catch{}})}async function In(e,t,n){let r=st(e,t);if(!r.ok)return {ok:false,reason:r.reason};let{apiBase:o=D,sessionToken:i,env:s,timeoutMs:h=mo}=n,C=s.setTimeoutImpl??((l,v)=>setTimeout(l,v)),g=s.fetchImpl;if(!g||!i)return {ok:false,reason:"failed"};let c=(async()=>{let l=await bo(e,s),v;try{v=new FormData,v.append("file",l.blob,"image");}catch{return {ok:false,reason:"failed"}}let d;try{d=await g(`${o}${lo}`,{method:"POST",headers:{Authorization:`Bearer ${i}`},body:v,credentials:"omit"});}catch{return {ok:false,reason:"failed"}}if(!d.ok)return {ok:false,reason:"failed"};let u;try{u=await d.json();}catch{return {ok:false,reason:"failed"}}let w=yo(u);return w?{ok:true,attachment:{objectKey:w,contentType:l.contentType,width:l.width,height:l.height}}:{ok:false,reason:"failed"}})();return wo(c,h,C,{ok:false,reason:"failed"})}async function Rn(e,t){let{apiBase:n=D,sessionToken:r,fetchImpl:o}=t;if(!o||!r||!e)return false;try{return (await o(`${n}${co}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({objectKey:e}),credentials:"omit"})).ok}catch{return false}}var de="arcy-chat-panel",lt="arcy-chat-header",Nn="arcy-chat-icon",$n="arcy-chat-name",He="arcy-chat-hbtn",ne="arcy-chat-body",On="arcy-chat-strip",Dn="arcy-chat-main",xe="arcy-chat-mark",Ce="arcy-chat-mark-link",$i=It;var xo="https://arcyai.com",re="arcy-chat-welcome",Ue="arcy-chat-starter",ct="arcy-chat-starters",dt="arcy-chat-chips",J="arcy-chat-chip",Co=new Set(["org_cap_exceeded","anon_org_cap_exceeded","credits_exhausted","lapsed"]),ko=60,Ao=2500,Eo=Pt+`
|
|
842
|
+
/* Stays mounted and animates open/shut in place (D929/D979) rather than
|
|
843
|
+
toggling "display": the bar glides the panel the last few pixels rather
|
|
844
|
+
than having it appear or vanish. "visibility" (not "pointer-events",
|
|
845
|
+
which the panel forces "auto !important" inline to survive a hostile
|
|
846
|
+
host page's own CSS) is what actually blocks interaction while closed: a
|
|
847
|
+
"visibility: hidden" element is never hit-tested regardless of its
|
|
848
|
+
"pointer-events" value. */
|
|
849
|
+
.${de} {
|
|
850
|
+
display: flex;
|
|
851
|
+
flex-direction: column;
|
|
852
|
+
overflow: hidden;
|
|
853
|
+
visibility: hidden;
|
|
854
|
+
opacity: 0;
|
|
855
|
+
/* Always under the bar (.arcy-bar-wrap's own z-index in styles.ts): the
|
|
856
|
+
panel mounts lazily, after the bar, and DOM order alone used to make it
|
|
857
|
+
the one painted on top whenever the two overlapped. */
|
|
858
|
+
z-index: 1;
|
|
859
|
+
transform: translateY(8px) scale(0.98);
|
|
860
|
+
transition: opacity 260ms cubic-bezier(0.32, 0.72, 0, 1),
|
|
861
|
+
transform 260ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 260ms;
|
|
862
|
+
font: 14px/1.4 var(${De}, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
|
|
863
|
+
background: var(--_arcy-main-bg, #ffffff);
|
|
864
|
+
color: var(--_arcy-main-text, #101828);
|
|
865
|
+
/* The shared base.border (D832): one value, the bar's edge and this one. */
|
|
866
|
+
border: var(--_arcy-border-width, 0px) solid
|
|
867
|
+
var(--_arcy-border-color, color-mix(in srgb, var(--_arcy-main-text, #101828) 15%, transparent));
|
|
868
|
+
border-radius: var(--_arcy-chat-radius, 16px);
|
|
869
|
+
/* Offset 0 (was 8px down): the panel sits only PANEL_GAP (8px) above the
|
|
870
|
+
bar, and a downward-pushed shadow painted across it. Centering the blur
|
|
871
|
+
keeps the same softness without smearing onto the surface below. */
|
|
872
|
+
box-shadow: var(--_arcy-chat-shadow, 0 0 24px rgba(16, 24, 40, 0.28));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/* Glassiness (\xA75.4): a blur behind the panel plus an alpha on
|
|
876
|
+
main.background. Only where the browser can blur; elsewhere the panel
|
|
877
|
+
stays opaque, never transparent. */
|
|
878
|
+
@supports (backdrop-filter: blur(1px)) {
|
|
879
|
+
.${de} {
|
|
880
|
+
background: color-mix(in srgb, var(--_arcy-main-bg, #ffffff) calc(100% - var(--_arcy-glass-alpha, 0%)), transparent);
|
|
881
|
+
backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
882
|
+
-webkit-backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
.${de}[data-open] {
|
|
887
|
+
visibility: visible;
|
|
888
|
+
opacity: 1;
|
|
889
|
+
transform: translateY(0) scale(1);
|
|
890
|
+
transition: opacity 260ms cubic-bezier(0.32, 0.72, 0, 1),
|
|
891
|
+
transform 260ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/* Under the breakpoint the panel is a sheet: full width, rounded at the top
|
|
895
|
+
only, so it reads as the screen rather than as a card floating on it.
|
|
896
|
+
Set from JS as an attribute rather than a media query, because the
|
|
897
|
+
breakpoint is one number and viewport.ts owns it (D865). */
|
|
898
|
+
.${de}[data-sheet] {
|
|
899
|
+
border-radius: var(--_arcy-chat-radius, 16px) var(--_arcy-chat-radius, 16px) 0 0;
|
|
900
|
+
border-bottom: 0;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.${lt} {
|
|
904
|
+
display: flex;
|
|
905
|
+
align-items: center;
|
|
906
|
+
gap: 4px;
|
|
907
|
+
padding: 8px 10px;
|
|
908
|
+
flex: 0 0 auto;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.${He} {
|
|
912
|
+
appearance: none;
|
|
913
|
+
border: 0;
|
|
914
|
+
background: transparent;
|
|
915
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 70%, transparent);
|
|
916
|
+
cursor: pointer;
|
|
917
|
+
padding: 6px;
|
|
918
|
+
border-radius: 999px;
|
|
919
|
+
display: flex;
|
|
920
|
+
align-items: center;
|
|
921
|
+
flex: 0 0 auto;
|
|
922
|
+
-webkit-tap-highlight-color: transparent;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.${He}:hover {
|
|
926
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.${He}:focus-visible {
|
|
930
|
+
outline: 2px solid currentColor;
|
|
931
|
+
outline-offset: 2px;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/* The identity sits in the middle, between the two controls on the left and
|
|
935
|
+
the one on the right, so the panel reads as the operator's rather than as
|
|
936
|
+
a third party's. */
|
|
937
|
+
.${lt} .arcy-chat-identity {
|
|
938
|
+
flex: 1 1 auto;
|
|
939
|
+
display: flex;
|
|
940
|
+
align-items: center;
|
|
941
|
+
justify-content: center;
|
|
942
|
+
gap: 6px;
|
|
943
|
+
min-width: 0;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/* Sized by its HEIGHT and keeps its own aspect ratio (D925/D930): it used to
|
|
947
|
+
be a square box with "object-fit: cover", right for an app icon and wrong
|
|
948
|
+
for everything else, since a wordmark got cropped to its middle letters.
|
|
949
|
+
"chat.logoSize" means height here and the width follows. */
|
|
950
|
+
.${Nn} {
|
|
951
|
+
display: block;
|
|
952
|
+
height: var(--_arcy-chat-logo-size, 24px);
|
|
953
|
+
width: auto;
|
|
954
|
+
max-width: 100%;
|
|
955
|
+
border-radius: 4px;
|
|
956
|
+
object-fit: contain;
|
|
957
|
+
flex: 0 0 auto;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.${$n} {
|
|
961
|
+
font-weight: 600;
|
|
962
|
+
white-space: nowrap;
|
|
963
|
+
overflow: hidden;
|
|
964
|
+
text-overflow: ellipsis;
|
|
965
|
+
min-width: 0;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.${Dn} {
|
|
969
|
+
position: relative;
|
|
970
|
+
display: flex;
|
|
971
|
+
flex: 1 1 auto;
|
|
972
|
+
min-height: 0;
|
|
973
|
+
overflow: hidden;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.${ne} {
|
|
977
|
+
position: relative;
|
|
978
|
+
flex: 1 1 auto;
|
|
979
|
+
overflow: auto;
|
|
980
|
+
min-height: 0;
|
|
981
|
+
scrollbar-width: thin;
|
|
982
|
+
scrollbar-color: var(--_arcy-scroll-thumb, color-mix(in srgb, var(--_arcy-main-text, #101828) 25%, transparent))
|
|
983
|
+
var(--_arcy-scroll-track, transparent);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* D896: a set scrollbar-color makes Chrome ignore every ::-webkit-scrollbar
|
|
987
|
+
rule, which silently killed the width, track and hover tokens. */
|
|
988
|
+
@supports selector(::-webkit-scrollbar) {
|
|
989
|
+
.${ne} {
|
|
990
|
+
scrollbar-width: auto;
|
|
991
|
+
scrollbar-color: auto;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.${ne}::-webkit-scrollbar {
|
|
996
|
+
width: var(--_arcy-scroll-width, 6px);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.${ne}::-webkit-scrollbar-track {
|
|
1000
|
+
background: var(--_arcy-scroll-track, transparent);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.${ne}::-webkit-scrollbar-thumb {
|
|
1004
|
+
background: var(--_arcy-scroll-thumb, color-mix(in srgb, var(--_arcy-main-text, #101828) 25%, transparent));
|
|
1005
|
+
border-radius: 999px;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
.${ne}::-webkit-scrollbar-thumb:hover {
|
|
1009
|
+
background: var(--_arcy-scroll-thumb-hover, color-mix(in srgb, var(--_arcy-main-text, #101828) 40%, transparent));
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/* \u2500\u2500 The welcome screen \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1013
|
+
|
|
1014
|
+
.${re} {
|
|
1015
|
+
display: flex;
|
|
1016
|
+
flex-direction: column;
|
|
1017
|
+
align-items: center;
|
|
1018
|
+
text-align: center;
|
|
1019
|
+
gap: 10px;
|
|
1020
|
+
/* Room under the starter pills, so they do not sit on the bottom strip
|
|
1021
|
+
now that the panel takes its full height (D897), and room ABOVE the
|
|
1022
|
+
mark, which otherwise sits against the header's bottom edge and reads
|
|
1023
|
+
as part of the chrome rather than the start of the content. */
|
|
1024
|
+
padding: 26px 14px 20px;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.${re} .arcy-chat-welcome-icon {
|
|
1028
|
+
display: flex;
|
|
1029
|
+
align-items: center;
|
|
1030
|
+
justify-content: center;
|
|
1031
|
+
width: var(--_arcy-chat-welcome-icon-size, 34px);
|
|
1032
|
+
height: var(--_arcy-chat-welcome-icon-size, 34px);
|
|
1033
|
+
border-radius: 999px;
|
|
1034
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
1035
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
1036
|
+
overflow: hidden;
|
|
1037
|
+
flex-shrink: 0;
|
|
1038
|
+
/* The uploaded mark is drawn full-bleed against a round clip: without an
|
|
1039
|
+
inset, any mark that is not a perfect circle (most logos aren't) reads
|
|
1040
|
+
as cropped at top/bottom the moment it stops being square.
|
|
1041
|
+
calc() against the size token itself, NOT a percentage: a percentage
|
|
1042
|
+
padding resolves against the *containing block's* width (the chat
|
|
1043
|
+
panel), not this element's own, so it would inflate a 34px badge to
|
|
1044
|
+
match the panel's width instead of insetting it. */
|
|
1045
|
+
box-sizing: border-box;
|
|
1046
|
+
padding: calc(var(--_arcy-chat-welcome-icon-size, 34px) * 0.15);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.${re} .arcy-chat-welcome-icon img {
|
|
1050
|
+
width: 100%;
|
|
1051
|
+
height: 100%;
|
|
1052
|
+
object-fit: contain;
|
|
1053
|
+
display: block;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
/* The default mark is drawn at a fixed 18px by icon(), so it would stay 18px
|
|
1057
|
+
inside a badge the operator resized. A share of the badge instead, which is
|
|
1058
|
+
what the 18-in-34 it shipped with already was. */
|
|
1059
|
+
.${re} .arcy-chat-welcome-icon svg {
|
|
1060
|
+
width: 53%;
|
|
1061
|
+
height: 53%;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.${re} .arcy-chat-headline {
|
|
1065
|
+
font-size: 19px;
|
|
1066
|
+
font-weight: 600;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.${re} .arcy-chat-greeting {
|
|
1070
|
+
font-size: 13.5px;
|
|
1071
|
+
white-space: pre-wrap;
|
|
1072
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 70%, transparent);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.${ct} {
|
|
1076
|
+
display: flex;
|
|
1077
|
+
flex-wrap: wrap;
|
|
1078
|
+
justify-content: center;
|
|
1079
|
+
gap: 6px;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/* The pills arrive a beat after the welcome screen paints, because they come
|
|
1083
|
+
from the flow catalog fetch rather than the bootstrap (D959). Holding one
|
|
1084
|
+
row of height until that answers is what stops the greeting sliding up the
|
|
1085
|
+
panel while somebody is reading it. Released either way: an operator who
|
|
1086
|
+
has featured nothing must not be left with a permanent gap. */
|
|
1087
|
+
.${ct}[data-pending] {
|
|
1088
|
+
min-height: 34px;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.${Ue} {
|
|
1092
|
+
appearance: none;
|
|
1093
|
+
text-align: left;
|
|
1094
|
+
font: inherit;
|
|
1095
|
+
font-size: 12.5px;
|
|
1096
|
+
cursor: pointer;
|
|
1097
|
+
padding: 7px 13px;
|
|
1098
|
+
border-radius: 999px;
|
|
1099
|
+
border: 1px solid color-mix(in srgb, var(--_arcy-main-text, #101828) 14%, transparent);
|
|
1100
|
+
background: transparent;
|
|
1101
|
+
color: inherit;
|
|
1102
|
+
max-width: 100%;
|
|
1103
|
+
transition: background 120ms ease, border-color 120ms ease;
|
|
1104
|
+
-webkit-tap-highlight-color: transparent;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
.${Ue}:hover {
|
|
1108
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 9%, transparent);
|
|
1109
|
+
border-color: color-mix(in srgb, var(--_arcy-main-text, #101828) 30%, transparent);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1113
|
+
.${Ue} {
|
|
1114
|
+
transition: none;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/* \u2500\u2500 Attachments waiting to be sent \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1119
|
+
|
|
1120
|
+
.${dt} {
|
|
1121
|
+
display: flex;
|
|
1122
|
+
flex-wrap: wrap;
|
|
1123
|
+
gap: 6px;
|
|
1124
|
+
padding: 8px 12px 0;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/* In the tray the bar owns the insets; the rule above is the D845 fallback
|
|
1128
|
+
for a core with no tray. */
|
|
1129
|
+
.${Rt} .${dt} {
|
|
1130
|
+
flex: 1 1 auto;
|
|
1131
|
+
min-width: 0;
|
|
1132
|
+
padding: 0;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
.${J} {
|
|
1136
|
+
position: relative;
|
|
1137
|
+
width: 56px;
|
|
1138
|
+
height: 56px;
|
|
1139
|
+
border-radius: 10px;
|
|
1140
|
+
overflow: hidden;
|
|
1141
|
+
border: 1px solid color-mix(in srgb, var(--_arcy-main-text, #101828) 16%, transparent);
|
|
1142
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 6%, transparent);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.${J} img {
|
|
1146
|
+
display: block;
|
|
1147
|
+
width: 100%;
|
|
1148
|
+
height: 100%;
|
|
1149
|
+
object-fit: cover;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/* While the bytes are still going up. The picture is already on screen, so
|
|
1153
|
+
the wait is a dimming rather than a placeholder that swaps for the real
|
|
1154
|
+
thing and moves the row. */
|
|
1155
|
+
.${J}[data-state="uploading"] img {
|
|
1156
|
+
opacity: 0.45;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.${J}[data-state="uploading"]::after {
|
|
1160
|
+
content: "";
|
|
1161
|
+
position: absolute;
|
|
1162
|
+
inset: 50% auto auto 50%;
|
|
1163
|
+
width: 16px;
|
|
1164
|
+
height: 16px;
|
|
1165
|
+
margin: -8px 0 0 -8px;
|
|
1166
|
+
border-radius: 50%;
|
|
1167
|
+
border: 2px solid color-mix(in srgb, var(--_arcy-main-text, #101828) 25%, transparent);
|
|
1168
|
+
border-top-color: var(--_arcy-main-text, #101828);
|
|
1169
|
+
animation: arcy-chip-spin 700ms linear infinite;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
@keyframes arcy-chip-spin {
|
|
1173
|
+
to { transform: rotate(360deg); }
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1177
|
+
.${J}[data-state="uploading"]::after {
|
|
1178
|
+
animation: none;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/* The remove control. Over the picture rather than beside it, so three
|
|
1183
|
+
tiles still fit a phone screen, and 20px with a dark disc behind it so it
|
|
1184
|
+
is legible over a photograph of anything. */
|
|
1185
|
+
.${J} button {
|
|
1186
|
+
position: absolute;
|
|
1187
|
+
top: 3px;
|
|
1188
|
+
right: 3px;
|
|
1189
|
+
display: flex;
|
|
1190
|
+
align-items: center;
|
|
1191
|
+
justify-content: center;
|
|
1192
|
+
width: 18px;
|
|
1193
|
+
height: 18px;
|
|
1194
|
+
padding: 0;
|
|
1195
|
+
appearance: none;
|
|
1196
|
+
border: none;
|
|
1197
|
+
border-radius: 50%;
|
|
1198
|
+
background: rgba(16, 24, 40, 0.72);
|
|
1199
|
+
color: #ffffff;
|
|
1200
|
+
cursor: pointer;
|
|
1201
|
+
-webkit-tap-highlight-color: transparent;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.${J} button:hover {
|
|
1205
|
+
background: rgba(16, 24, 40, 0.9);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
.${J} button svg {
|
|
1209
|
+
display: block;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/* \u2500\u2500 The bottom strip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
1213
|
+
|
|
1214
|
+
/* "Powered by ARCY" only, centred (D979): it is the widget's one free
|
|
1215
|
+
distribution channel, always rendered in beta (D839) and never a theme
|
|
1216
|
+
field. The AI disclosure and the consent sentence used to share this row
|
|
1217
|
+
and now sit under the bar instead, so the watermark is centred rather
|
|
1218
|
+
than pinned to a corner by a neighbour. */
|
|
1219
|
+
.${On} {
|
|
1220
|
+
flex: 0 0 auto;
|
|
1221
|
+
display: flex;
|
|
1222
|
+
align-items: center;
|
|
1223
|
+
justify-content: center;
|
|
1224
|
+
padding: 6px 14px 10px;
|
|
1225
|
+
font-size: 10.5px;
|
|
1226
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 55%, transparent);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.${Ce} {
|
|
1230
|
+
display: inline-flex;
|
|
1231
|
+
align-items: center;
|
|
1232
|
+
gap: 4px;
|
|
1233
|
+
max-width: 100%;
|
|
1234
|
+
color: inherit;
|
|
1235
|
+
text-decoration: none;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.${Ce} span {
|
|
1239
|
+
overflow: hidden;
|
|
1240
|
+
text-overflow: ellipsis;
|
|
1241
|
+
white-space: nowrap;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
.${xe} {
|
|
1245
|
+
height: 12px;
|
|
1246
|
+
width: auto;
|
|
1247
|
+
display: block;
|
|
1248
|
+
/* Dimmed to sit with the strip's own text, and lifted to full strength on
|
|
1249
|
+
hover so the link answers the pointer (D907). */
|
|
1250
|
+
opacity: 0.75;
|
|
1251
|
+
transition: opacity 120ms ease;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.${Ce}:hover .${xe},
|
|
1255
|
+
.${Ce}:focus-visible .${xe} {
|
|
1256
|
+
opacity: 1;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1260
|
+
.${xe} {
|
|
1261
|
+
transition: none;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1266
|
+
.${de} {
|
|
1267
|
+
transition: none;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
`+Jt+Vt+dn,Mn="http://www.w3.org/2000/svg";function te(e,t,n=17){let r=e.createElementNS(Mn,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true"),r.setAttribute("width",String(n)),r.setAttribute("height",String(n));for(let o of typeof t=="string"?[t]:t){let i=e.createElementNS(Mn,"path");i.setAttribute("d",o),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","2"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),r.appendChild(i);}return r}var To="M12 21a9 9 0 100-18 9 9 0 000 18zM12 7v5l3 2",Fn="M13 3L5 14h6l-1 7 8-11h-6l1-7z",_o="M6 9l6 6 6-6",So="M18 6L6 18M6 6l12 12",Lo=["M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z","M9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0"],Io=["M19 13V19H13","M5 5L19 19"],Pn=["M5 8h10","M9 4v4","M12 20l4-9 4 9","M13.5 17h5","M13 8a10 10 0 0 1-8 8","M8 11a10 10 0 0 0 5 5"],Ro="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z";function Be(e,t){let n=e.style,r=t.bar.getMetrics(),o=t.getMaxHeightPercent?.()??ko,i=r.bottomOffset+r.keyboardOffset+r.height+8;if(n.setProperty("bottom",`${i}px`),n.setProperty("left","50%"),n.setProperty("translate","-50%"),n.setProperty("transform",we(r.offset)),r.isMobile){e.setAttribute("data-sheet",""),n.setProperty("width",`calc(100% - ${24}px)`),n.setProperty("max-width","none"),n.setProperty("height",`calc(100% - ${i+12}px)`),n.setProperty("max-height","none");return}e.removeAttribute("data-sheet");let s=Ne(r.widthPercent,{width:r.viewportWidth,height:r.viewportHeight});n.setProperty("width",`${s}px`),n.setProperty("max-width",`calc(100vw - ${32}px)`),n.setProperty("transform",we({x:$e(r.offset.x,s,r.viewportWidth),y:r.offset.y}));let h=i-r.offset.y,C=pn(o,r.viewportHeight,h);n.setProperty("height",`${C}px`),n.setProperty("max-height",`${C}px`);}function Mo(e){try{let ee=function(){try{for(;Q.firstChild;)Q.removeChild(Q.firstChild);Q.style.setProperty("display",F.length>0?"flex":"none");let a=d().removeImage;for(let p of F){let f=c.createElement("div");if(f.className=J,f.setAttribute("data-state",p.attachment?"ready":"uploading"),p.previewUrl){let _=c.createElement("img");_.src=p.previewUrl,_.alt="",f.appendChild(_);}let b=c.createElement("button");b.type="button",b.setAttribute("aria-label",a),b.setAttribute("data-tip",a),b.appendChild(te(c,So,12)),b.addEventListener("click",()=>{F=F.filter(_=>_!==p),mt(p),ee();}),f.appendChild(b),Q.appendChild(f);}e.bar.setAttachmentCount(F.length);}catch{}},yt=function(){e.setConversationId?.(null),P.clear(),gt(),X();},ue=function(a){let p=ie;p&&(ie=null,oe.hide(),e.bar.setAwaitingInput?.(!1),e.bar.setDisabled(Te),e.bar.setPlaceholder(v()?.inputPlaceholder??null),p.resolve(a));},We=function(a){let p=ie;if(!p)return;let f=p.request,b=f.kind==="select"||f.kind==="radio"?mn(a,f.options):f.kind==="password"?a:a.trim(),_=hn(b,f);if(_!==null){oe.setError(_);return}ue(b);},Ct=function(a){if(Te)return;let p=F.filter(f=>f.attachment!==null);F=F.filter(f=>f.attachment===null),ee(),P.addMessage("user",a,{images:p.length,imageUrls:p.map(f=>f.previewUrl).filter(f=>f!==null)}),X(),Te=!0,e.bar.setDisabled(!0),P.setPending(!0),yn({apiBase:e.apiBase??D,publicKey:e.publicKey??"",sessionId:e.getSessionId?.()??"",sessionToken:e.getSessionToken?.()??"",query:a,route:e.getRoute?.()??l?.location?.pathname??"",conversationId:e.getConversationId?.()??"",attachments:p.map(f=>({objectKey:f.attachment.objectKey}))}).then(f=>{let b=d();if(f.ok){P.addMessage("assistant",f.message,{messageId:f.messageId,citedSources:f.citedSources,flowOffers:f.flowsOffered}),e.touchConversation?.(),f.isFallback&&e.track?.("fallback_triggered",{},{question:a});for(let _ of f.flowsOffered)e.track?.("flow_suggested",{},{flowCvid:_.flowCvid});return}if(f.reason==="cap_denied"){Co.has(f.capReason)?e.onOrgCapExceeded?.():P.addMessage("system",b.userCapReached);return}P.addMessage("system",b.genericError);}).finally(()=>{Te=!1,P.setPending(!1),e.bar.setDisabled(!1);});},he=function(){if(!u.hasAttribute("data-open")){Ge(),it(e.host,c,e.apiBase),e.bar.setMode("open"),Be(u,e),u.setAttribute("data-open","");try{let a=e.isolated?e.root:c,p=e.isolated?a.activeElement:c.activeElement;_e=(e.isolated?p!==null:!!(p&&e.host.contains(p)))?null:c.activeElement,e.bar.focusInput();}catch{}}},Ge=function(){let a=v(),p=d();$(),W(),ie||e.bar.setPlaceholder(a?.inputPlaceholder??null),e.bar.setAttachEnabled(a?.allowImageUpload===!0),e.bar.setDisclaimer(j());for(let[f,b]of [[x,p.historyTitle],[A,p.flowsTitle],[N,p.settingsTitle],[U,p.collapse]])f.setAttribute("aria-label",b),f.setAttribute("data-tip",b);for(let f of [O,G,B])f.setTexts({backLabel:p.back,closeLabel:p.closeSheet});X();},Tt=function(){if(u.hasAttribute("data-open")){u.removeAttribute("data-open"),O.close(),G.close(),B.close(),Z="root",e.bar.setMode("idle"),e.bar.setDisclaimer(null);try{let a=_e;_e=null;let p=u.getRootNode();(p instanceof ShadowRoot?p.activeElement:document.activeElement!==null&&document.activeElement!==document.body)&&a&&a.isConnected&&typeof a.focus=="function"&&a.focus();}catch{}}};var t=ee,n=yt,r=ue,o=We,i=Ct,s=he,h=Ge,C=Tt;let g={host:e.host,root:e.root,isolated:e.isolated,destroy(){}};Ke(g,Eo),Ke(g,un);let c=e.host.ownerDocument,l=c.defaultView,v=()=>{try{return e.getWidget?.()??null}catch{return null}},d=()=>v()?.chrome??Mt,u=c.createElement("div");u.className=de,u.setAttribute("role","dialog"),u.setAttribute("aria-label","ARCY chat"),u.tabIndex=-1,u.style.setProperty("position","absolute","important"),u.style.setProperty("pointer-events","auto","important"),u.style.setProperty("box-sizing","border-box");let w=c.createElement("div");w.className=lt;let m=(a,p,f)=>{let b=c.createElement("button");return b.type="button",b.className=He,b.setAttribute("aria-label",a),b.setAttribute("data-tip",a),b.setAttribute("data-tip-placement","below"),b.setAttribute("data-tip-align",f),b.appendChild(te(c,p)),b},x=m(d().historyTitle,To,"start"),A=m(d().flowsTitle,Fn,"start");A.style.setProperty("display","none");let E=c.createElement("div");E.className="arcy-chat-identity";let L=c.createElement("span"),H=c.createElement("span");H.className=$n,E.appendChild(L),E.appendChild(H);let N=m(d().settingsTitle,Lo,"end");e.bar.dock||N.style.setProperty("display","none");let U=m(d().collapse,_o,"end");w.appendChild(x),w.appendChild(A),w.appendChild(E),w.appendChild(N),w.appendChild(U);let $=()=>{let a=v(),p=ot(a?.logoUrl,e.apiBase);if(H.textContent=p?"":a?.name??"",H.style.setProperty("display",p?"none":"block"),p&&L.getAttribute("data-src")===p)return;let f=p?c.createElement("img"):c.createElement("span");if(f.className=p?Nn:"",p){let b=f;b.alt=a?.name??"",b.decoding="async",b.onerror=()=>{try{let _=c.createElement("span");b.replaceWith(_),L=_,H.textContent=a?.name??"",H.style.setProperty("display","block");}catch{}},b.setAttribute("data-src",p),b.src=p;}L.replaceWith(f),L=f;},y=c.createElement("div");y.className=ne;let k=c.createElement("div");k.className=On;let T=c.createElement("a");T.className=Ce,T.href=xo,T.target="_blank",T.rel="noopener noreferrer";let I=c.createElement("span"),q=Sn(c);q&&q.setAttribute("class",xe),T.appendChild(I),q&&T.appendChild(q),k.appendChild(T);let W=()=>{let a=d();I.textContent=a.poweredBy.replace(/\s*ARCY\s*$/i,""),T.setAttribute("aria-label",a.poweredBy);},j=()=>{let a=v(),p=d(),f=a?.privacyPolicyUrl,b=a?.name?p.aiDisclaimer.replace("{app}",a.name):p.aiDisclaimer;if(typeof f=="string"&&/^https:\/\//i.test(f)){let _=p.consentWithPolicy.indexOf("{policy}"),Y=_>=0?p.consentWithPolicy.slice(0,_):`${p.consentWithPolicy} `,R=_>=0?p.consentWithPolicy.slice(_+8):"";return {before:`${b}${p.disclaimerJoin}${Y}`,linkLabel:p.privacyPolicy,linkHref:f,after:R}}return b},pe=c.createElement("div");pe.className=Dn,pe.appendChild(y),u.appendChild(w),u.appendChild(pe),u.appendChild(k),e.root.appendChild(u),it(e.host,c,e.apiBase),Be(u,e);let P=Zt(y,c,{labels:{likeAnswer:d().likeAnswer,dislikeAnswer:d().dislikeAnswer},answeringLabel:()=>d().answering,searchedSourcesLabel:d().searchedSourcesLabel,sourcesLabel:d().sourcesLabel,flowOfferHint:()=>d().flowOfferHint,onStartFlow:a=>{e.track?.("flow_pill_clicked",{},{flowCvid:a}),e.onStartFlow?.(a);},onFeedback:(a,p)=>{e.track?.("answer_feedback",{},{value:a});let f=e.getSessionToken?.()??"",b=e.getConversationId?.()??"";!p||!f||!b||_n({apiBase:e.apiBase,sessionToken:f,conversationId:b,messageId:p,value:a,visitorId:e.getVisitorId?.()??void 0});}}),z=c.createElement("div");z.className=re,y.insertBefore(z,y.firstChild);let pt=[],ke=!0,ut=null,X=()=>{try{for(;z.firstChild;)z.removeChild(z.firstChild);if(!P.isEmpty()){z.style.setProperty("display","none");return}z.style.setProperty("display","flex");let a=v(),p=c.createElement("div");p.className="arcy-chat-welcome-icon";let f=ot(a?.welcomeIconUrl,e.apiBase);if(f&&f!==ut){let R=c.createElement("img");R.src=f,R.alt="",R.addEventListener("error",()=>{ut=f,X();},{once:!0}),p.appendChild(R);}else p.appendChild(te(c,Ro,18));z.appendChild(p);let b=a?.welcomeHeadline?.trim()??"",_=a?.welcomeMessage?.trim()??"";if(b){let R=c.createElement("div");R.className="arcy-chat-headline",R.textContent=b,z.appendChild(R);}if(_){let R=c.createElement("div");R.className="arcy-chat-greeting",R.textContent=_,z.appendChild(R);}let Y=c.createElement("div");Y.className=ct,ke&&Y.setAttribute("data-pending","");for(let R of pt){let K=c.createElement("button");K.type="button",K.className=Ue,K.textContent=R.publicName,K.addEventListener("click",()=>{e.track?.("starter_flow_clicked",{},{flowCvid:R.cvid}),e.onStartFlow?.(R.cvid);}),Y.appendChild(K);}z.appendChild(Y);}catch{}},Q=c.createElement("div");Q.className=dt,Q.style.setProperty("display","none");let ft=e.bar.attachmentSlot?.()??null;ft?ft.appendChild(Q):y.insertBefore(Q,y.firstChild);let F=[],ht=Ln(c),Bn=ht.fetchImpl??(typeof fetch<"u"?fetch.bind(globalThis):null),Hn=a=>{try{return l?.URL?.createObjectURL?.(a)??URL.createObjectURL(a)}catch{return null}},ze=a=>{if(a.previewUrl){try{(l?.URL??URL).revokeObjectURL(a.previewUrl);}catch{}a.previewUrl=null;}},mt=a=>{ze(a);let p=a.attachment?.objectKey;p&&Rn(p,{apiBase:e.apiBase,sessionToken:e.getSessionToken?.()??"",fetchImpl:Bn});},gt=()=>{let a=F;F=[];for(let p of a)mt(p);ee();},Ae=Promise.resolve(),bt=a=>{Ae=Ae.then(async()=>{for(let p of a){let f=e.getSessionToken?.()??"",b=K=>{let Se=d();P.addMessage("system",K==="type"?Se.imageWrongType:K==="size"?Se.imageTooLarge:K==="count"?Se.imageTooMany:Se.imageFailed);},_=st(p,F.length);if(!_.ok){b(_.reason),X();continue}let Y={previewUrl:Hn(p),attachment:null};F=[...F,Y],ee();let R=await In(p,F.length-1,{apiBase:e.apiBase,sessionToken:f,env:ht});if(R.ok){Y.attachment=R.attachment,ee();continue}F=F.filter(K=>K!==Y),ze(Y),ee(),b(R.reason),X();}}),Ae=Ae.catch(()=>{});},Ve=[],O=Fe(u,c,{title:d().historyTitle,emptyText:d().historyEmpty,actionLabel:d().newChat,subtitleTips:!1,backLabel:d().back,closeLabel:d().closeSheet,onBack:()=>O.close(),onAction:()=>{yt(),O.close();},onSelect:a=>{if((e.getConversationId?.()??"")===a){O.close();return}e.setConversationId?.(a),P.clear(),gt(),X(),O.close(),Un(a);}});async function Un(a){let p=e.getSessionToken?.()??"";if(!p)return;let f=await Tn({apiBase:e.apiBase,sessionToken:p,conversationId:a,visitorId:e.getVisitorId?.()??void 0});if(f.ok&&(e.getConversationId?.()??"")===a){P.clear();for(let b of f.messages)P.addMessage(En(b.role),b.text,{images:b.images,at:b.occurredAt?new Date(b.occurredAt):void 0,messageId:b.id,feedback:b.feedback});X(),P.scrollToEnd();}}let G=Fe(u,c,{title:d().flowsTitle,emptyText:d().flowsEmpty,actionLabel:null,backLabel:d().back,closeLabel:d().closeSheet,itemIcon:a=>te(a,Fn,16),onBack:()=>G.close(),onSelect:a=>{G.close(),e.onStartFlow?.(a);}}),Z="root",B=Fe(u,c,{title:d().settingsTitle,side:"right",actionLabel:null,backLabel:d().back,closeLabel:d().closeSheet,onBack:()=>{if(Z==="language"){Z="root",Ee();return}B.close();},onSelect:a=>{if(Z==="language"){B.close(),Z="root",e.onSelectLocale?.(a);return}if(a==="language"){Z="language",Ee();return}a==="dock"&&(B.close(),e.onRequestClose(),e.bar.dock?.());}}),zn=()=>{if(!e.onSelectLocale)return [];let a=v()?.locales??[];return a.length>=2?a:[]},Ee=()=>{let a=d(),p=zn();if(Z==="language"){B.setTitle(a.language),B.setItems(p.map(b=>({id:b.code,title:b.label,active:b.code===v()?.activeLocale,icon:_=>te(_,Pn,16)})));return}B.setTitle(a.settingsTitle);let f=p.find(b=>b.code===v()?.activeLocale);B.setItems([...p.length?[{id:"language",title:a.language,subtitle:f?.label??null,icon:b=>te(b,Pn,16)}]:[],{id:"dock",title:a.dockChat,subtitle:a.dockChatHint,icon:b=>te(b,Io,16)}]);},wt=()=>{let a=d();O.setTitle(a.historyTitle),O.setTexts({emptyText:a.historyEmpty,actionLabel:a.newChat}),O.setItems(at(Ve,a.imageConversation,e.getConversationId?.())),O.open(),Vn();};async function Vn(){let a=e.getSessionToken?.()??"",p=e.getVisitorId?.()??"";if(!a||!p)return;let f=await An({apiBase:e.apiBase,sessionToken:a,visitorId:p});f.ok&&(Ve=f.conversations,O.isOpen()&&O.setItems(at(Ve,d().imageConversation,e.getConversationId?.())));}x.addEventListener("click",wt),A.addEventListener("click",()=>{let a=d();G.setTitle(a.flowsTitle),G.setTexts({emptyText:a.flowsEmpty}),G.open();});let vt=()=>{Z="root",Ee(),B.open();};N.addEventListener("click",vt);let xt=()=>e.onRequestClose();U.addEventListener("click",xt);let oe=fn(e,()=>d()),ie=null,Te=!1;e.bar.onSubmit(a=>{if(ie){We(a);return}he(),Ct(a);}),e.bar.onFiles?.(a=>{he(),bt(a);});let Wn=()=>v()?.allowImageUpload===!0,jn=a=>{Ye(a)&&a.preventDefault();},Gn=a=>{if(!Ye(a)||(a.preventDefault(),!Wn()))return;let p=Ft(a);p.length>0&&bt(p);};u.addEventListener("dragover",jn),u.addEventListener("drop",Gn);let fe=a=>{pt=a,ke=!1,X();},kt=!1,je=()=>{if(kt)return !0;let a=e.getSessionToken?.();return a?(kt=!0,gn({apiBase:e.apiBase,sessionToken:a,sessionId:e.getSessionId?.()}).then(p=>{if(!p.ok){fe([]);return}let f=bn(p.flows);fe(p.starterFlows),f.length!==0&&(A.style.setProperty("display","flex"),G.setItems(f.map(b=>({id:b.cvid,title:b.publicName,subtitle:b.summary}))));}).catch(()=>{fe([]);}),!0):!1};if(!je())try{l?.setTimeout(()=>{!je()&&ke&&fe([]);},Ao);}catch{}let At=a=>{if(a.key==="Escape"){if(a.stopPropagation(),O.isOpen()){O.close();return}if(G.isOpen()){G.close();return}if(B.isOpen()){B.close();return}e.onRequestClose();}};u.addEventListener("keydown",At);let Et=()=>{u.hasAttribute("data-open")&&Be(u,e),oe.reposition();};l?.addEventListener("resize",Et);let _e=null;return {open:he,close:Tt,reposition(){u.hasAttribute("data-open")&&Be(u,e),oe.reposition();},refreshChrome(){!je()&&ke&&fe([]),u.hasAttribute("data-open")&&(Ge(),B.isOpen()&&Ee());},destroy(){x.removeEventListener("click",wt),N.removeEventListener("click",vt),U.removeEventListener("click",xt),u.removeEventListener("keydown",At),l?.removeEventListener("resize",Et),_e=null,ue(null),oe.destroy(),O.destroy(),G.destroy(),B.destroy(),P.destroy();for(let a of F)ze(a);F=[],Q.remove(),e.bar.setAttachmentCount(0),u.remove();},promptFill(a){return new Promise(p=>{ue(null),e.onRequestClose(),oe.show(a,{onAnswer:f=>We(f)}),e.bar.setAwaitingInput?.(!0),a.kind==="password"?e.bar.setDisabled(!0):(e.bar.setPlaceholder(a.question),e.bar.focusInput()),ie={resolve:p,request:a};})},cancelFill(){ue(null);},showFlowFailure(){he(),P.addMessage("assistant",d().flowFailed),X();}}}catch{return null}}var Fo={contract:4,mount:Mo};if(typeof window<"u")try{window[_t]=Fo;}catch{}
|
|
1271
|
+
exports.ARCY_HOME_URL=xo;exports.BODY_CLASS=ne;exports.CATALOG_RETRY_MS=Ao;exports.CHAT_CSS=Eo;exports.CHIPS_CLASS=dt;exports.CHIP_CLASS=J;exports.HEADER_BUTTON_CLASS=He;exports.HEADER_CLASS=lt;exports.HEADER_ICON_CLASS=Nn;exports.HEADER_NAME_CLASS=$n;exports.MAIN_CLASS=Dn;exports.MARK_CLASS=xe;exports.MARK_LINK_CLASS=Ce;exports.PANEL_CLASS=de;exports.POLICY_CLASS=$i;exports.STARTER_CLASS=Ue;exports.STARTER_ROW_CLASS=ct;exports.STRIP_CLASS=On;exports.WELCOME_CLASS=re;exports.mount=Mo;exports.resolveImageUrl=ot;return exports;})({});
|