PageSourceSearch

https://ai-energy-planning.netlify.app/assets/AssistantPanel-CpypnVsz.js

js ai-energy-planning.netlify.app collected 2026-10-03 10:25:48 UTC 58,712 bytes, 61 lines download raw bytes

1import{r as A,j as f,b as ge,v as Ge,o as z,u as M,d as Y,n as B,e as H,f as Ze,t as ke,E as Qe,h as ee,i as _,m as S,k as Je,l as Xe,p as F,s as K,q as Ye,w as P,x as E,y as et,M as tt}from"./vendor-react-DVrBU6_x.js";import{c as D,X as J,C as ve,a as nt,T as we,A as oe,D as se,n as rt,P as it,g as at,s as lt,l as ot,i as ue,S as st,b as ut}from"./index-DM7KUgsE.js";import{W as ct}from"./wrench-OWDPItrK.js";import{S as ft}from"./square-eZWa-Jut.js";import"./vendor-d3-CGnuPtl4.js";import"./vendor-sweetalert-CRdFYMG-.js";import"./vendor-duckdb-DncbAeEm.js";/**
2 * @license lucide-react v0.344.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ht=D("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
7 * @license lucide-react v0.344.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const pt=D("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
12 * @license lucide-react v0.344.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const mt=D("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
17 * @license lucide-react v0.344.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const dt=D("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
22 * @license lucide-react v0.344.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const xt=D("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
27 * @license lucide-react v0.344.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const bt=D("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
32 * @license lucide-react v0.344.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const ye=D("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
37 * @license lucide-react v0.344.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const gt=D("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
42 * @license lucide-react v0.344.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const Ce=D("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),ce={running:{icon:ye,className:"text-[var(--laep-text-soft)]",spin:!0,note:"running"},awaiting:{icon:Ce,className:"text-amber-600",note:"awaiting approval"},done:{icon:ve,className:"text-emerald-600",note:null},denied:{icon:J,className:"text-[var(--laep-text-soft)]",note:"declined"},error:{icon:J,className:"text-red-600",note:"failed"}};function kt(e){const n=we[e.name]||e.name,t=e.input?.label;return t?`${n}: ${t}`:n}const vt=({segment:e})=>{const[n,t]=A.useState(!1),r=ce[e.status]||ce.running,l=r.icon;return f.jsxs("div",{className:"my-1 rounded-md border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-muted)] text-xs",children:[f.jsxs("button",{type:"button",onClick:()=>t(o=>!o),className:"w-full flex items-center gap-1.5 px-2 py-1.5 text-left text-[var(--laep-text)]","aria-expanded":n,children:[n?f.jsx(nt,{"aria-hidden":"true",className:"w-3 h-3 shrink-0"}):f.jsx(pt,{"aria-hidden":"true",className:"w-3 h-3 shrink-0"}),f.jsx(ct,{"aria-hidden":"true",className:"w-3 h-3 shrink-0 text-[var(--laep-text-soft)]"}),f.jsx("span",{className:"flex-1 truncate font-medium",children:kt(e)}),r.note&&f.jsx("span",{className:"text-[10px] text-[var(--laep-text-soft)]",children:r.note}),f.jsx(l,{"aria-hidden":"true",className:`w-3.5 h-3.5 shrink-0 ${r.className} ${r.spin?"animate-spin":""}`})]}),n&&f.jsxs("div",{className:"px-2 pb-2 space-y-1",children:[f.jsx("pre",{className:"overflow-x-auto rounded bg-[var(--laep-surface-panel)] p-1.5 text-[10px] leading-snug",children:JSON.stringify(e.input??{},null,1)}),e.result&&f.jsx("pre",{className:"overflow-x-auto rounded bg-[var(--laep-surface-panel)] p-1.5 text-[10px] leading-snug",children:e.result})]})]})};function fe(e,n){const t=String(e);
vendor: 6,392 bytes, lines 46-47
46if(typeof n!="string")throw new TypeError("Expected character");let r=0,l=t.indexOf(n);for(;l!==-1;)r++,l=t.indexOf(n,l+n.length);return r}function wt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yt(e,n,t){const l=ge((t||{}).ignore||[]),o=Ct(n);let i=-1;for(;++i<o.length;)Ge(e,"text",u);function u(s,m){let c=-1,d;for(;++c<m.length;){const x=m[c],p=d?d.children:void 0;if(l(x,p?p.indexOf(x):void 0,d))return;d=x}if(d)return a(s,m)}function a(s,m){const c=m[m.length-1],d=o[i][0],x=o[i][1];let p=0;const v=c.children.indexOf(s);let g=!1,b=[];d.lastIndex=0;let y=d.exec(s.value);for(;y;){const j=y.index,w={index:y.index,input:y.input,stack:[...m,s]};let C=x(...y,w);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?d.lastIndex=j+1:(p!==j&&b.push({type:"text",value:s.value.slice(p,j)}),Array.isArray(C)?b.push(...C):C&&b.push(C),p=j+y[0].length,g=!0),!d.global)break;y=d.exec(s.value)}return g?(p<s.value.length&&b.push({type:"text",value:s.value.slice(p)}),c.children.splice(v,1,...b)):b=[s],v+b.length}}function Ct(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const l=t[r];n.push([jt(l[0]),At(l[1])])}return n}function jt(e){return typeof e=="string"?new RegExp(wt(e),"g"):e}function At(e){return typeof e=="function"?e:function(){return e}}const V="phrasing",G=["autolink","link","image","label"];function St(){return{transforms:[It],enter:{literalAutolink:Dt,literalAutolinkEmail:Z,literalAutolinkHttp:Z,literalAutolinkWww:Z},exit:{literalAutolink:Et,literalAutolinkEmail:Lt,literalAutolinkHttp:Tt,literalAutolinkWww:Ft}}}function Nt(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:V,notInConstruct:G},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:V,notInConstruct:G},{character:":",before:"[ps]",after:"\\/",inConstruct:V,notInConstruct:G}]}}function Dt(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Z(e){this.config.enter.autolinkProtocol.call(this,e)}function Tt(e){this.config.exit.autolinkProtocol.call(this,e)}function Ft(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];z(n.type==="link"),n.url="http://"+this.sliceSerialize(e)}function Lt(e){this.config.exit.autolinkEmail.call(this,e)}function Et(e){this.exit(e)}function It(e){yt(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Mt],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zt]],{ignore:["link","linkReference"]})}function Mt(e,n,t,r,l){let o="";if(!je(l)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!Rt(t)))return!1;const i=Pt(t+r);if(!i[0])return!1;const u={type:"link",title:null,url:o+n+i[0],children:[{type:"text",value:n+i[0]}]};return i[1]?[u,{type:"text",value:i[1]}]:u}function zt(e,n,t,r){return!je(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Rt(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Pt(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const l=fe(e,"(");let o=fe(e,")");for(;r!==-1&&l>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function je(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||M(t)||Y(t))&&(!n||t!==47)}Ae.peek=Kt;function _t(){this.buffer()}function Ot(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Bt(){this.buffer()}function qt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ut(e){const n=this.resume(),t=this.stack[this.stack.length-1];z(t.type==="footnoteReference"),t.identifier=B(this.sliceSerialize(e)).toLowerCase(),t.label=n}function $t(e){this.exit(e)}function Ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];z(t.type==="footnoteDefinition"),t.identifier=B(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Wt(e){this.exit(e)}function Kt(){return"["}function Ae(e,n,t,r){const l=t.createTracker(r);let o=l.move("[^");const i=t.enter("footnoteReference"),u=t.enter("reference");return o+=l.move(t.safe(t.associationId(e),{after:"]",before:o})),u(),i(),o+=l.move("]"),o}function Vt(){return{enter:{gfmFootnoteCallString:_t,gfmFootnoteCall:Ot,gfmFootnoteDefinitionLabelString:Bt,gfmFootnoteDefinition:qt},exit:{gfmFootnoteCallString:Ut,gfmFootnoteCall:$t,gfmFootnoteDefinitionLabelString:Ht,gfmFootnoteDefinition:Wt}}}function Gt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Ae},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,l,o,i){const u=o.createTracker(i);let a=u.move("[^");const s=o.enter("footnoteDefinition"),m=o.enter("label");return a+=u.move(o.safe(o.associationId(r),{before:a,after:"]"})),m(),a+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),a+=u.move((n?`
47`:" ")+o.indentLines(o.containerFlow(r,u.current()),n?Se:Zt))),s(),a}}function Zt(e,n,t){return n===0?e:Se(e,n,t)}function Se(e,n,t){return(t?"":"    ")+e}const Qt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ne.peek=tn;function Jt(){return{canContainEols:["delete"],enter:{strikethrough:Yt},exit:{strikethrough:en}}}function Xt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Qt}],handlers:{delete:Ne}}}function Yt(e){this.enter({type:"delete",children:[]},e)}function en(e){this.exit(e)}function Ne(e,n,t,r){const l=t.createTracker(r),o=t.enter("strikethrough");let i=l.move("~~");return i+=t.containerPhrasing(e,{...l.current(),before:i,after:"~"}),i+=l.move("~~"),o(),i}function tn(){return"~"}function nn(e){return e.length}function rn(e,n){const t=n||{},r=(t.align||[]).concat(),l=t.stringLength||nn,o=[],i=[],u=[],a=[];let s=0,m=-1;for(;++m<e.length;){const k=[],v=[];let g=-1;for(e[m].length>s&&(s=e[m].length);++g<e[m].length;){const b=an(e[m][g]);if(t.alignDelimiters!==!1){const y=l(b);v[g]=y,(a[g]===void 0||y>a[g])&&(a[g]=y)}k.push(b)}i[m]=k,u[m]=v}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)o[c]=he(r[c]);
vendor: 11,121 bytes, lines 47-59
47else{const k=he(r);for(;++c<s;)o[c]=k}c=-1;const d=[],x=[];for(;++c<s;){const k=o[c];let v="",g="";k===99?(v=":",g=":"):k===108?v=":":k===114&&(g=":");let b=t.alignDelimiters===!1?1:Math.max(1,a[c]-v.length-g.length);const y=v+"-".repeat(b)+g;t.alignDelimiters!==!1&&(b=v.length+b+g.length,b>a[c]&&(a[c]=b),x[c]=b),d[c]=y}i.splice(1,0,d),u.splice(1,0,x),m=-1;const p=[];for(;++m<i.length;){const k=i[m],v=u[m];c=-1;const g=[];for(;++c<s;){const b=k[c]||"";let y="",j="";if(t.alignDelimiters!==!1){const w=a[c]-(v[c]||0),C=o[c];C===114?y=" ".repeat(w):C===99?w%2?(y=" ".repeat(w/2+.5),j=" ".repeat(w/2-.5)):(y=" ".repeat(w/2),j=y):j=" ".repeat(w)}t.delimiterStart!==!1&&!c&&g.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&b==="")&&(t.delimiterStart!==!1||c)&&g.push(" "),t.alignDelimiters!==!1&&g.push(y),g.push(b),t.alignDelimiters!==!1&&g.push(j),t.padding!==!1&&g.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&g.push("|")}p.push(t.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return p.join(`
48`)}function an(e){return e==null?"":String(e)}function he(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function ln(e,n,t,r){const l=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const i=t.indentLines(t.containerFlow(e,o.current()),on);return l(),i}function on(e,n,t){return">"+(t?"":" ")+e}function sn(e,n){return pe(e,n.inConstruct,!0)&&!pe(e,n.notInConstruct,!1)}function pe(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function me(e,n,t,r){let l=-1;for(;++l<t.unsafe.length;)if(t.unsafe[l].character===`
49`&&sn(t.stack,t.unsafe[l]))return/[ \t]/.test(r.before)?"":" ";return`\\
50`}function un(e,n){const t=String(e);let r=t.indexOf(n),l=r,o=0,i=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===l?++o>i&&(i=o):o=1,l=r+n.length,r=t.indexOf(n,l);return i}function cn(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function fn(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function hn(e,n,t,r){const l=fn(t),o=e.value||"",i=l==="`"?"GraveAccent":"Tilde";if(cn(e,t)){const c=t.enter("codeIndented"),d=t.indentLines(o,pn);return c(),d}const u=t.createTracker(r),a=l.repeat(Math.max(un(o,l)+1,3)),s=t.enter("codeFenced");let m=u.move(a);if(e.lang){const c=t.enter(`codeFencedLang${i}`);m+=u.move(t.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${i}`);m+=u.move(" "),m+=u.move(t.safe(e.meta,{before:m,after:`
51`,encode:["`"],...u.current()})),c()}return m+=u.move(`
52`),o&&(m+=u.move(o+`
53`)),m+=u.move(a),s(),m}function pn(e,n,t){return(t?"":"    ")+e}function te(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function mn(e,n,t,r){const l=te(t),o=l==='"'?"Quote":"Apostrophe",i=t.enter("definition");let u=t.enter("label");const a=t.createTracker(r);let s=a.move("[");return s+=a.move(t.safe(t.associationId(e),{before:s,after:"]",...a.current()})),s+=a.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=a.move("<"),s+=a.move(t.safe(e.url,{before:s,after:">",...a.current()})),s+=a.move(">")):(u=t.enter("destinationRaw"),s+=a.move(t.safe(e.url,{before:s,after:e.title?" ":`
54`,...a.current()}))),u(),e.title&&(u=t.enter(`title${o}`),s+=a.move(" "+l),s+=a.move(t.safe(e.title,{before:s,after:l,...a.current()})),s+=a.move(l),u()),i(),s}function dn(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function O(e){return"&#x"+e.toString(16).toUpperCase()+";"}function W(e,n,t){const r=H(e),l=H(n);return r===void 0?l===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}De.peek=xn;function De(e,n,t,r){const l=dn(t),o=t.enter("emphasis"),i=t.createTracker(r),u=i.move(l);let a=i.move(t.containerPhrasing(e,{after:l,before:u,...i.current()}));const s=a.charCodeAt(0),m=W(r.before.charCodeAt(r.before.length-1),s,l);m.inside&&(a=O(s)+a.slice(1));const c=a.charCodeAt(a.length-1),d=W(r.after.charCodeAt(0),c,l);d.inside&&(a=a.slice(0,-1)+O(c));const x=i.move(l);return o(),t.attentionEncodeSurroundingInfo={after:d.outside,before:m.outside},u+a+x}function xn(e,n,t){return t.options.emphasis||"*"}function bn(e,n){let t=!1;return Ze(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Qe}),!!((!e.depth||e.depth<3)&&ke(e)&&(n.options.setext||t))}function gn(e,n,t,r){const l=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(bn(e,t)){const m=t.enter("headingSetext"),c=t.enter("phrasing"),d=t.containerPhrasing(e,{...o.current(),before:`
55`,after:`
56`});return c(),m(),d+`
57`+(l===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
58`))+1))}const i="#".repeat(l),u=t.enter("headingAtx"),a=t.enter("phrasing");o.move(i+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
59`,...o.current()});return/^[\t ]/.test(s)&&(s=O(s.charCodeAt(0))+s.slice(1)),s=s?i+" "+s:i,t.options.closeAtx&&(s+=" "+i),a(),u(),s}Te.peek=kn;function Te(e){return e.value||""}function kn(){return"<"}Fe.peek=vn;function Fe(e,n,t,r){const l=te(t),o=l==='"'?"Quote":"Apostrophe",i=t.enter("image");let u=t.enter("label");const a=t.createTracker(r);let s=a.move("![");return s+=a.move(t.safe(e.alt,{before:s,after:"]",...a.current()})),s+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),s+=a.move("<"),s+=a.move(t.safe(e.url,{before:s,after:">",...a.current()})),s+=a.move(">")):(u=t.enter("destinationRaw"),s+=a.move(t.safe(e.url,{before:s,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=t.enter(`title${o}`),s+=a.move(" "+l),s+=a.move(t.safe(e.title,{before:s,after:l,...a.current()})),s+=a.move(l),u()),s+=a.move(")"),i(),s}function vn(){return"!"}Le.peek=wn;function Le(e,n,t,r){const l=e.referenceType,o=t.enter("imageReference");let i=t.enter("label");const u=t.createTracker(r);let a=u.move("![");const s=t.safe(e.alt,{before:a,after:"]",...u.current()});a+=u.move(s+"]["),i();const m=t.stack;t.stack=[],i=t.enter("reference");const c=t.safe(t.associationId(e),{before:a,after:"]",...u.current()});return i(),t.stack=m,o(),l==="full"||!s||s!==c?a+=u.move(c+"]"):l==="shortcut"?a=a.slice(0,-1):a+=u.move("]"),a}function wn(){return"!"}Ee.peek=yn;function Ee(e,n,t){let r=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(r);)l+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const i=t.unsafe[o],u=t.compilePattern(i);let a;if(i.atBreak)for(;a=u.exec(r);){let s=a.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(a.index+1)}}return l+r+l}function yn(){return"`"}function Ie(e,n){const t=ke(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Me.peek=Cn;function Me(e,n,t,r){const l=te(t),o=l==='"'?"Quote":"Apostrophe",i=t.createTracker(r);let u,a;if(Ie(e,t)){const m=t.stack;t.stack=[],u=t.enter("autolink");let c=i.move("<");return c+=i.move(t.containerPhrasing(e,{before:c,after:">",...i.current()})),c+=i.move(">"),u(),t.stack=m,c}u=t.enter("link"),a=t.enter("label");let s=i.move("[");return s+=i.move(t.containerPhrasing(e,{before:s,after:"](",...i.current()})),s+=i.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=i.move("<"),s+=i.move(t.safe(e.url,{before:s,after:">",...i.current()})),s+=i.move(">")):(a=t.enter("destinationRaw"),s+=i.move(t.safe(e.url,{before:s,after:e.title?" ":")",...i.current()}))),a(),e.title&&(a=t.enter(`title${o}`),s+=i.move(" "+l),s+=i.move(t.safe(e.title,{before:s,after:l,...i.current()})),s+=i.move(l),a()),s+=i.move(")"),u(),s}function Cn(e,n,t){return Ie(e,t)?"<":"["}ze.peek=jn;function ze(e,n,t,r){const l=e.referenceType,o=t.enter("linkReference");let i=t.enter("label");const u=t.createTracker(r);let a=u.move("[");const s=t.containerPhrasing(e,{before:a,after:"]",...u.current()});a+=u.move(s+"]["),i();const m=t.stack;t.stack=[],i=t.enter("reference");const c=t.safe(t.associationId(e),{before:a,after:"]",...u.current()});return i(),t.stack=m,o(),l==="full"||!s||s!==c?a+=u.move(c+"]"):l==="shortcut"?a=a.slice(0,-1):a+=u.move("]"),a}function jn(){return"["}function ne(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function An(e){const n=ne(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Sn(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Re(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Nn(e,n,t,r){const l=t.enter("list"),o=t.bulletCurrent;let i=e.ordered?Sn(t):ne(t);const u=e.ordered?i==="."?")":".":An(t);let a=n&&t.bulletLastUsed?i===t.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&m&&(!m.children||!m.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(a=!0),Re(t)===i&&m){let c=-1;for(;++c<e.children.length;){const d=e.children[c];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(i=u),t.bulletCurrent=i;const s=t.containerFlow(e,r);return t.bulletLastUsed=i,t.bulletCurrent=o,l(),s}function Dn(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Tn(e,n,t,r){const l=Dn(t);let o=t.bulletCurrent||ne(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>
vendor: 8,264 bytes, lines 59-61
59-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let i=o.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(i=Math.ceil(i/4)*4);const u=t.createTracker(r);u.move(o+" ".repeat(i-o.length)),u.shift(i);const a=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,u.current()),m);return a(),s;function m(c,d,x){return d?(x?"":" ".repeat(i))+c:(x?o:o+" ".repeat(i-o.length))+c}}function Fn(e,n,t,r){const l=t.enter("paragraph"),o=t.enter("phrasing"),i=t.containerPhrasing(e,r);return o(),l(),i}const Ln=ge(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function En(e,n,t,r){return(e.children.some(function(i){return Ln(i)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function In(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Pe.peek=Mn;function Pe(e,n,t,r){const l=In(t),o=t.enter("strong"),i=t.createTracker(r),u=i.move(l+l);let a=i.move(t.containerPhrasing(e,{after:l,before:u,...i.current()}));const s=a.charCodeAt(0),m=W(r.before.charCodeAt(r.before.length-1),s,l);m.inside&&(a=O(s)+a.slice(1));const c=a.charCodeAt(a.length-1),d=W(r.after.charCodeAt(0),c,l);d.inside&&(a=a.slice(0,-1)+O(c));const x=i.move(l+l);return o(),t.attentionEncodeSurroundingInfo={after:d.outside,before:m.outside},u+a+x}function Mn(e,n,t){return t.options.strong||"*"}function zn(e,n,t,r){return t.safe(e.value,r)}function Rn(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Pn(e,n,t){const r=(Re(t)+(t.options.ruleSpaces?" ":"")).repeat(Rn(t));return t.options.ruleSpaces?r.slice(0,-1):r}const _e={blockquote:ln,break:me,code:hn,definition:mn,emphasis:De,hardBreak:me,heading:gn,html:Te,image:Fe,imageReference:Le,inlineCode:Ee,link:Me,linkReference:ze,list:Nn,listItem:Tn,paragraph:Fn,root:En,strong:Pe,text:zn,thematicBreak:Pn};function _n(){return{enter:{table:On,tableData:de,tableHeader:de,tableRow:qn},exit:{codeText:Un,table:Bn,tableData:Q,tableHeader:Q,tableRow:Q}}}function On(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Bn(e){this.exit(e),this.data.inTable=void 0}function qn(e){this.enter({type:"tableRow",children:[]},e)}function Q(e){this.exit(e)}function de(e){this.enter({type:"tableCell",children:[]},e)}function Un(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,$n));const t=this.stack[this.stack.length-1];z(t.type==="inlineCode"),t.value=n,this.exit(e)}function $n(e,n){return n==="|"?n:e}function Hn(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,l=n.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
60`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:i,tableCell:a,tableRow:u}};function i(x,p,k,v){return s(m(x,k,v),x.align)}function u(x,p,k,v){const g=c(x,k,v),b=s([g]);return b.slice(0,b.indexOf(`
61`))}function a(x,p,k,v){const g=k.enter("tableCell"),b=k.enter("phrasing"),y=k.containerPhrasing(x,{...v,before:o,after:o});return b(),g(),y}function s(x,p){return rn(x,{align:p,alignDelimiters:r,padding:t,stringLength:l})}function m(x,p,k){const v=x.children;let g=-1;const b=[],y=p.enter("table");for(;++g<v.length;)b[g]=c(v[g],p,k);return y(),b}function c(x,p,k){const v=x.children;let g=-1;const b=[],y=p.enter("tableRow");for(;++g<v.length;)b[g]=a(v[g],x,p,k);return y(),b}function d(x,p,k){let v=_e.inlineCode(x,p,k);return k.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function Wn(){return{exit:{taskListCheckValueChecked:xe,taskListCheckValueUnchecked:xe,paragraph:Vn}}}function Kn(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Gn}}}function xe(e){const n=this.stack[this.stack.length-2];z(n.type==="listItem"),n.checked=e.type==="taskListCheckValueChecked"}function Vn(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];z(t.type==="paragraph");const r=t.children[0];if(r&&r.type==="text"){const l=n.children;let o=-1,i;for(;++o<l.length;){const u=l[o];if(u.type==="paragraph"){i=u;break}}i===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Gn(e,n,t,r){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",u=t.createTracker(r);o&&u.move(i);let a=_e.listItem(e,n,t,{...r,...u.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),a;function s(m){return m+i}}function Zn(){return[St(),Vt(),Jt(),_n(),Wn()]}function Qn(e){return{extensions:[Nt(),Gt(e),Xt(),Hn(e),Kn()]}}const Jn={tokenize:rr,partial:!0},Oe={tokenize:ir,partial:!0},Be={tokenize:ar,partial:!0},qe={tokenize:lr,partial:!0},Xn={tokenize:or,partial:!0},Ue={name:"wwwAutolink",tokenize:tr,previous:He},$e={name:"protocolAutolink",tokenize:nr,previous:We},T={name:"emailAutolink",tokenize:er,previous:Ke},N={};function Yn(){return{text:N}}let L=48;for(;L<123;)N[L]=T,L++,L===58?L=65:L===91&&(L=97);N[43]=T;N[45]=T;N[46]=T;N[95]=T;N[72]=[T,$e];N[104]=[T,$e];N[87]=[T,Ue];N[119]=[T,Ue];function er(e,n,t){const r=this;let l,o;return i;function i(c){return!X(c)||!Ke.call(r,r.previous)||re(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(c))}function u(c){return X(c)?(e.consume(c),u):c===64?(e.consume(c),a):t(c)}function a(c){return c===46?e.check(Xn,m,s)(c):c===45||c===95||ee(c)?(o=!0,e.consume(c),a):m(c)}function s(c){return e.consume(c),l=!0,a}function m(c){return o&&l&&_(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function tr(e,n,t){const r=this;return l;function l(i){return i!==87&&i!==119||!He.call(r,r.previous)||re(r.events)?t(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Jn,e.attempt(Oe,e.attempt(Be,o),t),t)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(i)}}function nr(e,n,t){const r=this;let l="",o=!1;return i;function i(c){return(c===72||c===104)&&We.call(r,r.previous)&&!re(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),u):t(c)}function u(c){if(_(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),u;if(c===58){const d=l.toLowerCase();if(d==="http"||d==="https")return e.consume(c),a}return t(c)}function a(c){return c===47?(e.consume(c),o?s:(o=!0,a)):t(c)}function s(c){return c===null||Je(c)||S(c)||M(c)||Y(c)?t(c):e.attempt(Oe,e.attempt(Be,m),t)(c)}function m(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function rr(e,n,t){let r=0;return l;function l(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),l):i===46&&r===3?(e.consume(i),o):t(i)}function o(i){return i===null?t(i):n(i)}}function ir(e,n,t){let r,l,o;return i;function i(s){return s===46||s===95?e.check(qe,a,u)(s):s===null||S(s)||M(s)||s!==45&&Y(s)?a(s):(o=!0,e.consume(s),i)}function u(s){return s===95?r=!0:(l=r,r=void 0),e.consume(s),i}function a(s){return l||r||!o?t(s):n(s)}}function ar(e,n){let t=0,r=0;return l;function l(i){return i===40?(t++,e.consume(i),l):i===41&&r<t?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(qe,n,o)(i):i===null||S(i)||M(i)?n(i):(e.consume(i),l)}function o(i){return i===41&&r++,e.consume(i),l}}function lr(e,n,t){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),l):u===60||u===null||S(u)||M(u)?
vendor: 5,275 bytes, line 61
61n(u):t(u)}function l(u){return u===null||u===40||u===91||S(u)||M(u)?n(u):r(u)}function o(u){return _(u)?i(u):t(u)}function i(u){return u===59?(e.consume(u),r):_(u)?(e.consume(u),i):t(u)}}function or(e,n,t){return r;function r(o){return e.consume(o),l}function l(o){return ee(o)?t(o):n(o)}}function He(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||S(e)}function We(e){return!_(e)}function Ke(e){return!(e===47||X(e))}function X(e){return e===43||e===45||e===46||e===95||ee(e)}function re(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const sr={tokenize:xr,partial:!0};function ur(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pr,continuation:{tokenize:mr},exit:dr}},text:{91:{name:"gfmFootnoteCall",tokenize:hr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cr,resolveTo:fr}}}}function cr(e,n,t){const r=this;let l=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;l--;){const a=r.events[l][1];if(a.type==="labelImage"){i=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return u;function u(a){if(!i||!i._balanced)return t(a);const s=B(r.sliceSerialize({start:i.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?t(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),n(a))}}function fr(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",l,n],["exit",l,n],["enter",o,n],["enter",i,n],["exit",i,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...u),e}function hr(e,n,t){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,i;return u;function u(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),a}function a(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(o>999||c===93&&!i||c===null||c===91||S(c))return t(c);if(c===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return l.includes(B(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return S(c)||(i=!0),o++,e.consume(c),c===92?m:s}function m(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function pr(e,n,t){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,i=0,u;return a;function a(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):t(p)}function m(p){if(i>999||p===93&&!u||p===null||p===91||S(p))return t(p);if(p===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=B(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return S(p)||(u=!0),i++,e.consume(p),p===92?c:m}function c(p){return p===91||p===92||p===93?(e.consume(p),i++,m):m(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l.includes(o)||l.push(o),F(e,x,"gfmFootnoteDefinitionWhitespace")):t(p)}function x(p){return n(p)}}function mr(e,n,t){return e.check(Xe,n,e.attempt(sr,n,t))}function dr(e){e.exit("gfmFootnoteDefinition")}function xr(e,n,t){const r=this;return F(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?n(o):t(o)}}function br(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:l};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function l(i,u){let a=-1;for(;++a<i.length;)if(i[a][0]==="enter"&&i[a][1].type==="strikethroughSequenceTemporary"&&i[a][1]._close){let s=a;for(;s--;)if(i[s][0]==="exit"&&i[s][1].type==="strikethroughSequenceTemporary"&&i[s][1]._open&&i[a][1].end.offset-i[a][
vendor: 5,139 bytes, line 61
611].start.offset===i[s][1].end.offset-i[s][1].start.offset){i[a][1].type="strikethroughSequence",i[s][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},i[s][1].start),end:Object.assign({},i[a][1].end)},c={type:"strikethroughText",start:Object.assign({},i[s][1].end),end:Object.assign({},i[a][1].start)},d=[["enter",m,u],["enter",i[s][1],u],["exit",i[s][1],u],["enter",c,u]],x=u.parser.constructs.insideSpan.null;x&&K(d,d.length,0,Ye(x,i.slice(s+1,a),u)),K(d,d.length,0,[["exit",c,u],["enter",i[a][1],u],["exit",i[a][1],u],["exit",m,u]]),K(i,s-1,a-s+3,d),a=s+d.length-2;break}}for(a=-1;++a<i.length;)i[a][1].type==="strikethroughSequenceTemporary"&&(i[a][1].type="data");return i}function o(i,u,a){const s=this.previous,m=this.events;let c=0;return d;function d(p){return s===126&&m[m.length-1][1].type!=="characterEscape"?a(p):(i.enter("strikethroughSequenceTemporary"),x(p))}function x(p){const k=H(s);if(p===126)return c>1?a(p):(i.consume(p),c++,x);if(c<2&&!t)return a(p);const v=i.exit("strikethroughSequenceTemporary"),g=H(p);return v._open=!g||g===2&&!!k,v._close=!k||k===2&&!!g,u(p)}}}class gr{constructor(){this.map=[]}add(n,t,r){kr(this,n,t,r)}consume(n){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let l=r.pop();for(;l;){for(const o of l)n.push(o);l=r.pop()}this.map.length=0}}function kr(e,n,t,r){let l=0;if(!(t===0&&r.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=t,e.map[l][2].push(...r);return}l+=1}e.map.push([n,t,r])}}function vr(e,n){let t=!1;const r=[];for(;n<e.length;){const l=e[n];if(t){if(l[0]==="enter")l[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function wr(){return{flow:{null:{name:"table",tokenize:yr,resolveAll:Cr}}}}function yr(e,n,t){const r=this;let l=0,o=0,i;return u;function u(h){let R=r.events.length-1;for(;R>-1;){const le=r.events[R][1].type;if(le==="lineEnding"||le==="linePrefix")R--;else break}const ie=R>-1?r.events[R][1].type:null,ae=ie==="tableHead"||ie==="tableRow"?C:a;return ae===C&&r.parser.lazy[r.now().line]?t(h):ae(h)}function a(h){return e.enter("tableHead"),e.enter("tableRow"),s(h)}function s(h){return h===124||(i=!0,o+=1),m(h)}function m(h){return h===null?t(h):P(h)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),x):t(h):E(h)?F(e,m,"whitespace")(h):(o+=1,i&&(i=!1,l+=1),h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),i=!0,m):(e.enter("data"),c(h)))}function c(h){return h===null||h===124||S(h)?(e.exit("data"),m(h)):(e.consume(h),h===92?d:c)}function d(h){return h===92||h===124?(e.consume(h),c):c(h)}function x(h){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(h):(e.enter("tableDelimiterRow"),i=!1,E(h)?F(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):p(h))}function p(h){return h===45||h===58?v(h):h===124?(i=!0,e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),k):w(h)}function k(h){return E(h)?F(e,v,"whitespace")(h):v(h)}function v(h){return h===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),g):h===45?(o+=1,g(h)):h===null||P(h)?j(h):w(h)}function g(h){return h===45?(e.enter("tableDelimiterFiller"),b(h)):w(h)}function b(h){return h===45?(e.consume(h),b):h===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(h))}function y(h){return E(h)?F(e,j,"whitespace")(h):j(h)}function j(h){return h===124?p(h):h===null||P(h)?!i||l!==o?w(h):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(h)):w(h)}function w(h){return t(h)}function C(h){return e.enter("tableRow"),q(h)}function q(h){return h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),q):h===null||P(h)?(e.exit("tableRow"),n(h)):E(h)?F(e,q,"whitespace")(h):(e.enter("data"),U(h))}function U(h){return h===null||h===124||S(h)?(e.exit("data"),q(h)):(e.consume(h),h===92?Ve:U)}function Ve(h){return h===92||h===124?(e.consume(h),U):U(h)}}function Cr(e,n){let t=-1,r=!0,l=0,o=[0,0,0,0],i=[0,0,0,0],u=!1,a=0,s,m,c;const d=new gr;for(;++t<e.length;){const x=e[t],p=x[1];x[0]==="enter"?p.type==="tableHead"?(u=!1,a!==0&&(be(d,n,a,s,m),m=void 0,a=0),s={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(t,0,[["enter",s,n]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],i=[0,t+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(t,0,[["enter",m,n]])),l=p.type==="tableDelimiterRow"?2:m?3:1):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.t
61ype==="tableDelimiterFiller")?(r=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],c=$(d,n,o,l,void 0,c),o=[0,0,0,0]),i[2]=t)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(i[0]=i[1],c=$(d,n,o,l,void 0,c)),o=i,i=[o[1],t,0,0])):p.type==="tableHead"?(u=!0,a=t):p.type==="tableRow"||p.type==="tableDelimiterRow"?(a=t,o[1]!==0?(i[0]=i[1],c=$(d,n,o,l,t,c)):i[1]!==0&&(c=$(d,n,i,l,t,c)),l=0):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(i[3]=t)}for(a!==0&&be(d,n,a,s,m),d.consume(n.events),t=-1;++t<n.events.length;){const x=n.events[t];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=vr(n.events,t))}return e}function $(e,n,t,r,l,o){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";t[0]!==0&&(o.end=Object.assign({},I(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const a=I(n.events,t[1]);if(o={type:i,start:Object.assign({},a),end:Object.assign({},a)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const s=I(n.events,t[2]),m=I(n.events,t[3]),c={type:u,start:Object.assign({},s),end:Object.assign({},m)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const d=n.events[t[2]],x=n.events[t[3]];if(d[1].end=Object.assign({},x[1].end),d[1].type="chunkText",d[1].contentType="text",t[3]>t[2]+1){const p=t[2]+1,k=t[3]-t[2]-1;e.add(p,k,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return l!==void 0&&(o.end=Object.assign({},I(n.events,l)),e.add(l,0,[["exit",o,n]]),o=void 0),o}function be(e,n,t,r,l){const o=[],i=I(n.events,t);l&&(l.end=Object.assign({},i),o.push(["exit",l,n])),r.end=Object.assign({},i),o.push(["exit",r,n]),e.add(t+1,0,o)}function I(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const jr={name:"tasklistCheck",tokenize:Sr};function Ar(){return{text:{91:jr}}}function Sr(e,n,t){const r=this;return l;function l(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return S(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),i):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),i):t(a)}function i(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):t(a)}function u(a){return P(a)?n(a):E(a)?e.check({tokenize:Nr},n,t)(a):t(a)}}function Nr(e,n,t){return F(e,r,"whitespace");function r(l){return l===null?t(l):n(l)}}function Dr(e){return et([Yn(),ur(),br(e),wr(),Ar()])}const Tr={};function Fr(e){const n=this,t=e||Tr,r=n.data(),l=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);l.push(Dr(t)),o.push(Zn()),i.push(Qn(t))}const Lr={p:e=>f.jsx("p",{className:"my-1 break-words",...e}),ul:e=>f.jsx("ul",{className:"my-1 ml-4 list-disc space-y-0.5",...e}),ol:e=>f.jsx("ol",{className:"my-1 ml-4 list-decimal space-y-0.5",...e}),li:e=>f.jsx("li",{className:"break-words",...e}),strong:e=>f.jsx("strong",{className:"font-bold",...e}),a:({href:e,...n})=>f.jsx("a",{href:e,target:"_blank",rel:"noreferrer noopener",className:"underline text-[var(--laep-action)]",...n}),h1:e=>f.jsx("p",{className:"mt-2 mb-1 font-bold",...e}),h2:e=>f.jsx("p",{className:"mt-2 mb-1 font-bold",...e}),h3:e=>f.jsx("p",{className:"mt-2 mb-1 font-bold",...e}),h4:e=>f.jsx("p",{className:"mt-2 mb-1 font-bold",...e}),blockquote:e=>f.jsx("blockquote",{className:"my-1 border-l-2 border-[var(--laep-border-subtle)] pl-2 text-[var(--laep-text-soft)]",...e}),code:({inline:e,className:n,children:t,...r})=>e?f.jsx("code",{className:"rounded bg-[var(--laep-surface-muted)] px-1 py-0.5 font-mono text-[10px]",...r,children:t}):f.jsx("code",{className:`${n||""} font-mono text-[10px]`,...r,children:t}),pre:e=>f.jsx("pre",{className:"my-1 overflow-x-auto rounded bg-[var(--laep-surface-muted)] p-1.5",...e}),table:e=>f.jsx("div",{className:"my-1 overflow-x-auto",children:f.jsx("table",{className:"w-full border-collapse text-[10px]",...e})}),th:e=>f.jsx("th",{className:"border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-muted)] px-1.5 py-0.5 text-left font-bold",...e}),td:e=>f.jsx("td",{className:"border border-[var(--laep-border-subtle)] px-1.5 py-0.5",...e}),hr:()=>f.jsx("hr",{className:"my-2 border-[var(--laep-border-subtle)]"})},Er=({text:e})=>f.jsx(tt,{remarkPlugins:[Fr],components:Lr,children:e}),Ir=({segments:e})=>f.jsx("div",{children:e.map((n,t)=>n.type==="tool"?f.jsx(vt,{segment:n},n.callId||t):f.jsx(Er,{text:n.text},t))}),Mr=({transcript:e,status:n})=>{const t=A.useRef(null);return A.useEffect(()=>{t.current?.scrollIntoView({block:"end"})},[e,n]),f.jsxs("div",{className:"flex flex-col gap-2 text-xs leading-relaxed","data-testid":"assistant-transcript",children:[e.map(r=>r.role==="user"?f.jsx("div",{className:"self-end max-w-[90%] rounded-lg rounded-br-sm bg-[var(--laep-action)] px-2.5 py-1.5 text-[var(--laep-action-contrast)] whitespace-pre-wrap break-words",children:r.text},r.id):r.role==="error"?f.jsxs("div",{className:"flex items-start gap-1.5 rounded-md border border-red-200 bg-red-50 px-2 py-1.5 text-red-800",children:[f.jsx(ht,{"aria-hidden":"true",className:"mt-0.5 w-3.5 h-3.5 shrink-0"}),f.jsx("span",{children:r.text})]},r.id):r.role==="notice"?f.jsx("div",{className:"self-center text-[10px] uppercase tracking-wider text-[var(--laep-text-soft)]",children:r.text},r.id):f.jsx("div",{className:"max-w-full rounded-lg rounded-bl-sm bg-[var(--laep-surface-panel)] border border-[var(--laep-border-subtle)] px-2.5 py-1.5 text-[var(--laep-text)]",children:f.jsx(Ir,{segments:r.segments})},r.id)),n==="streaming"&&e[e.length-1]?.role==="user"&&f.jsx("div",{className:"self-start px-2 text-[var(--laep-text-soft)] animate-pulse",children:"Thinking…"}),f.jsx("div",{ref:t})]})},zr=({pendingConfirmation:e})=>
61{if(!e)return null;const{toolCall:n,resolve:t}=e;return f.jsxs("div",{className:"mx-1 my-2 rounded-md border border-amber-300 bg-amber-50 p-2 text-xs",role:"alertdialog","aria-label":"Confirm assistant action",children:[f.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-amber-800",children:[f.jsx(Ce,{"aria-hidden":"true",className:"w-3.5 h-3.5"}),"Approve this action?"]}),f.jsxs("p",{className:"mt-1 text-amber-900",children:["The assistant wants to run ",f.jsx("strong",{children:we[n.name]||n.name}),n.input?.intervention_id?` on ${n.input.intervention_id}`:"",". This cannot be undone."]}),f.jsxs("div",{className:"mt-2 flex gap-2",children:[f.jsx("button",{type:"button",onClick:()=>t(!0),className:"flex-1 rounded bg-amber-600 px-2 py-1 font-bold text-white hover:bg-amber-700",children:"Approve"}),f.jsx("button",{type:"button",onClick:()=>t(!1),className:"flex-1 rounded border border-amber-400 px-2 py-1 font-bold text-amber-800 hover:bg-amber-100",children:"Deny"})]})]})},Rr=({initialSettings:e,onClose:n,onSaved:t})=>{const[r,l]=A.useState(e.provider),[o,i]=A.useState(e.apiKey),[u,a]=A.useState(e.provider==="anthropic"?e.model:oe[0].id),[s,m]=A.useState(e.provider==="openai"?e.model:se),[c,d]=A.useState(e.baseUrl||""),[x,p]=A.useState(!1),[k,v]=A.useState({status:"idle",message:""}),g=r==="openai"?s:u,b=r==="openai"?rt(c):"",y=async()=>{if(!o.trim()){v({status:"error",message:"Enter an API key first."});return}v({status:"testing",message:""});const C=await at({provider:r,apiKey:o.trim(),model:g,baseUrl:b}).validateKey();v(C.ok?{status:"ok",message:"Key works."}:{status:"error",message:C.error||"Validation failed."})},j=()=>{const w={provider:r,apiKey:o.trim(),model:g,baseUrl:b};lt(w),t(w)};return f.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","aria-label":"Assistant settings",children:f.jsxs("div",{className:"w-full max-w-md rounded-lg border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-panel)] p-4 shadow-xl",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h2",{className:"text-sm font-bold text-[var(--laep-text)]",children:"Assistant settings"}),f.jsx("button",{type:"button",onClick:n,"aria-label":"Close settings",className:"rounded p-1 text-[var(--laep-text-soft)] hover:bg-[var(--laep-surface-muted)]",children:f.jsx(J,{"aria-hidden":"true",className:"w-4 h-4"})})]}),f.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"mb-1 block font-semibold text-[var(--laep-text)]",children:"Provider"}),f.jsx("select",{value:r,onChange:w=>{l(w.target.value),v({status:"idle",message:""})},className:"w-full rounded border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-panel)] px-2 py-1.5",children:it.map(w=>f.jsx("option",{value:w.id,children:w.label},w.id))})]}),r==="anthropic"?f.jsxs("fieldset",{children:[f.jsx("legend",{className:"mb-1 font-semibold text-[var(--laep-text)]",children:"Model"}),f.jsx("div",{className:"space-y-1",children:oe.map(w=>f.jsxs("label",{className:"flex items-center gap-2 rounded border border-[var(--laep-border-subtle)] px-2 py-1.5 cursor-pointer hover:bg-[var(--laep-surface-muted)]",children:[f.jsx("input",{type:"radio",name:"anthropic-model",checked:u===w.id,onChange:()=>a(w.id)}),f.jsx("span",{className:"font-medium",children:w.label}),f.jsx("span",{className:"ml-auto text-[10px] text-[var(--laep-text-soft)]",children:w.hint})]},w.id))})]}):f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"mb-1 block font-semibold text-[var(--laep-text)]",children:"Model id"}),f.jsx("input",{type:"text",value:s,onChange:w=>m(w.target.value),placeholder:se,className:"w-full rounded border border-[var(--laep-border-subtle)] px-2 py-1.5"})]}),f.jsxs("label",{className:"block",children:[f.jsxs("span",{className:"mb-1 block font-semibold text-[var(--laep-text)]",children:["Base URL ",f.jsx("span",{className:"font-normal text-[var(--laep-text-soft)]",children:"(optional — any OpenAI-compatible API)"})]}),f.jsx("input",{type:"text",value:c,onChange:w=>{d(w.target.value),v({status:"idle",message:""})},placeholder:"https://api.openai.com/v1 (default)",className:"w-full rounded border border-[var(--laep-border-subtle)] px-2 py-1.5 font-mono"}),f.jsx("span",{className:"mt-1 block text-[10px] text-[var(--laep-text-soft)]",children:'e.g. DeepSeek: https://api.deepseek.com (model "deepseek-chat") · OpenRouter: https://openrouter.ai/api/v1. The endpoint must allow browser (CORS) requests.'})]})]}),f.jsxs("label",{className:"block",children:[f.jsx("span",{className:"mb-1 block font-semibold text-[var(--laep-text)]",children:"API key"}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx("input",{type:x?"text":"password",value:o,onChange:w=>{i(w.target.value),v({status:"idle",message:""})}
61,placeholder:r==="anthropic"?"sk-ant-…":"sk-…",autoComplete:"off",className:"flex-1 rounded border border-[var(--laep-border-subtle)] px-2 py-1.5 font-mono"}),f.jsx("button",{type:"button",onClick:()=>p(w=>!w),"aria-label":x?"Hide key":"Show key",className:"rounded border border-[var(--laep-border-subtle)] px-2 text-[var(--laep-text-soft)] hover:bg-[var(--laep-surface-muted)]",children:x?f.jsx(dt,{"aria-hidden":"true",className:"w-3.5 h-3.5"}):f.jsx(xt,{"aria-hidden":"true",className:"w-3.5 h-3.5"})}),f.jsx("button",{type:"button",onClick:y,disabled:k.status==="testing",className:"rounded border border-[var(--laep-border-subtle)] px-2 font-semibold text-[var(--laep-text)] hover:bg-[var(--laep-surface-muted)] disabled:opacity-50",children:k.status==="testing"?f.jsx(ye,{"aria-hidden":"true",className:"w-3.5 h-3.5 animate-spin"}):"Test"})]}),k.status==="ok"&&f.jsxs("span",{className:"mt-1 flex items-center gap-1 text-emerald-700",children:[f.jsx(ve,{"aria-hidden":"true",className:"w-3 h-3"}),k.message]}),k.status==="error"&&f.jsx("span",{className:"mt-1 block text-red-700",children:k.message})]}),f.jsx("p",{className:"rounded border border-amber-200 bg-amber-50 p-2 text-[11px] leading-snug text-amber-900",children:"Your key is stored unencrypted in this browser's localStorage and sent only to the provider's API. Use a dedicated key with a spend limit, and don't enter it on a shared computer."})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2 text-xs",children:[f.jsx("button",{type:"button",onClick:n,className:"rounded border border-[var(--laep-border-subtle)] px-3 py-1.5 font-semibold text-[var(--laep-text)] hover:bg-[var(--laep-surface-muted)]",children:"Cancel"}),f.jsx("button",{type:"button",onClick:j,className:"rounded bg-[var(--laep-action)] px-3 py-1.5 font-bold text-[var(--laep-action-contrast)] hover:bg-[var(--laep-action-hover)]",children:"Save"})]})]})})},Pr=["Add a £5m heat pump intervention starting 2027","Target the most fuel-poor buildings with insulation","Run the simulation and summarise the results"],Wr=({assistant:e})=>{const[n,t]=A.useState(()=>ot()),[r,l]=A.useState(!1),[o,i]=A.useState(""),u=A.useRef(null),{transcript:a,status:s,pendingConfirmation:m,sendMessage:c,cancel:d,clearConversation:x}=e,p=!!n.apiKey||ue(),k=s==="streaming"||s==="executing"||s==="awaiting-confirmation",v=()=>{const b=o.trim();!b||k||!p||(i(""),c(b))},g=b=>{(b.provider!==n.provider||b.model!==n.model||(b.baseUrl||"")!==(n.baseUrl||""))&&x(),t(b),l(!1)};return f.jsxs("section",{"aria-label":"Planning assistant","data-testid":"assistant-panel",className:"flex h-full min-h-0 flex-col rounded-lg border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-panel)]",children:[f.jsxs("header",{className:"flex items-center gap-1.5 border-b border-[var(--laep-border-subtle)] px-2 py-1.5",children:[f.jsx(st,{"aria-hidden":"true",className:"w-3.5 h-3.5 text-[var(--laep-action)]"}),f.jsx("span",{className:"flex-1 truncate text-xs font-bold text-[var(--laep-text)]",children:"Assistant"}),f.jsx("span",{className:"truncate text-[10px] text-[var(--laep-text-soft)]",title:n.model,children:ue()?"mock":n.model}),f.jsx("button",{type:"button",onClick:x,disabled:k||a.length===0,"aria-label":"Clear conversation",title:"Clear conversation",className:"rounded p-1 text-[var(--laep-text-soft)] hover:bg-[var(--laep-surface-muted)] hover:text-[var(--laep-text)] disabled:opacity-40",children:f.jsx(mt,{"aria-hidden":"true",className:"w-3.5 h-3.5"})}),f.jsx("button",{type:"button",onClick:()=>l(!0),"aria-label":"Assistant settings",title:"Assistant settings",className:"rounded p-1 text-[var(--laep-text-soft)] hover:bg-[var(--laep-surface-muted)] hover:text-[var(--laep-text)]",children:f.jsx(ut,{"aria-hidden":"true",className:"w-3.5 h-3.5"})})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:p?a.length===0?f.jsxs("div",{className:"flex h-full flex-col justify-end gap-1.5 text-xs",children:[f.jsx("p",{className:"mb-1 text-[var(--laep-text-soft)]",children:"Describe an intervention, ask about the scenario, or request a simulation. Try:"}),Pr.map(b=>f.jsx("button",{type:"button",onClick:()=>c(b),className:"rounded border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-muted)] px-2 py-1.5 text-left text-[var(--laep-text)] hover:border-[var(--laep-action)]",children:b},b))]}):f.jsxs(f.Fragment,{children:[f.jsx(Mr,{transcript:a,status:s}),f.jsx(zr,{pendingConfirmation:m})]}):f.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-3 text-center text-xs text-[var(--laep-text-soft)]",children:[f.jsx(bt,{"aria-hidden":"true",className:"w-6 h-6"}),f.jsx("p",{children:"Bring your own API key to chat with the planning assistant."}),f.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded bg-[var(--laep-action)] px-3 py-1.5 font-bold text-[var(--laep-action-contrast)] hover:bg-[var(--laep-action-hover)]",children:"Set API key"})]})}),f.jsx("footer",{className:"border-t border-[var(--laep-border-subtle)] p-2",children:f.jsxs("div",{className:"flex items-end gap-1",children:[f.jsx("textarea",{ref:u,rows:2,value:o,onChange:b=>i(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),v())},placeholder:p?"Ask the assistant…":"Set an API key first",disabled:!p,"aria-label":"Message the assistant",className:"min-h-0 flex-1 resize-none rounded border border-[var(--laep-border-subtle)] bg-[var(--laep-surface-panel)] px-2 py-1.5 text-xs text-[var(--laep-text)] focu
61s:outline-none focus:ring-1 focus:ring-[var(--laep-focus)] disabled:opacity-50"}),k?f.jsx("button",{type:"button",onClick:d,"aria-label":"Stop",title:"Stop",className:"rounded bg-red-600 p-2 text-white hover:bg-red-700",children:f.jsx(ft,{"aria-hidden":"true",className:"w-3.5 h-3.5 fill-current"})}):f.jsx("button",{type:"button",onClick:v,disabled:!o.trim()||!p,"aria-label":"Send message",title:"Send",className:"rounded bg-[var(--laep-action)] p-2 text-[var(--laep-action-contrast)] hover:bg-[var(--laep-action-hover)] disabled:opacity-40",children:f.jsx(gt,{"aria-hidden":"true",className:"w-3.5 h-3.5"})})]})}),r&&f.jsx(Rr,{initialSettings:n,onClose:()=>l(!1),onSaved:g})]})};export{Wr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.