botframework-webchat-core 4.18.0 → 4.18.1-main.20240807.dfe788c

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.
@@ -1,12 +1,8 @@
1
1
  import { Store } from 'redux';
2
2
 
3
- const CLEAR_SUGGESTED_ACTIONS = 'WEB_CHAT/CLEAR_SUGGESTED_ACTIONS';
4
-
5
- function clearSuggestedActions() {
6
- return {
7
- type: CLEAR_SUGGESTED_ACTIONS
8
- };
9
- }
3
+ declare function clearSuggestedActions(): {
4
+ type: "WEB_CHAT/CLEAR_SUGGESTED_ACTIONS";
5
+ };
10
6
 
11
7
  const CONNECT = 'DIRECT_LINE/CONNECT';
12
8
 
@@ -1,3 +1,3 @@
1
- var Co=Object.defineProperty;var hi=(t,e)=>{for(var i in e)Co(t,i,{get:e[i],enumerable:!0})};var Wt="WEB_CHAT/CLEAR_SUGGESTED_ACTIONS";function Ni(){return{type:Wt}}var T="DIRECT_LINE/CONNECT",mt=`${T}_FULFILLED`,vi=`${T}_FULFILLING`,lt=`${T}_PENDING`,ft=`${T}_REJECTED`,dt=`${T}_STILL_PENDING`;function _i({directLine:t,userID:e,username:i}){return{type:T,payload:{directLine:t,userID:e,username:i}}}var _="DIRECT_LINE/DISCONNECT",yt=`${_}_PENDING`,$c=`${_}_REJECTED`,ut=`${_}_FULFILLED`;function bi(){return{type:_}}var Mt="WEB_CHAT/DISMISS_NOTIFICATION";function Do(t){return{payload:{id:t},type:Mt}}var ho=Do;var Ut="WEB_CHAT/EMIT_TYPING_INDICATOR";function Tt(){return{type:Ut}}var j="WEB_CHAT/MARK_ACTIVITY";function No({id:t},e,i){return{type:j,payload:{activityID:t,name:e,value:i}}}var $=No;var I="DIRECT_LINE/POST_ACTIVITY",At=`${I}_FULFILLED`,St=`${I}_IMPEDED`,d=`${I}_PENDING`,H=`${I}_REJECTED`;function vo(t,e="keyboard"){return{type:I,meta:{method:e},payload:{activity:t}}}var y=vo;var Vt="WEB_CHAT/SEND_EVENT";function xi(t,e){return{type:Vt,payload:{name:t,value:e}}}var Yt="WEB_CHAT/SEND_FILES";function Pi(t){return{type:Yt,payload:{files:t}}}var jt="WEB_CHAT/SEND_MESSAGE";function Et(t,e,{attachments:i,channelData:o}={}){return{type:jt,payload:{attachments:i,channelData:o,method:e,text:t}}}var $t="WEB_CHAT/SEND_MESSAGE_BACK";function Oi(t,e,i){return{type:$t,payload:{displayText:i,text:e,value:t}}}var Ht="WEB_CHAT/SEND_POST_BACK";function Li(t){return{type:Ht,payload:{value:t}}}var qt="WEB_CHAT/SET_DICTATE_INTERIMS";function ki(t){return{type:qt,payload:{dictateInterims:t}}}var q="WEB_CHAT/SET_DICTATE_STATE";function It(t){return{type:q,payload:{dictateState:t}}}var Jt="WEB_CHAT/SET_LANGUAGE";function Ri(t){return{type:Jt,payload:{language:t}}}import _o from"math-random";function b(){return _o().toString(36).substring(2)}var Kt="WEB_CHAT/SET_NOTIFICATION";function L({alt:t,data:e,id:i,level:o,message:n}){return(!i||typeof i!="string")&&(console.warn('botframework-webchat: The "id" argument passed to "setNotification" must be a string; defaulting to a random value.'),i=b()),(!o||typeof o!="string")&&(console.warn('botframework-webchat: The "level" argument passed to "setNotification" must be a string; defaulting to "info".'),o="info"),{type:Kt,payload:{alt:t,data:e,id:i,level:o,message:n}}}var C="WEB_CHAT/SET_SEND_BOX";function gt(t){return{type:C,payload:{text:t}}}var zt="WEB_CHAT/SET_SEND_BOX_ATTACHMENTS";function Ct(t){return{type:zt,payload:{attachments:t}}}var Xt="WEB_CHAT/SET_SEND_TIMEOUT";function Gi(t){return{type:Xt,payload:{sendTimeout:t}}}var J="WEB_CHAT/SET_SEND_TYPING_INDICATOR";function wi(t){return{payload:{sendTypingIndicator:!!t},type:J}}var Qt="WEB_CHAT/START_DICTATE";function Dt(){return{type:Qt}}var Zt="WEB_CHAT/START_SPEAKING";function ht(){return{type:Zt}}var te="WEB_CHAT/STOP_DICTATE";function k(){return{type:te}}var K="WEB_CHAT/STOP_SPEAKING";function Nt(){return{type:K}}var ee="WEB_CHAT/SUBMIT_SEND_BOX";function Fi(t="keyboard",{channelData:e}={}){return{type:ee,payload:{channelData:e,method:t}}}var ie={};hi(ie,{SENDING:()=>xo,SEND_FAILED:()=>bo,SENT:()=>Po});var bo="send failed",xo="sending",Po="sent";var ne={};hi(ne,{DICTATING:()=>oe,IDLE:()=>z,STARTING:()=>vt,STOPPING:()=>_t,WILL_START:()=>D});var z=0,D=1,vt=2,oe=3,_t=4;import{applyMiddleware as Kr,createStore as zr}from"redux";import{composeWithDevTools as Xr}from"redux-devtools-extension";import Qr from"redux-saga";import{combineReducers as Ko}from"redux";var R="DIRECT_LINE/RECONNECT",bt=`${R}_FULFILLED`,Bi=`${R}_FULFILLING`,G=`${R}_PENDING`,Wi=`${R}_REJECTED`;var X="WEB_CHAT/SAGA_ERROR";function re(){return{type:X}}var Oo="uninitialized";function ce(t=Oo,{type:e,meta:i}){if(t!=="sagaerror")switch(e){case lt:case G:t!=="uninitialized"&&(t="reconnecting");break;case mt:t="connected";break;case bt:t="reconnected";break;case ft:t="error";break;case dt:t="connectingslow";break;case ut:t=i&&i.error?"error":"notconnected";break;case X:t="sagaerror";break;default:break}return t}import f from"simple-update-in";var Mi="DIRECT_LINE/DELETE_ACTIVITY";var A="DIRECT_LINE/INCOMING_ACTIVITY";function Lo(t){return{type:A,payload:{activity:t}}}var Ui=Lo;var xt="sending",Q="send failed",Z="sent";function ae(t,e){let i,o="unknown";for(let n=0;n<t.length;n++){let r=t[+n],c=e(r);if((o==="before"||o==="unknown")&&c==="after"||o==="before"&&(c==="after"||c==="unknown"))return[i,r,n];i=r,o=c}return o==="before"?[i,void 0,t.length]:[void 0,void 0,void 0]}var ko=[],Ro="https://docs.botframework.com/static/devportal/client/images/bot-framework-default-placeholder.png";function pe(t){return t.channelData?.clientActivityID}function se(t){return e=>pe(e)===t}function Go(t){return t.type==="typing"&&"text"in t&&typeof t.text=="string"}function Yi(t,e,{Date:i}){t=f(t,["attachments",()=>!0,"contentUrl"],n=>{if(n!==Ro&&!/^blob:/iu.test(n))return n}),t=f(t,["channelData"],n=>({...n})),t=f(t,["channelData","webChat","receivedAt"],()=>i.now());let{channelData:{"webchat:sequence-id":o}}=t;if(typeof o!="number"){let n,r;Go(t)&&typeof t.channelData.streamSequence=="number"&&([r,n]=ae(e,p=>p.type==="typing"&&p.channelData.streamId===t.channelData.streamId?p.channelData.streamSequence<t.channelData.streamSequence?"before":"after":"unknown"));let c;r?c=r.channelData["webchat:sequence-id"]+.001:n?c=n.channelData["webchat:sequence-id"]-.001:typeof t.timestamp<"u"?c=+new i(t.timestamp):c=(e[e.length-1]?.channelData["webchat:sequence-id"]||0)+.001,t=f(t,["channelData","webchat:sequence-id"],()=>c)}return t}function Vi(t,e,i){e=Yi(e,t,i);let{channelData:{clientActivityID:o,"webchat:sequence-id":n}={}}=e,r=t.filter(({channelData:{clientActivityID:p}={},id:a})=>!(o&&p===o)&&!(a&&a===e.id)),c=r.findIndex(({channelData:{"webchat:sequence-id":p}={}})=>(p||0)>(n||0));return r.splice(~c?c:r.length,0,e),r}function me(t){return function(i=ko,o){switch(o.type){case Mi:i=f(i,[({id:n})=>n===o.payload.activityID]);break;case j:{let{payload:n}=o;i=f(i,[({id:r})=>r===n.activityID,"channelData",n.name],()=>n.value)}break;case d:{let{payload:{activity:n}}=o;n=f(n,["channelData","state"],()=>xt),n=f(n,["channelData","webchat:send-status"],()=>xt),i=Vi(i,n,t)}break;case St:i=f(i,[se(o.meta.clientActivityID),"channelData","state"],()=>Q);break;case H:i=f(i,[se(o.meta.clientActivityID)],n=>(n=f(n,["channelData","state"],()=>Q),f(n,["channelData","webchat:send-status"],()=>Q)));break;case At:{let n=f(f(Yi(o.payload.activity,i,t),["channelData","state"],()=>Z),["channelData","webchat:send-status"],()=>Z);i=f(i,[se(o.meta.clientActivityID)],()=>n)}break;case A:{let{payload:{activity:n}}=o;if(n.from.role==="user"){let{id:r}=n,c=pe(n),p=i.find(a=>c&&pe(a)===c||r&&a.id===r);if(p){let{channelData:{"webchat:send-status":a}}=p;(a===xt||a===Q||a===Z)&&(n=f(n,["channelData","webchat:send-status"],()=>a))}else n=f(n,["channelData","webchat:send-status"],()=>Z)}i=Vi(i,n,t)}break;default:break}return i}}function le(t){return()=>({ponyfill:t})}import fe from"simple-update-in";var ji;function wo(){return ji||(ji=Object.freeze(Array.from(new Set([...Object.getOwnPropertyNames(Object.prototype),"prototype"]))))}function w(t){return wo().includes(t)}var Fo={};function de({Date:t}){return function(i=Fo,o){let{type:n}=o,r=t.now();if(n===Mt)i=fe(i,[o.payload.id]);else if(n===X)i=fe(i,["connectivitystatus","message"],()=>"javascripterror");else if(n===Kt){let{alt:c,data:p,id:a,level:u,message:E}=o.payload;if(!w(a)){let v=i[a];(!v||c!==v.alt||!Object.is(p,v.data)||u!==v.level||E!==v.message)&&(i=fe(i,[a],()=>({alt:c,data:p,id:a,level:u,message:E,timestamp:r})))}}return i}}import tt from"simple-update-in";var Bo={};function ye({Date:t}){return function(i=Bo,{payload:o,type:n}){if(n===A||n===d){let{activity:{from:{id:r,name:c,role:p},type:a}}=o;if(a==="typing"){let u=t.now();i=tt(i,[r,"at"],E=>E||u),i=tt(i,[r,"last"],()=>u),i=tt(i,[r,"name"],()=>c),i=tt(i,[r,"role"],()=>p)}else a==="message"&&(i=tt(i,[r]))}return i}}var Wo=[];function ue(t=Wo,{payload:e,type:i}){switch(i){case qt:t=e.dictateInterims;break;default:break}return t}var Mo=0;function Te(t=Mo,{payload:e,type:i}){switch(i){case q:t=e.dictateState;break;case Qt:(t===0||t===4||t===1)&&(t=2);break;case te:t===2||t===3?t=4:t===1&&(t=0);break;default:break}return t}var Uo="en-US";function Ae(t=Uo,{payload:e,type:i}){switch(i){case Jt:t=e.language;break;default:break}return t}var Se="DIRECT_LINE/CONNECTION_STATUS_UPDATE";function Ee(t){return{type:Se,payload:{connectionStatus:t}}}var Vo=0;function Ie(t=Vo,{payload:e,type:i}){switch(i){case Se:t=e.connectionStatus;break;default:break}return t}var ge="WEB_CHAT/SET_REFERENCE_GRAMMAR_ID";function Ce(t){return{type:ge,payload:{referenceGrammarID:t}}}var Yo=null;function De(t=Yo,{payload:e,type:i}){switch(i){case ge:t=e.referenceGrammarID||null;break;default:break}return t}var jo=Object.freeze([]);function he(t=jo,{payload:e,type:i}){switch(i){case zt:t=e.attachments;break;default:break}return t}var $o="";function Ne(t=$o,{payload:e,type:i}){switch(i){case C:t=e.text;break;default:break}return t}var Ho=2e4;function ve(t=Ho,{payload:e,type:i}){switch(i){case Xt:t=e.sendTimeout;break;default:break}return t}var qo=!1;function _e(t=qo,{payload:e,type:i}){switch(i){case J:t=e.sendTypingIndicator;break;default:break}return t}function be(t=!1,{type:e}){switch(e){case Zt:t=!0;break;case K:t=!1;break;default:break}return t}var Jo=[],xe="WEB_CHAT/SET_SUGGESTED_ACTIONS";function et(t=Jo){return{type:xe,payload:{suggestedActions:t}}}var Pe=[];function Oe(t=Pe,{payload:e={},type:i}){switch(i){case xe:(e.suggestedActions||[]).length?t=[].slice.call(e.suggestedActions):t=Pe;break;case Wt:t=Pe;break;default:break}return t}function Le(t){return Ko({activities:me(t),connectivityStatus:ce,dictateInterims:ue,dictateState:Te,internal:le(t),language:Ae,notifications:de(t),readyState:Ie,referenceGrammarID:De,sendBoxAttachments:he,sendBoxValue:Ne,sendTimeout:ve,sendTypingIndicator:_e,shouldSpeakIncomingActivity:be,suggestedActions:Oe,typing:ye(t)})}import{fork as l}from"redux-saga/effects";import{put as Zo,takeEvery as tn}from"redux-saga/effects";import{call as zo,cancel as Xo,fork as Qo,take as $i}from"redux-saga/effects";function s(t,...e){return zo(function*(){for(;;){let{meta:{userID:o,username:n},payload:{directLine:r}}=yield $i([vi,Bi]),c=yield Qo(t,{directLine:r,userID:o,username:n},...e);yield $i([yt,G]),yield Xo(c)}})}function*en(){yield Zo(et())}function*on(){yield tn(({payload:t,type:e})=>e===d&&t.activity.type==="message",en)}function*ke(){yield s(on)}import{call as rn,put as Re,takeLatest as cn}from"redux-saga/effects";import nn from"p-defer-es5";function x(){let t,e=[];return{push:n=>{if(t){let{resolve:r}=t;t=null,r(n)}else e.push(n)},shift:()=>e.length?Promise.resolve(e.shift()):(t||(t=nn())).promise}}var Ge="connectivitystatus";function an(t){let{push:e,shift:i}=x(),o=t.subscribe({next:e});return{shift:i,unsubscribe(){o.unsubscribe()}}}function*sn({payload:{directLine:t}}){let{shift:e,unsubscribe:i}=an(t.connectionStatus$);try{let o;for(;;)switch(yield rn(e)){case 0:case 1:yield Re(L({id:Ge,level:"info",message:o?"reconnecting":"connecting"}));break;case 2:o=1,yield Re(L({id:Ge,level:"success",message:"connected"}));break;case 3:case 4:o=1,yield Re(L({id:Ge,level:"error",message:"failedtoconnect"}));break;default:break}}finally{i()}}function*Hi(){yield cn(T,sn)}import{put as qi}from"redux-saga/effects";import{call as we}from"redux-saga/effects";function it(t,e){return we(function*(){let o=x(),n=t.subscribe({next:o.push});try{for(;;){let r=yield we(o.shift);yield we(e,r)}}finally{n.unsubscribe()}})}function*pn({directLine:t}){yield it(t.connectionStatus$,function*(i){yield qi(Ee(i)),yield qi(Ce(t.referenceGrammarId))})}function*Fe(){yield s(pn)}import{call as Me,cancel as fn,cancelled as dn,fork as yn,put as un,race as Ki,take as B}from"redux-saga/effects";import{jwtDecode as Tn}from"jwt-decode";import{fork as mn,put as ln}from"redux-saga/effects";function F(...t){return mn(function*(){for(let i of t)yield ln(i)})}var ot="DIRECT_LINE/UPDATE_CONNECTION_STATUS";function Be(t){return{type:ot,payload:{connectionStatus:t}}}var Ue=1,Ve=2,An=0;function We(){return`r_${b().substring(0,10)}`}function*Sn(t){let e=x(),i=t.connectionStatus$.subscribe({next:e.push});try{for(;;){let o=yield Me(e.shift);yield un(Be(o))}}finally{i.unsubscribe()}}function En(t,e){let{token:i}=t,o;try{o=(Tn(i)||{}).user}catch{}let n={fromAction:e,fromToken:o};return o?(e&&e!==o&&console.warn("Web Chat: user ID is both specified in the Direct Line token and passed in, will use the user ID from the token."),n.final=o):e?typeof e!="string"?(console.warn("Web Chat: user ID must be a string."),n.final=We()):/^dl_/u.test(e)?(console.warn('Web Chat: user ID prefixed with "dl_" is reserved and must be embedded into the Direct Line token to prevent forgery.'),n.final=We()):n.final=e:n.final=We(),n}function*In(t){let e=t.activity$.subscribe({next:()=>0}),i=e.unsubscribe.bind(e);try{for(;;){let{payload:{connectionStatus:o}}=yield B(ot);if(o===Ve)return()=>{i(),t.end()};if(o!==An&&o!==Ue)throw new Error(`Failed to connect, DirectLineJS returned ${o}.`)}}catch(o){throw i(),o}finally{(yield dn())&&i()}}function*gn(){for(;;){let{payload:{connectionStatus:t}}=yield B(ot);if(t===Ve)break;if(t!==Ue)throw new Error(`Failed to reconnect. DirectLineJS returned ${t}.`)}}function*Cn({type:t,meta:e,payload:i},o){try{yield F({type:`${t}_PENDING`,meta:e,payload:i});let n=yield o();return yield F({type:`${t}_FULFILLING`,meta:e,payload:i},{type:`${t}_FULFILLED`,meta:e,payload:i}),n}catch(n){throw yield F({type:`${t}_REJECTED`,error:!0,meta:e,payload:n}),n}}function*Dn(){throw yield B(_),new Error("disconnected")}function Ji(t,e){return Cn(t,function*(){let{result:o}=yield Ki({_:Dn(),result:e()});return o})}function*zi(){for(;;){let{payload:{directLine:t,userID:e,username:i}}=yield B(T),o=yield yn(Sn,t),n=En(t,e),r={userID:n.final,username:i};t.setUserId&&n.fromToken!==r.userID&&t.setUserId(r.userID);let c;try{let p=yield Ji({type:T,meta:r,payload:{directLine:t}},()=>Me(In,t));try{for(;;){let{updateConnectionStatusAction:{payload:{connectionStatus:a}={}}={}}=yield Ki({_:B(_),updateConnectionStatusAction:B(ot)});if(a===Ue)yield Ji({type:R,meta:r,payload:{directLine:t}},()=>Me(gn));else if(a!==Ve){if(typeof a<"u")throw new Error(`Connection status changed to ${a}`);break}}}finally{p()}}catch(p){c={error:p}}finally{yield fn(o),yield F({type:yt,meta:c,payload:{directLine:t}},{type:ut,meta:c,payload:{directLine:t}})}}}import{call as hn,put as Nn,race as vn,take as Ye}from"redux-saga/effects";function S(t,e){return new Promise(i=>e.setTimeout(i,Math.max(t,0)))}var _n=15e3;function*je(t){for(;;)yield Ye([lt,G]),"slow"in(yield vn({fulfilled:Ye([mt,bt]),rejected:Ye([ft,Wi]),slow:hn(S,_n,t)}))&&(yield Nn({type:dt}))}import{put as bn,takeEvery as xn}from"redux-saga/effects";function*Pn(){yield bn(y({type:"typing"}))}function*On(){yield xn(({type:t})=>t===Ut,Pn)}function*$e(){yield s(On)}import{put as Ln,select as kn,takeEvery as Rn}from"redux-saga/effects";var Xi=({activities:t})=>t,nt=t=>e=>Xi(e).filter(t);var Qi=t=>nt(({type:e})=>e===t),He=Xi;function rt(t){return t.channelData?.speak}function*Gn(){let t=yield kn(nt(rt));for(let e of t)yield Ln($(e,"speak",!1))}function*qe(){yield Rn(K,Gn)}import{put as wn}from"redux-saga/effects";import W from"simple-update-in";var Je="DIRECT_LINE/QUEUE_INCOMING_ACTIVITY";function Ke(t){return{type:Je,payload:{activity:t}}}var Fn=t=>t;function Bn(t,e){return t.from?t.from.role||(t.from.id===e?t=W(t,["from","role"],()=>"user"):t.from.id?t=W(t,["from","role"],()=>"bot"):t=W(t,["from","role"],()=>"channel")):t=W(t,["from","role"],()=>"channel"),t}function Wn(t){return["attachmentLayout","attachments","channelData","conversation","entities","from","inputHint","locale","name","recipient","speak","suggestedActions","text","textFormat","timestamp","type"].reduce((e,i)=>{let{[i]:o}=e;return W(e,[i],typeof o>"u"||o===null?void 0:Fn)},t)}function Mn(t){return W(t,["from","name"],e=>{let{channelId:i,from:o={}}=t;return(i==="directline"||i==="webchat")&&o.id===o.name&&o.role==="bot"?"Bot":e})}function*Un({directLine:t,userID:e}){yield it(t.activity$,function*(o){o=Wn(o),o=Bn(o,e),o=Mn(o),yield wn(Ke(o))})}function*ze(){yield s(Un)}import{all as Vn,call as Ot,cancelled as Yn,put as ct,race as jn,select as io,take as $n,takeEvery as Hn}from"redux-saga/effects";function h(t,e=2){if(typeof t!="number")throw new Error("First argument must be a number");let i=t+"";for(;i.length<e;)i="0"+i;return i}function Xe(t){if(!(t.getTimezoneOffset&&t.getFullYear&&t.getMonth&&t.getDate&&t.getHours&&t.getMinutes&&t.getSeconds&&t.getMilliseconds))throw new Error("First argument must be a Date-like object.");let i=-t.getTimezoneOffset(),o=i<0?"-":"+",n=~~Math.abs(i);return`${t.getFullYear()}-${h(t.getMonth()+1)}-${h(t.getDate())}T${h(t.getHours())}:${h(t.getMinutes())}:${h(t.getSeconds())}.${h(t.getMilliseconds(),3)}${i?`${o}${h(~~(n/60))}:${h(n%60)}`:"Z"}`}function Pt(t,...e){if(!t)return t;let i={...t};for(let o of e)(typeof o!="string"||!w(o))&&delete i[o];return i}var Zi=({language:t})=>t;import{call as to}from"redux-saga/effects";function Qe(t){return to(function*(){let i;try{return yield to(()=>new Promise((o,n)=>{i=t.subscribe({complete:o,error:n,next:o})}))}finally{i&&i.unsubscribe()}})}var eo=({sendTimeout:t})=>t;var qn=3e5;function*Jn(t,e,i,o,{meta:{method:n},payload:{activity:r}},c){let p=r.type==="message"&&r.attachments||[],a=b(),u=yield io(Zi),E=typeof window.Intl>"u"?void 0:new Intl.DateTimeFormat().resolvedOptions().timeZone,v=new c.Date,U={...Pt(r,"id"),channelData:{...Pt(r.channelData,"state","webchat:send-status"),clientActivityID:a},channelId:"webchat",from:{id:e,name:i,role:"user"},locale:u,localTimestamp:Xe(v),localTimezone:E,...r.type==="message"?{attachments:p&&p.map(({contentType:O,contentUrl:pt,name:Bt,thumbnailUrl:Y})=>({contentType:O,contentUrl:pt,name:Bt,thumbnailUrl:Y})),text:r.text}:r.type==="event"?{name:r.name,value:r.value}:{}};o||(U.entities=[...U.entities||[],{requiresBotState:!0,supportsListening:!0,supportsTts:!0,type:"ClientCapabilities"}]);let V={clientActivityID:a,method:n};yield ct({type:d,meta:V,payload:{activity:U}});let Di;try{let O=Ot(function*(){for(;;){let{payload:{activity:Y}}=yield $n(A);if(Y.channelData?.clientActivityID===a&&Y.id)return Di=!0,Y}}),pt=yield io(eo),{send:{echoBack:Bt}}=yield jn({send:Vn({echoBack:O,postActivity:Qe(t.postActivity(U))}),timeout:Ot(function*(){throw yield Ot(S,pt,c),yield ct({type:St,meta:V,payload:{activity:U}}),yield Ot(S,qn-pt,c),Di?new Error("timed out while waiting for postActivity to return any values"):new Error("timed out while waiting for outgoing message to echo back")})});yield ct({type:At,meta:V,payload:{activity:Bt}})}catch(O){console.error("botframework-webchat: Failed to post activity to chat adapter.",O),yield ct({type:H,error:!0,meta:V,payload:O})}finally{(yield Yn())&&(yield ct({type:H,error:!0,meta:V,payload:new Error("cancelled")}))}}function*Ze(t){yield s(function*({directLine:i,userID:o,username:n}){let r=0;yield Hn(I,function*(p){yield*Jn(i,o,n,r++,p,t)})})}import{call as Kn,cancelled as zn,fork as Xn,put as no,race as Qn,select as ti,take as ro}from"redux-saga/effects";var oo=t=>t&&t.from.role==="bot";var Zn=5e3;function*tr(t,e,i){for(;!(yield zn());){let o=yield ro(t),n=yield ti(e);yield Xn(i,o,n)}}function*er(t,e){let i=e;for(;!i.find(r=>r.id===t||r.replyToId===t);){let{payload:{activity:n}}=yield ro(A);if(n.id===t)break;i=yield ti(He)}}function*ir({userID:t},e){yield tr(Je,He,function*({payload:{activity:o}},n){let{replyToId:r}=o,c=n.filter(({from:{role:u}})=>u==="bot");r&&c.length&&"timeout"in(yield Qn({_:er(r,n),timeout:Kn(S,Zn,e)}))&&console.warn(`botframework-webchat: Timed out while waiting for activity "${r}" which activity "${o.id}" is replying to.`,{activity:o,replyToId:r}),yield no(Ui(o));let p=yield ti(Qi("message")),a=p[p.length-1];if(oo(a)){let{suggestedActions:{actions:u,to:E}={actions:void 0,to:void 0}}=a;yield no(et(E?.length&&!E.includes(t)?null:u))}})}function*ei(t){yield s(ir,t)}import{put as or,takeEvery as nr}from"redux-saga/effects";function*rr({payload:{name:t,value:e}}){yield or(y({name:t,type:"event",value:e}))}function*cr(){yield nr(({payload:t,type:e})=>e===Vt&&t.name,rr)}function*ii(){yield s(cr)}import{put as ar,takeEvery as sr}from"redux-saga/effects";import co from"mime";var pr=co.getType.bind(co);function*mr({payload:{files:t}}){yield ar(y({attachments:[].map.call(t,({name:e,thumbnail:i,url:o})=>({contentType:pr(e)||"application/octet-stream",contentUrl:o,name:e,thumbnailUrl:i})),channelData:{attachmentSizes:[].map.call(t,({size:e})=>e)},type:"message"}))}function*lr(){yield sr(({payload:t,type:e})=>e===Yt&&t.files.length,mr)}function*oi(){yield s(lr)}import{put as fr,takeEvery as dr}from"redux-saga/effects";function*yr({payload:{displayText:t,text:e,value:i}}){yield fr(y({channelData:{messageBack:{displayText:t}},text:e,type:"message",value:i}))}function*ur(){yield dr($t,yr)}function*ni(){yield s(ur)}import{put as Tr,takeEvery as Ar}from"redux-saga/effects";function*Sr({payload:{attachments:t=[],channelData:e,method:i,text:o}}){yield Tr(y({attachments:t.map(({blob:n,thumbnailURL:r})=>({contentType:n instanceof File&&n.type||"application/octet-stream",contentUrl:URL.createObjectURL(n),name:n instanceof File?n.name:void 0,thumbnailUrl:r?.toString()})),channelData:{...e,attachmentSizes:t.map(({blob:{size:n}})=>n)},text:o||void 0,textFormat:"plain",type:"message"},i))}function*Er(){yield Ar(({payload:t,type:e})=>e===jt&&(t.text||t.attachments?.length),Sr)}function*ri(){yield s(Er)}import{put as Ir,takeEvery as gr}from"redux-saga/effects";function*Cr({payload:{value:t}}){yield Ir(y({channelData:{postBack:!0},text:typeof t=="string"?t:void 0,type:"message",value:typeof t!="string"?t:void 0}))}function*Dr(){yield gr(Ht,Cr)}function*ci(){yield s(Dr)}import{call as hr,cancel as Nr,put as vr,select as _r,take as br,takeLatest as xr}from"redux-saga/effects";var ao=({sendTypingIndicator:t})=>t;var Pr=3e3;function ai(t){return br(({payload:e,type:i})=>i===J&&!e.sendTypingIndicator==!t)}function*Or(t,e){let{Date:i}=e;for((yield _r(ao))||(yield ai(!0));;){let n=-1/0,r=yield xr(({payload:c,type:p})=>p===C&&c.text||p===I&&c.activity.type!=="typing",function*({payload:c,type:p}){if(p===C){let a=Pr-i.now()+n;a>0&&(yield hr(S,a,e)),yield vr(Tt()),n=i.now()}else c.activity.type==="message"&&(n=-1/0)});yield ai(!1),yield Nr(r),yield ai(!0)}}function*si(t){yield s(Or,t)}import{put as mi,select as Lr,takeEvery as kr}from"redux-saga/effects";var so=({shouldSpeakIncomingActivity:t})=>t;function pi(t){return t&&t.from&&t.type==="message"}function*Rr({userID:t}){yield kr(({payload:e,type:i})=>i===A&&e.activity.from.id!==t&&e.activity.from.role!=="user",function*({payload:{activity:e}}){let i=yield Lr(so),o=pi(e)&&i;o&&(e.speak||e.text||~(e.attachments||[]).findIndex(({content:{speak:n}={}})=>n))&&(yield mi($(e,"speak",!0))),o&&e.inputHint==="expectingInput"?yield mi(It(1)):e.inputHint==="ignoringInput"&&(yield mi(k()))})}function*li(){yield s(Rr)}import{put as Gr,select as mo,takeEvery as wr}from"redux-saga/effects";var po=({dictateState:t})=>t;function*Fr(){let t=yield mo(nt(rt));(yield mo(po))===1&&!t.length&&(yield Gr(Dt()))}function*fi(){yield wr(({type:t})=>t===j||t===q,Fr)}import{put as Br,takeEvery as Wr}from"redux-saga/effects";function*Mr(){yield Wr(({meta:t,payload:e,type:i})=>i===d&&t.method==="speech"&&e.activity.type==="message",function*(){yield Br(ht())})}function*di(){yield s(Mr)}import{put as Ur,takeEvery as Vr}from"redux-saga/effects";function*Yr(){yield Vr(({payload:t,type:e})=>e===d&&t.activity.type==="message",function*(){yield Ur(k())})}function*yi(){yield s(Yr)}import{put as jr,takeEvery as $r}from"redux-saga/effects";function*Hr(){yield $r(({meta:t,payload:e,type:i})=>i===C&&e.text||i===d&&t.method!=="speech"&&e.activity.type==="message",function*(){yield jr(Nt())})}function*ui(){yield s(Hr)}import{put as Ai,select as fo,takeEvery as qr}from"redux-saga/effects";function Ti({sendBoxAttachments:t}){return t}var lo=({sendBoxValue:t})=>t;function*Jr(){yield qr(ee,function*({payload:{channelData:t,method:e}}){let i=yield fo(Ti),o=yield fo(lo);(i.length||o)&&(yield Ai(Et(o.trim(),e,{attachments:i,channelData:t})),yield Ai(gt("")),yield Ai(Ct(Object.freeze([]))))})}function*Si(){yield s(Jr)}function Ei({ponyfill:t}){return function*(){yield l(ke),yield l(Hi),yield l(Fe),yield l(zi),yield l(je,t),yield l($e),yield l(qe),yield l(ze),yield l(Ze,t),yield l(ei,t),yield l(ii),yield l(oi),yield l(ni),yield l(ri),yield l(ci),yield l(si,t),yield l(li),yield l(fi),yield l(di),yield l(yi),yield l(ui),yield l(Si)}}function Zr(t,...e){let i=Qr({onError:(...o)=>{let[n]=o;console.error(n);let r=t();r&&r.dispatch(re())}});return{enhancer:Kr(...e,i),sagaMiddleware:i}}function Ii(t,e,...i){let o=typeof globalThis>"u"?window:globalThis,n=t.ponyfill||{},r={cancelAnimationFrame:n.cancelAnimationFrame||(typeof cancelAnimationFrame=="function"?cancelAnimationFrame.bind(o):void 0),cancelIdleCallback:n.cancelIdleCallback||(typeof cancelIdleCallback=="function"?cancelIdleCallback.bind(o):void 0),clearImmediate:n.clearImmediate||(typeof clearImmediate=="function"?clearImmediate.bind(o):void 0),clearInterval:n.clearInterval||(typeof clearInterval=="function"?clearInterval.bind(o):void 0),clearTimeout:n.clearTimeout||(typeof clearTimeout=="function"?clearTimeout.bind(o):void 0),Date:n.Date||Date,requestAnimationFrame:n.requestAnimationFrame||(typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(o):void 0),requestIdleCallback:n.requestIdleCallback||(typeof requestIdleCallback=="function"?requestIdleCallback.bind(o):void 0),setImmediate:n.setImmediate||(typeof setImmediate=="function"?setImmediate.bind(o):void 0),setInterval:n.setInterval||(typeof setInterval=="function"?setInterval.bind(o):void 0),setTimeout:n.setTimeout||(typeof setTimeout=="function"?setTimeout.bind(o):void 0)},{enhancer:c,sagaMiddleware:p}=Zr(()=>a,...i),a=zr(Le(r),e||{},t.devTools?Xr(c):c);return p.run(Ei({ponyfill:r})),a}function yo(t,...e){return Ii({},t,...e)}function tc(t,...e){return Ii({devTools:!0},t,...e)}import{lazy as gc,parse as Cc,string as Lt,union as Dc,value as kt}from"valibot";import{array as ec,fallback as ic,optional as oc,transform as nc,union as rc}from"valibot";var cc=t=>ic(oc(rc([nc(ec(t),e=>e[0]),t])),void 0),m=cc;import{parse as Sc,string as Ec}from"valibot";import{lazy as fc,object as dc,optional as uo,parse as yc,string as N,unknown as uc,value as Tc}from"valibot";import{array as ac,fallback as sc,parse as pc,transform as mc}from"valibot";var lc=t=>sc(mc(ac(t),e=>e.filter(i=>typeof i<"u")),e=>e?.input?[pc(t,e?.input)]:void 0);function P(t){return lc(m(t))}var Ac={"@context":uo(N([Tc("https://schema.org")])),"@id":uo(N()),"@type":N(),additionalType:m(N()),alternateName:m(N()),description:m(N()),name:m(N()),potentialAction:P(fc(()=>at())),url:m(N())},g=t=>dc({...Ac,...t},uc()),gi=t=>yc(g(),t);var st=t=>g({slogan:m(Ec()),...t}),Ic=t=>Sc(st(),t);var at=t=>g({actionStatus:m(Dc([Lt([kt("ActiveActionStatus")]),Lt([kt("CompletedActionStatus")]),Lt([kt("FailedActionStatus")]),Lt([kt("PotentialActionStatus")])])),provider:m(gc(()=>st())),...t}),hc=t=>Cc(at(),t);import{lazy as Ao,number as xc,parse as Pc,string as Oc,union as Lc}from"valibot";import{lazy as Gt,parse as _c,string as wt,union as bc}from"valibot";import{parse as Nc,string as To}from"valibot";var Rt=t=>g({inDefinedTermSet:m(To()),termCode:m(To()),...t}),vc=t=>Nc(Rt(),t);var M=t=>g({abstract:m(wt()),author:P(wt()),citation:P(Gt(()=>M())),keywords:P(bc([Gt(()=>Rt()),wt()])),pattern:m(Gt(()=>Rt())),text:m(wt()),usageInfo:m(Gt(()=>M())),...t}),Ft=t=>_c(M(),t);var kc=t=>M({appearance:m(Ao(()=>M())),claimInterpreter:m(Ao(()=>st())),position:m(Lc([xc(),Oc()])),...t}),Rc=t=>Pc(kc(),t);import{parse as Gc,string as wc}from"valibot";var Fc=t=>at({actionOption:m(wc()),...t}),Bc=t=>Gc(Fc(),t);function So(t){let e=(t||[]).find(o=>{if(o.type?.startsWith("https://schema.org/"))return gi(o)["@id"]===""}),i=e&&Ft(e);return i&&Ft(i)}function Eo(t,e){try{return t()}catch{return e}}function Io(t){return t?Array.isArray(t)?t:[t]:[]}function Ci(t){let e;return()=>{e||(t(),e=1)}}function go(t){return Ci(()=>console.warn(`botframework-webchat: ${t}.`))}var uy={ActivityClientState:ie,DictateState:ne},Wc="tsup",Mc="esmodules",Uc="4.18.0",Ty={buildTool:Wc,moduleFormat:Mc,version:Uc};export{uy as Constants,Ty as buildInfo,Ni as clearSuggestedActions,_i as connect,yo as createStore,tc as createStoreWithDevTools,Ii as createStoreWithOptions,bi as disconnect,ho as dismissNotification,Tt as emitTypingIndicator,So as getOrgSchemaMessage,w as isForbiddenPropertyName,$ as markActivity,Mc as moduleFormat,Eo as onErrorResumeNext,hc as parseAction,Rc as parseClaim,Ft as parseCreativeWork,vc as parseDefinedTerm,Ic as parseProject,gi as parseThing,Bc as parseVoteAction,y as postActivity,xi as sendEvent,Pi as sendFiles,Et as sendMessage,Oi as sendMessageBack,Li as sendPostBack,ki as setDictateInterims,It as setDictateState,Ri as setLanguage,L as setNotification,gt as setSendBox,Ct as setSendBoxAttachments,Gi as setSendTimeout,wi as setSendTypingIndicator,Io as singleToArray,Dt as startDictate,ht as startSpeakingActivity,k as stopDictate,Nt as stopSpeakingActivity,Fi as submitSendBox,Uc as version,go as warnOnce};
1
+ var ho=Object.defineProperty;var vi=(t,e)=>{for(var i in e)ho(t,i,{get:e[i],enumerable:!0})};var $="WEB_CHAT/CLEAR_SUGGESTED_ACTIONS";function _i(){return{type:$}}var A="DIRECT_LINE/CONNECT",lt=`${A}_FULFILLED`,bi=`${A}_FULFILLING`,dt=`${A}_PENDING`,yt=`${A}_REJECTED`,ut=`${A}_STILL_PENDING`;function xi({directLine:t,userID:e,username:i}){return{type:A,payload:{directLine:t,userID:e,username:i}}}var _="DIRECT_LINE/DISCONNECT",At=`${_}_PENDING`,qc=`${_}_REJECTED`,Tt=`${_}_FULFILLED`;function Pi(){return{type:_}}var Mt="WEB_CHAT/DISMISS_NOTIFICATION";function No(t){return{payload:{id:t},type:Mt}}var vo=No;var Vt="WEB_CHAT/EMIT_TYPING_INDICATOR";function St(){return{type:Vt}}var H="WEB_CHAT/MARK_ACTIVITY";function _o({id:t},e,i){return{type:H,payload:{activityID:t,name:e,value:i}}}var q=_o;var g="DIRECT_LINE/POST_ACTIVITY",Et=`${g}_FULFILLED`,It=`${g}_IMPEDED`,d=`${g}_PENDING`,J=`${g}_REJECTED`;function bo(t,e="keyboard"){return{type:g,meta:{method:e},payload:{activity:t}}}var y=bo;var Yt="WEB_CHAT/SEND_EVENT";function Oi(t,e){return{type:Yt,payload:{name:t,value:e}}}var jt="WEB_CHAT/SEND_FILES";function Li(t){return{type:jt,payload:{files:t}}}var $t="WEB_CHAT/SEND_MESSAGE";function gt(t,e,{attachments:i,channelData:o}={}){return{type:$t,payload:{attachments:i,channelData:o,method:e,text:t}}}var Ht="WEB_CHAT/SEND_MESSAGE_BACK";function ki(t,e,i){return{type:Ht,payload:{displayText:i,text:e,value:t}}}var qt="WEB_CHAT/SEND_POST_BACK";function Ri(t){return{type:qt,payload:{value:t}}}var Jt="WEB_CHAT/SET_DICTATE_INTERIMS";function Gi(t){return{type:Jt,payload:{dictateInterims:t}}}var K="WEB_CHAT/SET_DICTATE_STATE";function Ct(t){return{type:K,payload:{dictateState:t}}}var Kt="WEB_CHAT/SET_LANGUAGE";function wi(t){return{type:Kt,payload:{language:t}}}import xo from"math-random";function b(){return xo().toString(36).substring(2)}var zt="WEB_CHAT/SET_NOTIFICATION";function L({alt:t,data:e,id:i,level:o,message:n}){return(!i||typeof i!="string")&&(console.warn('botframework-webchat: The "id" argument passed to "setNotification" must be a string; defaulting to a random value.'),i=b()),(!o||typeof o!="string")&&(console.warn('botframework-webchat: The "level" argument passed to "setNotification" must be a string; defaulting to "info".'),o="info"),{type:zt,payload:{alt:t,data:e,id:i,level:o,message:n}}}var D="WEB_CHAT/SET_SEND_BOX";function Dt(t){return{type:D,payload:{text:t}}}var Xt="WEB_CHAT/SET_SEND_BOX_ATTACHMENTS";function ht(t){return{type:Xt,payload:{attachments:t}}}var Qt="WEB_CHAT/SET_SEND_TIMEOUT";function Fi(t){return{type:Qt,payload:{sendTimeout:t}}}var z="WEB_CHAT/SET_SEND_TYPING_INDICATOR";function Bi(t){return{payload:{sendTypingIndicator:!!t},type:z}}var Zt="WEB_CHAT/START_DICTATE";function Nt(){return{type:Zt}}var te="WEB_CHAT/START_SPEAKING";function vt(){return{type:te}}var ee="WEB_CHAT/STOP_DICTATE";function k(){return{type:ee}}var X="WEB_CHAT/STOP_SPEAKING";function _t(){return{type:X}}var ie="WEB_CHAT/SUBMIT_SEND_BOX";function Wi(t="keyboard",{channelData:e}={}){return{type:ie,payload:{channelData:e,method:t}}}var oe={};vi(oe,{SENDING:()=>Oo,SEND_FAILED:()=>Po,SENT:()=>Lo});var Po="send failed",Oo="sending",Lo="sent";var re={};vi(re,{DICTATING:()=>ne,IDLE:()=>Q,STARTING:()=>bt,STOPPING:()=>xt,WILL_START:()=>h});var Q=0,h=1,bt=2,ne=3,xt=4;import{applyMiddleware as Xr,createStore as Qr}from"redux";import{composeWithDevTools as Zr}from"redux-devtools-extension";import tc from"redux-saga";import{combineReducers as Xo}from"redux";var R="DIRECT_LINE/RECONNECT",Pt=`${R}_FULFILLED`,Ui=`${R}_FULFILLING`,G=`${R}_PENDING`,Mi=`${R}_REJECTED`;var Z="WEB_CHAT/SAGA_ERROR";function ce(){return{type:Z}}var ko="uninitialized";function ae(t=ko,{type:e,meta:i}){if(t!=="sagaerror")switch(e){case dt:case G:t!=="uninitialized"&&(t="reconnecting");break;case lt:t="connected";break;case Pt:t="reconnected";break;case yt:t="error";break;case ut:t="connectingslow";break;case Tt:t=i&&i.error?"error":"notconnected";break;case Z:t="sagaerror";break;default:break}return t}import l from"simple-update-in";var Vi="DIRECT_LINE/DELETE_ACTIVITY";var T="DIRECT_LINE/INCOMING_ACTIVITY";function Ro(t){return{type:T,payload:{activity:t}}}var Yi=Ro;var Ot="sending",tt="send failed",et="sent";function se(t,e){let i,o="unknown";for(let n=0;n<t.length;n++){let r=t[+n],c=e(r);if((o==="before"||o==="unknown")&&c==="after"||o==="before"&&(c==="after"||c==="unknown"))return[i,r,n];i=r,o=c}return o==="before"?[i,void 0,t.length]:[void 0,void 0,void 0]}var Go=[],wo="https://docs.botframework.com/static/devportal/client/images/bot-framework-default-placeholder.png";function me(t){return t.channelData?.clientActivityID}function pe(t){return e=>me(e)===t}function Fo(t){return t.type==="typing"&&"text"in t&&typeof t.text=="string"}function $i(t,e,{Date:i}){t=l(t,["attachments",()=>!0,"contentUrl"],n=>{if(n!==wo&&!/^blob:/iu.test(n))return n}),t=l(t,["channelData"],n=>({...n})),t=l(t,["channelData","webChat","receivedAt"],()=>i.now());let{channelData:{"webchat:sequence-id":o}}=t;if(typeof o!="number"){let n,r;Fo(t)&&typeof t.channelData.streamSequence=="number"&&([r,n]=se(e,p=>p.type==="typing"&&p.channelData.streamId===t.channelData.streamId?p.channelData.streamSequence<t.channelData.streamSequence?"before":"after":"unknown"));let c;r?c=r.channelData["webchat:sequence-id"]+.001:n?c=n.channelData["webchat:sequence-id"]-.001:typeof t.timestamp<"u"?c=+new i(t.timestamp):c=(e[e.length-1]?.channelData["webchat:sequence-id"]||0)+.001,t=l(t,["channelData","webchat:sequence-id"],()=>c)}return t}function ji(t,e,i){e=$i(e,t,i);let{channelData:{clientActivityID:o,"webchat:sequence-id":n}={}}=e,r=t.filter(({channelData:{clientActivityID:p}={},id:a})=>!(o&&p===o)&&!(a&&a===e.id)),c=r.findIndex(({channelData:{"webchat:sequence-id":p}={}})=>(p||0)>(n||0));return r.splice(~c?c:r.length,0,e),r}function fe(t){return function(i=Go,o){switch(o.type){case Vi:i=l(i,[({id:n})=>n===o.payload.activityID]);break;case H:{let{payload:n}=o;i=l(i,[({id:r})=>r===n.activityID,"channelData",n.name],()=>n.value)}break;case d:{let{payload:{activity:n}}=o;n=l(n,["channelData","state"],()=>Ot),n=l(n,["channelData","webchat:send-status"],()=>Ot),i=ji(i,n,t)}break;case It:i=l(i,[pe(o.meta.clientActivityID),"channelData","state"],()=>tt);break;case J:i=l(i,[pe(o.meta.clientActivityID)],n=>(n=l(n,["channelData","state"],()=>tt),l(n,["channelData","webchat:send-status"],()=>tt)));break;case Et:{let n=l(l($i(o.payload.activity,i,t),["channelData","state"],()=>et),["channelData","webchat:send-status"],()=>et);i=l(i,[pe(o.meta.clientActivityID)],()=>n)}break;case T:{let{payload:{activity:n}}=o;if(n.from.role==="user"){let{id:r}=n,c=me(n),p=i.find(a=>c&&me(a)===c||r&&a.id===r);if(p){let{channelData:{"webchat:send-status":a}}=p;(a===Ot||a===tt||a===et)&&(n=l(n,["channelData","webchat:send-status"],()=>a))}else n=l(n,["channelData","webchat:send-status"],()=>et)}i=ji(i,n,t)}break;default:break}return i}}function le(t){return()=>({ponyfill:t})}import de from"simple-update-in";var Hi;function Bo(){return Hi||(Hi=Object.freeze(Array.from(new Set([...Object.getOwnPropertyNames(Object.prototype),"prototype"]))))}function w(t){return Bo().includes(t)}var Wo={};function ye({Date:t}){return function(i=Wo,o){let{type:n}=o,r=t.now();if(n===Mt)i=de(i,[o.payload.id]);else if(n===Z)i=de(i,["connectivitystatus","message"],()=>"javascripterror");else if(n===zt){let{alt:c,data:p,id:a,level:u,message:I}=o.payload;if(!w(a)){let S=i[a];(!S||c!==S.alt||!Object.is(p,S.data)||u!==S.level||I!==S.message)&&(i=de(i,[a],()=>({alt:c,data:p,id:a,level:u,message:I,timestamp:r})))}}return i}}import it from"simple-update-in";var Uo={};function ue({Date:t}){return function(i=Uo,{payload:o,type:n}){if(n===T||n===d){let{activity:{from:{id:r,name:c,role:p},type:a}}=o;if(a==="typing"){let u=t.now();i=it(i,[r,"at"],I=>I||u),i=it(i,[r,"last"],()=>u),i=it(i,[r,"name"],()=>c),i=it(i,[r,"role"],()=>p)}else a==="message"&&(i=it(i,[r]))}return i}}var Mo=[];function Ae(t=Mo,{payload:e,type:i}){switch(i){case Jt:t=e.dictateInterims;break;default:break}return t}var Vo=0;function Te(t=Vo,{payload:e,type:i}){switch(i){case K:t=e.dictateState;break;case Zt:(t===0||t===4||t===1)&&(t=2);break;case ee:t===2||t===3?t=4:t===1&&(t=0);break;default:break}return t}var Yo="en-US";function Se(t=Yo,{payload:e,type:i}){switch(i){case Kt:t=e.language;break;default:break}return t}var Ee="DIRECT_LINE/CONNECTION_STATUS_UPDATE";function Ie(t){return{type:Ee,payload:{connectionStatus:t}}}var jo=0;function ge(t=jo,{payload:e,type:i}){switch(i){case Ee:t=e.connectionStatus;break;default:break}return t}var Ce="WEB_CHAT/SET_REFERENCE_GRAMMAR_ID";function De(t){return{type:Ce,payload:{referenceGrammarID:t}}}var $o=null;function he(t=$o,{payload:e,type:i}){switch(i){case Ce:t=e.referenceGrammarID||null;break;default:break}return t}var Ho=Object.freeze([]);function Ne(t=Ho,{payload:e,type:i}){switch(i){case Xt:t=e.attachments;break;default:break}return t}var qo="";function ve(t=qo,{payload:e,type:i}){switch(i){case D:t=e.text;break;default:break}return t}var Jo=2e4;function _e(t=Jo,{payload:e,type:i}){switch(i){case Qt:t=e.sendTimeout;break;default:break}return t}var Ko=!1;function be(t=Ko,{payload:e,type:i}){switch(i){case z:t=e.sendTypingIndicator;break;default:break}return t}function xe(t=!1,{type:e}){switch(e){case te:t=!0;break;case X:t=!1;break;default:break}return t}var zo=Object.freeze([]),ot="WEB_CHAT/SET_SUGGESTED_ACTIONS";function F(t=zo,e=void 0){return{type:ot,payload:{originActivity:e,suggestedActions:t}}}var Pe=Object.freeze([]);function Oe(t=Pe,{payload:e={},type:i}){switch(i){case ot:(e.suggestedActions||[]).length?t=[].slice.call(e.suggestedActions):t=Pe;break;case $:t=Pe;break;default:break}return t}var qi=Object.freeze({activity:void 0});function Le(t=qi,e){switch(e.type){case ot:t={activity:e.payload.originActivity};break;case $:t=qi;break;default:break}return t}function ke(t){return Xo({activities:fe(t),connectivityStatus:ae,dictateInterims:Ae,dictateState:Te,internal:le(t),language:Se,notifications:ye(t),readyState:ge,referenceGrammarID:he,sendBoxAttachments:Ne,sendBoxValue:ve,sendTimeout:_e,sendTypingIndicator:be,shouldSpeakIncomingActivity:xe,suggestedActions:Oe,suggestedActionsOriginActivity:Le,typing:ue(t)})}import{fork as f}from"redux-saga/effects";import{put as en,takeEvery as on}from"redux-saga/effects";import{call as Qo,cancel as Zo,fork as tn,take as Ji}from"redux-saga/effects";function s(t,...e){return Qo(function*(){for(;;){let{meta:{userID:o,username:n},payload:{directLine:r}}=yield Ji([bi,Ui]),c=yield tn(t,{directLine:r,userID:o,username:n},...e);yield Ji([At,G]),yield Zo(c)}})}function*nn(){yield en(F())}function*rn(){yield on(({payload:t,type:e})=>e===d&&t.activity.type==="message",nn)}function*Re(){yield s(rn)}import{call as an,put as Ge,takeLatest as sn}from"redux-saga/effects";import cn from"p-defer-es5";function x(){let t,e=[];return{push:n=>{if(t){let{resolve:r}=t;t=null,r(n)}else e.push(n)},shift:()=>e.length?Promise.resolve(e.shift()):(t||(t=cn())).promise}}var we="connectivitystatus";function pn(t){let{push:e,shift:i}=x(),o=t.subscribe({next:e});return{shift:i,unsubscribe(){o.unsubscribe()}}}function*mn({payload:{directLine:t}}){let{shift:e,unsubscribe:i}=pn(t.connectionStatus$);try{let o;for(;;)switch(yield an(e)){case 0:case 1:yield Ge(L({id:we,level:"info",message:o?"reconnecting":"connecting"}));break;case 2:o=1,yield Ge(L({id:we,level:"success",message:"connected"}));break;case 3:case 4:o=1,yield Ge(L({id:we,level:"error",message:"failedtoconnect"}));break;default:break}}finally{i()}}function*Ki(){yield sn(A,mn)}import{put as zi}from"redux-saga/effects";import{call as Fe}from"redux-saga/effects";function nt(t,e){return Fe(function*(){let o=x(),n=t.subscribe({next:o.push});try{for(;;){let r=yield Fe(o.shift);yield Fe(e,r)}}finally{n.unsubscribe()}})}function*fn({directLine:t}){yield nt(t.connectionStatus$,function*(i){yield zi(Ie(i)),yield zi(De(t.referenceGrammarId))})}function*Be(){yield s(fn)}import{call as Me,cancel as yn,cancelled as un,fork as An,put as Tn,race as Qi,take as W}from"redux-saga/effects";import{jwtDecode as Sn}from"jwt-decode";import{fork as ln,put as dn}from"redux-saga/effects";function B(...t){return ln(function*(){for(let i of t)yield dn(i)})}var rt="DIRECT_LINE/UPDATE_CONNECTION_STATUS";function We(t){return{type:rt,payload:{connectionStatus:t}}}var Ve=1,Ye=2,En=0;function Ue(){return`r_${b().substring(0,10)}`}function*In(t){let e=x(),i=t.connectionStatus$.subscribe({next:e.push});try{for(;;){let o=yield Me(e.shift);yield Tn(We(o))}}finally{i.unsubscribe()}}function gn(t,e){let{token:i}=t,o;try{o=(Sn(i)||{}).user}catch{}let n={fromAction:e,fromToken:o};return o?(e&&e!==o&&console.warn("Web Chat: user ID is both specified in the Direct Line token and passed in, will use the user ID from the token."),n.final=o):e?typeof e!="string"?(console.warn("Web Chat: user ID must be a string."),n.final=Ue()):/^dl_/u.test(e)?(console.warn('Web Chat: user ID prefixed with "dl_" is reserved and must be embedded into the Direct Line token to prevent forgery.'),n.final=Ue()):n.final=e:n.final=Ue(),n}function*Cn(t){let e=t.activity$.subscribe({next:()=>0}),i=e.unsubscribe.bind(e);try{for(;;){let{payload:{connectionStatus:o}}=yield W(rt);if(o===Ye)return()=>{i(),t.end()};if(o!==En&&o!==Ve)throw new Error(`Failed to connect, DirectLineJS returned ${o}.`)}}catch(o){throw i(),o}finally{(yield un())&&i()}}function*Dn(){for(;;){let{payload:{connectionStatus:t}}=yield W(rt);if(t===Ye)break;if(t!==Ve)throw new Error(`Failed to reconnect. DirectLineJS returned ${t}.`)}}function*hn({type:t,meta:e,payload:i},o){try{yield B({type:`${t}_PENDING`,meta:e,payload:i});let n=yield o();return yield B({type:`${t}_FULFILLING`,meta:e,payload:i},{type:`${t}_FULFILLED`,meta:e,payload:i}),n}catch(n){throw yield B({type:`${t}_REJECTED`,error:!0,meta:e,payload:n}),n}}function*Nn(){throw yield W(_),new Error("disconnected")}function Xi(t,e){return hn(t,function*(){let{result:o}=yield Qi({_:Nn(),result:e()});return o})}function*Zi(){for(;;){let{payload:{directLine:t,userID:e,username:i}}=yield W(A),o=yield An(In,t),n=gn(t,e),r={userID:n.final,username:i};t.setUserId&&n.fromToken!==r.userID&&t.setUserId(r.userID);let c;try{let p=yield Xi({type:A,meta:r,payload:{directLine:t}},()=>Me(Cn,t));try{for(;;){let{updateConnectionStatusAction:{payload:{connectionStatus:a}={}}={}}=yield Qi({_:W(_),updateConnectionStatusAction:W(rt)});if(a===Ve)yield Xi({type:R,meta:r,payload:{directLine:t}},()=>Me(Dn));else if(a!==Ye){if(typeof a<"u")throw new Error(`Connection status changed to ${a}`);break}}}finally{p()}}catch(p){c={error:p}}finally{yield yn(o),yield B({type:At,meta:c,payload:{directLine:t}},{type:Tt,meta:c,payload:{directLine:t}})}}}import{call as vn,put as _n,race as bn,take as je}from"redux-saga/effects";function E(t,e){return new Promise(i=>e.setTimeout(i,Math.max(t,0)))}var xn=15e3;function*$e(t){for(;;)yield je([dt,G]),"slow"in(yield bn({fulfilled:je([lt,Pt]),rejected:je([yt,Mi]),slow:vn(E,xn,t)}))&&(yield _n({type:ut}))}import{put as Pn,takeEvery as On}from"redux-saga/effects";function*Ln(){yield Pn(y({type:"typing"}))}function*kn(){yield On(({type:t})=>t===Vt,Ln)}function*He(){yield s(kn)}import{put as Rn,select as Gn,takeEvery as wn}from"redux-saga/effects";var to=({activities:t})=>t,ct=t=>e=>to(e).filter(t);var eo=t=>ct(({type:e})=>e===t),qe=to;function at(t){return t.channelData?.speak}function*Fn(){let t=yield Gn(ct(at));for(let e of t)yield Rn(q(e,"speak",!1))}function*Je(){yield wn(X,Fn)}import{put as Bn}from"redux-saga/effects";import U from"simple-update-in";var Ke="DIRECT_LINE/QUEUE_INCOMING_ACTIVITY";function ze(t){return{type:Ke,payload:{activity:t}}}var Wn=t=>t;function Un(t,e){return t.from?t.from.role||(t.from.id===e?t=U(t,["from","role"],()=>"user"):t.from.id?t=U(t,["from","role"],()=>"bot"):t=U(t,["from","role"],()=>"channel")):t=U(t,["from","role"],()=>"channel"),t}function Mn(t){return["attachmentLayout","attachments","channelData","conversation","entities","from","inputHint","locale","name","recipient","speak","suggestedActions","text","textFormat","timestamp","type"].reduce((e,i)=>{let{[i]:o}=e;return U(e,[i],typeof o>"u"||o===null?void 0:Wn)},t)}function Vn(t){return U(t,["from","name"],e=>{let{channelId:i,from:o={}}=t;return(i==="directline"||i==="webchat")&&o.id===o.name&&o.role==="bot"?"Bot":e})}function*Yn({directLine:t,userID:e}){yield nt(t.activity$,function*(o){o=Mn(o),o=Un(o,e),o=Vn(o),yield Bn(ze(o))})}function*Xe(){yield s(Yn)}import{all as jn,call as kt,cancelled as $n,put as st,race as Hn,select as ro,take as qn,takeEvery as Jn}from"redux-saga/effects";function N(t,e=2){if(typeof t!="number")throw new Error("First argument must be a number");let i=t+"";for(;i.length<e;)i="0"+i;return i}function Qe(t){if(!(t.getTimezoneOffset&&t.getFullYear&&t.getMonth&&t.getDate&&t.getHours&&t.getMinutes&&t.getSeconds&&t.getMilliseconds))throw new Error("First argument must be a Date-like object.");let i=-t.getTimezoneOffset(),o=i<0?"-":"+",n=~~Math.abs(i);return`${t.getFullYear()}-${N(t.getMonth()+1)}-${N(t.getDate())}T${N(t.getHours())}:${N(t.getMinutes())}:${N(t.getSeconds())}.${N(t.getMilliseconds(),3)}${i?`${o}${N(~~(n/60))}:${N(n%60)}`:"Z"}`}function Lt(t,...e){if(!t)return t;let i={...t};for(let o of e)(typeof o!="string"||!w(o))&&delete i[o];return i}var io=({language:t})=>t;import{call as oo}from"redux-saga/effects";function Ze(t){return oo(function*(){let i;try{return yield oo(()=>new Promise((o,n)=>{i=t.subscribe({complete:o,error:n,next:o})}))}finally{i&&i.unsubscribe()}})}var no=({sendTimeout:t})=>t;var Kn=3e5;function*zn(t,e,i,o,{meta:{method:n},payload:{activity:r}},c){let p=r.type==="message"&&r.attachments||[],a=b(),u=yield ro(io),I=typeof window.Intl>"u"?void 0:new Intl.DateTimeFormat().resolvedOptions().timeZone,S=new c.Date,V={...Lt(r,"id"),channelData:{...Lt(r.channelData,"state","webchat:send-status"),clientActivityID:a},channelId:"webchat",from:{id:e,name:i,role:"user"},locale:u,localTimestamp:Qe(S),localTimezone:I,...r.type==="message"?{attachments:p&&p.map(({contentType:O,contentUrl:ft,name:Ut,thumbnailUrl:j})=>({contentType:O,contentUrl:ft,name:Ut,thumbnailUrl:j})),text:r.text}:r.type==="event"?{name:r.name,value:r.value}:{}};o||(V.entities=[...V.entities||[],{requiresBotState:!0,supportsListening:!0,supportsTts:!0,type:"ClientCapabilities"}]);let Y={clientActivityID:a,method:n};yield st({type:d,meta:Y,payload:{activity:V}});let Ni;try{let O=kt(function*(){for(;;){let{payload:{activity:j}}=yield qn(T);if(j.channelData?.clientActivityID===a&&j.id)return Ni=!0,j}}),ft=yield ro(no),{send:{echoBack:Ut}}=yield Hn({send:jn({echoBack:O,postActivity:Ze(t.postActivity(V))}),timeout:kt(function*(){throw yield kt(E,ft,c),yield st({type:It,meta:Y,payload:{activity:V}}),yield kt(E,Kn-ft,c),Ni?new Error("timed out while waiting for postActivity to return any values"):new Error("timed out while waiting for outgoing message to echo back")})});yield st({type:Et,meta:Y,payload:{activity:Ut}})}catch(O){console.error("botframework-webchat: Failed to post activity to chat adapter.",O),yield st({type:J,error:!0,meta:Y,payload:O})}finally{(yield $n())&&(yield st({type:J,error:!0,meta:Y,payload:new Error("cancelled")}))}}function*ti(t){yield s(function*({directLine:i,userID:o,username:n}){let r=0;yield Jn(g,function*(p){yield*zn(i,o,n,r++,p,t)})})}import{call as Xn,cancelled as Qn,fork as Zn,put as ei,race as tr,select as ii,take as ao}from"redux-saga/effects";var co=t=>t&&t.from.role==="bot";var er=5e3;function*ir(t,e,i){for(;!(yield Qn());){let o=yield ao(t),n=yield ii(e);yield Zn(i,o,n)}}function*or(t,e){let i=e;for(;!i.find(r=>r.id===t||r.replyToId===t);){let{payload:{activity:n}}=yield ao(T);if(n.id===t)break;i=yield ii(qe)}}function*nr({userID:t},e){yield ir(Ke,qe,function*({payload:{activity:o}},n){let{replyToId:r}=o,c=n.filter(({from:{role:u}})=>u==="bot");r&&c.length&&"timeout"in(yield tr({_:or(r,n),timeout:Xn(E,er,e)}))&&console.warn(`botframework-webchat: Timed out while waiting for activity "${r}" which activity "${o.id}" is replying to.`,{activity:o,replyToId:r}),yield ei(Yi(o));let p=yield ii(eo("message")),a=p[p.length-1];if(co(a)){let{suggestedActions:{actions:u,to:I}={actions:void 0,to:void 0}}=a,S=I?.length&&!I.includes(t)?null:u;S?yield ei(F(S,a)):yield ei(F())}})}function*oi(t){yield s(nr,t)}import{put as rr,takeEvery as cr}from"redux-saga/effects";function*ar({payload:{name:t,value:e}}){yield rr(y({name:t,type:"event",value:e}))}function*sr(){yield cr(({payload:t,type:e})=>e===Yt&&t.name,ar)}function*ni(){yield s(sr)}import{put as pr,takeEvery as mr}from"redux-saga/effects";import so from"mime";var fr=so.getType.bind(so);function*lr({payload:{files:t}}){yield pr(y({attachments:[].map.call(t,({name:e,thumbnail:i,url:o})=>({contentType:fr(e)||"application/octet-stream",contentUrl:o,name:e,thumbnailUrl:i})),channelData:{attachmentSizes:[].map.call(t,({size:e})=>e)},type:"message"}))}function*dr(){yield mr(({payload:t,type:e})=>e===jt&&t.files.length,lr)}function*ri(){yield s(dr)}import{put as yr,takeEvery as ur}from"redux-saga/effects";function*Ar({payload:{displayText:t,text:e,value:i}}){yield yr(y({channelData:{messageBack:{displayText:t}},text:e,type:"message",value:i}))}function*Tr(){yield ur(Ht,Ar)}function*ci(){yield s(Tr)}import{put as Sr,takeEvery as Er}from"redux-saga/effects";function*Ir({payload:{attachments:t=[],channelData:e,method:i,text:o}}){yield Sr(y({attachments:t.map(({blob:n,thumbnailURL:r})=>({contentType:n instanceof File&&n.type||"application/octet-stream",contentUrl:URL.createObjectURL(n),name:n instanceof File?n.name:void 0,thumbnailUrl:r?.toString()})),channelData:{...e,attachmentSizes:t.map(({blob:{size:n}})=>n)},text:o||void 0,textFormat:"plain",type:"message"},i))}function*gr(){yield Er(({payload:t,type:e})=>e===$t&&(t.text||t.attachments?.length),Ir)}function*ai(){yield s(gr)}import{put as Cr,takeEvery as Dr}from"redux-saga/effects";function*hr({payload:{value:t}}){yield Cr(y({channelData:{postBack:!0},text:typeof t=="string"?t:void 0,type:"message",value:typeof t!="string"?t:void 0}))}function*Nr(){yield Dr(qt,hr)}function*si(){yield s(Nr)}import{call as vr,cancel as _r,put as br,select as xr,take as Pr,takeLatest as Or}from"redux-saga/effects";var po=({sendTypingIndicator:t})=>t;var Lr=3e3;function pi(t){return Pr(({payload:e,type:i})=>i===z&&!e.sendTypingIndicator==!t)}function*kr(t,e){let{Date:i}=e;for((yield xr(po))||(yield pi(!0));;){let n=-1/0,r=yield Or(({payload:c,type:p})=>p===D&&c.text||p===g&&c.activity.type!=="typing",function*({payload:c,type:p}){if(p===D){let a=Lr-i.now()+n;a>0&&(yield vr(E,a,e)),yield br(St()),n=i.now()}else c.activity.type==="message"&&(n=-1/0)});yield pi(!1),yield _r(r),yield pi(!0)}}function*mi(t){yield s(kr,t)}import{put as li,select as Rr,takeEvery as Gr}from"redux-saga/effects";var mo=({shouldSpeakIncomingActivity:t})=>t;function fi(t){return t&&t.from&&t.type==="message"}function*wr({userID:t}){yield Gr(({payload:e,type:i})=>i===T&&e.activity.from.id!==t&&e.activity.from.role!=="user",function*({payload:{activity:e}}){let i=yield Rr(mo),o=fi(e)&&i;o&&(e.speak||e.text||~(e.attachments||[]).findIndex(({content:{speak:n}={}})=>n))&&(yield li(q(e,"speak",!0))),o&&e.inputHint==="expectingInput"?yield li(Ct(1)):e.inputHint==="ignoringInput"&&(yield li(k()))})}function*di(){yield s(wr)}import{put as Fr,select as lo,takeEvery as Br}from"redux-saga/effects";var fo=({dictateState:t})=>t;function*Wr(){let t=yield lo(ct(at));(yield lo(fo))===1&&!t.length&&(yield Fr(Nt()))}function*yi(){yield Br(({type:t})=>t===H||t===K,Wr)}import{put as Ur,takeEvery as Mr}from"redux-saga/effects";function*Vr(){yield Mr(({meta:t,payload:e,type:i})=>i===d&&t.method==="speech"&&e.activity.type==="message",function*(){yield Ur(vt())})}function*ui(){yield s(Vr)}import{put as Yr,takeEvery as jr}from"redux-saga/effects";function*$r(){yield jr(({payload:t,type:e})=>e===d&&t.activity.type==="message",function*(){yield Yr(k())})}function*Ai(){yield s($r)}import{put as Hr,takeEvery as qr}from"redux-saga/effects";function*Jr(){yield qr(({meta:t,payload:e,type:i})=>i===D&&e.text||i===d&&t.method!=="speech"&&e.activity.type==="message",function*(){yield Hr(_t())})}function*Ti(){yield s(Jr)}import{put as Ei,select as uo,takeEvery as Kr}from"redux-saga/effects";function Si({sendBoxAttachments:t}){return t}var yo=({sendBoxValue:t})=>t;function*zr(){yield Kr(ie,function*({payload:{channelData:t,method:e}}){let i=yield uo(Si),o=yield uo(yo);(i.length||o)&&(yield Ei(gt(o.trim(),e,{attachments:i,channelData:t})),yield Ei(Dt("")),yield Ei(ht(Object.freeze([]))))})}function*Ii(){yield s(zr)}function gi({ponyfill:t}){return function*(){yield f(Re),yield f(Ki),yield f(Be),yield f(Zi),yield f($e,t),yield f(He),yield f(Je),yield f(Xe),yield f(ti,t),yield f(oi,t),yield f(ni),yield f(ri),yield f(ci),yield f(ai),yield f(si),yield f(mi,t),yield f(di),yield f(yi),yield f(ui),yield f(Ai),yield f(Ti),yield f(Ii)}}function ec(t,...e){let i=tc({onError:(...o)=>{let[n]=o;console.error(n);let r=t();r&&r.dispatch(ce())}});return{enhancer:Xr(...e,i),sagaMiddleware:i}}function Ci(t,e,...i){let o=typeof globalThis>"u"?window:globalThis,n=t.ponyfill||{},r={cancelAnimationFrame:n.cancelAnimationFrame||(typeof cancelAnimationFrame=="function"?cancelAnimationFrame.bind(o):void 0),cancelIdleCallback:n.cancelIdleCallback||(typeof cancelIdleCallback=="function"?cancelIdleCallback.bind(o):void 0),clearImmediate:n.clearImmediate||(typeof clearImmediate=="function"?clearImmediate.bind(o):void 0),clearInterval:n.clearInterval||(typeof clearInterval=="function"?clearInterval.bind(o):void 0),clearTimeout:n.clearTimeout||(typeof clearTimeout=="function"?clearTimeout.bind(o):void 0),Date:n.Date||Date,requestAnimationFrame:n.requestAnimationFrame||(typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(o):void 0),requestIdleCallback:n.requestIdleCallback||(typeof requestIdleCallback=="function"?requestIdleCallback.bind(o):void 0),setImmediate:n.setImmediate||(typeof setImmediate=="function"?setImmediate.bind(o):void 0),setInterval:n.setInterval||(typeof setInterval=="function"?setInterval.bind(o):void 0),setTimeout:n.setTimeout||(typeof setTimeout=="function"?setTimeout.bind(o):void 0)},{enhancer:c,sagaMiddleware:p}=ec(()=>a,...i),a=Qr(ke(r),e||{},t.devTools?Zr(c):c);return p.run(gi({ponyfill:r})),a}function Ao(t,...e){return Ci({},t,...e)}function ic(t,...e){return Ci({devTools:!0},t,...e)}import{lazy as Dc,parse as hc,string as Rt,union as Nc,value as Gt}from"valibot";import{array as oc,fallback as nc,optional as rc,transform as cc,union as ac}from"valibot";var sc=t=>nc(rc(ac([cc(oc(t),e=>e[0]),t])),void 0),m=sc;import{parse as Ic,string as gc}from"valibot";import{lazy as yc,object as uc,optional as To,parse as Ac,string as v,unknown as Tc,value as Sc}from"valibot";import{array as pc,fallback as mc,parse as fc,transform as lc}from"valibot";var dc=t=>mc(lc(pc(t),e=>e.filter(i=>typeof i<"u")),e=>e?.input?[fc(t,e?.input)]:void 0);function P(t){return dc(m(t))}var Ec={"@context":To(v([Sc("https://schema.org")])),"@id":To(v()),"@type":v(),additionalType:m(v()),alternateName:m(v()),description:m(v()),name:m(v()),potentialAction:P(yc(()=>pt())),url:m(v())},C=t=>uc({...Ec,...t},Tc()),Di=t=>Ac(C(),t);var mt=t=>C({slogan:m(gc()),...t}),Cc=t=>Ic(mt(),t);var pt=t=>C({actionStatus:m(Nc([Rt([Gt("ActiveActionStatus")]),Rt([Gt("CompletedActionStatus")]),Rt([Gt("FailedActionStatus")]),Rt([Gt("PotentialActionStatus")])])),provider:m(Dc(()=>mt())),...t}),vc=t=>hc(pt(),t);import{lazy as Eo,number as Oc,parse as Lc,string as kc,union as Rc}from"valibot";import{lazy as Ft,parse as xc,string as Bt,union as Pc}from"valibot";import{parse as _c,string as So}from"valibot";var wt=t=>C({inDefinedTermSet:m(So()),termCode:m(So()),...t}),bc=t=>_c(wt(),t);var M=t=>C({abstract:m(Bt()),author:P(Bt()),citation:P(Ft(()=>M())),keywords:P(Pc([Ft(()=>wt()),Bt()])),pattern:m(Ft(()=>wt())),text:m(Bt()),usageInfo:m(Ft(()=>M())),...t}),Wt=t=>xc(M(),t);var Gc=t=>M({appearance:m(Eo(()=>M())),claimInterpreter:m(Eo(()=>mt())),position:m(Rc([Oc(),kc()])),...t}),wc=t=>Lc(Gc(),t);import{parse as Fc,string as Bc}from"valibot";var Wc=t=>pt({actionOption:m(Bc()),...t}),Uc=t=>Fc(Wc(),t);function Io(t){let e=(t||[]).find(o=>{if(o.type?.startsWith("https://schema.org/"))return Di(o)["@id"]===""}),i=e&&Wt(e);return i&&Wt(i)}function go(t,e){try{return t()}catch{return e}}function Co(t){return t?Array.isArray(t)?t:[t]:[]}function hi(t){let e;return()=>{e||(t(),e=1)}}function Do(t){return hi(()=>console.warn(`botframework-webchat: ${t}.`))}var gy={ActivityClientState:oe,DictateState:re},Mc="tsup",Vc="esmodules",Yc="4.18.1-main.20240807.dfe788c",Cy={buildTool:Mc,moduleFormat:Vc,version:Yc};export{gy as Constants,Cy as buildInfo,_i as clearSuggestedActions,xi as connect,Ao as createStore,ic as createStoreWithDevTools,Ci as createStoreWithOptions,Pi as disconnect,vo as dismissNotification,St as emitTypingIndicator,Io as getOrgSchemaMessage,w as isForbiddenPropertyName,q as markActivity,Vc as moduleFormat,go as onErrorResumeNext,vc as parseAction,wc as parseClaim,Wt as parseCreativeWork,bc as parseDefinedTerm,Cc as parseProject,Di as parseThing,Uc as parseVoteAction,y as postActivity,Oi as sendEvent,Li as sendFiles,gt as sendMessage,ki as sendMessageBack,Ri as sendPostBack,Gi as setDictateInterims,Ct as setDictateState,wi as setLanguage,L as setNotification,Dt as setSendBox,ht as setSendBoxAttachments,Fi as setSendTimeout,Bi as setSendTypingIndicator,Co as singleToArray,Nt as startDictate,vt as startSpeakingActivity,k as stopDictate,_t as stopSpeakingActivity,Wi as submitSendBox,Yc as version,Do as warnOnce};
2
2
  /*! For license information please see botframework-webchat-core.mjs.LEGAL.txt */
3
3
  //# sourceMappingURL=botframework-webchat-core.mjs.map