@cimulate/copilot-widget 0.27.0 → 0.28.0
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.
|
@@ -21228,15 +21228,15 @@ function aL(e, t) {
|
|
|
21228
21228
|
}
|
|
21229
21229
|
function lL(e, t) {
|
|
21230
21230
|
const n = t.value ? t.value + `
|
|
21231
|
-
` : "", r = {};
|
|
21232
|
-
|
|
21233
|
-
let
|
|
21231
|
+
` : "", r = {}, o = t.lang ? t.lang.split(/\s+/) : [];
|
|
21232
|
+
o.length > 0 && (r.className = ["language-" + o[0]]);
|
|
21233
|
+
let u = {
|
|
21234
21234
|
type: "element",
|
|
21235
21235
|
tagName: "code",
|
|
21236
21236
|
properties: r,
|
|
21237
21237
|
children: [{ type: "text", value: n }]
|
|
21238
21238
|
};
|
|
21239
|
-
return t.meta && (
|
|
21239
|
+
return t.meta && (u.data = { meta: t.meta }), e.patch(t, u), u = e.applyData(t, u), u = { type: "element", tagName: "pre", properties: {}, children: [u] }, e.patch(t, u), u;
|
|
21240
21240
|
}
|
|
21241
21241
|
function cL(e, t) {
|
|
21242
21242
|
const n = {
|
|
@@ -32804,8 +32804,8 @@ const Uc = () => /* @__PURE__ */ O.jsx("span", { className: `${ee}-blinking-curs
|
|
|
32804
32804
|
message: t,
|
|
32805
32805
|
isWidgetStandalone: n
|
|
32806
32806
|
}) => {
|
|
32807
|
-
var o
|
|
32808
|
-
const r = (
|
|
32807
|
+
var o;
|
|
32808
|
+
const r = (o = t.searchParams) == null ? void 0 : o.query;
|
|
32809
32809
|
return /* @__PURE__ */ O.jsxs(
|
|
32810
32810
|
"div",
|
|
32811
32811
|
{
|
|
@@ -32814,7 +32814,7 @@ const Uc = () => /* @__PURE__ */ O.jsx("span", { className: `${ee}-blinking-curs
|
|
|
32814
32814
|
standalone: n
|
|
32815
32815
|
}),
|
|
32816
32816
|
children: [
|
|
32817
|
-
/* @__PURE__ */ O.jsxs(
|
|
32817
|
+
!!r && /* @__PURE__ */ O.jsxs(
|
|
32818
32818
|
"div",
|
|
32819
32819
|
{
|
|
32820
32820
|
className: oe(e, `${ee}-refined-event-query`, {
|
|
@@ -32834,7 +32834,7 @@ const Uc = () => /* @__PURE__ */ O.jsx("span", { className: `${ee}-blinking-curs
|
|
|
32834
32834
|
standalone: n
|
|
32835
32835
|
}
|
|
32836
32836
|
),
|
|
32837
|
-
children: /* @__PURE__ */ O.jsx(gc, {})
|
|
32837
|
+
children: /* @__PURE__ */ O.jsx(gc, { role: "img" })
|
|
32838
32838
|
}
|
|
32839
32839
|
),
|
|
32840
32840
|
/* @__PURE__ */ O.jsx("p", { className: oe(e, `${ee}-text`, "bold"), children: r })
|
|
@@ -16,7 +16,7 @@ Error generating stack: `+y.message+`
|
|
|
16
16
|
`;break}case-3:{u=`\r
|
|
17
17
|
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(a)}o=a===-2,r.push(u)}return r.join("")}function BI(e){const r={constructs:zE([LI,...(e||{}).extensions||[]]),content:o(uO),defined:[],document:o(cO),flow:o(kI),lazy:{},string:o(II),text:o(PI)};return r;function o(a){return u;function u(c){return DI(r,a,c)}}}function UI(e){for(;!QE(e););return e}const iy=/[\0\t\n\r]/g;function HI(){let e=1,t="",n=!0,r;return o;function o(a,u,c){const f=[];let h,m,E,b,T;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),E=0,t="",n&&(a.charCodeAt(0)===65279&&E++,n=void 0);E<a.length;){if(iy.lastIndex=E,h=iy.exec(a),b=h&&h.index!==void 0?h.index:a.length,T=a.charCodeAt(b),!h){t=a.slice(E);break}if(T===10&&E===b&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),E<b&&(f.push(a.slice(E,b)),e+=b-E),T){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}E=b+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const zI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jI(e){return e.replace(zI,$I)}function $I(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return jE(n.slice(a?2:1),a?16:10)}return Hd(n)||e}const sy={}.hasOwnProperty;function VI(e,t,n){return typeof t!="string"&&(n=t,t=void 0),qI(n)(UI(BI(n).document().write(HI()(e,t,!0))))}function qI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(St),autolinkProtocol:he,autolinkEmail:he,atxHeading:a(_e),blockQuote:a(xt),characterEscape:he,characterReference:he,codeFenced:a(Gn),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(Gn,u),codeText:a(oo,u),codeTextData:he,data:he,codeFlowValue:he,definition:a(Zr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(Ti),hardBreakEscape:a(He),hardBreakTrailing:a(He),htmlFlow:a(nt,u),htmlFlowData:he,htmlText:a(nt,u),htmlTextData:he,image:a(Tt),label:u,link:a(St),listItem:a(Ut),listItemValue:b,listOrdered:a(Pt,E),listUnordered:a(Pt),paragraph:a(Ze),reference:k,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(_e),strong:a(Mn),thematicBreak:a(hr)},exit:{atxHeading:f(),atxHeadingSequence:W,autolink:f(),autolinkEmail:Je,autolinkProtocol:Ve,blockQuote:f(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Fe,characterReferenceMarkerNumeric:Fe,characterReferenceValue:Ie,characterReference:Ke,codeFenced:f(C),codeFencedFence:S,codeFencedFenceInfo:T,codeFencedFenceMeta:_,codeFlowValue:H,codeIndented:f(I),codeText:f(ye),codeTextData:H,data:H,definition:f(),definitionDestinationString:G,definitionLabelString:F,definitionTitleString:D,emphasis:f(),hardBreakEscape:f(de),hardBreakTrailing:f(de),htmlFlow:f(ce),htmlFlowData:H,htmlText:f(fe),htmlTextData:H,image:f(ie),label:ee,labelText:$,lineEnding:le,link:f(Ae),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:xe,resourceDestinationString:w,resourceTitleString:R,resource:Q,setextHeading:f(be),setextHeadingLineSequence:te,setextHeadingText:B,strong:f(),thematicBreak:f()}};oy(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(J){let Ee={type:"root",children:[]};const Be={stack:[Ee],tokenStack:[],config:t,enter:c,exit:h,buffer:u,resume:m,data:n},Ye=[];let et=-1;for(;++et<J.length;)if(J[et][1].type==="listOrdered"||J[et][1].type==="listUnordered")if(J[et][0]==="enter")Ye.push(et);else{const Qt=Ye.pop();et=o(J,Qt,et)}for(et=-1;++et<J.length;){const Qt=t[J[et][0]];sy.call(Qt,J[et][1].type)&&Qt[J[et][1].type].call(Object.assign({sliceSerialize:J[et][2].sliceSerialize},Be),J[et][1])}if(Be.tokenStack.length>0){const Qt=Be.tokenStack[Be.tokenStack.length-1];(Qt[1]||ay).call(Be,void 0,Qt[0])}for(Ee.position={start:mi(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:mi(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)Ee=t.transforms[et](Ee)||Ee;return Ee}function o(J,Ee,Be){let Ye=Ee-1,et=-1,Qt=!1,ei,Kn,_i,is;for(;++Ye<=Be;){const Xt=J[Ye];switch(Xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xt[0]==="enter"?et++:et--,is=void 0;break}case"lineEndingBlank":{Xt[0]==="enter"&&(ei&&!is&&!et&&!_i&&(_i=Ye),is=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:is=void 0}if(!et&&Xt[0]==="enter"&&Xt[1].type==="listItemPrefix"||et===-1&&Xt[0]==="exit"&&(Xt[1].type==="listUnordered"||Xt[1].type==="listOrdered")){if(ei){let Dr=Ye;for(Kn=void 0;Dr--;){const Fn=J[Dr];if(Fn[1].type==="lineEnding"||Fn[1].type==="lineEndingBlank"){if(Fn[0]==="exit")continue;Kn&&(J[Kn][1].type="lineEndingBlank",Qt=!0),Fn[1].type="lineEnding",Kn=Dr}else if(!(Fn[1].type==="linePrefix"||Fn[1].type==="blockQuotePrefix"||Fn[1].type==="blockQuotePrefixWhitespace"||Fn[1].type==="blockQuoteMarker"||Fn[1].type==="listItemIndent"))break}_i&&(!Kn||_i<Kn)&&(ei._spread=!0),ei.end=Object.assign({},Kn?J[Kn][1].start:Xt[1].end),J.splice(Kn||Ye,0,["exit",ei,Xt[2]]),Ye++,Be++}if(Xt[1].type==="listItemPrefix"){const Dr={type:"listItem",_spread:!1,start:Object.assign({},Xt[1].start),end:void 0};ei=Dr,J.splice(Ye,0,["enter",Dr,Xt[2]]),Ye++,Be++,_i=void 0,is=!0}}}return J[Ee][1]._spread=Qt,Be}function a(J,Ee){return Be;function Be(Ye){c.call(this,J(Ye),Ye),Ee&&Ee.call(this,Ye)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(J,Ee,Be){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([Ee,Be||void 0]),J.position={start:mi(Ee.start),end:void 0}}function f(J){return Ee;function Ee(Be){J&&J.call(this,Be),h.call(this,Be)}}function h(J,Ee){const Be=this.stack.pop(),Ye=this.tokenStack.pop();if(Ye)Ye[0].type!==J.type&&(Ee?Ee.call(this,J,Ye[0]):(Ye[1]||ay).call(this,J,Ye[0]));else throw new Error("Cannot close `"+J.type+"` ("+ua({start:J.start,end:J.end})+"): it’s not open");Be.position.end=mi(J.end)}function m(){return Ud(this.stack.pop())}function E(){this.data.expectingFirstListItemValue=!0}function b(J){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function T(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=J}function _(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=J}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function I(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=J.replace(/(\r?\n|\r)$/g,"")}function F(J){const Ee=this.resume(),Be=this.stack[this.stack.length-1];Be.label=Ee,Be.identifier=fr(this.sliceSerialize(J)).toLowerCase()}function D(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=J}function G(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=J}function W(J){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Be=this.sliceSerialize(J).length;Ee.depth=Be}}function B(){this.data.setextHeadingSlurpLineEnding=!0}function te(J){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function be(){this.data.setextHeadingSlurpLineEnding=void 0}function he(J){const Be=this.stack[this.stack.length-1].children;let Ye=Be[Be.length-1];(!Ye||Ye.type!=="text")&&(Ye=bi(),Ye.position={start:mi(J.start),end:void 0},Be.push(Ye)),this.stack.push(Ye)}function H(J){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(J),Ee.position.end=mi(J.end)}function le(J){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=Ee.children[Ee.children.length-1];Be.position.end=mi(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(he.call(this,J),H.call(this,J))}function de(){this.data.atHardBreak=!0}function ce(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=J}function fe(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=J}function ye(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=J}function Ae(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=Ee,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function ie(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=Ee,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function $(J){const Ee=this.sliceSerialize(J),Be=this.stack[this.stack.length-2];Be.label=jI(Ee),Be.identifier=fr(Ee).toLowerCase()}function ee(){const J=this.stack[this.stack.length-1],Ee=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ye=J.children;Be.children=Ye}else Be.alt=Ee}function w(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=J}function R(){const J=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=J}function Q(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function xe(J){const Ee=this.resume(),Be=this.stack[this.stack.length-1];Be.label=Ee,Be.identifier=fr(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function Fe(J){this.data.characterReferenceType=J.type}function Ie(J){const Ee=this.sliceSerialize(J),Be=this.data.characterReferenceType;let Ye;Be?(Ye=jE(Ee,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ye=Hd(Ee);const et=this.stack[this.stack.length-1];et.value+=Ye}function Ke(J){const Ee=this.stack.pop();Ee.position.end=mi(J.end)}function Ve(J){H.call(this,J);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(J)}function Je(J){H.call(this,J);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(J)}function xt(){return{type:"blockquote",children:[]}}function Gn(){return{type:"code",lang:null,meta:null,value:""}}function oo(){return{type:"inlineCode",value:""}}function Zr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ti(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function He(){return{type:"break"}}function nt(){return{type:"html",value:""}}function Tt(){return{type:"image",title:null,url:"",alt:null}}function St(){return{type:"link",title:null,url:"",children:[]}}function Pt(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Ut(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Mn(){return{type:"strong",children:[]}}function bi(){return{type:"text",value:""}}function hr(){return{type:"thematicBreak"}}}function mi(e){return{line:e.line,column:e.column,offset:e.offset}}function oy(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?oy(e,r):YI(e,r)}}function YI(e,t){let n;for(n in t)if(sy.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ay(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ua({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ua({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ua({start:t.start,end:t.end})+") is still open")}function WI(e){const t=this;t.parser=n;function n(r){return VI(r,Te(U(U({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function GI(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function KI(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
18
18
|
`}]}function QI(e,t){const n=t.value?t.value+`
|
|
19
|
-
`:"",r={}
|
|
19
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function XI(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JI(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Gs(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let u,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=a+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function eP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uy(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=r:o.push({type:"text",value:r}),o}function nP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uy(e,t);const o={src:Gs(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function rP(e,t){const n={src:Gs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function iP(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function sP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uy(e,t);const o={href:Gs(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function oP(e,t){const n={href:Gs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aP(e,t,n){const r=e.all(t),o=n?uP(n):ly(t),a={},u=[];if(typeof t.checked=="boolean"){const m=r[0];let E;m&&m.type==="element"&&m.tagName==="p"?E=m:(E={type:"element",tagName:"p",properties:{},children:[]},r.unshift(E)),E.children.length>0&&E.children.unshift({type:"text",value:" "}),E.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(o||c!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
20
20
|
`}),m.type==="element"&&m.tagName==="p"&&!o?u.push(...m.children):u.push(m)}const f=r[r.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&u.push({type:"text",value:`
|
|
21
21
|
`});const h={type:"element",tagName:"li",properties:a,children:u};return e.patch(t,h),e.applyData(t,h)}function uP(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ly(n[r])}return t}function ly(e){const t=e.spread;return t==null?e.children.length>1:t}function lP(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const u=r[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function cP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dP(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hP(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),o.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Ir(t.children[1]),f=dl(t.children[t.children.length-1]);c&&f&&(u.position={start:c,end:f}),o.push(u)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function pP(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const E=t.children[f],b={},T=u?u[f]:void 0;T&&(b.align=T);let _={type:"element",tagName:a,properties:b,children:[]};E&&(_.children=e.all(E),e.patch(E,_),_=e.applyData(E,_)),h.push(_)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function mP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const cy=9,fy=32;function gP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(dy(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(dy(t.slice(o),o>0,!1)),a.join("")}function dy(e,t,n){let r=0,o=e.length;if(t){let a=e.codePointAt(r);for(;a===cy||a===fy;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(o-1);for(;a===cy||a===fy;)o--,a=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function EP(e,t){const n={type:"text",value:gP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TP={blockquote:GI,break:KI,code:QI,delete:XI,emphasis:JI,footnoteReference:ZI,heading:eP,html:tP,imageReference:nP,image:rP,inlineCode:iP,linkReference:sP,link:oP,listItem:aP,list:lP,paragraph:cP,root:fP,strong:dP,table:hP,tableCell:mP,tableRow:pP,text:EP,thematicBreak:yP,toml:El,yaml:El,definition:El,footnoteDefinition:El};function El(){}const hy=-1,yl=0,ha=1,Tl=2,Yd=3,Wd=4,Gd=5,Kd=6,py=7,my=8,gy=typeof self=="object"?self:globalThis,bP=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),r=o=>{if(e.has(o))return e.get(o);const[a,u]=t[o];switch(a){case yl:case hy:return n(u,o);case ha:{const c=n([],o);for(const f of u)c.push(r(f));return c}case Tl:{const c=n({},o);for(const[f,h]of u)c[r(f)]=r(h);return c}case Yd:return n(new Date(u),o);case Wd:{const{source:c,flags:f}=u;return n(new RegExp(c,f),o)}case Gd:{const c=n(new Map,o);for(const[f,h]of u)c.set(r(f),r(h));return c}case Kd:{const c=n(new Set,o);for(const f of u)c.add(r(f));return c}case py:{const{name:c,message:f}=u;return n(new gy[c](f),o)}case my:return n(BigInt(u),o);case"BigInt":return n(Object(BigInt(u)),o);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new gy[a](u),o)};return r},Ey=e=>bP(new Map,e)(0),Qs="",{toString:_P}={},{keys:xP}=Object,pa=e=>{const t=typeof e;if(t!=="object"||!e)return[yl,t];const n=_P.call(e).slice(8,-1);switch(n){case"Array":return[ha,Qs];case"Object":return[Tl,Qs];case"Date":return[Yd,Qs];case"RegExp":return[Wd,Qs];case"Map":return[Gd,Qs];case"Set":return[Kd,Qs];case"DataView":return[ha,n]}return n.includes("Array")?[ha,n]:n.includes("Error")?[py,n]:[Tl,n]},bl=([e,t])=>e===yl&&(t==="function"||t==="symbol"),SP=(e,t,n,r)=>{const o=(u,c)=>{const f=r.push(u)-1;return n.set(c,f),f},a=u=>{if(n.has(u))return n.get(u);let[c,f]=pa(u);switch(c){case yl:{let m=u;switch(f){case"bigint":c=my,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return o([hy],u)}return o([c,m],u)}case ha:{if(f){let b=u;return f==="DataView"?b=new Uint8Array(u.buffer):f==="ArrayBuffer"&&(b=new Uint8Array(u)),o([f,[...b]],u)}const m=[],E=o([c,m],u);for(const b of u)m.push(a(b));return E}case Tl:{if(f)switch(f){case"BigInt":return o([f,u.toString()],u);case"Boolean":case"Number":case"String":return o([f,u.valueOf()],u)}if(t&&"toJSON"in u)return a(u.toJSON());const m=[],E=o([c,m],u);for(const b of xP(u))(e||!bl(pa(u[b])))&&m.push([a(b),a(u[b])]);return E}case Yd:return o([c,u.toISOString()],u);case Wd:{const{source:m,flags:E}=u;return o([c,{source:m,flags:E}],u)}case Gd:{const m=[],E=o([c,m],u);for(const[b,T]of u)(e||!(bl(pa(b))||bl(pa(T))))&&m.push([a(b),a(T)]);return E}case Kd:{const m=[],E=o([c,m],u);for(const b of u)(e||!bl(pa(b)))&&m.push(a(b));return E}}const{message:h}=u;return o([c,{name:f,message:h}],u)};return a},yy=(e,{json:t,lossy:n}={})=>{const r=[];return SP(!(t||n),!!t,new Map,r)(e),r},Xs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ey(yy(e,t)):structuredClone(e):(e,t)=>Ey(yy(e,t));function wP(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function CP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wP,r=e.options.footnoteBackLabel||CP,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const m=e.all(h),E=String(h.identifier).toUpperCase(),b=Gs(E.toLowerCase());let T=0;const _=[],S=e.footnoteCounts.get(E);for(;S!==void 0&&++T<=S;){_.length>0&&_.push({type:"text",value:" "});let F=typeof n=="string"?n:n(f,T);typeof F=="string"&&(F={type:"text",value:F}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(T>1?"-"+T:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,T),className:["data-footnote-backref"]},children:Array.isArray(F)?F:[F]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const F=C.children[C.children.length-1];F&&F.type==="text"?F.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(..._)}else m.push(..._);const I={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!0)};e.patch(h,I),c.push(I)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:Te(U({},Xs(u)),{id:"footnote-label"}),children:[{type:"text",value:o}]},{type:"text",value:`
|
|
22
22
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
@@ -40,4 +40,4 @@ Error generating stack: `+y.message+`
|
|
|
40
40
|
`))+1))}const u="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(u+" ");let h=n.containerPhrasing(e,U({before:"# ",after:`
|
|
41
41
|
`},a.current()));return/^[\t ]/.test(h)&&(h=ka(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),f(),c(),h}XT.peek=MD;function XT(e){return e.value||""}function MD(){return"<"}JT.peek=FD;function JT(e,t,n,r){const o=Nh(n),a=o==='"'?"Quote":"Apostrophe",u=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let h=f.move("![");return h+=f.move(n.safe(e.alt,U({before:h,after:"]"},f.current()))),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,U({before:h,after:">"},f.current()))),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,U({before:h,after:e.title?" ":")"},f.current())))),c(),e.title&&(c=n.enter(`title${a}`),h+=f.move(" "+o),h+=f.move(n.safe(e.title,U({before:h,after:o},f.current()))),h+=f.move(o),c()),h+=f.move(")"),u(),h}function FD(){return"!"}ZT.peek=BD;function ZT(e,t,n,r){const o=e.referenceType,a=n.enter("imageReference");let u=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const h=n.safe(e.alt,U({before:f,after:"]"},c.current()));f+=c.move(h+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const E=n.safe(n.associationId(e),U({before:f,after:"]"},c.current()));return u(),n.stack=m,a(),o==="full"||!h||h!==E?f+=c.move(E+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function BD(){return"!"}eb.peek=UD;function eb(e,t,n){let r=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const u=n.unsafe[a],c=n.compilePattern(u);let f;if(u.atBreak)for(;f=c.exec(r);){let h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return o+r+o}function UD(){return"`"}function tb(e,t){const n=Ud(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nb.peek=HD;function nb(e,t,n,r){const o=Nh(n),a=o==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let c,f;if(tb(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let E=u.move("<");return E+=u.move(n.containerPhrasing(e,U({before:E,after:">"},u.current()))),E+=u.move(">"),c(),n.stack=m,E}c=n.enter("link"),f=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,U({before:h,after:"]("},u.current()))),h+=u.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,U({before:h,after:">"},u.current()))),h+=u.move(">")):(f=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,U({before:h,after:e.title?" ":")"},u.current())))),f(),e.title&&(f=n.enter(`title${a}`),h+=u.move(" "+o),h+=u.move(n.safe(e.title,U({before:h,after:o},u.current()))),h+=u.move(o),f()),h+=u.move(")"),c(),h}function HD(e,t,n){return tb(e,n)?"<":"["}rb.peek=zD;function rb(e,t,n,r){const o=e.referenceType,a=n.enter("linkReference");let u=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const h=n.containerPhrasing(e,U({before:f,after:"]"},c.current()));f+=c.move(h+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const E=n.safe(n.associationId(e),U({before:f,after:"]"},c.current()));return u(),n.stack=m,a(),o==="full"||!h||h!==E?f+=c.move(E+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function zD(){return"["}function Oh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function jD(e){const t=Oh(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $D(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ib(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function VD(e,t,n,r){const o=n.enter("list"),a=n.bulletCurrent;let u=e.ordered?$D(n):Oh(n);const c=e.ordered?u==="."?")":".":jD(n);let f=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),ib(n)===u&&m){let E=-1;for(;++E<e.children.length;){const b=e.children[E];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(u=c),n.bulletCurrent=u;const h=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=a,o(),h}function qD(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function YD(e,t,n,r){const o=qD(n);let a=n.bulletCurrent||Oh(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let u=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(u-a.length)),c.shift(u);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),m);return f(),h;function m(E,b,T){return b?(T?"":" ".repeat(u))+E:(T?a:a+" ".repeat(u-a.length))+E}}function WD(e,t,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),u=n.containerPhrasing(e,r);return a(),o(),u}const GD=_l(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KD(e,t,n,r){return(e.children.some(function(u){return GD(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function QD(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sb.peek=XD;function sb(e,t,n,r){const o=QD(n),a=n.enter("strong"),u=n.createTracker(r),c=u.move(o+o);let f=u.move(n.containerPhrasing(e,U({after:o,before:c},u.current())));const h=f.charCodeAt(0),m=Dl(r.before.charCodeAt(r.before.length-1),h,o);m.inside&&(f=ka(h)+f.slice(1));const E=f.charCodeAt(f.length-1),b=Dl(r.after.charCodeAt(0),E,o);b.inside&&(f=f.slice(0,-1)+ka(E));const T=u.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+f+T}function XD(e,t,n){return n.options.strong||"*"}function JD(e,t,n,r){return n.safe(e.value,r)}function ZD(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function e5(e,t,n){const r=(ib(n)+(n.options.ruleSpaces?" ":"")).repeat(ZD(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ob={blockquote:SD,break:KT,code:ND,definition:ID,emphasis:QT,hardBreak:KT,heading:DD,html:XT,image:JT,imageReference:ZT,inlineCode:eb,link:nb,linkReference:rb,list:VD,listItem:YD,paragraph:WD,root:KD,strong:sb,text:JD,thematicBreak:e5};function t5(){return{enter:{table:n5,tableData:ab,tableHeader:ab,tableRow:i5},exit:{codeText:s5,table:r5,tableData:Ih,tableHeader:Ih,tableRow:Ih}}}function n5(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function r5(e){this.exit(e),this.data.inTable=void 0}function i5(e){this.enter({type:"tableRow",children:[]},e)}function Ih(e){this.exit(e)}function ab(e){this.enter({type:"tableCell",children:[]},e)}function s5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,o5));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function o5(e,t){return t==="|"?t:e}function a5(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
42
42
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:f,tableRow:c}};function u(T,_,S,C){return h(m(T,S,C),T.align)}function c(T,_,S,C){const I=E(T,S,C),F=h([I]);return F.slice(0,F.indexOf(`
|
|
43
|
-
`))}function f(T,_,S,C){const I=S.enter("tableCell"),F=S.enter("phrasing"),D=S.containerPhrasing(T,Te(U({},C),{before:a,after:a}));return F(),I(),D}function h(T,_){return _D(T,{align:_,alignDelimiters:r,padding:n,stringLength:o})}function m(T,_,S){const C=T.children;let I=-1;const F=[],D=_.enter("table");for(;++I<C.length;)F[I]=E(C[I],_,S);return D(),F}function E(T,_,S){const C=T.children;let I=-1;const F=[],D=_.enter("tableRow");for(;++I<C.length;)F[I]=f(C[I],T,_,S);return D(),F}function b(T,_,S){let C=ob.inlineCode(T,_,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function u5(){return{exit:{taskListCheckValueChecked:ub,taskListCheckValueUnchecked:ub,paragraph:c5}}}function l5(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:f5}}}function ub(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function c5(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,u;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){u=c;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function f5(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(u);let f=ob.listItem(e,t,n,U(U({},r),c.current()));return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(m){return m+u}}function d5(){return[V4(),fD(),mD(),t5(),u5()]}function h5(e){return{extensions:[q4(),dD(e),gD(),a5(e),l5()]}}const p5={tokenize:b5,partial:!0},lb={tokenize:_5,partial:!0},cb={tokenize:x5,partial:!0},fb={tokenize:S5,partial:!0},m5={tokenize:w5,partial:!0},db={name:"wwwAutolink",tokenize:y5,previous:pb},hb={name:"protocolAutolink",tokenize:T5,previous:mb},Jr={name:"emailAutolink",tokenize:E5,previous:gb},Lr={};function g5(){return{text:Lr}}let ns=48;for(;ns<123;)Lr[ns]=Jr,ns++,ns===58?ns=65:ns===91&&(ns=97);Lr[43]=Jr,Lr[45]=Jr,Lr[46]=Jr,Lr[95]=Jr,Lr[72]=[Jr,hb],Lr[104]=[Jr,hb],Lr[87]=[Jr,db],Lr[119]=[Jr,db];function E5(e,t,n){const r=this;let o,a;return u;function u(E){return!Ph(E)||!gb.call(r,r.previous)||Rh(r.events)?n(E):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(E))}function c(E){return Ph(E)?(e.consume(E),c):E===64?(e.consume(E),f):n(E)}function f(E){return E===46?e.check(m5,m,h)(E):E===45||E===95||rn(E)?(a=!0,e.consume(E),f):m(E)}function h(E){return e.consume(E),o=!0,f}function m(E){return a&&o&&dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(E)):n(E)}}function y5(e,t,n){const r=this;return o;function o(u){return u!==87&&u!==119||!pb.call(r,r.previous)||Rh(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(p5,e.attempt(lb,e.attempt(cb,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function T5(e,t,n){const r=this;let o="",a=!1;return u;function u(E){return(E===72||E===104)&&mb.call(r,r.previous)&&!Rh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(E),e.consume(E),c):n(E)}function c(E){if(dn(E)&&o.length<5)return o+=String.fromCodePoint(E),e.consume(E),c;if(E===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(E),f}return n(E)}function f(E){return E===47?(e.consume(E),a?h:(a=!0,f)):n(E)}function h(E){return E===null||hl(E)||lt(E)||Xi(E)||pl(E)?n(E):e.attempt(lb,e.attempt(cb,m),n)(E)}function m(E){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(E)}}function b5(e,t,n){let r=0;return o;function o(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),o):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function _5(e,t,n){let r,o,a;return u;function u(h){return h===46||h===95?e.check(fb,f,c)(h):h===null||lt(h)||Xi(h)||h!==45&&pl(h)?f(h):(a=!0,e.consume(h),u)}function c(h){return h===95?r=!0:(o=r,r=void 0),e.consume(h),u}function f(h){return o||r||!a?n(h):t(h)}}function x5(e,t){let n=0,r=0;return o;function o(u){return u===40?(n++,e.consume(u),o):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(fb,t,a)(u):u===null||lt(u)||Xi(u)?t(u):(e.consume(u),o)}function a(u){return u===41&&r++,e.consume(u),o}}function S5(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||lt(c)||Xi(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||lt(c)||Xi(c)?t(c):r(c)}function a(c){return dn(c)?u(c):n(c)}function u(c){return c===59?(e.consume(c),r):dn(c)?(e.consume(c),u):n(c)}}function w5(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return rn(a)?n(a):t(a)}}function pb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function mb(e){return!dn(e)}function gb(e){return!(e===47||Ph(e))}function Ph(e){return e===43||e===45||e===46||e===95||rn(e)}function Rh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C5={tokenize:R5,partial:!0};function A5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O5,continuation:{tokenize:I5},exit:P5}},text:{91:{name:"gfmFootnoteCall",tokenize:N5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:v5,resolveTo:k5}}}}function v5(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;o--;){const f=r.events[o][1];if(f.type==="labelImage"){u=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!u||!u._balanced)return n(f);const h=fr(r.sliceSerialize({start:u.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function k5(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function N5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return c;function c(E){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(E),e.exit("gfmFootnoteCallLabelMarker"),f}function f(E){return E!==94?n(E):(e.enter("gfmFootnoteCallMarker"),e.consume(E),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(E){if(a>999||E===93&&!u||E===null||E===91||lt(E))return n(E);if(E===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(fr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(E),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(E)}return lt(E)||(u=!0),a++,e.consume(E),E===92?m:h}function m(E){return E===91||E===92||E===93?(e.consume(E),a++,h):h(E)}}function O5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,c;return f;function f(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(_)}function m(_){if(u>999||_===93&&!c||_===null||_===91||lt(_))return n(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=fr(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return lt(_)||(c=!0),u++,e.consume(_),_===92?E:m}function E(_){return _===91||_===92||_===93?(e.consume(_),u++,m):m(_)}function b(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),o.includes(a)||o.push(a),Xe(e,T,"gfmFootnoteDefinitionWhitespace")):n(_)}function T(_){return t(_)}}function I5(e,t,n){return e.check(ca,t,e.attempt(C5,t,n))}function P5(e){e.exit("gfmFootnoteDefinition")}function R5(e,t,n){const r=this;return Xe(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function L5(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(u,c){let f=-1;for(;++f<u.length;)if(u[f][0]==="enter"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._close){let h=f;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[f][1].end.offset-u[f][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[f][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[f][1].end)},E={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[f][1].start)},b=[["enter",m,c],["enter",u[h][1],c],["exit",u[h][1],c],["enter",E,c]],T=c.parser.constructs.insideSpan.null;T&&Ln(b,b.length,0,ml(T,u.slice(h+1,f),c)),Ln(b,b.length,0,[["exit",E,c],["enter",u[f][1],c],["exit",u[f][1],c],["exit",m,c]]),Ln(u,h-1,f-h+3,b),f=h+b.length-2;break}}for(f=-1;++f<u.length;)u[f][1].type==="strikethroughSequenceTemporary"&&(u[f][1].type="data");return u}function a(u,c,f){const h=this.previous,m=this.events;let E=0;return b;function b(_){return h===126&&m[m.length-1][1].type!=="characterEscape"?f(_):(u.enter("strikethroughSequenceTemporary"),T(_))}function T(_){const S=Ks(h);if(_===126)return E>1?f(_):(u.consume(_),E++,T);if(E<2&&!n)return f(_);const C=u.exit("strikethroughSequenceTemporary"),I=Ks(_);return C._open=!I||I===2&&!!S,C._close=!S||S===2&&!!I,c(_)}}}class D5{constructor(){this.map=[]}add(t,n,r){M5(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function M5(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function F5(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function B5(){return{flow:{null:{name:"table",tokenize:U5,resolveAll:H5}}}}function U5(e,t,n){const r=this;let o=0,a=0,u;return c;function c(H){let le=r.events.length-1;for(;le>-1;){const fe=r.events[le][1].type;if(fe==="lineEnding"||fe==="linePrefix")le--;else break}const de=le>-1?r.events[le][1].type:null,ce=de==="tableHead"||de==="tableRow"?B:f;return ce===B&&r.parser.lazy[r.now().line]?n(H):ce(H)}function f(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(u=!0,a+=1),m(H)}function m(H){return H===null?n(H):Re(H)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),T):n(H):Ge(H)?Xe(e,m,"whitespace")(H):(a+=1,u&&(u=!1,o+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,m):(e.enter("data"),E(H)))}function E(H){return H===null||H===124||lt(H)?(e.exit("data"),m(H)):(e.consume(H),H===92?b:E)}function b(H){return H===92||H===124?(e.consume(H),E):E(H)}function T(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,Ge(H)?Xe(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):_(H))}function _(H){return H===45||H===58?C(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),S):W(H)}function S(H){return Ge(H)?Xe(e,C,"whitespace")(H):C(H)}function C(H){return H===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),I):H===45?(a+=1,I(H)):H===null||Re(H)?G(H):W(H)}function I(H){return H===45?(e.enter("tableDelimiterFiller"),F(H)):W(H)}function F(H){return H===45?(e.consume(H),F):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(H))}function D(H){return Ge(H)?Xe(e,G,"whitespace")(H):G(H)}function G(H){return H===124?_(H):H===null||Re(H)?!u||o!==a?W(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):W(H)}function W(H){return n(H)}function B(H){return e.enter("tableRow"),te(H)}function te(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),te):H===null||Re(H)?(e.exit("tableRow"),t(H)):Ge(H)?Xe(e,te,"whitespace")(H):(e.enter("data"),be(H))}function be(H){return H===null||H===124||lt(H)?(e.exit("data"),te(H)):(e.consume(H),H===92?he:be)}function he(H){return H===92||H===124?(e.consume(H),be):be(H)}}function H5(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],u=[0,0,0,0],c=!1,f=0,h,m,E;const b=new D5;for(;++n<e.length;){const T=e[n],_=T[1];T[0]==="enter"?_.type==="tableHead"?(c=!1,f!==0&&(Eb(b,t,f,h,m),m=void 0,f=0),h={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",h,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(r=!0,E=void 0,a=[0,0,0,0],u=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",m,t]])),o=_.type==="tableDelimiterRow"?2:m?3:1):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],E=Ml(b,t,a,o,void 0,E),a=[0,0,0,0]),u[2]=n)):_.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],E=Ml(b,t,a,o,void 0,E)),a=u,u=[a[1],n,0,0])):_.type==="tableHead"?(c=!0,f=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(f=n,a[1]!==0?(u[0]=u[1],E=Ml(b,t,a,o,n,E)):u[1]!==0&&(E=Ml(b,t,u,o,n,E)),o=0):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=n)}for(f!==0&&Eb(b,t,f,h,m),b.consume(t.events),n=-1;++n<t.events.length;){const T=t.events[n];T[0]==="enter"&&T[1].type==="table"&&(T[1]._align=F5(t.events,n))}return e}function Ml(e,t,n,r,o,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},so(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=so(t.events,n[1]);if(a={type:u,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=so(t.events,n[2]),m=so(t.events,n[3]),E={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",E,t]]),r!==2){const b=t.events[n[2]],T=t.events[n[3]];if(b[1].end=Object.assign({},T[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,S=n[3]-n[2]-1;e.add(_,S,[])}}e.add(n[3]+1,0,[["exit",E,t]])}return o!==void 0&&(a.end=Object.assign({},so(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function Eb(e,t,n,r,o){const a=[],u=so(t.events,n);o&&(o.end=Object.assign({},u),a.push(["exit",o,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function so(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const z5={name:"tasklistCheck",tokenize:$5};function j5(){return{text:{91:z5}}}function $5(e,t,n){const r=this;return o;function o(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return lt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),u):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),u):n(f)}function u(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Re(f)?t(f):Ge(f)?e.check({tokenize:V5},t,n)(f):n(f)}}function V5(e,t,n){return Xe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function q5(e){return zE([g5(),A5(),L5(e),B5(),j5()])}const Y5={};function W5(e){const t=this,n=e||Y5,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(q5(n)),a.push(d5()),u.push(h5(n))}const Fl=()=>N.jsx("span",{className:`${Z}-blinking-cursor`,children:N.jsx("svg",{height:"1rem",width:"1rem",xmlns:"http://www.w3.org/2000/svg",children:N.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),yb=({globalClassName:e,message:t})=>{const{isLoading:n,isResponseLoading:r}=qr(),o=n&&r((t==null?void 0:t.eventSourceId)||"")&&t.name==="partial_inquiry";return N.jsx(dR,{remarkPlugins:[W5],rehypePlugins:[B4],components:{h1:({children:a})=>N.jsx("h1",{className:oe(e,`${Z}-header h1`),children:a}),h2:({children:a})=>N.jsx("h2",{className:oe(e,`${Z}-header h2`),children:a}),h3:({children:a})=>N.jsx("h3",{className:oe(e,`${Z}-header h3`),children:a}),ul:({children:a})=>N.jsx("ul",{className:oe(e,`${Z}-ul`),children:a}),ol:({children:a})=>N.jsx("ol",{className:oe(e,`${Z}-ol`),children:a}),li:({children:a})=>N.jsx("li",{className:oe(e,`${Z}-li`),children:a}),a:({href:a,children:u})=>N.jsx("a",Te(U({className:oe(e,`${Z}-link`)},a?{href:a,target:"_blank"}:{}),{rel:"noopener noreferrer",children:u})),table:({children:a})=>N.jsx("table",{className:oe(e,`${Z}-table`),children:a}),thead:({children:a})=>N.jsx("thead",{className:oe(e,`${Z}-thead`),children:a}),tbody:({children:a})=>N.jsx("tbody",{className:oe(e,`${Z}-tbody`),children:a}),tr:({children:a})=>N.jsx("tr",{className:oe(e,`${Z}-tr`),children:a}),th:({children:a})=>N.jsx("th",{className:oe(e,`${Z}-th`),children:a}),td:({children:a})=>N.jsx("td",{className:oe(e,`${Z}-td`),children:a}),span:({className:a,children:u})=>a===`${Z}-blinking-cursor`?N.jsx(Fl,{}):N.jsx("span",{children:u})},children:t.message+(o?`<span className='${Z}-blinking-cursor'></span>`:"")})},G5=({globalClassName:e,message:t})=>{const[n,r]=q.useState(!1),o=t.tool_name||t.toolName,a=!!t.thought,u=!!o,c=()=>{r(f=>!f)};return N.jsxs("div",{children:[N.jsxs("div",{className:oe(e,`${Z}-progress-message`,"standalone"),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,"progress-icon","standalone"),children:N.jsx(Ug,{})}),N.jsx("p",{className:oe(e,`${Z}-progress-text`,"standalone"),children:t.message})]}),(a||u)&&N.jsxs(N.Fragment,{children:[N.jsx($f,{className:oe(e,`${Z}-thought-context-button`),onClick:c,children:n?N.jsxs(N.Fragment,{children:["Hide ",N.jsx(vA,{})]}):N.jsxs(N.Fragment,{children:["Context ",N.jsx(kA,{})]})}),n&&N.jsx("div",{className:oe(e,`${Z}-thought-container`),children:a&&N.jsx("p",{className:oe(e,`${Z}-progress-thought`),children:t.thought})})]})]})},K5=({globalClassName:e,message:t,isWidgetStandalone:n})=>n?N.jsx(G5,{globalClassName:e,message:t}):N.jsxs("div",{className:oe(e,`${Z}-progress-message`,"embedded"),title:t.message,children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,"progress-icon","embedded"),children:N.jsx(Ug,{})}),N.jsx("i",{className:oe(e,`${Z}-progress-text`,"embedded"),children:t.message})]}),Q5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{var o,a;const r=((o=t.searchParams)==null?void 0:o.query)||((a=t.browseParams)==null?void 0:a.categoryId);return N.jsxs("div",{className:oe(e,`${Z}-refined-event`,{embedded:!n,standalone:n}),children:[N.jsxs("div",{className:oe(e,`${Z}-refined-event-query`,{embedded:!n,standalone:n}),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,`${Z}-refined-event-icon`,{embedded:!n,standalone:n}),children:N.jsx($u,{})}),N.jsx("p",{className:oe(e,`${Z}-text`,"bold"),children:r})]}),N.jsx(yb,{message:t})]})},Tb=e=>{var f,h;const{configModule:t}=Tn(),n=((f=e.request)==null?void 0:f.searchParams)||((h=e.request)==null?void 0:h.browseParams),r=(t==null?void 0:t.getProductHiddenFields())||[],{facetFilters:o={}}=n||{facetFilters:{}},a=Object.fromEntries(Object.entries(o).filter(([m])=>!r.includes(m))),u=Object.keys(a),c=Object.values(a).reduce((m,E)=>m+E.length,0);return{facetFiltersList:u,filterCount:c}},Bl=({isWidgetStandalone:e,globalClassName:t,filterCount:n})=>N.jsx("span",{className:oe(t,`${Z}-facet-pill`,{standalone:e,embedded:!e}),children:`${n} filters`}),bb=({globalClassName:e,message:t,facetFiltersList:n})=>{var a,u;if(!n.length)return null;const r=((a=t.request)==null?void 0:a.searchParams)||((u=t.request)==null?void 0:u.browseParams),o=(r==null?void 0:r.facetFilters)||{};return n.map(c=>{var h;const f=((h=o[c])==null?void 0:h.join(", "))||"";return N.jsxs("div",{className:oe(e,`${Z}-facets`),children:[N.jsx("p",{className:oe(e,`${Z}-facet-category`),children:c}),N.jsx("p",{className:oe(e,`${Z}-facet-values`),children:f})]},c)})},X5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{var a,u;const{facetFiltersList:r,filterCount:o}=Tb(t);return n?N.jsxs("div",{children:[N.jsxs("div",{className:oe(e,`${Z}-user-message standalone`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-message-icon standalone`),children:N.jsx(Hg,{})}),N.jsx("p",{className:oe(e,`${Z}-user-message-text`),children:(a=t.request)==null?void 0:a.userPrompt}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!0,globalClassName:e,filterCount:o})]}),N.jsx(bb,{globalClassName:e,facetFiltersList:r,message:t})]}):N.jsxs("div",{className:oe(e,`${Z}-user-message embedded`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-message-icon embedded`),children:N.jsx(Hg,{})}),N.jsx("p",{children:(u=t.request)==null?void 0:u.userPrompt}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!1,filterCount:o})]})},J5=({globalClassName:e,actionLabel:t,query:n,queryLabel:r,message:o,facetFiltersList:a,filterCount:u})=>N.jsxs("div",{className:oe(e,`${Z}-user-search standalone`),children:[N.jsxs("div",{className:oe(e,`${Z}-user-search-query`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-search-icon standalone`),children:N.jsx($u,{})}),N.jsx("p",{className:oe(e,`${Z}-text bold`),children:`${t}: ${r||n}`}),a.length>0&&N.jsx(Bl,{isWidgetStandalone:!0,globalClassName:e,filterCount:u})]}),N.jsx(bb,{globalClassName:e,facetFiltersList:a,message:o})]}),Z5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{const{facetFiltersList:r,filterCount:o}=Tb(t),{actionLabel:a,query:u,queryLabel:c}=q.useMemo(()=>{var h,m,E,b,T,_;switch(t.name){case"copilot_search":return{actionLabel:"Your search",query:(h=t.request)==null?void 0:h.searchParams.query,queryLabel:""};case"copilot_browse":return{actionLabel:"Browsing category",query:(E=(m=t.request)==null?void 0:m.browseParams)==null?void 0:E.categoryId,queryLabel:((b=t.request)==null?void 0:b.label)||""};case"product_view":return{actionLabel:"Viewing product",query:(T=t.request)==null?void 0:T.productId,queryLabel:((_=t.request)==null?void 0:_.label)||""};default:return{actionLabel:"",query:"",queryLabel:""}}},[t]);return!t.isUserAction||!u?null:n?N.jsx(J5,{globalClassName:e,message:t,actionLabel:a,query:u,queryLabel:c,facetFiltersList:r,filterCount:o}):N.jsxs("div",{className:oe(e,`${Z}-user-search embedded`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-search-icon embedded`),children:N.jsx($u,{})}),N.jsx("p",{children:c||u}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!1,filterCount:o})]})},_b=["copilot_search","copilot_browse","product_view"],xb=({message:e,globalClassName:t,resetConversationMessage:n,isWidgetStandalone:r,handleSuggestionClick:o})=>{var u;if(!e)return null;let a=e.name;if(_b.includes(a)&&(e.isInitial||e.isUserAction)&&(a="faceted_navigation"),_b.includes(a)&&!((u=e.request)!=null&&u.userPrompt))return null;switch(a){case"copilot_search":case"copilot_browse":case"product_view":return N.jsx(X5,{globalClassName:t,isWidgetStandalone:r,message:e});case"faceted_navigation":return N.jsx(Z5,{globalClassName:t,message:e,isWidgetStandalone:r});case"refined_search":case"refined_browse":return N.jsx(Q5,{globalClassName:t,message:e,isWidgetStandalone:r});case"follow_up":return N.jsx(p3,{globalClassName:t,isWidgetStandalone:r,message:e,handleSuggestionClick:o});case"inquiry":case"partial_inquiry":return N.jsx(yb,{globalClassName:t,message:e});case"error":return N.jsx(f3,{message:e,isWidgetStandalone:r});case"display_products":return N.jsx(c3,{message:e,isWidgetStandalone:r});case"progress":return N.jsx(K5,{globalClassName:t,isWidgetStandalone:r,message:e});case"conversation_reset":return N.jsxs(N.Fragment,{children:[N.jsx("p",{className:oe(t,`${Z}-reset-message`),children:"This conversation has been reset."}),N.jsx("p",{className:oe(t,`${Z}-start-search-message`),children:n})]});default:return null}},Lh=({isWidgetStandalone:e,messages:t,handleSuggestionClick:n})=>{const{globalClassName:r,resetConversationMessage:o}=Tn();return t.map(a=>a.messages&&a.type==="group"?N.jsx("div",{className:oe(r,`${Z}-message-group`,e?"standalone":"embedded"),children:a.messages.length>0&&a.messages.map(u=>N.jsx("div",{className:`${Z}-message-group-child`,children:N.jsx(xb,{id:u.id,globalClassName:r,isWidgetStandalone:e,message:u,resetConversationMessage:o,handleSuggestionClick:n})},u.id))},`group-${a.eventSourceId}`):a.type==="individual"&&a.message?N.jsx("div",{className:oe(r,`${Z}-message`,e?"standalone":"embedded",{error:a.message.name.includes("error")}),children:N.jsx(xb,{id:a.message.id,globalClassName:r,isWidgetStandalone:e,message:a.message,resetConversationMessage:o,handleSuggestionClick:n})},a.message.id):null)},Sb=()=>{const{globalClassName:e,themeVariables:t}=Tn(),{status:n}=Wo(),{copilot:r,messages:o,groupedMessages:a,isLoading:u,handleUserInput:c,handleSuggestion:f}=qr(),{isOpen:h}=n||{},m=q.useRef(null);return q.useEffect(()=>{m.current&&m.current.scrollIntoView({behavior:"smooth",block:"end"})},[o]),r?!h||a.length===0?null:N.jsxs("div",{className:oe(e,`${Z}-container`,`${Z}-embedded-chat`),style:t,children:[N.jsxs("div",{className:oe(e,`${Z}-message-container`,"embedded"),children:[N.jsx(Lh,{isWidgetStandalone:!1,messages:a,handleSuggestionClick:f}),u&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:m})]}),N.jsx(Vf,{componentType:"chat",className:"embedded-chat",isLoading:u,onSubmit:c}),N.jsx("div",{className:oe(`${Z}-embedded-chat-menu`),children:N.jsx(a3,{componentType:"chat",children:N.jsx(cE,{componentType:"chat"})})})]}):N.jsx("div",{children:"Loading Copilot..."})},[e8,t8]=Ls({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),n8=e=>h1()(e,["lazyMount","unmountOnExit"]),[r8,Na]=Ls({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),wb=q.forwardRef((e,t)=>{const n=Na(),r=t8(),o=cd(Te(U({},r),{present:n.open})),a=ur(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:N.jsx(fi.div,Te(U({},a),{ref:Zu(o.ref,t)}))});wb.displayName="DialogBackdrop";const Dh=q.forwardRef((e,t)=>{const n=Na(),r=Xo(),o=ur(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:N.jsx(fi.div,Te(U({},o),{ref:Zu(r.ref,t)}))});Dh.displayName="DialogContent";const Mh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getDescriptionProps(),e);return N.jsx(fi.div,Te(U({},r),{ref:t}))});Mh.displayName="DialogDescription";const Fh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getPositionerProps(),e);return Xo().unmounted?null:N.jsx(fi.div,Te(U({},r),{ref:t}))});Fh.displayName="DialogPositioner";var i8=Ds("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),rs=i8.build(),Cb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Bh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},vb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},Uh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},Hh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},kb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Ul=e=>e.getById(Bh(e)),s8=e=>e.getById(Cb(e)),o8=e=>e.getById(Ab(e)),a8=e=>e.getById(vb(e)),u8=e=>e.getById(Uh(e)),l8=e=>e.getById(Hh(e)),c8=e=>e.getById(kb(e));function f8(e,t){const{state:n,send:r,context:o,prop:a,scope:u}=e,c=a("aria-label"),f=n.matches("open");return{open:f,setOpen(h){n.matches("open")!==h&&r({type:h?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(Te(U({},rs.trigger.attrs),{dir:a("dir"),id:vb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":f,"data-state":f?"open":"closed","aria-controls":Bh(u),onClick(h){h.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(Te(U({},rs.backdrop.attrs),{dir:a("dir"),hidden:!f,id:Ab(u),"data-state":f?"open":"closed"}))},getPositionerProps(){return t.element(Te(U({},rs.positioner.attrs),{dir:a("dir"),id:Cb(u),style:{pointerEvents:f?void 0:"none"}}))},getContentProps(){const h=o.get("rendered");return t.element(Te(U({},rs.content.attrs),{dir:a("dir"),role:a("role"),hidden:!f,id:Bh(u),tabIndex:-1,"data-state":f?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!h.title?void 0:Uh(u),"aria-describedby":h.description?Hh(u):void 0}))},getTitleProps(){return t.element(Te(U({},rs.title.attrs),{dir:a("dir"),id:Uh(u)}))},getDescriptionProps(){return t.element(Te(U({},rs.description.attrs),{dir:a("dir"),id:Hh(u)}))},getCloseTriggerProps(){return t.button(Te(U({},rs.closeTrigger.attrs),{dir:a("dir"),id:kb(u),type:"button",onClick(h){h.defaultPrevented||(h.stopPropagation(),r({type:"CLOSE"}))}}))}}}var d8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>c8(t):void 0,o=typeof e.modal=="boolean"?e.modal:!0;return U({role:"dialog",modal:o,trapFocus:o,preventScroll:o,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return W1(()=>Ul(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[a8(e)],onInteractOutside(o){var a;(a=n("onInteractOutside"))==null||a(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(o){var a;(a=n("onEscapeKeyDown"))==null||a(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return J1(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?Q1(()=>Ul(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,a;return(a=(o=t("finalFocusEl"))==null?void 0:o())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?B1(()=>[Ul(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){bn(()=>{e.set("rendered",{title:!!u8(t),description:!!l8(t)})})},syncZIndex({scope:e}){bn(()=>{const t=Ul(e);if(!t)return;const n=Gu(t);[s8(e),o8(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex),o==null||o.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};od()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const h8=e=>{const t=q.useId(),{getRootNode:n}=vd(),{dir:r}=iE(),o=U({id:t,getRootNode:n,dir:r},e),a=ad(d8,o);return f8(a,l1)},Nb=e=>{const[t,c]=p1(e),f=c,{children:n}=f,r=en(f,["children"]),[o]=n8(t),a=h8(r),u=cd(ur({present:a.open},t));return N.jsx(r8,{value:a,children:N.jsx(e8,{value:o,children:N.jsx(c1,{value:u,children:n})})})},zh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getTitleProps(),e);return N.jsx(fi.h2,Te(U({},r),{ref:t}))});zh.displayName="DialogTitle";const Ob=e=>{var f;const{children:t,disabled:n}=e,[r,o]=q.useState((f=e.container)==null?void 0:f.current),a=q.useSyncExternalStore(m8,()=>!1,()=>!0),{getRootNode:u}=vd();if(q.useEffect(()=>{o(()=>{var h;return(h=e.container)==null?void 0:h.current})},[e.container]),a||n)return N.jsx(N.Fragment,{children:t});const c=r!=null?r:p8(u);return N.jsx(N.Fragment,{children:q.Children.map(t,h=>Xu.createPortal(h,c))})},p8=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return Wi(n)?n:Cr(t).body},m8=()=>()=>{},g8=()=>{const{globalClassName:e}=Tn(),{dialogPosition:t}=Wo(),n=t==="bottom-left",r=()=>{ng(n?"bottom-right":"bottom-left")},o=n?i3:r3,a=n?"Move right":"Move left";return N.jsx(Ns,{className:oe(e,`${Z}-left-right-toggle-button`,"dialog"),ariaLabel:a,onClick:r,icon:N.jsx(o,{})})},Ib=()=>{const{logoUrl:e,headerText:t,globalClassName:n,themeVariables:r}=Tn(),{mode:o,status:a,dialogPosition:u}=Wo(),{copilot:c,messages:f,groupedMessages:h,isLoading:m,handleUserInput:E,handleSuggestion:b}=qr(),T=q.useRef(null),{isOpen:_}=a||{},S=o==="standalone";q.useEffect(()=>{T.current&&T.current.scrollIntoView({behavior:"smooth",block:"end"})},[f]);const C=()=>{Uu(!1)};return!_||h.length===0?null:c?N.jsx(Nb,{lazyMount:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:_,children:N.jsx(Ob,{children:N.jsx(Fh,{className:oe(n,`${Z}-container`,`${Z}-dialog`,u),style:r,children:N.jsxs(Dh,{className:oe(n,`${Z}-dialog-content`,{standalone:S,embedded:!S}),children:[N.jsxs("div",{className:oe(n,`${Z}-dialog-header`,{standalone:S,embedded:!S}),children:[e&&N.jsx("img",{alt:"",role:"img",className:oe(n,`${Z}-dialog-logo`,{standalone:S,embedded:!S}),src:e}),N.jsx(zh,{className:oe(n,`${Z}-dialog-title`,{standalone:S,embedded:!S}),children:t}),N.jsxs("div",{className:oe(n,`${Z}-dialog-controls`),children:[N.jsx(cE,{componentType:"dialog",isIcon:!0}),N.jsx(g8,{}),N.jsx(lE,{componentType:"dialog"}),N.jsx(uE,{className:`dialog ${n}`,onClick:C})]})]}),N.jsxs(Mh,{className:oe(n,`${Z}-message-container`,{standalone:S,embedded:!S}),children:[N.jsx(Lh,{isWidgetStandalone:S,messages:h,handleSuggestionClick:b}),m&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:T})]}),N.jsx(Vf,{componentType:"dialog",isLoading:m,onSubmit:E})]})})})}):N.jsx("div",{children:"Loading Copilot..."})},Pb=()=>{const{logoUrl:e,headerText:t,globalClassName:n,themeVariables:r}=Tn(),{mode:o,status:a,isModalFullscreen:u,previousComponentType:c}=Wo(),{copilot:f,messages:h,groupedMessages:m,isLoading:E,handleUserInput:b,handleSuggestion:T}=qr(),_=q.useRef(null),{isOpen:S}=a||{},C=o==="standalone";q.useEffect(()=>{_.current&&_.current.scrollIntoView({behavior:"smooth",block:"end"})},[h]);const I=({open:W})=>{Uu(W)},F=()=>{tg(!u)},D=()=>{jf(c||"dialog")},G=()=>{Uu(!1)};return!S||m.length===0?null:f?N.jsx(Nb,{lazyMount:!0,open:S,onOpenChange:I,children:N.jsx(Ob,{children:N.jsxs("div",{className:oe(n,`${Z}-modal-container`),style:r,children:[N.jsx(wb,{className:oe(n,`${Z}-modal-backdrop`)}),N.jsx(Fh,{className:oe(n,`${Z}-container`,`${Z}-modal`,{fullscreen:u,standalone:C,embedded:!C}),children:N.jsxs(Dh,{className:oe(n,`${Z}-modal-content`,{standalone:C,embedded:!C}),children:[N.jsxs("div",{className:oe(n,`${Z}-modal-header`,{standalone:C,embedded:!C}),children:[e&&N.jsx("img",{alt:"",role:"img",className:oe(n,`${Z}-modal-logo`,{standalone:C,embedded:!C}),src:e}),N.jsx(zh,{className:oe(n,`${Z}-modal-title`,{standalone:C,embedded:!C}),children:t}),N.jsxs("div",{className:oe(n,`${Z}-modal-controls`),children:[N.jsx(Ns,{ariaLabel:"Toggle Fullscreen",className:oe(n,`${Z}-modal-fullscreen-button`),icon:u?N.jsx(NA,{}):N.jsx(OA,{}),onClick:F}),N.jsx(Ns,{ariaLabel:"Toggle Dialog",className:oe(n,`${Z}-modal-toggle-dialog-button`),onClick:D,icon:N.jsx(u3,{})}),N.jsx(lE,{componentType:"modal"}),N.jsx(uE,{className:`modal ${n}`,onClick:G})]})]}),N.jsxs(Mh,{className:oe(n,`${Z}-message-container`,{standalone:C,embedded:!C}),children:[N.jsx(Lh,{isWidgetStandalone:C,messages:m,handleSuggestionClick:T}),E&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingLeft:"1rem",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:_})]}),N.jsx(Vf,{componentType:"modal",isLoading:E,onSubmit:b})]})})]})})}):N.jsx("div",{children:"Loading Copilot..."})},E8=()=>{const e=Wo(),{status:{type:t}}=e||{status:{}};return t==="dialog"?N.jsx(Ib,{}):t==="modal"?N.jsx(Pb,{}):N.jsx(Sb,{})},jh=e=>N.jsx(Rg,Te(U({},e),{children:N.jsx(E8,{})}));var Hl={},Rb;function y8(){if(Rb)return Hl;Rb=1;var e=s1();return Hl.createRoot=e.createRoot,Hl.hydrateRoot=e.hydrateRoot,Hl}var Lb=y8();const T8=r=>{var o=r,{elementId:e,timeout:t=5e3}=o,n=en(o,["elementId","timeout"]);let a;const u=(f,h)=>{var m;for(const E of f)if(E.type==="childList"&&E.addedNodes.length)for(const b of E.addedNodes)b.nodeType===Node.ELEMENT_NODE&&b.id===e&&(vs(!0,"log","Target element found, rendering Copilot Widget"),h.disconnect(),clearTimeout(a),(m=Lb.createRoot(b))==null||m.render(N.jsx(jh,U({},n))))},c=new MutationObserver(u);return c.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{c.disconnect(),vs(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),c},b8=r=>{var o=r,{timeout:e,elementId:t}=o,n=en(o,["timeout","elementId"]);if(!n.apiKey&&!n.apiToken){vs(!0,"error","Copilot Widget requires either apiKey or apiToken");return}const a=document.getElementById(t);if(!a){vs(!0,"warn","Container element not found for id:",t),vs(!0,"warn","Beginning observation for element"),T8(U({elementId:t,timeout:e},n));return}Lb.createRoot(a).render(N.jsx(jh,U({},n)))},_8={search:rA,browse:WC,pdp:{setPdpContext:bg,updatePdpProductId:KC,updatePdpLink:QC},components:{toggleWidgetOpen:Uu,toggleModalFullscreen:tg,setWidgetType:jf,setWidgetDialogPosition:ng},session:XC},x8=()=>Object.freeze({search:Object.freeze(ht.state),browse:Object.freeze(ot.state),pdp:Object.freeze(or.state),isConnected:Ot.state.connected});Oe.CopilotDialog=Ib,Oe.CopilotEmbed=Sb,Oe.CopilotModal=Pb,Oe.CopilotWidget=jh,Oe.WidgetProvider=Rg,Oe.eventHandlers=_8,Oe.injectCopilotWidget=b8,Oe.state=x8,Oe.useCopilot=qr,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|
|
43
|
+
`))}function f(T,_,S,C){const I=S.enter("tableCell"),F=S.enter("phrasing"),D=S.containerPhrasing(T,Te(U({},C),{before:a,after:a}));return F(),I(),D}function h(T,_){return _D(T,{align:_,alignDelimiters:r,padding:n,stringLength:o})}function m(T,_,S){const C=T.children;let I=-1;const F=[],D=_.enter("table");for(;++I<C.length;)F[I]=E(C[I],_,S);return D(),F}function E(T,_,S){const C=T.children;let I=-1;const F=[],D=_.enter("tableRow");for(;++I<C.length;)F[I]=f(C[I],T,_,S);return D(),F}function b(T,_,S){let C=ob.inlineCode(T,_,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function u5(){return{exit:{taskListCheckValueChecked:ub,taskListCheckValueUnchecked:ub,paragraph:c5}}}function l5(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:f5}}}function ub(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function c5(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,u;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){u=c;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function f5(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(u);let f=ob.listItem(e,t,n,U(U({},r),c.current()));return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(m){return m+u}}function d5(){return[V4(),fD(),mD(),t5(),u5()]}function h5(e){return{extensions:[q4(),dD(e),gD(),a5(e),l5()]}}const p5={tokenize:b5,partial:!0},lb={tokenize:_5,partial:!0},cb={tokenize:x5,partial:!0},fb={tokenize:S5,partial:!0},m5={tokenize:w5,partial:!0},db={name:"wwwAutolink",tokenize:y5,previous:pb},hb={name:"protocolAutolink",tokenize:T5,previous:mb},Jr={name:"emailAutolink",tokenize:E5,previous:gb},Lr={};function g5(){return{text:Lr}}let ns=48;for(;ns<123;)Lr[ns]=Jr,ns++,ns===58?ns=65:ns===91&&(ns=97);Lr[43]=Jr,Lr[45]=Jr,Lr[46]=Jr,Lr[95]=Jr,Lr[72]=[Jr,hb],Lr[104]=[Jr,hb],Lr[87]=[Jr,db],Lr[119]=[Jr,db];function E5(e,t,n){const r=this;let o,a;return u;function u(E){return!Ph(E)||!gb.call(r,r.previous)||Rh(r.events)?n(E):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(E))}function c(E){return Ph(E)?(e.consume(E),c):E===64?(e.consume(E),f):n(E)}function f(E){return E===46?e.check(m5,m,h)(E):E===45||E===95||rn(E)?(a=!0,e.consume(E),f):m(E)}function h(E){return e.consume(E),o=!0,f}function m(E){return a&&o&&dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(E)):n(E)}}function y5(e,t,n){const r=this;return o;function o(u){return u!==87&&u!==119||!pb.call(r,r.previous)||Rh(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(p5,e.attempt(lb,e.attempt(cb,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function T5(e,t,n){const r=this;let o="",a=!1;return u;function u(E){return(E===72||E===104)&&mb.call(r,r.previous)&&!Rh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(E),e.consume(E),c):n(E)}function c(E){if(dn(E)&&o.length<5)return o+=String.fromCodePoint(E),e.consume(E),c;if(E===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(E),f}return n(E)}function f(E){return E===47?(e.consume(E),a?h:(a=!0,f)):n(E)}function h(E){return E===null||hl(E)||lt(E)||Xi(E)||pl(E)?n(E):e.attempt(lb,e.attempt(cb,m),n)(E)}function m(E){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(E)}}function b5(e,t,n){let r=0;return o;function o(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),o):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function _5(e,t,n){let r,o,a;return u;function u(h){return h===46||h===95?e.check(fb,f,c)(h):h===null||lt(h)||Xi(h)||h!==45&&pl(h)?f(h):(a=!0,e.consume(h),u)}function c(h){return h===95?r=!0:(o=r,r=void 0),e.consume(h),u}function f(h){return o||r||!a?n(h):t(h)}}function x5(e,t){let n=0,r=0;return o;function o(u){return u===40?(n++,e.consume(u),o):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(fb,t,a)(u):u===null||lt(u)||Xi(u)?t(u):(e.consume(u),o)}function a(u){return u===41&&r++,e.consume(u),o}}function S5(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||lt(c)||Xi(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||lt(c)||Xi(c)?t(c):r(c)}function a(c){return dn(c)?u(c):n(c)}function u(c){return c===59?(e.consume(c),r):dn(c)?(e.consume(c),u):n(c)}}function w5(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return rn(a)?n(a):t(a)}}function pb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function mb(e){return!dn(e)}function gb(e){return!(e===47||Ph(e))}function Ph(e){return e===43||e===45||e===46||e===95||rn(e)}function Rh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C5={tokenize:R5,partial:!0};function A5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O5,continuation:{tokenize:I5},exit:P5}},text:{91:{name:"gfmFootnoteCall",tokenize:N5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:v5,resolveTo:k5}}}}function v5(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;o--;){const f=r.events[o][1];if(f.type==="labelImage"){u=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!u||!u._balanced)return n(f);const h=fr(r.sliceSerialize({start:u.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function k5(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function N5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return c;function c(E){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(E),e.exit("gfmFootnoteCallLabelMarker"),f}function f(E){return E!==94?n(E):(e.enter("gfmFootnoteCallMarker"),e.consume(E),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(E){if(a>999||E===93&&!u||E===null||E===91||lt(E))return n(E);if(E===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(fr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(E),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(E)}return lt(E)||(u=!0),a++,e.consume(E),E===92?m:h}function m(E){return E===91||E===92||E===93?(e.consume(E),a++,h):h(E)}}function O5(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,c;return f;function f(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(_)}function m(_){if(u>999||_===93&&!c||_===null||_===91||lt(_))return n(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return a=fr(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return lt(_)||(c=!0),u++,e.consume(_),_===92?E:m}function E(_){return _===91||_===92||_===93?(e.consume(_),u++,m):m(_)}function b(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),o.includes(a)||o.push(a),Xe(e,T,"gfmFootnoteDefinitionWhitespace")):n(_)}function T(_){return t(_)}}function I5(e,t,n){return e.check(ca,t,e.attempt(C5,t,n))}function P5(e){e.exit("gfmFootnoteDefinition")}function R5(e,t,n){const r=this;return Xe(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function L5(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(u,c){let f=-1;for(;++f<u.length;)if(u[f][0]==="enter"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._close){let h=f;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[f][1].end.offset-u[f][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[f][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[f][1].end)},E={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[f][1].start)},b=[["enter",m,c],["enter",u[h][1],c],["exit",u[h][1],c],["enter",E,c]],T=c.parser.constructs.insideSpan.null;T&&Ln(b,b.length,0,ml(T,u.slice(h+1,f),c)),Ln(b,b.length,0,[["exit",E,c],["enter",u[f][1],c],["exit",u[f][1],c],["exit",m,c]]),Ln(u,h-1,f-h+3,b),f=h+b.length-2;break}}for(f=-1;++f<u.length;)u[f][1].type==="strikethroughSequenceTemporary"&&(u[f][1].type="data");return u}function a(u,c,f){const h=this.previous,m=this.events;let E=0;return b;function b(_){return h===126&&m[m.length-1][1].type!=="characterEscape"?f(_):(u.enter("strikethroughSequenceTemporary"),T(_))}function T(_){const S=Ks(h);if(_===126)return E>1?f(_):(u.consume(_),E++,T);if(E<2&&!n)return f(_);const C=u.exit("strikethroughSequenceTemporary"),I=Ks(_);return C._open=!I||I===2&&!!S,C._close=!S||S===2&&!!I,c(_)}}}class D5{constructor(){this.map=[]}add(t,n,r){M5(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function M5(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function F5(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function B5(){return{flow:{null:{name:"table",tokenize:U5,resolveAll:H5}}}}function U5(e,t,n){const r=this;let o=0,a=0,u;return c;function c(H){let le=r.events.length-1;for(;le>-1;){const fe=r.events[le][1].type;if(fe==="lineEnding"||fe==="linePrefix")le--;else break}const de=le>-1?r.events[le][1].type:null,ce=de==="tableHead"||de==="tableRow"?B:f;return ce===B&&r.parser.lazy[r.now().line]?n(H):ce(H)}function f(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(u=!0,a+=1),m(H)}function m(H){return H===null?n(H):Re(H)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),T):n(H):Ge(H)?Xe(e,m,"whitespace")(H):(a+=1,u&&(u=!1,o+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,m):(e.enter("data"),E(H)))}function E(H){return H===null||H===124||lt(H)?(e.exit("data"),m(H)):(e.consume(H),H===92?b:E)}function b(H){return H===92||H===124?(e.consume(H),E):E(H)}function T(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,Ge(H)?Xe(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):_(H))}function _(H){return H===45||H===58?C(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),S):W(H)}function S(H){return Ge(H)?Xe(e,C,"whitespace")(H):C(H)}function C(H){return H===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),I):H===45?(a+=1,I(H)):H===null||Re(H)?G(H):W(H)}function I(H){return H===45?(e.enter("tableDelimiterFiller"),F(H)):W(H)}function F(H){return H===45?(e.consume(H),F):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(H))}function D(H){return Ge(H)?Xe(e,G,"whitespace")(H):G(H)}function G(H){return H===124?_(H):H===null||Re(H)?!u||o!==a?W(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):W(H)}function W(H){return n(H)}function B(H){return e.enter("tableRow"),te(H)}function te(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),te):H===null||Re(H)?(e.exit("tableRow"),t(H)):Ge(H)?Xe(e,te,"whitespace")(H):(e.enter("data"),be(H))}function be(H){return H===null||H===124||lt(H)?(e.exit("data"),te(H)):(e.consume(H),H===92?he:be)}function he(H){return H===92||H===124?(e.consume(H),be):be(H)}}function H5(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],u=[0,0,0,0],c=!1,f=0,h,m,E;const b=new D5;for(;++n<e.length;){const T=e[n],_=T[1];T[0]==="enter"?_.type==="tableHead"?(c=!1,f!==0&&(Eb(b,t,f,h,m),m=void 0,f=0),h={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",h,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(r=!0,E=void 0,a=[0,0,0,0],u=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",m,t]])),o=_.type==="tableDelimiterRow"?2:m?3:1):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],E=Ml(b,t,a,o,void 0,E),a=[0,0,0,0]),u[2]=n)):_.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],E=Ml(b,t,a,o,void 0,E)),a=u,u=[a[1],n,0,0])):_.type==="tableHead"?(c=!0,f=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(f=n,a[1]!==0?(u[0]=u[1],E=Ml(b,t,a,o,n,E)):u[1]!==0&&(E=Ml(b,t,u,o,n,E)),o=0):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=n)}for(f!==0&&Eb(b,t,f,h,m),b.consume(t.events),n=-1;++n<t.events.length;){const T=t.events[n];T[0]==="enter"&&T[1].type==="table"&&(T[1]._align=F5(t.events,n))}return e}function Ml(e,t,n,r,o,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},so(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=so(t.events,n[1]);if(a={type:u,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=so(t.events,n[2]),m=so(t.events,n[3]),E={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",E,t]]),r!==2){const b=t.events[n[2]],T=t.events[n[3]];if(b[1].end=Object.assign({},T[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,S=n[3]-n[2]-1;e.add(_,S,[])}}e.add(n[3]+1,0,[["exit",E,t]])}return o!==void 0&&(a.end=Object.assign({},so(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function Eb(e,t,n,r,o){const a=[],u=so(t.events,n);o&&(o.end=Object.assign({},u),a.push(["exit",o,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function so(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const z5={name:"tasklistCheck",tokenize:$5};function j5(){return{text:{91:z5}}}function $5(e,t,n){const r=this;return o;function o(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return lt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),u):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),u):n(f)}function u(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Re(f)?t(f):Ge(f)?e.check({tokenize:V5},t,n)(f):n(f)}}function V5(e,t,n){return Xe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function q5(e){return zE([g5(),A5(),L5(e),B5(),j5()])}const Y5={};function W5(e){const t=this,n=e||Y5,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(q5(n)),a.push(d5()),u.push(h5(n))}const Fl=()=>N.jsx("span",{className:`${Z}-blinking-cursor`,children:N.jsx("svg",{height:"1rem",width:"1rem",xmlns:"http://www.w3.org/2000/svg",children:N.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),yb=({globalClassName:e,message:t})=>{const{isLoading:n,isResponseLoading:r}=qr(),o=n&&r((t==null?void 0:t.eventSourceId)||"")&&t.name==="partial_inquiry";return N.jsx(dR,{remarkPlugins:[W5],rehypePlugins:[B4],components:{h1:({children:a})=>N.jsx("h1",{className:oe(e,`${Z}-header h1`),children:a}),h2:({children:a})=>N.jsx("h2",{className:oe(e,`${Z}-header h2`),children:a}),h3:({children:a})=>N.jsx("h3",{className:oe(e,`${Z}-header h3`),children:a}),ul:({children:a})=>N.jsx("ul",{className:oe(e,`${Z}-ul`),children:a}),ol:({children:a})=>N.jsx("ol",{className:oe(e,`${Z}-ol`),children:a}),li:({children:a})=>N.jsx("li",{className:oe(e,`${Z}-li`),children:a}),a:({href:a,children:u})=>N.jsx("a",Te(U({className:oe(e,`${Z}-link`)},a?{href:a,target:"_blank"}:{}),{rel:"noopener noreferrer",children:u})),table:({children:a})=>N.jsx("table",{className:oe(e,`${Z}-table`),children:a}),thead:({children:a})=>N.jsx("thead",{className:oe(e,`${Z}-thead`),children:a}),tbody:({children:a})=>N.jsx("tbody",{className:oe(e,`${Z}-tbody`),children:a}),tr:({children:a})=>N.jsx("tr",{className:oe(e,`${Z}-tr`),children:a}),th:({children:a})=>N.jsx("th",{className:oe(e,`${Z}-th`),children:a}),td:({children:a})=>N.jsx("td",{className:oe(e,`${Z}-td`),children:a}),span:({className:a,children:u})=>a===`${Z}-blinking-cursor`?N.jsx(Fl,{}):N.jsx("span",{children:u})},children:t.message+(o?`<span className='${Z}-blinking-cursor'></span>`:"")})},G5=({globalClassName:e,message:t})=>{const[n,r]=q.useState(!1),o=t.tool_name||t.toolName,a=!!t.thought,u=!!o,c=()=>{r(f=>!f)};return N.jsxs("div",{children:[N.jsxs("div",{className:oe(e,`${Z}-progress-message`,"standalone"),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,"progress-icon","standalone"),children:N.jsx(Ug,{})}),N.jsx("p",{className:oe(e,`${Z}-progress-text`,"standalone"),children:t.message})]}),(a||u)&&N.jsxs(N.Fragment,{children:[N.jsx($f,{className:oe(e,`${Z}-thought-context-button`),onClick:c,children:n?N.jsxs(N.Fragment,{children:["Hide ",N.jsx(vA,{})]}):N.jsxs(N.Fragment,{children:["Context ",N.jsx(kA,{})]})}),n&&N.jsx("div",{className:oe(e,`${Z}-thought-container`),children:a&&N.jsx("p",{className:oe(e,`${Z}-progress-thought`),children:t.thought})})]})]})},K5=({globalClassName:e,message:t,isWidgetStandalone:n})=>n?N.jsx(G5,{globalClassName:e,message:t}):N.jsxs("div",{className:oe(e,`${Z}-progress-message`,"embedded"),title:t.message,children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,"progress-icon","embedded"),children:N.jsx(Ug,{})}),N.jsx("i",{className:oe(e,`${Z}-progress-text`,"embedded"),children:t.message})]}),Q5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{var o;const r=(o=t.searchParams)==null?void 0:o.query;return N.jsxs("div",{className:oe(e,`${Z}-refined-event`,{embedded:!n,standalone:n}),children:[!!r&&N.jsxs("div",{className:oe(e,`${Z}-refined-event-query`,{embedded:!n,standalone:n}),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon`,`${Z}-refined-event-icon`,{embedded:!n,standalone:n}),children:N.jsx($u,{role:"img"})}),N.jsx("p",{className:oe(e,`${Z}-text`,"bold"),children:r})]}),N.jsx(yb,{message:t})]})},Tb=e=>{var f,h;const{configModule:t}=Tn(),n=((f=e.request)==null?void 0:f.searchParams)||((h=e.request)==null?void 0:h.browseParams),r=(t==null?void 0:t.getProductHiddenFields())||[],{facetFilters:o={}}=n||{facetFilters:{}},a=Object.fromEntries(Object.entries(o).filter(([m])=>!r.includes(m))),u=Object.keys(a),c=Object.values(a).reduce((m,E)=>m+E.length,0);return{facetFiltersList:u,filterCount:c}},Bl=({isWidgetStandalone:e,globalClassName:t,filterCount:n})=>N.jsx("span",{className:oe(t,`${Z}-facet-pill`,{standalone:e,embedded:!e}),children:`${n} filters`}),bb=({globalClassName:e,message:t,facetFiltersList:n})=>{var a,u;if(!n.length)return null;const r=((a=t.request)==null?void 0:a.searchParams)||((u=t.request)==null?void 0:u.browseParams),o=(r==null?void 0:r.facetFilters)||{};return n.map(c=>{var h;const f=((h=o[c])==null?void 0:h.join(", "))||"";return N.jsxs("div",{className:oe(e,`${Z}-facets`),children:[N.jsx("p",{className:oe(e,`${Z}-facet-category`),children:c}),N.jsx("p",{className:oe(e,`${Z}-facet-values`),children:f})]},c)})},X5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{var a,u;const{facetFiltersList:r,filterCount:o}=Tb(t);return n?N.jsxs("div",{children:[N.jsxs("div",{className:oe(e,`${Z}-user-message standalone`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-message-icon standalone`),children:N.jsx(Hg,{})}),N.jsx("p",{className:oe(e,`${Z}-user-message-text`),children:(a=t.request)==null?void 0:a.userPrompt}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!0,globalClassName:e,filterCount:o})]}),N.jsx(bb,{globalClassName:e,facetFiltersList:r,message:t})]}):N.jsxs("div",{className:oe(e,`${Z}-user-message embedded`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-message-icon embedded`),children:N.jsx(Hg,{})}),N.jsx("p",{children:(u=t.request)==null?void 0:u.userPrompt}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!1,filterCount:o})]})},J5=({globalClassName:e,actionLabel:t,query:n,queryLabel:r,message:o,facetFiltersList:a,filterCount:u})=>N.jsxs("div",{className:oe(e,`${Z}-user-search standalone`),children:[N.jsxs("div",{className:oe(e,`${Z}-user-search-query`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-search-icon standalone`),children:N.jsx($u,{})}),N.jsx("p",{className:oe(e,`${Z}-text bold`),children:`${t}: ${r||n}`}),a.length>0&&N.jsx(Bl,{isWidgetStandalone:!0,globalClassName:e,filterCount:u})]}),N.jsx(bb,{globalClassName:e,facetFiltersList:a,message:o})]}),Z5=({globalClassName:e,message:t,isWidgetStandalone:n})=>{const{facetFiltersList:r,filterCount:o}=Tb(t),{actionLabel:a,query:u,queryLabel:c}=q.useMemo(()=>{var h,m,E,b,T,_;switch(t.name){case"copilot_search":return{actionLabel:"Your search",query:(h=t.request)==null?void 0:h.searchParams.query,queryLabel:""};case"copilot_browse":return{actionLabel:"Browsing category",query:(E=(m=t.request)==null?void 0:m.browseParams)==null?void 0:E.categoryId,queryLabel:((b=t.request)==null?void 0:b.label)||""};case"product_view":return{actionLabel:"Viewing product",query:(T=t.request)==null?void 0:T.productId,queryLabel:((_=t.request)==null?void 0:_.label)||""};default:return{actionLabel:"",query:"",queryLabel:""}}},[t]);return!t.isUserAction||!u?null:n?N.jsx(J5,{globalClassName:e,message:t,actionLabel:a,query:u,queryLabel:c,facetFiltersList:r,filterCount:o}):N.jsxs("div",{className:oe(e,`${Z}-user-search embedded`),children:[N.jsx("span",{className:oe(e,`${Z}-message-icon user-search-icon embedded`),children:N.jsx($u,{})}),N.jsx("p",{children:c||u}),r.length>0&&N.jsx(Bl,{isWidgetStandalone:!1,filterCount:o})]})},_b=["copilot_search","copilot_browse","product_view"],xb=({message:e,globalClassName:t,resetConversationMessage:n,isWidgetStandalone:r,handleSuggestionClick:o})=>{var u;if(!e)return null;let a=e.name;if(_b.includes(a)&&(e.isInitial||e.isUserAction)&&(a="faceted_navigation"),_b.includes(a)&&!((u=e.request)!=null&&u.userPrompt))return null;switch(a){case"copilot_search":case"copilot_browse":case"product_view":return N.jsx(X5,{globalClassName:t,isWidgetStandalone:r,message:e});case"faceted_navigation":return N.jsx(Z5,{globalClassName:t,message:e,isWidgetStandalone:r});case"refined_search":case"refined_browse":return N.jsx(Q5,{globalClassName:t,message:e,isWidgetStandalone:r});case"follow_up":return N.jsx(p3,{globalClassName:t,isWidgetStandalone:r,message:e,handleSuggestionClick:o});case"inquiry":case"partial_inquiry":return N.jsx(yb,{globalClassName:t,message:e});case"error":return N.jsx(f3,{message:e,isWidgetStandalone:r});case"display_products":return N.jsx(c3,{message:e,isWidgetStandalone:r});case"progress":return N.jsx(K5,{globalClassName:t,isWidgetStandalone:r,message:e});case"conversation_reset":return N.jsxs(N.Fragment,{children:[N.jsx("p",{className:oe(t,`${Z}-reset-message`),children:"This conversation has been reset."}),N.jsx("p",{className:oe(t,`${Z}-start-search-message`),children:n})]});default:return null}},Lh=({isWidgetStandalone:e,messages:t,handleSuggestionClick:n})=>{const{globalClassName:r,resetConversationMessage:o}=Tn();return t.map(a=>a.messages&&a.type==="group"?N.jsx("div",{className:oe(r,`${Z}-message-group`,e?"standalone":"embedded"),children:a.messages.length>0&&a.messages.map(u=>N.jsx("div",{className:`${Z}-message-group-child`,children:N.jsx(xb,{id:u.id,globalClassName:r,isWidgetStandalone:e,message:u,resetConversationMessage:o,handleSuggestionClick:n})},u.id))},`group-${a.eventSourceId}`):a.type==="individual"&&a.message?N.jsx("div",{className:oe(r,`${Z}-message`,e?"standalone":"embedded",{error:a.message.name.includes("error")}),children:N.jsx(xb,{id:a.message.id,globalClassName:r,isWidgetStandalone:e,message:a.message,resetConversationMessage:o,handleSuggestionClick:n})},a.message.id):null)},Sb=()=>{const{globalClassName:e,themeVariables:t}=Tn(),{status:n}=Wo(),{copilot:r,messages:o,groupedMessages:a,isLoading:u,handleUserInput:c,handleSuggestion:f}=qr(),{isOpen:h}=n||{},m=q.useRef(null);return q.useEffect(()=>{m.current&&m.current.scrollIntoView({behavior:"smooth",block:"end"})},[o]),r?!h||a.length===0?null:N.jsxs("div",{className:oe(e,`${Z}-container`,`${Z}-embedded-chat`),style:t,children:[N.jsxs("div",{className:oe(e,`${Z}-message-container`,"embedded"),children:[N.jsx(Lh,{isWidgetStandalone:!1,messages:a,handleSuggestionClick:f}),u&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:m})]}),N.jsx(Vf,{componentType:"chat",className:"embedded-chat",isLoading:u,onSubmit:c}),N.jsx("div",{className:oe(`${Z}-embedded-chat-menu`),children:N.jsx(a3,{componentType:"chat",children:N.jsx(cE,{componentType:"chat"})})})]}):N.jsx("div",{children:"Loading Copilot..."})},[e8,t8]=Ls({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),n8=e=>h1()(e,["lazyMount","unmountOnExit"]),[r8,Na]=Ls({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),wb=q.forwardRef((e,t)=>{const n=Na(),r=t8(),o=cd(Te(U({},r),{present:n.open})),a=ur(n.getBackdropProps(),o.getPresenceProps(),e);return o.unmounted?null:N.jsx(fi.div,Te(U({},a),{ref:Zu(o.ref,t)}))});wb.displayName="DialogBackdrop";const Dh=q.forwardRef((e,t)=>{const n=Na(),r=Xo(),o=ur(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:N.jsx(fi.div,Te(U({},o),{ref:Zu(r.ref,t)}))});Dh.displayName="DialogContent";const Mh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getDescriptionProps(),e);return N.jsx(fi.div,Te(U({},r),{ref:t}))});Mh.displayName="DialogDescription";const Fh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getPositionerProps(),e);return Xo().unmounted?null:N.jsx(fi.div,Te(U({},r),{ref:t}))});Fh.displayName="DialogPositioner";var i8=Ds("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),rs=i8.build(),Cb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Ab=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},Bh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},vb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},Uh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},Hh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},kb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Ul=e=>e.getById(Bh(e)),s8=e=>e.getById(Cb(e)),o8=e=>e.getById(Ab(e)),a8=e=>e.getById(vb(e)),u8=e=>e.getById(Uh(e)),l8=e=>e.getById(Hh(e)),c8=e=>e.getById(kb(e));function f8(e,t){const{state:n,send:r,context:o,prop:a,scope:u}=e,c=a("aria-label"),f=n.matches("open");return{open:f,setOpen(h){n.matches("open")!==h&&r({type:h?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(Te(U({},rs.trigger.attrs),{dir:a("dir"),id:vb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":f,"data-state":f?"open":"closed","aria-controls":Bh(u),onClick(h){h.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(Te(U({},rs.backdrop.attrs),{dir:a("dir"),hidden:!f,id:Ab(u),"data-state":f?"open":"closed"}))},getPositionerProps(){return t.element(Te(U({},rs.positioner.attrs),{dir:a("dir"),id:Cb(u),style:{pointerEvents:f?void 0:"none"}}))},getContentProps(){const h=o.get("rendered");return t.element(Te(U({},rs.content.attrs),{dir:a("dir"),role:a("role"),hidden:!f,id:Bh(u),tabIndex:-1,"data-state":f?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!h.title?void 0:Uh(u),"aria-describedby":h.description?Hh(u):void 0}))},getTitleProps(){return t.element(Te(U({},rs.title.attrs),{dir:a("dir"),id:Uh(u)}))},getDescriptionProps(){return t.element(Te(U({},rs.description.attrs),{dir:a("dir"),id:Hh(u)}))},getCloseTriggerProps(){return t.button(Te(U({},rs.closeTrigger.attrs),{dir:a("dir"),id:kb(u),type:"button",onClick(h){h.defaultPrevented||(h.stopPropagation(),r({type:"CLOSE"}))}}))}}}var d8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>c8(t):void 0,o=typeof e.modal=="boolean"?e.modal:!0;return U({role:"dialog",modal:o,trapFocus:o,preventScroll:o,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return W1(()=>Ul(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[a8(e)],onInteractOutside(o){var a;(a=n("onInteractOutside"))==null||a(o),n("closeOnInteractOutside")||o.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(o){var a;(a=n("onEscapeKeyDown"))==null||a(o),n("closeOnEscape")||o.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return J1(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?Q1(()=>Ul(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var o,a;return(a=(o=t("finalFocusEl"))==null?void 0:o())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?B1(()=>[Ul(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){bn(()=>{e.set("rendered",{title:!!u8(t),description:!!l8(t)})})},syncZIndex({scope:e}){bn(()=>{const t=Ul(e);if(!t)return;const n=Gu(t);[s8(e),o8(e)].forEach(o=>{o==null||o.style.setProperty("--z-index",n.zIndex),o==null||o.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};od()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const h8=e=>{const t=q.useId(),{getRootNode:n}=vd(),{dir:r}=iE(),o=U({id:t,getRootNode:n,dir:r},e),a=ad(d8,o);return f8(a,l1)},Nb=e=>{const[t,c]=p1(e),f=c,{children:n}=f,r=en(f,["children"]),[o]=n8(t),a=h8(r),u=cd(ur({present:a.open},t));return N.jsx(r8,{value:a,children:N.jsx(e8,{value:o,children:N.jsx(c1,{value:u,children:n})})})},zh=q.forwardRef((e,t)=>{const n=Na(),r=ur(n.getTitleProps(),e);return N.jsx(fi.h2,Te(U({},r),{ref:t}))});zh.displayName="DialogTitle";const Ob=e=>{var f;const{children:t,disabled:n}=e,[r,o]=q.useState((f=e.container)==null?void 0:f.current),a=q.useSyncExternalStore(m8,()=>!1,()=>!0),{getRootNode:u}=vd();if(q.useEffect(()=>{o(()=>{var h;return(h=e.container)==null?void 0:h.current})},[e.container]),a||n)return N.jsx(N.Fragment,{children:t});const c=r!=null?r:p8(u);return N.jsx(N.Fragment,{children:q.Children.map(t,h=>Xu.createPortal(h,c))})},p8=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return Wi(n)?n:Cr(t).body},m8=()=>()=>{},g8=()=>{const{globalClassName:e}=Tn(),{dialogPosition:t}=Wo(),n=t==="bottom-left",r=()=>{ng(n?"bottom-right":"bottom-left")},o=n?i3:r3,a=n?"Move right":"Move left";return N.jsx(Ns,{className:oe(e,`${Z}-left-right-toggle-button`,"dialog"),ariaLabel:a,onClick:r,icon:N.jsx(o,{})})},Ib=()=>{const{logoUrl:e,headerText:t,globalClassName:n,themeVariables:r}=Tn(),{mode:o,status:a,dialogPosition:u}=Wo(),{copilot:c,messages:f,groupedMessages:h,isLoading:m,handleUserInput:E,handleSuggestion:b}=qr(),T=q.useRef(null),{isOpen:_}=a||{},S=o==="standalone";q.useEffect(()=>{T.current&&T.current.scrollIntoView({behavior:"smooth",block:"end"})},[f]);const C=()=>{Uu(!1)};return!_||h.length===0?null:c?N.jsx(Nb,{lazyMount:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:_,children:N.jsx(Ob,{children:N.jsx(Fh,{className:oe(n,`${Z}-container`,`${Z}-dialog`,u),style:r,children:N.jsxs(Dh,{className:oe(n,`${Z}-dialog-content`,{standalone:S,embedded:!S}),children:[N.jsxs("div",{className:oe(n,`${Z}-dialog-header`,{standalone:S,embedded:!S}),children:[e&&N.jsx("img",{alt:"",role:"img",className:oe(n,`${Z}-dialog-logo`,{standalone:S,embedded:!S}),src:e}),N.jsx(zh,{className:oe(n,`${Z}-dialog-title`,{standalone:S,embedded:!S}),children:t}),N.jsxs("div",{className:oe(n,`${Z}-dialog-controls`),children:[N.jsx(cE,{componentType:"dialog",isIcon:!0}),N.jsx(g8,{}),N.jsx(lE,{componentType:"dialog"}),N.jsx(uE,{className:`dialog ${n}`,onClick:C})]})]}),N.jsxs(Mh,{className:oe(n,`${Z}-message-container`,{standalone:S,embedded:!S}),children:[N.jsx(Lh,{isWidgetStandalone:S,messages:h,handleSuggestionClick:b}),m&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:T})]}),N.jsx(Vf,{componentType:"dialog",isLoading:m,onSubmit:E})]})})})}):N.jsx("div",{children:"Loading Copilot..."})},Pb=()=>{const{logoUrl:e,headerText:t,globalClassName:n,themeVariables:r}=Tn(),{mode:o,status:a,isModalFullscreen:u,previousComponentType:c}=Wo(),{copilot:f,messages:h,groupedMessages:m,isLoading:E,handleUserInput:b,handleSuggestion:T}=qr(),_=q.useRef(null),{isOpen:S}=a||{},C=o==="standalone";q.useEffect(()=>{_.current&&_.current.scrollIntoView({behavior:"smooth",block:"end"})},[h]);const I=({open:W})=>{Uu(W)},F=()=>{tg(!u)},D=()=>{jf(c||"dialog")},G=()=>{Uu(!1)};return!S||m.length===0?null:f?N.jsx(Nb,{lazyMount:!0,open:S,onOpenChange:I,children:N.jsx(Ob,{children:N.jsxs("div",{className:oe(n,`${Z}-modal-container`),style:r,children:[N.jsx(wb,{className:oe(n,`${Z}-modal-backdrop`)}),N.jsx(Fh,{className:oe(n,`${Z}-container`,`${Z}-modal`,{fullscreen:u,standalone:C,embedded:!C}),children:N.jsxs(Dh,{className:oe(n,`${Z}-modal-content`,{standalone:C,embedded:!C}),children:[N.jsxs("div",{className:oe(n,`${Z}-modal-header`,{standalone:C,embedded:!C}),children:[e&&N.jsx("img",{alt:"",role:"img",className:oe(n,`${Z}-modal-logo`,{standalone:C,embedded:!C}),src:e}),N.jsx(zh,{className:oe(n,`${Z}-modal-title`,{standalone:C,embedded:!C}),children:t}),N.jsxs("div",{className:oe(n,`${Z}-modal-controls`),children:[N.jsx(Ns,{ariaLabel:"Toggle Fullscreen",className:oe(n,`${Z}-modal-fullscreen-button`),icon:u?N.jsx(NA,{}):N.jsx(OA,{}),onClick:F}),N.jsx(Ns,{ariaLabel:"Toggle Dialog",className:oe(n,`${Z}-modal-toggle-dialog-button`),onClick:D,icon:N.jsx(u3,{})}),N.jsx(lE,{componentType:"modal"}),N.jsx(uE,{className:`modal ${n}`,onClick:G})]})]}),N.jsxs(Mh,{className:oe(n,`${Z}-message-container`,{standalone:C,embedded:!C}),children:[N.jsx(Lh,{isWidgetStandalone:C,messages:m,handleSuggestionClick:T}),E&&N.jsx("div",{style:{display:"flex",justifyContent:"flex-start",paddingLeft:"1rem",paddingBottom:"1rem"},children:N.jsx(Fl,{})}),N.jsx("div",{ref:_})]}),N.jsx(Vf,{componentType:"modal",isLoading:E,onSubmit:b})]})})]})})}):N.jsx("div",{children:"Loading Copilot..."})},E8=()=>{const e=Wo(),{status:{type:t}}=e||{status:{}};return t==="dialog"?N.jsx(Ib,{}):t==="modal"?N.jsx(Pb,{}):N.jsx(Sb,{})},jh=e=>N.jsx(Rg,Te(U({},e),{children:N.jsx(E8,{})}));var Hl={},Rb;function y8(){if(Rb)return Hl;Rb=1;var e=s1();return Hl.createRoot=e.createRoot,Hl.hydrateRoot=e.hydrateRoot,Hl}var Lb=y8();const T8=r=>{var o=r,{elementId:e,timeout:t=5e3}=o,n=en(o,["elementId","timeout"]);let a;const u=(f,h)=>{var m;for(const E of f)if(E.type==="childList"&&E.addedNodes.length)for(const b of E.addedNodes)b.nodeType===Node.ELEMENT_NODE&&b.id===e&&(vs(!0,"log","Target element found, rendering Copilot Widget"),h.disconnect(),clearTimeout(a),(m=Lb.createRoot(b))==null||m.render(N.jsx(jh,U({},n))))},c=new MutationObserver(u);return c.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{c.disconnect(),vs(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),c},b8=r=>{var o=r,{timeout:e,elementId:t}=o,n=en(o,["timeout","elementId"]);if(!n.apiKey&&!n.apiToken){vs(!0,"error","Copilot Widget requires either apiKey or apiToken");return}const a=document.getElementById(t);if(!a){vs(!0,"warn","Container element not found for id:",t),vs(!0,"warn","Beginning observation for element"),T8(U({elementId:t,timeout:e},n));return}Lb.createRoot(a).render(N.jsx(jh,U({},n)))},_8={search:rA,browse:WC,pdp:{setPdpContext:bg,updatePdpProductId:KC,updatePdpLink:QC},components:{toggleWidgetOpen:Uu,toggleModalFullscreen:tg,setWidgetType:jf,setWidgetDialogPosition:ng},session:XC},x8=()=>Object.freeze({search:Object.freeze(ht.state),browse:Object.freeze(ot.state),pdp:Object.freeze(or.state),isConnected:Ot.state.connected});Oe.CopilotDialog=Ib,Oe.CopilotEmbed=Sb,Oe.CopilotModal=Pb,Oe.CopilotWidget=jh,Oe.WidgetProvider=Rg,Oe.eventHandlers=_8,Oe.injectCopilotWidget=b8,Oe.state=x8,Oe.useCopilot=qr,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|