@bcrumbs.net/bc-chat 1.0.34 → 1.0.35
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/build/index.es.js +44 -44
- package/build/index.js +13 -13
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMemo as a,useRef as o,useEffect as r,
|
|
2
|
-
background-image: ${e=>
|
|
3
|
-
color: ${e=>
|
|
4
|
-
border-color: ${e=>
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMemo as a,useRef as o,useEffect as r,useLayoutEffect as c,useCallback as s,useState as l}from"react";import d from"@emotion/styled";import g from"react-markdown";import{franc as p}from"franc-min";import{v4 as h}from"uuid";import{BlobServiceClient as b,AnonymousCredential as m}from"@azure/storage-blob";const u={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD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Wgr3eBB3JtmI65WnKLD/za0xaxeiuSwVK/NwrHgT57SYaZaxAMyjvlkBfF1u4k2Svr/dLEhVSlAIVr+d0y5TF+KYYeu8lZ9d6uKIAFo93YJJ7oK6Q2PfNaKSpJNrcLSyDpcc7TjtuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",C=["🤓","🙃","😕","☹️","😲","😳","😠","😇","😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😏","😣","😥","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","😶","🙄"];function f(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function w(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function v(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const A=({message:n})=>e("div",{className:"bc-mediaMessage"+("audio"===n.type?" audio":""),style:{padding:0},children:e("video",{src:n.content,controls:!0})}),I=d.div`
|
|
2
|
+
background-image: ${e=>f(e)};
|
|
3
|
+
color: ${e=>v(e)};
|
|
4
|
+
border-color: ${e=>w(e)};
|
|
5
5
|
border-width: 1px;
|
|
6
6
|
border-style: solid;
|
|
7
7
|
:hover {
|
|
@@ -11,25 +11,25 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
11
11
|
-ms-filter: brightness(80%);
|
|
12
12
|
filter: brightness(80%);
|
|
13
13
|
}
|
|
14
|
-
`;const
|
|
14
|
+
`;const k=d.i`
|
|
15
15
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.51194%203.00541C9.18829%202.54594%2010.0435%202.53694%2010.6788%202.95419C10.8231%203.04893%2010.9771%203.1993%2011.389%203.61119C11.8009%204.02307%2011.9513%204.17714%2012.046%204.32141C12.4633%204.95675%2012.4543%205.81192%2011.9948%206.48827C11.8899%206.64264%2011.7276%206.80811%2011.3006%207.23511L10.6819%207.85383C10.4867%208.04909%2010.4867%208.36567%2010.6819%208.56093C10.8772%208.7562%2011.1938%208.7562%2011.389%208.56093L12.0077%207.94221L12.0507%207.89929C12.4203%207.52976%2012.6568%207.2933%2012.822%207.0502C13.4972%206.05623%2013.5321%204.76252%2012.8819%203.77248C12.7233%203.53102%2012.4922%203.30001%2012.1408%202.94871L12.0961%202.90408L12.0515%202.85942C11.7002%202.508%2011.4692%202.27689%2011.2277%202.11832C10.2377%201.46813%208.94398%201.50299%207.95001%202.17822C7.70691%202.34336%207.47044%202.57991%207.1009%202.94955L7.058%202.99247L6.43928%203.61119C6.24401%203.80645%206.24401%204.12303%206.43928%204.31829C6.63454%204.51355%206.95112%204.51355%207.14638%204.31829L7.7651%203.69957C8.1921%203.27257%208.35757%203.11027%208.51194%203.00541ZM4.31796%207.14672C4.51322%206.95146%204.51322%206.63487%204.31796%206.43961C4.12269%206.24435%203.80611%206.24435%203.61085%206.43961L2.99213%207.05833L2.94922%207.10124C2.57957%207.47077%202.34303%207.70724%202.17788%207.95035C1.50265%208.94432%201.4678%2010.238%202.11799%2011.2281C2.27656%2011.4695%202.50766%2011.7005%202.8591%2012.0518L2.90374%2012.0965L2.94837%2012.1411C3.29967%2012.4925%203.53068%2012.7237%203.77214%2012.8822C4.76219%2013.5324%206.05589%2013.4976%207.04986%2012.8223C7.29296%2012.6572%207.52943%2012.4206%207.89896%2012.051L7.89897%2012.051L7.94188%2012.0081L8.5606%2011.3894C8.75586%2011.1941%208.75586%2010.8775%208.5606%2010.6823C8.36533%2010.487%208.04875%2010.487%207.85349%2010.6823L7.23477%2011.301C6.80777%2011.728%206.6423%2011.8903%206.48794%2011.9951C5.81158%2012.4546%204.95642%2012.4636%204.32107%2012.0464C4.17681%2011.9516%204.02274%2011.8012%203.61085%2011.3894C3.19896%2010.9775%203.0486%2010.8234%202.95385%2010.6791C2.53661%2010.0438%202.54561%209.18863%203.00507%208.51227C3.10993%208.35791%203.27224%208.19244%203.69924%207.76544L4.31796%207.14672ZM9.62172%206.08558C9.81698%205.89032%209.81698%205.57373%209.62172%205.37847C9.42646%205.18321%209.10988%205.18321%208.91461%205.37847L5.37908%208.91401C5.18382%209.10927%205.18382%209.42585%205.37908%209.62111C5.57434%209.81637%205.89092%209.81637%206.08619%209.62111L9.62172%206.08558Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
16
16
|
width: 24px;
|
|
17
17
|
background-position: center;
|
|
18
18
|
background-size: contain;
|
|
19
19
|
background-repeat: no-repeat;
|
|
20
|
-
`,
|
|
20
|
+
`,y=d.a`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
align-item: center;
|
|
24
24
|
text-decoration: auto;
|
|
25
25
|
gap: 5px;
|
|
26
|
-
color: ${e=>`${
|
|
26
|
+
color: ${e=>`${v(e)}`};
|
|
27
27
|
font-size: var(--bc-chat-fontSize-sm);
|
|
28
|
-
`,
|
|
28
|
+
`,L=d.a`
|
|
29
29
|
font-size: var(--bc-chat-fontSize-sm);
|
|
30
|
-
background-image: ${e=>
|
|
31
|
-
color: ${e=>
|
|
32
|
-
border-color: ${e=>
|
|
30
|
+
background-image: ${e=>f(e)};
|
|
31
|
+
color: ${e=>v(e)};
|
|
32
|
+
border-color: ${e=>w(e)};
|
|
33
33
|
border-width: 1px;
|
|
34
34
|
border-style: solid;
|
|
35
35
|
:hover {
|
|
@@ -39,21 +39,21 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
39
39
|
-ms-filter: brightness(80%);
|
|
40
40
|
filter: brightness(80%);
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,M=d.div`
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: row;
|
|
45
45
|
align-items: center;
|
|
46
46
|
gap: 5px;
|
|
47
|
-
`,
|
|
47
|
+
`,E=d.span`
|
|
48
48
|
color: ${e=>e.color};
|
|
49
|
-
`;const
|
|
49
|
+
`;const S=d.i`
|
|
50
50
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22currentColor%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
51
51
|
background-position: center;
|
|
52
52
|
background-size: contain;
|
|
53
53
|
background-repeat: no-repeat;
|
|
54
54
|
width: 15px;
|
|
55
55
|
height: 15px;
|
|
56
|
-
`,
|
|
56
|
+
`,z={document:({message:t})=>{let i=t.content.split("/"),a=i[i.length-1];return e(I,{className:"bc-fileMessage",...t,children:n(y,{href:t.content,target:"_blank",download:a,rel:"noopener noreferrer",...t,children:[e(k,{color:(o=t,o.isAgent,"000000")}),e("span",{children:a})]})});var o},image:({message:n})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:f(n),color:v(n),borderColor:w(n),borderWidth:"1px",borderStyle:"solid",padding:0},children:e("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e("img",{src:n.content,alt:"message content"})})}),location:({message:t})=>{return e(L,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:t.isAgent,children:n(M,{children:[e(S,{color:(i=t,i.isAgent,"000000")}),e(E,{color:v(t),children:"Open location"})]})});var i},text:({message:n})=>{const t=p(n.content);return e("div",{style:{backgroundImage:f(n),color:v(n),borderColor:w(n),borderWidth:"1px",borderStyle:"solid",direction:"arb"===t?"rtl":"ltr"},children:(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map(((t,i)=>e(g,{children:t},`${n.messageId}-${i}`)))})},video:A,audio:A,interactive:null,template:({message:t})=>{const i=a((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return n("div",{style:{backgroundImage:f(t),color:v(t),borderColor:w(t),borderWidth:"1px",borderStyle:"solid"},children:[e("b",{children:"Template message:"})," ",i.name," ",i.language?.code?`/ ${i.language.code}`:null]})},note:({message:n})=>e("div",{children:n.content})},D=d.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 5px;
|
|
@@ -62,8 +62,8 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
62
62
|
margin: ${e=>e.isAgent?"0 40px 0 20px":"0 20px 0 40px"};
|
|
63
63
|
text-align: ${e=>e.isAgent?"left":"right"};
|
|
64
64
|
}
|
|
65
|
-
`;function
|
|
66
|
-
background-image: url(${e=>e.brandLogo||
|
|
65
|
+
`;function B({message:t}){const{debug:i,conversationId:a,traceId:o,spanId:r,isAgent:c}=t;return i?e(D,{isAgent:c,className:"bc-debugCon",children:n("div",{children:[n("div",{className:"bc-response-debug",children:["Trace id: ",e("span",{children:o})]}),n("div",{className:"bc-response-debug",children:["Span id: ",e("span",{children:r})]}),n("div",{className:"bc-response-debug",children:["Conversation id: ",e("span",{children:a})]})]})}):null}const N=()=>n("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),F={delivered:N,failed:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:N,sent:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},Z=({message:n})=>{if(!n.status)return null;const t=F[n.status];return e("div",{className:`status-icon ${n.status||""}`,children:e(t,{})})};function R(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}R(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\n.bc-note {\n text-align: center;\n gap: 5px; }\n .bc-note > div {\n background-color: #f9f9f9 !important;\n /* Light background */\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%; }\n\n.status-icon.read {\n color: var(--bc-chat-success-color); }\n\n.status-icon.failed {\n color: var(--bc-chat-danger-color); }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n\n.bc-agentMessage .bc-fileMessage,\n.bc-clientMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.bc-debug-panel {\n border-radius: 10px;\n box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.15);\n border: solid 1px #ffffff;\n background-color: #ffffff;\n color: var(--bc-chat-dark-gray-color);\n display: table;\n width: calc(100% - 40px);\n margin: 10px -40px 10px 0;\n text-align: left;\n padding: 8px;\n max-width: 310px; }\n\n.bc-exception-debug {\n color: #f5a623;\n position: relative; }\n .bc-exception-debug .bc-exception-icon {\n width: 30px;\n position: absolute;\n top: 3px;\n left: 10px; }\n .bc-exception-debug span {\n margin-left: 40px; }\n\n.bc-parameters-debug span {\n text-decoration: underline; }\n\n.bc-parameters-debug .bc-parameters-title {\n width: 100%;\n border-bottom: solid 1px #f3f3f3;\n text-align: left;\n font-weight: bold;\n margin-bottom: 6px; }\n\n.bc-debugCon {\n width: 100%; }\n");const G=d.i`
|
|
66
|
+
background-image: url(${e=>e.brandLogo||x});
|
|
67
67
|
width: 30px;
|
|
68
68
|
height: 30px;
|
|
69
69
|
background-position: center;
|
|
@@ -72,7 +72,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
72
72
|
border-radius: 50%;
|
|
73
73
|
background-repeat: no-repeat;
|
|
74
74
|
|
|
75
|
-
`;function
|
|
75
|
+
`;function j(e,n){return"note"===e?"bc-note":n?"bc-agentMessage":"bc-clientMessage"}const J=t=>{const{type:i,isAgent:a}=t.message,o=z[i]??null;return o?n("div",{className:j(i,a),children:[a&&"note"!==i?e(G,{brandLogo:t.config?.brandLogo}):null,e(o,{message:t.message}),a&&"note"!==i?e(Z,{message:t.message}):null,e(B,{message:t.message})]}):null},K=d.div`
|
|
76
76
|
width: 100%;
|
|
77
77
|
display: flex;
|
|
78
78
|
align-items: center;
|
|
@@ -85,7 +85,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
85
85
|
align-items: center;
|
|
86
86
|
${e=>e.centered?"":e.isAgent?"margin-left: 34px;":"margin-right: 8px;"}
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,H=({message:n})=>e("div",{children:e(K,{isAgent:n.isAgent,centered:"note"===n.type,children:e("div",{className:"date-seperator-content",children:new Date(n.createdAt).toLocaleString("en-US")})})}),P=d.div`
|
|
89
89
|
width: 90%;
|
|
90
90
|
display: flex;
|
|
91
91
|
align-items: center;
|
|
@@ -100,7 +100,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
100
100
|
margin-bottom: -10px;
|
|
101
101
|
padding:0 16px;
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`,Q=({data:n,config:t})=>e("div",{children:e(P,{backgroundColor:t.backgroundColor,children:e("div",{className:"seperator-content",children:n.content})})}),W="bc-message-list-content",T=d.div`
|
|
104
104
|
height: 100%;
|
|
105
105
|
width: 100%;
|
|
106
106
|
overflow-y: auto;
|
|
@@ -108,22 +108,22 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
108
108
|
background-size: 100% 100%;
|
|
109
109
|
background-image: ${e=>`url(${e.config.backgroundImage})`};
|
|
110
110
|
${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
|
|
111
|
-
`,
|
|
111
|
+
`,U=({sendMessage:t,debug:i,config:a,messages:s,onReachingUp:l})=>{const d=o(null),g=o(0);return r((()=>{const e=document.getElementById(W);if(!e)return;g.current=e.scrollHeight;const n=()=>{0===e.scrollTop&&l?.()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n)}}),[l]),c((()=>{const e=d.current;if(!e)return;const n=g.current;if(e.scrollHeight-e.scrollTop<=e.clientHeight+200){const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}else{const t=e.scrollHeight-n;e.style.scrollBehavior="auto",e.scrollTop=e.scrollTop+t}g.current=e.scrollHeight}),[s]),e(T,{ref:d,id:W,config:a,children:s?.map(((o,r)=>"seperator"===o.type?e(Q,{data:o,config:a}):n("div",{children:[e(J,{message:o,index:r,sendMessage:t,messageActionsEnabled:s.length-1===r,debug:i,config:a}),e(H,{message:o})]},o.messageId?o.messageId:"message"+r)))},W)},Y="text";var V={EN:{share_my_location:"Share My Location",share_my_current_location:"Share My Current Location",placeholder:"Type a Message",see_your_location:"See Your Location",location_permission:"Please give location permission"},TR:{share_my_location:"Konumumu paylaş",share_my_current_location:"Güncel konumumu paylaş",placeholder:"Mesajınızı yazın",see_your_location:"Konumunuzu Görüntüleyin",location_permission:"Lütfen konum paylaşımı için izin verin"},DE:{share_my_location:"Standortfreigabe",share_my_current_location:"Meinen aktuellen Standort teilen",placeholder:"Geben Sie eine Nachricht ein",see_your_location:"Sehen Sie Ihren Standort",location_permission:"Bitte geben Sie Ihren Standort frei"}};const O=d.span`
|
|
112
112
|
cursor: pointer;
|
|
113
113
|
width: 20px;
|
|
114
114
|
height: 20px;
|
|
115
115
|
margin: 5px;
|
|
116
|
-
`,
|
|
117
|
-
${e=>
|
|
118
|
-
`,
|
|
119
|
-
${e=>
|
|
120
|
-
`,
|
|
116
|
+
`,q=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),X=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),$=({file:t,isFileSelected:i,cancelFileUpload:a})=>n("div",{className:"bc-uploadFileDetails",style:{border:i?"green dashed 1px":""},id:"uploadFileDetails",children:[e("div",{className:"bc-uploadedFile",children:u.SupportedImageFormats.indexOf(t.extension)>=0?e("img",{src:t.fileUrl,alt:"",className:"bc-imageFile"}):e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawkc2dHl4ykkHYFIbyMNipjEyJjo1VGgmKNcHGfeKSo79yqLdm/zjiRq720xyRMhrt0YDLE6TCERLroC+GivhtOaCkdpZnfpCsdrS7TEdFlGISK+qyDKRm/yDgRq6M00+8mHW3dkI4IpSiREirl1YwTsTpKshrt0nHw50pHkSYjIaQwh4TW9xmdcaJVrEuIg1GllI5s1+kIJ8iBcGHftnBhzsCME1JISYrp2Ji+dISpDJ3m9TlVrWtP+23GiSXkOExHUQ4dWxrrczbB8oxfZpwwQo7TdIQMIYWn0n/Oblp/6hB3nJFk9RlDAt3CwCHVPMuT1K4YkBtYPtj+W4lYSY/G7k9HH/fpKDSEnArNlPUG/aDJYJ3BH6DRYK1Gw9rTkqzRqF9zuongZ5QzTARWU/7YhZ+yitI/QR3LyjMT1LIUDIAanhUDwLd8wC5fQe5IZ0JKs6H9i/4cZ8LBLWb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ZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e("div",{className:"bc-uploadFileName",children:e("span",{children:t.fileName})}),e("div",{className:"bc-uploadFileCancel",children:e("span",{onClick:a,children:e(X,{})})})]}),_=({text:n,setText:t,config:i,send:a})=>{const c=o(null),l=s((()=>{const e=c.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return r((()=>{n||(l(),c.current.focus())}),[l,n]),e("textarea",{ref:c,value:n,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||V[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{if("Enter"===e.key&&(e.shiftKey||e.ctrlKey||e.altKey)){e.preventDefault();const i=c.current.selectionStart,a=n.slice(0,i)+"\n"+n.slice(i);return t(a),void l()}"Enter"===e.key&&(e.preventDefault(),a(),l())},onChange:e=>{t(e.target.value),l()}})},ee=({config:t,send:i,file:a,isFileSelected:o,text:r,setText:c,cancelFileUpload:s})=>n("div",{className:"bc-messageInput",children:[a?e($,{file:a,isFileSelected:o,cancelFileUpload:s}):e(_,{text:r,setText:c,config:t,send:i}),e(O,{onClick:()=>i(),children:r||a?e(q,{}):null})]});async function ne(e,n,t){const i=new b("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new m).getContainerClient("anonymous"),a=new Date,o=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}`,r=i.getBlockBlobClient(`${o}/${h()}`);try{await r.uploadBrowserData(e,{onProgress:t=>{const i=Math.round(t.loadedBytes/e.size*100);n(i)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(r.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const te=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,ie=d.i`
|
|
117
|
+
${e=>te("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
|
|
118
|
+
`,ae=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666",fillRule:"evenodd",clipRule:"evenodd"})}),oe=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});let re;const ce=({setProgress:i,setFile:a,setError:o,send:c})=>{const[d,g]=l(!1);r((()=>{const e=document.createElement("script");return e.src="https://cdn.bcrumbs.net/bc-assets/scripts/mic-recorder-to-mp3.js",e.async=!0,e.onload=()=>console.log("Script Loaded"),document.body.appendChild(e),()=>{document.body.removeChild(e)}}),[]);const p=s((()=>{if(!re){if("function"!=typeof MicRecorder)return void o("Please wait a little until voice library is loaded");re=new MicRecorder({bitRate:128})}o(void 0),d?re.stop().getMp3().then((([e,n])=>{g(!1);ne(new File([n],"recording.mp3",{type:"audio/mpeg"}),i,((e,n)=>{e?c({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&o(n)}))})).catch((e=>o(e.message))):navigator.mediaDevices.getUserMedia({audio:!0}).then((()=>{re.start().then((()=>{g(!0)})).catch((e=>o(e.message)))})).catch((e=>o(e.message)))}),[d,o,i,c]);return n(t,{children:[d?e("i",{onClick:()=>{re?.stop(),g(!1)},children:e(oe,{})}):null,n("div",{id:"voiceRecorderIcon",className:"mic-container",children:[d?e("i",{onClick:p,children:e(ae,{})}):e(ie,{onClick:p,activeColor:"var(--bc-chat-dark-gray-color)"}),e("div",{className:"circle "+(d?"active":"")})]})]})};const se=d.i`
|
|
119
|
+
${e=>te("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 – 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
120
|
+
`,le=d.span`
|
|
121
121
|
margin: 8px;
|
|
122
122
|
cursor: pointer;
|
|
123
123
|
font-size: var(--bc-chat-fontSize-xl);
|
|
124
|
-
`,
|
|
125
|
-
${e=>
|
|
126
|
-
`,
|
|
124
|
+
`,de=({onClick:n})=>e("div",{id:"emojiIcon",children:e(se,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),ge=({text:n,setText:t,onClick:i})=>{const a=function(e){const n=o(null);return r((()=>{const t=t=>{n.current&&!n.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e]),n}(i),c=s((e=>{t(n+e)}),[t,n]),l=C.map(((n,t)=>e(le,{className:"emoji",onClick:e=>c(e.target.innerText),children:n},"emoji"+t)));return e("div",{ref:a,children:e("div",{className:"bc-emojiPicker",id:"emojiPicker",children:l})})},pe=d.i`
|
|
125
|
+
${e=>te("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
126
|
+
`,he=({setProgress:t,setFile:i,setError:a})=>{const o=s((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:c}=o,s=r.substring(r.lastIndexOf(".")+1).toLowerCase();return u.SupportedFormats.indexOf(s)<0?a("File type is not valid."):c>u.MaxFileSize?a("Maximum limit is 20 MBs"):void ne(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:s}):n&&a(n)}))}),[t,i,a]);return n("div",{id:"attachIcon",children:[e("label",{htmlFor:"fileInput",children:e(pe,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},be=d.div`
|
|
127
127
|
padding: 0px 0px 0px 10px;
|
|
128
128
|
margin: 0px;
|
|
129
129
|
width: fit-content;
|
|
@@ -138,7 +138,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
138
138
|
cursor: pointer;
|
|
139
139
|
display: block;
|
|
140
140
|
}
|
|
141
|
-
`,
|
|
141
|
+
`,me=({setView:t,setFile:i,setProgress:a,setError:o,text:r,setText:c,send:s})=>{const[d,g]=l(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(be,{id:"iconsContainer",children:[e(he,{setFile:i,setProgress:a,setError:o}),e(de,{onClick:()=>g(!0)}),e(ce,{setFile:i,setError:o,setProgress:a,send:s})]}),d?e(ge,{text:r,setText:c,onClick:()=>g(!1)}):null]})};R('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n max-width: 100%;\n max-height: 100%;\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3;\n animation: bounce 0.8s ease-in-out infinite 0.5s; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const ue=d.div`
|
|
142
142
|
width: calc(100% - 40px);
|
|
143
143
|
background-color: #d9d9d94d;
|
|
144
144
|
padding: 10px 20px;
|
|
@@ -156,26 +156,26 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
156
156
|
margin-top: 6px;
|
|
157
157
|
text-align: center;
|
|
158
158
|
}
|
|
159
|
-
`,
|
|
160
|
-
${e=>e.bannerWidth>
|
|
159
|
+
`,xe=({config:t,sendMessage:i,setView:a})=>{const[o,r]=l(),[c,d]=l(),[g,p]=l(),[h,b]=l(0),m=s((e=>{if(e){const{fileUrl:n,extension:t}=e;i(u.SupportedImageFormats.indexOf(t)>=0?"image":u.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(c){const{fileUrl:e,extension:n}=c;i(u.SupportedImageFormats.indexOf(n)>=0?"image":u.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),d(void 0)}else i(Y,o),r("")}),[c,o,i]);return n(ue,{children:[e("div",{className:"bc-InputArea",children:e(ee,{config:t,send:m,text:o,setText:r,file:c,isFileSelected:!!c,cancelFileUpload:()=>d(void 0)})}),e("div",{className:"bc-CommandsArea",children:e(me,{setView:a,setFile:d,setProgress:b,setError:p,setText:r,text:o,send:m})}),g?e("div",{className:"bc-uploadFileError",children:g}):null]})},Ce="bc-chat-header-banner",fe=390,we=d.div`
|
|
160
|
+
${e=>e.bannerWidth>fe?"height: 60px;":"height: 90px;"}
|
|
161
161
|
display: block;
|
|
162
162
|
width: 100%;
|
|
163
163
|
background-color: transparent;
|
|
164
164
|
z-index: 10;
|
|
165
165
|
border-top-left-radius: 15px;
|
|
166
166
|
border-top-right-radius: 15px;
|
|
167
|
-
`,
|
|
167
|
+
`,ve=d.div`
|
|
168
168
|
width: 100%;
|
|
169
169
|
display: flex;
|
|
170
170
|
align-items: center;
|
|
171
171
|
background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
|
|
172
|
-
${e=>e.bannerWidth<=
|
|
173
|
-
`,
|
|
172
|
+
${e=>e.bannerWidth<=fe?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4z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RhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
|
|
173
|
+
`,Ae=d.div`
|
|
174
174
|
width: 100%;
|
|
175
175
|
height: 100%;
|
|
176
176
|
display: flex;
|
|
177
|
-
`,
|
|
178
|
-
${e=>e.bannerWidth>
|
|
177
|
+
`,Ie=d.div`
|
|
178
|
+
${e=>e.bannerWidth>fe?"padding-bottom: 0 !important;":""}
|
|
179
179
|
display: flex;
|
|
180
180
|
gap: 10px;
|
|
181
181
|
align-items: center;
|
|
@@ -196,8 +196,8 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
196
196
|
color: #fff;
|
|
197
197
|
font-style: normal;
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
200
|
-
${e=>e.bannerWidth>
|
|
199
|
+
`,ke=d.div`
|
|
200
|
+
${e=>e.bannerWidth>fe?"padding-bottom: 0 !important;":""}
|
|
201
201
|
display: flex;
|
|
202
202
|
flex-direction: row-reverse;
|
|
203
203
|
gap: 10px;
|
|
@@ -212,9 +212,9 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
212
212
|
cursor: pointer;
|
|
213
213
|
display: block;
|
|
214
214
|
}
|
|
215
|
-
`,
|
|
215
|
+
`,ye=d.i`
|
|
216
216
|
background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
|
|
217
|
-
`,
|
|
217
|
+
`,Le=({config:t,minimize:i})=>{const[a,o]=l();return r((()=>{new ResizeObserver((()=>{const e=document.getElementById(Ce)?.offsetWidth;e&&e>50&&e!==a&&o(e)})).observe(document.getElementById(Ce))}),[]),e(we,{bannerWidth:a,className:"bc-header",children:e(ve,{className:"bc-banner",id:Ce,startColor:"#065A60",endColor:"#006466",bannerWidth:a,children:n(Ae,{className:"bc-bannerContents",children:[n(Ie,{className:"bc-companyInfo",bannerWidth:a,logo:t.brandLogo||x,children:[e("i",{}),e("span",{children:t.brandName||"BreadCrumbs"})]}),e(ke,{className:"bc-bannerActions",bannerWidth:a,children:i?e(ye,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},Me=d.div`
|
|
218
218
|
width: 100%;
|
|
219
219
|
text-align: center;
|
|
220
220
|
i {
|
|
@@ -222,7 +222,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
222
222
|
position: relative;
|
|
223
223
|
width: 20px;
|
|
224
224
|
height: 20px;
|
|
225
|
-
background-image: url(${
|
|
225
|
+
background-image: url(${x});
|
|
226
226
|
background-repeat: no-repeat;
|
|
227
227
|
background-size: 20px 20px;
|
|
228
228
|
background-position: center;
|
|
@@ -245,7 +245,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
245
245
|
border-radius: 0px 0px 10px 10px;
|
|
246
246
|
opacity: 1;
|
|
247
247
|
}
|
|
248
|
-
`,
|
|
248
|
+
`,Ee=i.forwardRef((({forRate:t},i)=>n(Me,{className:""+(t?"bc-ratingPositioning":""),children:[e("i",{}),e("span",{children:"Powered by Bread Crumbs"})]})));R('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px; }\n');const Se=d.div`
|
|
249
249
|
height: 100%;
|
|
250
250
|
display: flex;
|
|
251
251
|
flex-direction: column;
|
|
@@ -271,5 +271,5 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useMem
|
|
|
271
271
|
line-height: inherit;
|
|
272
272
|
font-weight: inherit;
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`,ze=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:a,debug:o,minimize:r,onReachingUp:c})=>{const[s,d]=l("MESSAGE_LIST"),g="interactive"===(i&&i.length>0&&i[i.length-1].type);return n(Se,{className:"bc-chat",children:[t.hideHeader?null:e(Le,{config:t,minimize:r}),"MESSAGE_LIST"===s?e(U,{messages:i,sendMessage:a,debug:o,config:t,onReachingUp:c},"message-list"):null,g?e(Ee,{forRate:!0}):t.inputDisabled?null:e(xe,{sendMessage:a,setView:d,config:t},"message-input")]})};export{ze as BCChat};
|
|
275
275
|
//# sourceMappingURL=index.es.js.map
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),i=require("react-markdown"),a=require("franc-min"),o=require("uuid"),r=require("@azure/storage-blob");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(n),l=s(t),d=s(i);const g={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD5bEN5dkQljlgFl6sKo854c97EMfvf2osl1K+FAEgqhPEWBuvyNRModi2XIFDDmVcCYV4FLjnZ8Zf8NQ1OTCysmmFR6HK2smxeAmVatNaC56lPUKrIXzk74Jv8dVGsNEcfZcAh3A25OX4pECp1cE/EZmUSKfaXbUGi/hnp7i7gh7Mku5QXAhkMwOztw8Z4NNx4yEZ+vVWRjbfrqiBCNeRVISUrG7t6L4oRQqMji3f4nesw47u6MyadPMU6cYpwo6G/Fl4U1vOtVaw0wBVyC6ZmCxoSZL8yGQ/j46hEccLbNOajZJoLY0tGEI9ZzvONfvP4BylMU4g6MbDiEz240RN36sdh3HisO3fyZd6wuf6O4j8hoAIxpq1CQqkbWciUAYGxqHANBPywBJyxjAWJ+w+AdKHvM+GjN28TOM6n0cbtFQiCc6DHzAjCmrcJ23QaolsmJMYNSj1qsh+0vJ37sbyFgHHC2YW2GnjhBNmlL44awOBFucNzdSfQfzK3CnqLNvACetIKXsnHYYMK2lWRA/KH3EtGnk2vijg2CQzhjv04EwYO5VahUF89pnU/WvAdj2ipO34VhL3wsucPK03PFBaHZ20O4wFwBTNuu/BooXljC6Tt718J7NIsGgo9liGRnu27DvNeTSaTYnvEqp8/6wEPMy41y03zqEBzDXk573TL5rDFgNqvI5GaefAFXJpGKB0L/yCAXgjz+hEe1TI51M0D2zcg7ptP1Z1pZkiUt5bQfhkMLI5VeSEYhCA1BJknmtP0CyWLmUV/URA0AbrGMOCA8KZwCwIXAQNxrtvu5V+KCpct558UjvQmeSqcn/Xe5YR5N4qrHGtea5+51cdpvpKmJOXynxf8aE2oUOZz2Ied1sPOM5lc9VsIV1qlWE/P+YJzigrBJW8ppM48mUd/VNGcQjlEvDjmvE67AJ9t3B1zigqCTawhV2DIWQH1XExyj3tjyj4E27Lp9Gswjrp/vyCnjvaqfinMnJERP+LxkM1qufMsJVpaxACydP2HbyjzUaEqgfTGTSME7/H/iylAv4QLTN0I+8fWyq1OcypJMIsXh14zY0tFEjDXet6Pxvv1xbiFLWgr3eBB3JtmI65WnKLD/za0xaxeiuSwVK/NwrHgT57SYaZaxAMyjvlkBfF1u4k2Svr/dLEhVSlAIVr+d0y5TF+KYYeu8lZ9d6uKIAFo93YJJ7oK6Q2PfNaKSpJNrcLSyDpcc7TjtuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",h=["🤓","🙃","😕","☹️","😲","😳","😠","😇","😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😏","😣","😥","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","😶","🙄"];function x(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function b(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),i=require("react-markdown"),a=require("franc-min"),o=require("uuid"),r=require("@azure/storage-blob");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(n),l=s(t),d=s(i);const g={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD5bEN5dkQljlgFl6sKo854c97EMfvf2osl1K+FAEgqhPEWBuvyNRModi2XIFDDmVcCYV4FLjnZ8Zf8NQ1OTCysmmFR6HK2smxeAmVatNaC56lPUKrIXzk74Jv8dVGsNEcfZcAh3A25OX4pECp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tuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",h=["🤓","🙃","😕","☹️","😲","😳","😠","😇","😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😏","😣","😥","😮","😴","😌","😋","😎","😍","🙂","🤗","🤔","😐","😑","😶","🙄"];function x(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function b(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function u(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const m=({message:n})=>e.jsx("div",{className:"bc-mediaMessage"+("audio"===n.type?" audio":""),style:{padding:0},children:e.jsx("video",{src:n.content,controls:!0})}),f=l.default.div`
|
|
2
2
|
background-image: ${e=>x(e)};
|
|
3
|
-
color: ${e=>
|
|
3
|
+
color: ${e=>u(e)};
|
|
4
4
|
border-color: ${e=>b(e)};
|
|
5
5
|
border-width: 1px;
|
|
6
6
|
border-style: solid;
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
align-item: center;
|
|
24
24
|
text-decoration: auto;
|
|
25
25
|
gap: 5px;
|
|
26
|
-
color: ${e=>`${
|
|
26
|
+
color: ${e=>`${u(e)}`};
|
|
27
27
|
font-size: var(--bc-chat-fontSize-sm);
|
|
28
28
|
`,v=l.default.a`
|
|
29
29
|
font-size: var(--bc-chat-fontSize-sm);
|
|
30
30
|
background-image: ${e=>x(e)};
|
|
31
|
-
color: ${e=>
|
|
31
|
+
color: ${e=>u(e)};
|
|
32
32
|
border-color: ${e=>b(e)};
|
|
33
33
|
border-width: 1px;
|
|
34
34
|
border-style: solid;
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
background-repeat: no-repeat;
|
|
54
54
|
width: 15px;
|
|
55
55
|
height: 15px;
|
|
56
|
-
`,I={document:({message:n})=>{let t=n.content.split("/"),i=t[t.length-1];return e.jsx(f,{className:"bc-fileMessage",...n,children:e.jsxs(w,{href:n.content,target:"_blank",download:i,rel:"noopener noreferrer",...n,children:[e.jsx(C,{color:(a=n,a.isAgent,"000000")}),e.jsx("span",{children:i})]})});var a},image:({message:n})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:x(n),color:
|
|
56
|
+
`,I={document:({message:n})=>{let t=n.content.split("/"),i=t[t.length-1];return e.jsx(f,{className:"bc-fileMessage",...n,children:e.jsxs(w,{href:n.content,target:"_blank",download:i,rel:"noopener noreferrer",...n,children:[e.jsx(C,{color:(a=n,a.isAgent,"000000")}),e.jsx("span",{children:i})]})});var a},image:({message:n})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:x(n),color:u(n),borderColor:b(n),borderWidth:"1px",borderStyle:"solid",padding:0},children:e.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e.jsx("img",{src:n.content,alt:"message content"})})}),location:({message:n})=>{return e.jsx(v,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:n.isAgent,children:e.jsxs(A,{children:[e.jsx(y,{color:(t=n,t.isAgent,"000000")}),e.jsx(k,{color:u(n),children:"Open location"})]})});var t},text:({message:n})=>{const t=a.franc(n.content);return e.jsx("div",{style:{backgroundImage:x(n),color:u(n),borderColor:b(n),borderWidth:"1px",borderStyle:"solid",direction:"arb"===t?"rtl":"ltr"},children:(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map(((t,i)=>e.jsx(d.default,{children:t},`${n.messageId}-${i}`)))})},video:m,audio:m,interactive:null,template:({message:t})=>{const i=n.useMemo((()=>{try{return JSON.parse(t.content)}catch(e){return void console.log(e.message)}}),[t]);return e.jsxs("div",{style:{backgroundImage:x(t),color:u(t),borderColor:b(t),borderWidth:"1px",borderStyle:"solid"},children:[e.jsx("b",{children:"Template message:"})," ",i.name," ",i.language?.code?`/ ${i.language.code}`:null]})},note:({message:n})=>e.jsx("div",{children:n.content})},L=l.default.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 5px;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
margin: ${e=>e.isAgent?"0 40px 0 20px":"0 20px 0 40px"};
|
|
63
63
|
text-align: ${e=>e.isAgent?"left":"right"};
|
|
64
64
|
}
|
|
65
|
-
`;function
|
|
65
|
+
`;function M({message:n}){const{debug:t,conversationId:i,traceId:a,spanId:o,isAgent:r}=n;return t?e.jsx(L,{isAgent:r,className:"bc-debugCon",children:e.jsxs("div",{children:[e.jsxs("div",{className:"bc-response-debug",children:["Trace id: ",e.jsx("span",{children:a})]}),e.jsxs("div",{className:"bc-response-debug",children:["Span id: ",e.jsx("span",{children:o})]}),e.jsxs("div",{className:"bc-response-debug",children:["Conversation id: ",e.jsx("span",{children:i})]})]})}):null}const j=()=>e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M1.5 12.5L5.57574 16.5757C5.81005 16.8101 6.18995 16.8101 6.42426 16.5757L9 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M16 7L12 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M7 12L11.5757 16.5757C11.8101 16.8101 12.1899 16.8101 12.4243 16.5757L22 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),E={delivered:j,failed:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),read:j,sent:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M5 13L9 17L19 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pending:()=>e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},S=({message:n})=>{if(!n.status)return null;const t=E[n.status];return e.jsx("div",{className:`status-icon ${n.status||""}`,children:e.jsx(t,{})})};function z(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}z(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\n.bc-note {\n text-align: center;\n gap: 5px; }\n .bc-note > div {\n background-color: #f9f9f9 !important;\n /* Light background */\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n border: 1px solid #999;\n max-width: 60%; }\n\n.status-icon.read {\n color: var(--bc-chat-success-color); }\n\n.status-icon.failed {\n color: var(--bc-chat-danger-color); }\n .status-icon.failed .resend {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer;\n margin: 0 10px; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n\n.bc-agentMessage .bc-fileMessage,\n.bc-clientMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.bc-debug-panel {\n border-radius: 10px;\n box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.15);\n border: solid 1px #ffffff;\n background-color: #ffffff;\n color: var(--bc-chat-dark-gray-color);\n display: table;\n width: calc(100% - 40px);\n margin: 10px -40px 10px 0;\n text-align: left;\n padding: 8px;\n max-width: 310px; }\n\n.bc-exception-debug {\n color: #f5a623;\n position: relative; }\n .bc-exception-debug .bc-exception-icon {\n width: 30px;\n position: absolute;\n top: 3px;\n left: 10px; }\n .bc-exception-debug span {\n margin-left: 40px; }\n\n.bc-parameters-debug span {\n text-decoration: underline; }\n\n.bc-parameters-debug .bc-parameters-title {\n width: 100%;\n border-bottom: solid 1px #f3f3f3;\n text-align: left;\n font-weight: bold;\n margin-bottom: 6px; }\n\n.bc-debugCon {\n width: 100%; }\n");const D=l.default.i`
|
|
66
66
|
background-image: url(${e=>e.brandLogo||p});
|
|
67
67
|
width: 30px;
|
|
68
68
|
height: 30px;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
border-radius: 50%;
|
|
73
73
|
background-repeat: no-repeat;
|
|
74
74
|
|
|
75
|
-
`;function B(e,n){return"note"===e?"bc-note":n?"bc-agentMessage":"bc-clientMessage"}const F=n=>{const{type:t,isAgent:i}=n.message,a=I[t]??null;return a?e.jsxs("div",{className:B(t,i),children:[i&&"note"!==t?e.jsx(D,{brandLogo:n.config?.brandLogo}):null,e.jsx(a,{message:n.message}),i&&"note"!==t?e.jsx(S,{message:n.message}):null,e.jsx(
|
|
75
|
+
`;function B(e,n){return"note"===e?"bc-note":n?"bc-agentMessage":"bc-clientMessage"}const F=n=>{const{type:t,isAgent:i}=n.message,a=I[t]??null;return a?e.jsxs("div",{className:B(t,i),children:[i&&"note"!==t?e.jsx(D,{brandLogo:n.config?.brandLogo}):null,e.jsx(a,{message:n.message}),i&&"note"!==t?e.jsx(S,{message:n.message}):null,e.jsx(M,{message:n.message})]}):null},N=l.default.div`
|
|
76
76
|
width: 100%;
|
|
77
77
|
display: flex;
|
|
78
78
|
align-items: center;
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
background-size: 100% 100%;
|
|
109
109
|
background-image: ${e=>`url(${e.config.backgroundImage})`};
|
|
110
110
|
${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
|
|
111
|
-
`,
|
|
111
|
+
`,H=({sendMessage:t,debug:i,config:a,messages:o,onReachingUp:r})=>{const s=n.useRef(null),c=n.useRef(0);return n.useEffect((()=>{const e=document.getElementById(J);if(!e)return;c.current=e.scrollHeight;const n=()=>{0===e.scrollTop&&r?.()};return e.addEventListener("scroll",n),()=>{e.removeEventListener("scroll",n)}}),[r]),n.useLayoutEffect((()=>{const e=s.current;if(!e)return;const n=c.current;if(e.scrollHeight-e.scrollTop<=e.clientHeight+200){const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}else{const t=e.scrollHeight-n;e.style.scrollBehavior="auto",e.scrollTop=e.scrollTop+t}c.current=e.scrollHeight}),[o]),e.jsx(K,{ref:s,id:J,config:a,children:o?.map(((n,r)=>"seperator"===n.type?e.jsx(G,{data:n,config:a}):e.jsxs("div",{children:[e.jsx(F,{message:n,index:r,sendMessage:t,messageActionsEnabled:o.length-1===r,debug:i,config:a}),e.jsx(Z,{message:n})]},n.messageId?n.messageId:"message"+r)))},J)},P="text";var Q={EN:{share_my_location:"Share My Location",share_my_current_location:"Share My Current Location",placeholder:"Type a Message",see_your_location:"See Your Location",location_permission:"Please give location permission"},TR:{share_my_location:"Konumumu paylaş",share_my_current_location:"Güncel konumumu paylaş",placeholder:"Mesajınızı yazın",see_your_location:"Konumunuzu Görüntüleyin",location_permission:"Lütfen konum paylaşımı için izin verin"},DE:{share_my_location:"Standortfreigabe",share_my_current_location:"Meinen aktuellen Standort teilen",placeholder:"Geben Sie eine Nachricht ein",see_your_location:"Sehen Sie Ihren Standort",location_permission:"Bitte geben Sie Ihren Standort frei"}};const W=l.default.span`
|
|
112
112
|
cursor: pointer;
|
|
113
113
|
width: 20px;
|
|
114
114
|
height: 20px;
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
margin-top: 6px;
|
|
157
157
|
text-align: center;
|
|
158
158
|
}
|
|
159
|
-
`,pe=({config:t,sendMessage:i,setView:a})=>{const[o,r]=n.useState(),[s,c]=n.useState(),[l,d]=n.useState(),[p,h]=n.useState(0),x=n.useCallback((e=>{if(e){const{fileUrl:n,extension:t}=e;i(g.SupportedImageFormats.indexOf(t)>=0?"image":g.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(s){const{fileUrl:e,extension:n}=s;i(g.SupportedImageFormats.indexOf(n)>=0?"image":g.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),c(void 0)}else i(
|
|
159
|
+
`,pe=({config:t,sendMessage:i,setView:a})=>{const[o,r]=n.useState(),[s,c]=n.useState(),[l,d]=n.useState(),[p,h]=n.useState(0),x=n.useCallback((e=>{if(e){const{fileUrl:n,extension:t}=e;i(g.SupportedImageFormats.indexOf(t)>=0?"image":g.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(s){const{fileUrl:e,extension:n}=s;i(g.SupportedImageFormats.indexOf(n)>=0?"image":g.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),c(void 0)}else i(P,o),r("")}),[s,o,i]);return e.jsxs(ge,{children:[e.jsx("div",{className:"bc-InputArea",children:e.jsx(O,{config:t,send:x,text:o,setText:r,file:s,isFileSelected:!!s,cancelFileUpload:()=>c(void 0)})}),e.jsx("div",{className:"bc-CommandsArea",children:e.jsx(de,{setView:a,setFile:c,setProgress:h,setError:d,setText:r,text:o,send:x})}),l?e.jsx("div",{className:"bc-uploadFileError",children:l}):null]})},he="bc-chat-header-banner",xe=390,be=l.default.div`
|
|
160
160
|
${e=>e.bannerWidth>xe?"height: 60px;":"height: 90px;"}
|
|
161
161
|
display: block;
|
|
162
162
|
width: 100%;
|
|
@@ -164,13 +164,13 @@
|
|
|
164
164
|
z-index: 10;
|
|
165
165
|
border-top-left-radius: 15px;
|
|
166
166
|
border-top-right-radius: 15px;
|
|
167
|
-
`,
|
|
167
|
+
`,ue=l.default.div`
|
|
168
168
|
width: 100%;
|
|
169
169
|
display: flex;
|
|
170
170
|
align-items: center;
|
|
171
171
|
background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
|
|
172
172
|
${e=>e.bannerWidth<=xe?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
|
|
173
|
-
`,
|
|
173
|
+
`,me=l.default.div`
|
|
174
174
|
width: 100%;
|
|
175
175
|
height: 100%;
|
|
176
176
|
display: flex;
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
}
|
|
215
215
|
`,we=l.default.i`
|
|
216
216
|
background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
|
|
217
|
-
`,ve=({config:t,minimize:i})=>{const[a,o]=n.useState();return n.useEffect((()=>{new ResizeObserver((()=>{const e=document.getElementById(he)?.offsetWidth;e&&e>50&&e!==a&&o(e)})).observe(document.getElementById(he))}),[]),e.jsx(be,{bannerWidth:a,className:"bc-header",children:e.jsx(
|
|
217
|
+
`,ve=({config:t,minimize:i})=>{const[a,o]=n.useState();return n.useEffect((()=>{new ResizeObserver((()=>{const e=document.getElementById(he)?.offsetWidth;e&&e>50&&e!==a&&o(e)})).observe(document.getElementById(he))}),[]),e.jsx(be,{bannerWidth:a,className:"bc-header",children:e.jsx(ue,{className:"bc-banner",id:he,startColor:"#065A60",endColor:"#006466",bannerWidth:a,children:e.jsxs(me,{className:"bc-bannerContents",children:[e.jsxs(fe,{className:"bc-companyInfo",bannerWidth:a,logo:t.brandLogo||p,children:[e.jsx("i",{}),e.jsx("span",{children:t.brandName||"BreadCrumbs"})]}),e.jsx(Ce,{className:"bc-bannerActions",bannerWidth:a,children:i?e.jsx(we,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},Ae=l.default.div`
|
|
218
218
|
width: 100%;
|
|
219
219
|
text-align: center;
|
|
220
220
|
i {
|
|
@@ -271,5 +271,5 @@
|
|
|
271
271
|
line-height: inherit;
|
|
272
272
|
font-weight: inherit;
|
|
273
273
|
}
|
|
274
|
-
`;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:a,debug:o,minimize:r,onReachingUp:s})=>{const[c,l]=n.useState("MESSAGE_LIST"),d="interactive"===(i&&i.length>0&&i[i.length-1].type);return e.jsxs(ye,{className:"bc-chat",children:[t.hideHeader?null:e.jsx(ve,{config:t,minimize:r}),"MESSAGE_LIST"===c?e.jsx(
|
|
274
|
+
`;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:i=[],sendMessage:a,debug:o,minimize:r,onReachingUp:s})=>{const[c,l]=n.useState("MESSAGE_LIST"),d="interactive"===(i&&i.length>0&&i[i.length-1].type);return e.jsxs(ye,{className:"bc-chat",children:[t.hideHeader?null:e.jsx(ve,{config:t,minimize:r}),"MESSAGE_LIST"===c?e.jsx(H,{messages:i,sendMessage:a,debug:o,config:t,onReachingUp:s},"message-list"):null,d?e.jsx(ke,{forRate:!0}):t.inputDisabled?null:e.jsx(pe,{sendMessage:a,setView:l,config:t},"message-input")]})};
|
|
275
275
|
//# sourceMappingURL=index.js.map
|