"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkTMLJUPYMjs = require('./chunk-TMLJUPYM.js');require('./chunk-2TRCRGZR.js');var _chunk5X4VJZOMjs = require('./chunk-5X4VJZOM.js');var _chunkOT2H52K5js = require('./chunk-OT2H52K5.js');require('./chunk-7GV72C4W.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _valibot = require('valibot');var Q=_valibot.pipe.call(void 0, _valibot.object.call(void 0, {children:_valibot.optional.call(void 0, _chunkOT2H52K5js.a.call(void 0, )),middleware:_valibot.optional.call(void 0, _valibot.pipe.call(void 0, _valibot.array.call(void 0, _valibot.custom.call(void 0, e=>typeof e=="function")),_valibot.readonly.call(void 0, )))}),_valibot.readonly.call(void 0, )),V=_valibot.optional.call(void 0, _valibot.array.call(void 0, _valibot.custom.call(void 0, e=>e[_chunkTMLJUPYMjs.a]===_chunkTMLJUPYMjs.a)));function Y(e){let{children:t,middleware:r}=_chunkOT2H52K5js.b.call(void 0, Q,e);return _react.useMemo.call(void 0, ()=>{_valibot.safeParse.call(void 0, V,r).success||console.warn('botframework-webchat: "middleware" props passed to <DecoratorComposer> should be created using createXXXMiddleware() functions.',{middleware:r})},[r]),r?_react2.default.createElement(_chunk5X4VJZOMjs.b,{middleware:r,priority:"normal"},t):_react2.default.createElement(_react.Fragment,null,t)}var Z=_react.memo.call(void 0, Y);function I(e){var r;let t=(r=_react.useContext.call(void 0, e))==null?void 0:r.request;if(!t)throw new Error(`useDecoratorRequest must be used within a ${e}Provider`);return t}var _botframeworkwebchatcore = require('botframework-webchat-core');function oe({children:e}){return _react2.default.createElement(_react.Fragment,null,e)}var f=_react.memo.call(void 0, oe);var _reactchainofresponsibility = require('react-chain-of-responsibility');var ae=_reactchainofresponsibility.createChainOfResponsibility.call(void 0, );function x(e,t,r=f){function a(d,o){function i(u){var n;let s=(n=_react.useContext.call(void 0, t))==null?void 0:n.request;return _react2.default.createElement(d,{...u,Next:o,request:s})}return i.displayName=`ChainNext(Next ${e})`,_react.memo.call(void 0, i)}function p(d){let o=i=>i!==e?!1:u=>()=>{let s=u(void 0);return s&&a(d,s)};return o[_chunkTMLJUPYMjs.a]=_chunkTMLJUPYMjs.a,o}let{Provider:c,useBuildComponentCallback:z}=ae;function R(d){let o=z(),i=_react.useMemo.call(void 0, ()=>o(void 0,{fallbackComponent:r}),[o]);return i&&_react2.default.createElement(i,{...d})}R.displayName=`DecoratorChain(Chain ${e})`;let L=_react.memo.call(void 0, R);function A(d){let{request:o}=d,{middleware:i}=_react.useContext.call(void 0, _chunk5X4VJZOMjs.a),u=_react.useMemo.call(void 0, ()=>i.map(n=>n(e)).filter(n=>n).map(n=>()=>n),[i]),s=_react.useMemo.call(void 0, ()=>({request:o}),[o]);return _react2.default.createElement(t.Provider,{value:s},_react2.default.createElement(c,{init:e,middleware:u},_react2.default.createElement(L,{...d})))}return A.displayName=`DecoratorProxy(Decorator ${e})`,{createMiddleware:p,Proxy:_react.memo.call(void 0, A),"~types":void 0}}var ne=_react.createContext.call(void 0, Object.freeze({request:Object.freeze({from:void 0,livestreamingState:void 0})})),v= exports.ActivityBorderDecoratorRequest =ne;var pe=x("activity border",v),{createMiddleware:F,Proxy:k}=pe;var le=["bot","channel","user",void 0];function me({activity:e,children:t}){let r=_react.useMemo.call(void 0, ()=>{var p,c;let{type:a}=_botframeworkwebchatcore.getActivityLivestreamingMetadata.call(void 0, e)||{};return{from:le.includes((p=e==null?void 0:e.from)==null?void 0:p.role)?(c=e==null?void 0:e.from)==null?void 0:c.role:void 0,livestreamingState:a==="final activity"?"completing":a==="informative message"?"preparing":a==="interim activity"?"ongoing":void 0}},[e]);return _react2.default.createElement(k,{request:r},t)}var fe=_react.memo.call(void 0, me);var ve=_chunkTMLJUPYMjs.b.call(void 0, "activity grouping"),{createMiddleware:S,extractMiddleware:W,Provider:O,Proxy:$}=ve;function Pe({activities:e,children:t,groupingName:r}){let a=_react.useMemo.call(void 0, ()=>({groupingName:r}),[r]),{middleware:p}=_react.useContext.call(void 0, _chunk5X4VJZOMjs.a),c=_react.useMemo.call(void 0, ()=>W(p),[p]);return _react2.default.createElement(O,{middleware:c},_react2.default.createElement($,{activities:e,fallbackComponent:f,request:a},t))}var xe=_react.memo.call(void 0, Pe);exports.ActivityBorderDecorator = fe; exports.ActivityBorderDecoratorRequest = v; exports.ActivityGroupingDecorator = xe; exports.DecoratorComposer = Z; exports.createActivityBorderMiddleware = F; exports.createActivityGroupingMiddleware = S; exports.useDecoratorRequest = I;
//# sourceMappingURL=botframework-webchat-api.decorator.js.map