@forbespro/lead-agent
Version:
Lead Chat Agent React Component
2 lines (1 loc) • 2.52 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./index161.js"),I=require("./index146.js"),F=require("./index160.js"),N={tokenize:$},y={tokenize:q};function $(i){const e=this,l=[];let s=0,t,a,h;return w;function w(n){if(s<l.length){const o=l[s];return e.containerState=o[1],i.attempt(o[0].continuation,b,p)(n)}return p(n)}function b(n){if(s++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,t&&x();const o=e.events.length;let u=o,r;for(;u--;)if(e.events[u][0]==="exit"&&e.events[u][1].type==="chunkFlow"){r=e.events[u][1].end;break}d(s);let c=o;for(;c<e.events.length;)e.events[c][1].end={...r},c++;return F.splice(e.events,u+1,0,e.events.slice(o)),e.events.length=c,p(n)}return w(n)}function p(n){if(s===l.length){if(!t)return v(n);if(t.currentConstruct&&t.currentConstruct.concrete)return m(n);e.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return e.containerState={},i.check(y,z,B)(n)}function z(n){return t&&x(),d(s),v(n)}function B(n){return e.parser.lazy[e.now().line]=s!==l.length,h=e.now().offset,m(n)}function v(n){return e.containerState={},i.attempt(y,T,m)(n)}function T(n){return s++,l.push([e.currentConstruct,e.containerState]),v(n)}function m(n){if(n===null){t&&x(),d(0),i.consume(n);return}return t=t||e.parser.flow(e.now()),i.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:a}),g(n)}function g(n){if(n===null){C(i.exit("chunkFlow"),!0),d(0),i.consume(n);return}return I.markdownLineEnding(n)?(i.consume(n),C(i.exit("chunkFlow")),s=0,e.interrupt=void 0,w):(i.consume(n),g)}function C(n,o){const u=e.sliceStream(n);if(o&&u.push(null),n.previous=a,a&&(a.next=n),a=n,t.defineSkip(n.start),t.write(u),e.parser.lazy[n.start.line]){let r=t.events.length;for(;r--;)if(t.events[r][1].start.offset<h&&(!t.events[r][1].end||t.events[r][1].end.offset>h))return;const c=e.events.length;let f=c,S,k;for(;f--;)if(e.events[f][0]==="exit"&&e.events[f][1].type==="chunkFlow"){if(S){k=e.events[f][1].end;break}S=!0}for(d(s),r=c;r<e.events.length;)e.events[r][1].end={...k},r++;F.splice(e.events,f+1,0,e.events.slice(c)),e.events.length=r}}function d(n){let o=l.length;for(;o-- >n;){const u=l[o];e.containerState=u[1],u[0].exit.call(e,i)}l.length=n}function x(){t.write([null]),a=void 0,t=void 0,e.containerState._closeFlow=void 0}}function q(i,e,l){return _.factorySpace(i,i.attempt(this.parser.constructs.document,e,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}exports.document=N;