@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.11
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.
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.js +22 -22
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/index.d.ts +99 -0
- package/dist/agent-utils/index.js +148 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +30 -1
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/cdn/{V2P4AIGG.js → 24QNMEFG.js} +1 -1
- package/dist/cdn/{NAUXSHIE.js → 34SG44C3.js} +2 -2
- package/dist/cdn/3JGWGKT6.js +2 -0
- package/dist/cdn/3NBDVZ2I.js +2 -0
- package/dist/cdn/3VOQD2MR.js +2 -0
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/53NTYC4I.js +2 -0
- package/dist/cdn/{4HU7735A.js → 5CV7R5IS.js} +6 -4
- package/dist/cdn/{AMP6IALT.js → 5W7S2RS4.js} +1 -1
- package/dist/cdn/{FL4W4VYN.js → 6ZW7Z36F.js} +16 -0
- package/dist/cdn/7CYGX4F4.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → AZGGTNA3.js} +1 -1
- package/dist/cdn/B7WJFBOZ.js +2 -0
- package/dist/cdn/BX7FSMUU.js +56 -0
- package/dist/cdn/CHPQM77M.js +181 -0
- package/dist/cdn/DHKUXLU3.js +179 -0
- package/dist/cdn/DQSEBKOX.js +2 -0
- package/dist/cdn/DXVU45KM.js +2 -0
- package/dist/cdn/{P6OPJQMC.js → DZ2QWNUA.js} +1 -1
- package/dist/cdn/EBISDZ5H.js +2 -0
- package/dist/cdn/{MDVYQQUG.js → ERL2CB2Y.js} +5 -5
- package/dist/cdn/F6QHMKF5.js +2 -0
- package/dist/cdn/FUIGPHBH.js +2 -0
- package/dist/cdn/{AO7BQHKC.js → H2CHHGGH.js} +1 -1
- package/dist/cdn/{OH64RMOR.js → HWKDNS4K.js} +2 -2
- package/dist/cdn/IMQ4TVHF.js +16 -0
- package/dist/cdn/IOD3GDA7.js +2 -0
- package/dist/cdn/IR7PTESF.js +2 -0
- package/dist/cdn/IRZDTYO2.js +2 -0
- package/dist/cdn/JIWK6QK6.js +2 -0
- package/dist/cdn/{S6W6HV4T.js → JLKGS6Y5.js} +12 -12
- package/dist/cdn/K3JCH4XW.js +2 -0
- package/dist/cdn/KHXUWZHB.js +2 -0
- package/dist/cdn/LIFK3QSD.js +2 -0
- package/dist/cdn/NXKKG5TK.js +2 -0
- package/dist/cdn/{FX5JFRDL.js → O3EN27N5.js} +1 -1
- package/dist/cdn/O3RFFPU3.js +6 -0
- package/dist/cdn/P7DG5T3Z.js +9 -0
- package/dist/cdn/PBO6FZN6.js +2 -0
- package/dist/cdn/Q3ZW4FYA.js +3 -0
- package/dist/cdn/Q6LRANX6.js +2 -0
- package/dist/cdn/Q7TL5Q5N.js +2 -0
- package/dist/cdn/QCSN44H4.js +2 -0
- package/dist/cdn/R56X6ZKR.js +161 -0
- package/dist/cdn/{HB5A5R2E.js → RUURNLTP.js} +1 -1
- package/dist/cdn/T43LEBBE.js +47 -0
- package/dist/cdn/{ZLXN7NMF.js → T537PKP4.js} +9 -7
- package/dist/cdn/TR4GFL7X.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → UPEEHMSY.js} +1 -1
- package/dist/cdn/WAIFKDR3.js +2 -0
- package/dist/cdn/WNS5ZUF5.js +2 -0
- package/dist/cdn/X4XY5HIE.js +2 -0
- package/dist/cdn/XOH56EQ2.js +2 -0
- package/dist/cdn/XON27U6U.js +2 -0
- package/dist/cdn/{H7422XUG.js → YLN2BZ5J.js} +1 -1
- package/dist/cdn/{2AXF774U.js → YUKR4AZW.js} +1 -1
- package/dist/cdn/{JY6LLOUJ.js → Z2G7MP5L.js} +3 -3
- package/dist/cdn/ZEYIBYSF.js +66 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/adapter.js +1390 -1323
- package/dist/chunks/arcgisKnowledgeGraph.js +109 -72
- package/dist/chunks/dataExplorationGraph.js +108 -96
- package/dist/chunks/generateLayerDescriptions.js +206 -168
- package/dist/chunks/helpGraph.js +16 -13
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +23 -20
- package/dist/chunks/navigationGraph.js +34 -30
- package/dist/chunks/orchestrator.js +241 -201
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +5 -3
- package/dist/components/arcgis-assistant/customElement.d.ts +15 -0
- package/dist/components/arcgis-assistant/customElement.js +228 -127
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +7 -7
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +13 -9
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-message/customElement.d.ts +23 -0
- package/dist/components/arcgis-assistant-message/customElement.js +28 -26
- package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/loader.js +6 -5
- package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
- package/dist/types/lumina.d.ts +10 -4
- package/dist/types/preact.d.ts +11 -4
- package/dist/types/react.d.ts +12 -4
- package/dist/types/stencil.d.ts +10 -4
- package/dist/utils/index.d.ts +87 -43
- package/dist/utils/index.js +54 -49
- package/package.json +8 -7
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/FHVXO2WG.js +0 -166
- package/dist/cdn/GSEPHN3A.js +0 -106
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/ON2V5XI2.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/V5YEZSRY.js +0 -16
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YY2SBO3V.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{i as Te,j as oe,q as Re,r as $e,s as Le}from"./
|
|
3
|
-
`&&a()}return W.trim(l)}var xt=bt,X=z,mt=xt;function Ee(e){return e==null}function wt(e){var t={};for(var r in e)t[r]=e[r];return t}function Pe(e){e=wt(e||{}),e.whiteList=e.whiteList||X.whiteList,e.onAttr=e.onAttr||X.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||X.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||X.safeAttrValue,this.options=e}Pe.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onAttr,i=r.onIgnoreAttr,l=r.safeAttrValue,a=mt(e,function(c,o,p,u,f){var h=n[p],g=!1;if(h===!0?g=h:typeof h=="function"?g=h(u):h instanceof RegExp&&(g=h.test(u)),g!==!0&&(g=!1),u=l(p,u),!!u){var b={position:o,sourcePosition:c,source:f,isWhite:g};if(g){var m=s(p,u,b);return Ee(m)?p+":"+u:m}else{var m=i(p,u,b);if(!Ee(m))return m}}});return a};var yt=Pe;(function(e,t){var r=z,n=yt;function s(l,a){var c=new n(a);return c.process(l)}t=e.exports=s,t.FilterCSS=n;for(var i in r)t[i]=r[i]})(ue,ue.exports);var pe=ue.exports,fe={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,s;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,s=e.length;n<s;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,r=t.exec(e);return r?r.index:-1}},vt=pe.FilterCSS,At=pe.getDefaultWhiteList,Y=fe;function Oe(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qe=new vt;function St(e,t,r){}function Tt(e,t,r){}function Rt(e,t,r){}function $t(e,t,r){}function Be(e){return e.replace(Et,"<").replace(_t,">")}function Lt(e,t,r,n){if(r=We(r),t==="href"||t==="src"){if(r=Y.trim(r),r==="#")return"#";if(!(r.substr(0,7)==="http://"||r.substr(0,8)==="https://"||r.substr(0,7)==="mailto:"||r.substr(0,4)==="tel:"||r.substr(0,11)==="data:image/"||r.substr(0,6)==="ftp://"||r.substr(0,2)==="./"||r.substr(0,3)==="../"||r[0]==="#"||r[0]==="/"))return""}else if(t==="background"){if(Q.lastIndex=0,Q.test(r))return""}else if(t==="style"){if(_e.lastIndex=0,_e.test(r)||(ze.lastIndex=0,ze.test(r)&&(Q.lastIndex=0,Q.test(r))))return"";n!==!1&&(n=n||qe,r=n.process(r))}return r=Me(r),r}var Et=/</g,_t=/>/g,zt=/"/g,Ct=/"/g,It=/&#([a-zA-Z0-9]*);?/gim,Pt=/:?/gim,Ot=/&newline;?/gim,Q=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,_e=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ze=/u\s*r\s*l\s*\(.*/gi;function De(e){return e.replace(zt,""")}function Fe(e){return e.replace(Ct,'"')}function Ne(e){return e.replace(It,function(r,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function Ve(e){return e.replace(Pt,":").replace(Ot," ")}function He(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return Y.trim(t)}function We(e){return e=Fe(e),e=Ne(e),e=Ve(e),e=He(e),e}function Me(e){return e=De(e),e=Be(e),e}function qt(){return""}function Bt(e,t){typeof t!="function"&&(t=function(){});var r=!Array.isArray(e);function n(l){return r?!0:Y.indexOf(e,l)!==-1}var s=[],i=!1;return{onIgnoreTag:function(l,a,c){if(n(l))if(c.isClosing){var o="[/removed]",p=c.position+o.length;return s.push([i!==!1?i:c.position,p]),i=!1,o}else return i||(i=c.position),"[removed]";else return t(l,a,c)},remove:function(l){var a="",c=0;return Y.forEach(s,function(o){a+=l.slice(c,o[0]),c=o[1]}),a+=l.slice(c),a}}}function Dt(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("<!--",r);if(n===-1){t+=e.slice(r);break}t+=e.slice(r,n);var s=e.indexOf("-->",n);if(s===-1)break;r=s+3}return t}function Ft(e){var t=e.split("");return t=t.filter(function(r){var n=r.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}x.whiteList=Oe();x.getDefaultWhiteList=Oe;x.onTag=St;x.onIgnoreTag=Tt;x.onTagAttr=Rt;x.onIgnoreTagAttr=$t;x.safeAttrValue=Lt;x.escapeHtml=Be;x.escapeQuote=De;x.unescapeQuote=Fe;x.escapeHtmlEntities=Ne;x.escapeDangerHtml5Entities=Ve;x.clearNonPrintableCharacter=He;x.friendlyAttrValue=We;x.escapeAttrValue=Me;x.onIgnoreTagStripAll=qt;x.StripTagBody=Bt;x.stripCommentTag=Dt;x.stripBlankChar=Ft;x.cssFilter=qe;x.getDefaultCSSWhiteList=At;var ee={},R=fe;function Nt(e){var t=R.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=R.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function Vt(e){return e.slice(0,2)==="</"}function Ht(e,t,r){var n="",s=0,i=!1,l=!1,a=0,c=e.length,o="",p="";e:for(a=0;a<c;a++){var u=e.charAt(a);if(i===!1){if(u==="<"){i=a;continue}}else if(l===!1){if(u==="<"){n+=r(e.slice(s,a)),i=a,s=a;continue}if(u===">"){n+=r(e.slice(s,i)),p=e.slice(i,a+1),o=Nt(p),n+=t(i,n.length,o,p,Vt(p)),s=a+1,i=!1;continue}if(u==='"'||u==="'")for(var f=1,h=e.charAt(a-f);h.trim()===""||h==="=";){if(h==="="){l=u;continue e}h=e.charAt(a-++f)}}else if(u===l){l=!1;continue}}return s<e.length&&(n+=r(e.substr(s))),n}var Wt=/[^a-zA-Z0-9\\_:.-]/gim;function Mt(e,t){var r=0,n=0,s=[],i=!1,l=e.length;function a(f,h){if(f=R.trim(f),f=f.replace(Wt,"").toLowerCase(),!(f.length<1)){var g=t(f,h||"");g&&s.push(g)}}for(var c=0;c<l;c++){var o=e.charAt(c),p,u;if(i===!1&&o==="="){i=e.slice(r,c),r=c+1,n=e.charAt(r)==='"'||e.charAt(r)==="'"?r:jt(e,c+1);continue}if(i!==!1&&c===n){if(u=e.indexOf(o,c+1),u===-1)break;p=R.trim(e.slice(n+1,u)),a(i,p),i=!1,c=u,r=c+1;continue}if(/\s|\n|\t/.test(o))if(e=e.replace(/\s|\n|\t/g," "),i===!1)if(u=Gt(e,c),u===-1){p=R.trim(e.slice(r,c)),a(p),i=!1,r=c+1;continue}else{c=u-1;continue}else if(u=Zt(e,c-1),u===-1){p=R.trim(e.slice(r,c)),p=Ce(p),a(i,p),i=!1,r=c+1;continue}else continue}return r<e.length&&(i===!1?a(e.slice(r)):a(i,Ce(R.trim(e.slice(r))))),R.trim(s.join(" "))}function Gt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="="?t:-1}}function jt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="'"||r==='"'?t:-1}}function Zt(e,t){for(;t>0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function Xt(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Ce(e){return Xt(e)?e.substr(1,e.length-2):e}ee.parseTag=Ht;ee.parseAttr=Mt;var Qt=pe.FilterCSS,y=x,Ge=ee,Ut=Ge.parseTag,Jt=Ge.parseAttr,J=fe;function U(e){return e==null}function Kt(e){var t=J.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=J.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=J.trim(e.slice(0,-1))),{html:e,closing:r}}function Yt(e){var t={};for(var r in e)t[r]=e[r];return t}function er(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(n){return n.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function je(e){e=Yt(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=y.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=er(e.whiteList||e.allowList):e.whiteList=y.whiteList,e.onTag=e.onTag||y.onTag,e.onTagAttr=e.onTagAttr||y.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||y.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||y.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||y.safeAttrValue,e.escapeHtml=e.escapeHtml||y.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Qt(e.css))}je.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onTag,i=r.onIgnoreTag,l=r.onTagAttr,a=r.onIgnoreTagAttr,c=r.safeAttrValue,o=r.escapeHtml,p=t.cssFilter;r.stripBlankChar&&(e=y.stripBlankChar(e)),r.allowCommentTag||(e=y.stripCommentTag(e));var u=!1;r.stripIgnoreTagBody&&(u=y.StripTagBody(r.stripIgnoreTagBody,i),i=u.onIgnoreTag);var f=Ut(e,function(h,g,b,m,L){var E={sourcePosition:h,position:g,isClosing:L,isWhite:Object.prototype.hasOwnProperty.call(n,b)},_=s(b,m,E);if(!U(_))return _;if(E.isWhite){if(E.isClosing)return"</"+b+">";var Z=Kt(m),N=n[b],T=Jt(Z.html,function(O,q){var le=J.indexOf(N,O)!==-1,V=l(b,O,q,le);return U(V)?le?(q=c(b,O,q,p),q?O+'="'+q+'"':O):(V=a(b,O,q,le),U(V)?void 0:V):V});return m="<"+b,T&&(m+=" "+T),Z.closing&&(m+=" /"),m+=">",m}else return _=i(b,m,E),U(_)?o(m):_},o);return u&&(f=u.remove(f)),f};var tr=je;(function(e,t){var r=x,n=ee,s=tr;function i(a,c){var o=new s(c);return o.process(a)}t=e.exports=i,t.filterXSS=i,t.FilterXSS=s,(function(){for(var a in r)t[a]=r[a];for(var c in n)t[c]=n[c]})();function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(ce,ce.exports);var B=ce.exports,rr=function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},Ze=(function(){function e(t,r){var n=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],article:["style"],aside:["style"],audio:["autoplay","controls","loop","muted","preload"],b:[],blockquote:["style"],br:[],code:["style"],dd:["style"],del:["style"],details:["open","style"],div:["align","aria-hidden","aria-label","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],footer:["style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],header:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],main:["style"],mark:["style"],nav:["style"],ol:[],p:["style"],pre:["style"],section:["style"],source:["media","src","type"],span:["aria-hidden","aria-label","style"],strong:[],sub:["style"],summary:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],time:["style"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.arcgisCSSWhiteList=K(K({},B.getDefaultCSSWhiteList()),{"align-items":!0,"align-self":!0,flex:!0,"flex-basis":!0,"flex-direction":!0,"flex-flow":!0,"flex-grow":!0,"flex-shrink":!0,"flex-wrap":!0,float:!0,gap:!0,grid:!0,"grid-area":!0,"grid-auto-columns":!0,"grid-auto-flow":!0,"grid-auto-rows":!0,"grid-column":!0,"grid-column-end":!0,"grid-column-start":!0,"grid-row":!0,"grid-row-end":!0,"grid-row-start":!0,"grid-template":!0,"grid-template-areas":!0,"grid-template-columns":!0,"grid-template-rows":!0,"justify-content":!0,"justify-items":!0,"justify-self":!0,"line-height":!0,overflow:!0}),this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(i,l,a,c){return i==="a"&&l==="href"||(i==="img"||i==="source")&&l==="src"?n.sanitizeUrl(a):B.safeAttrValue(i,l,a,c)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var s;t&&!r?s=t:t&&r?(s=Object.create(this.arcgisFilterOptions),s.css={whiteList:this.arcgisCSSWhiteList},Object.keys(t).forEach(function(i){if(i==="whiteList")s.whiteList=n._extendObjectOfArrays([n.arcgisWhiteList,t.whiteList||{}]);else if(i==="css"){var l=t.css.whiteList;l!=null&&t.css instanceof Object&&Object.keys(l).forEach(function(a){return s.css.whiteList[a]=l[a]})}else s[i]=t[i]})):(s=Object.create(this.arcgisFilterOptions),s.whiteList=this.arcgisWhiteList,s.css={whiteList:this.arcgisCSSWhiteList}),this.xssFilterOptions=s,this._xssFilter=new B.FilterXSS(s)}return e.prototype.sanitize=function(t,r){switch(r===void 0&&(r={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,r);default:return r.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,r){var n=(r??{}).isProtocolRequired,s=n===void 0?!0:n,i=this._trim(t.substring(0,t.indexOf(":"))),l=t==="/",a=/^#/.test(t),c=i&&this.allowedProtocols.indexOf(i.toLowerCase())>-1;return l||a||c?B.escapeAttrValue(t):!i&&!s?B.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,r,n,s){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,r,n,s):B.safeAttrValue(t,r,n,s)},e.prototype.validate=function(t,r){r===void 0&&(r={});var n=this.sanitize(t,r);return{isValid:t===n,sanitized:n}},e.prototype.encodeHTML=function(t){var r=this;return String(t).replace(/[&<>"'\/]/g,function(n){return r._entityMap[n]})},e.prototype.encodeAttrValue=function(t){var r=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(n,s){return r.test(n)?n:"&#x".concat(Number(t.charCodeAt(s)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var r={};return t.forEach(function(n){Object.keys(n).forEach(function(s){Array.isArray(n[s])&&Array.isArray(r[s])?r[s]=r[s].concat(n[s]):r[s]=n[s]})}),r},e.prototype._iterateOverObject=function(t,r){var n=this;r===void 0&&(r={});try{var s=!1,i=void 0;if(Array.isArray(t))i=t.reduce(function(a,c){var o=n.validate(c,r);return o.isValid?a.concat([c]):(s=!0,a.concat([o.sanitized]))},[]);else if(rr(t)){var l=Object.keys(t);i=l.reduce(function(a,c){var o=t[c],p=n.validate(o,r);return p.isValid?a[c]=o:(s=!0,a[c]=p.sanitized),a},{})}else return r.allowUndefined&&typeof t>"u"?void 0:null;return s?i:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e})();function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var P=ke();function tt(e){P=e}var C={exec:()=>null};function D(e){let t=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),s=t[n];return s||(s=e(n),t[n]=s),s}}function d(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(w.caret,"$1"),r=r.replace(s,l),n},getRegex:()=>new RegExp(r,t)};return n}var nr=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:D(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:D(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:D(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:D(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:D(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:D(e=>new RegExp(`^ {0,${e}}>`))},sr=/^(?:[ \t]*(?:\n|$))+/,ir=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ar=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,j=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,rt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nt=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),or=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cr=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ur=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pr=d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,be).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",we=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fr=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",we).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),st=d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),hr=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",st).getRegex(),ye={blockquote:hr,code:ir,def:ur,fences:ar,heading:lr,hr:j,html:fr,lheading:nt,list:pr,newline:sr,paragraph:st,table:C,text:cr},Xe=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),gr={...ye,lheading:or,table:Xe,paragraph:d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},dr={...ye,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(xe).replace("hr",j).replace("heading",` *#{1,6} *[^
|
|
2
|
+
import{i as Te,j as oe,q as Re,r as $e,s as Le}from"./HWKDNS4K.js";var H=class extends Le{constructor(t){if(super(t),this.it=oe,t.type!==Re.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===oe||t==null)return this._t=void 0,this.it=t;if(t===Te)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let r=[t];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};H.directiveName="unsafeHTML",H.resultType=1;var Jr=$e(H);var K=function(){return K=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},K.apply(this,arguments)},ce={exports:{}},x={},ue={exports:{}},z={};function Ie(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function ft(e,t,r){}function ht(e,t,r){}var gt=/javascript\s*\:/img;function dt(e,t){return gt.test(t)?"":t}z.whiteList=Ie();z.getDefaultWhiteList=Ie;z.onAttr=ft;z.onIgnoreAttr=ht;z.safeAttrValue=dt;var kt={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,s;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,s=e.length;n<s;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},W=kt;function bt(e,t){e=W.trimRight(e),e[e.length-1]!==";"&&(e+=";");var r=e.length,n=!1,s=0,i=0,l="";function a(){if(!n){var p=W.trim(e.slice(s,i)),u=p.indexOf(":");if(u!==-1){var f=W.trim(p.slice(0,u)),h=W.trim(p.slice(u+1));if(f){var g=t(s,l.length,f,h,p);g&&(l+=g+"; ")}}}s=i+1}for(;i<r;i++){var c=e[i];if(c==="/"&&e[i+1]==="*"){var o=e.indexOf("*/",i+2);if(o===-1)break;i=o+1,s=i+1,n=!1}else c==="("?n=!0:c===")"?n=!1:c===";"?n||a():c===`
|
|
3
|
+
`&&a()}return W.trim(l)}var xt=bt,X=z,mt=xt;function Ee(e){return e==null}function wt(e){var t={};for(var r in e)t[r]=e[r];return t}function Pe(e){e=wt(e||{}),e.whiteList=e.whiteList||X.whiteList,e.onAttr=e.onAttr||X.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||X.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||X.safeAttrValue,this.options=e}Pe.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onAttr,i=r.onIgnoreAttr,l=r.safeAttrValue,a=mt(e,function(c,o,p,u,f){var h=n[p],g=!1;if(h===!0?g=h:typeof h=="function"?g=h(u):h instanceof RegExp&&(g=h.test(u)),g!==!0&&(g=!1),u=l(p,u),!!u){var b={position:o,sourcePosition:c,source:f,isWhite:g};if(g){var m=s(p,u,b);return Ee(m)?p+":"+u:m}else{var m=i(p,u,b);if(!Ee(m))return m}}});return a};var yt=Pe;(function(e,t){var r=z,n=yt;function s(l,a){var c=new n(a);return c.process(l)}t=e.exports=s,t.FilterCSS=n;for(var i in r)t[i]=r[i]})(ue,ue.exports);var pe=ue.exports,fe={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,s;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,s=e.length;n<s;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,r=t.exec(e);return r?r.index:-1}},vt=pe.FilterCSS,At=pe.getDefaultWhiteList,Y=fe;function Oe(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qe=new vt;function St(e,t,r){}function Tt(e,t,r){}function Rt(e,t,r){}function $t(e,t,r){}function Be(e){return e.replace(Et,"<").replace(_t,">")}function Lt(e,t,r,n){if(r=We(r),t==="href"||t==="src"){if(r=Y.trim(r),r==="#")return"#";if(!(r.substr(0,7)==="http://"||r.substr(0,8)==="https://"||r.substr(0,7)==="mailto:"||r.substr(0,4)==="tel:"||r.substr(0,11)==="data:image/"||r.substr(0,6)==="ftp://"||r.substr(0,2)==="./"||r.substr(0,3)==="../"||r[0]==="#"||r[0]==="/"))return""}else if(t==="background"){if(Q.lastIndex=0,Q.test(r))return""}else if(t==="style"){if(_e.lastIndex=0,_e.test(r)||(ze.lastIndex=0,ze.test(r)&&(Q.lastIndex=0,Q.test(r))))return"";n!==!1&&(n=n||qe,r=n.process(r))}return r=Me(r),r}var Et=/</g,_t=/>/g,zt=/"/g,Ct=/"/g,It=/&#([a-zA-Z0-9]*);?/gim,Pt=/:?/gim,Ot=/&newline;?/gim,Q=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,_e=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ze=/u\s*r\s*l\s*\(.*/gi;function De(e){return e.replace(zt,""")}function Fe(e){return e.replace(Ct,'"')}function Ne(e){return e.replace(It,function(r,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function Ve(e){return e.replace(Pt,":").replace(Ot," ")}function He(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return Y.trim(t)}function We(e){return e=Fe(e),e=Ne(e),e=Ve(e),e=He(e),e}function Me(e){return e=De(e),e=Be(e),e}function qt(){return""}function Bt(e,t){typeof t!="function"&&(t=function(){});var r=!Array.isArray(e);function n(l){return r?!0:Y.indexOf(e,l)!==-1}var s=[],i=!1;return{onIgnoreTag:function(l,a,c){if(n(l))if(c.isClosing){var o="[/removed]",p=c.position+o.length;return s.push([i!==!1?i:c.position,p]),i=!1,o}else return i||(i=c.position),"[removed]";else return t(l,a,c)},remove:function(l){var a="",c=0;return Y.forEach(s,function(o){a+=l.slice(c,o[0]),c=o[1]}),a+=l.slice(c),a}}}function Dt(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("<!--",r);if(n===-1){t+=e.slice(r);break}t+=e.slice(r,n);var s=e.indexOf("-->",n);if(s===-1)break;r=s+3}return t}function Ft(e){var t=e.split("");return t=t.filter(function(r){var n=r.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}x.whiteList=Oe();x.getDefaultWhiteList=Oe;x.onTag=St;x.onIgnoreTag=Tt;x.onTagAttr=Rt;x.onIgnoreTagAttr=$t;x.safeAttrValue=Lt;x.escapeHtml=Be;x.escapeQuote=De;x.unescapeQuote=Fe;x.escapeHtmlEntities=Ne;x.escapeDangerHtml5Entities=Ve;x.clearNonPrintableCharacter=He;x.friendlyAttrValue=We;x.escapeAttrValue=Me;x.onIgnoreTagStripAll=qt;x.StripTagBody=Bt;x.stripCommentTag=Dt;x.stripBlankChar=Ft;x.cssFilter=qe;x.getDefaultCSSWhiteList=At;var ee={},R=fe;function Nt(e){var t=R.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=R.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function Vt(e){return e.slice(0,2)==="</"}function Ht(e,t,r){var n="",s=0,i=!1,l=!1,a=0,c=e.length,o="",p="";e:for(a=0;a<c;a++){var u=e.charAt(a);if(i===!1){if(u==="<"){i=a;continue}}else if(l===!1){if(u==="<"){n+=r(e.slice(s,a)),i=a,s=a;continue}if(u===">"){n+=r(e.slice(s,i)),p=e.slice(i,a+1),o=Nt(p),n+=t(i,n.length,o,p,Vt(p)),s=a+1,i=!1;continue}if(u==='"'||u==="'")for(var f=1,h=e.charAt(a-f);h.trim()===""||h==="=";){if(h==="="){l=u;continue e}h=e.charAt(a-++f)}}else if(u===l){l=!1;continue}}return s<e.length&&(n+=r(e.substr(s))),n}var Wt=/[^a-zA-Z0-9\\_:.-]/gim;function Mt(e,t){var r=0,n=0,s=[],i=!1,l=e.length;function a(f,h){if(f=R.trim(f),f=f.replace(Wt,"").toLowerCase(),!(f.length<1)){var g=t(f,h||"");g&&s.push(g)}}for(var c=0;c<l;c++){var o=e.charAt(c),p,u;if(i===!1&&o==="="){i=e.slice(r,c),r=c+1,n=e.charAt(r)==='"'||e.charAt(r)==="'"?r:jt(e,c+1);continue}if(i!==!1&&c===n){if(u=e.indexOf(o,c+1),u===-1)break;p=R.trim(e.slice(n+1,u)),a(i,p),i=!1,c=u,r=c+1;continue}if(/\s|\n|\t/.test(o))if(e=e.replace(/\s|\n|\t/g," "),i===!1)if(u=Gt(e,c),u===-1){p=R.trim(e.slice(r,c)),a(p),i=!1,r=c+1;continue}else{c=u-1;continue}else if(u=Zt(e,c-1),u===-1){p=R.trim(e.slice(r,c)),p=Ce(p),a(i,p),i=!1,r=c+1;continue}else continue}return r<e.length&&(i===!1?a(e.slice(r)):a(i,Ce(R.trim(e.slice(r))))),R.trim(s.join(" "))}function Gt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="="?t:-1}}function jt(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="'"||r==='"'?t:-1}}function Zt(e,t){for(;t>0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function Xt(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Ce(e){return Xt(e)?e.substr(1,e.length-2):e}ee.parseTag=Ht;ee.parseAttr=Mt;var Qt=pe.FilterCSS,y=x,Ge=ee,Ut=Ge.parseTag,Jt=Ge.parseAttr,J=fe;function U(e){return e==null}function Kt(e){var t=J.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=J.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=J.trim(e.slice(0,-1))),{html:e,closing:r}}function Yt(e){var t={};for(var r in e)t[r]=e[r];return t}function er(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(n){return n.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function je(e){e=Yt(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=y.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=er(e.whiteList||e.allowList):e.whiteList=y.whiteList,e.onTag=e.onTag||y.onTag,e.onTagAttr=e.onTagAttr||y.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||y.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||y.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||y.safeAttrValue,e.escapeHtml=e.escapeHtml||y.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Qt(e.css))}je.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,s=r.onTag,i=r.onIgnoreTag,l=r.onTagAttr,a=r.onIgnoreTagAttr,c=r.safeAttrValue,o=r.escapeHtml,p=t.cssFilter;r.stripBlankChar&&(e=y.stripBlankChar(e)),r.allowCommentTag||(e=y.stripCommentTag(e));var u=!1;r.stripIgnoreTagBody&&(u=y.StripTagBody(r.stripIgnoreTagBody,i),i=u.onIgnoreTag);var f=Ut(e,function(h,g,b,m,L){var E={sourcePosition:h,position:g,isClosing:L,isWhite:Object.prototype.hasOwnProperty.call(n,b)},_=s(b,m,E);if(!U(_))return _;if(E.isWhite){if(E.isClosing)return"</"+b+">";var Z=Kt(m),N=n[b],T=Jt(Z.html,function(O,q){var le=J.indexOf(N,O)!==-1,V=l(b,O,q,le);return U(V)?le?(q=c(b,O,q,p),q?O+'="'+q+'"':O):(V=a(b,O,q,le),U(V)?void 0:V):V});return m="<"+b,T&&(m+=" "+T),Z.closing&&(m+=" /"),m+=">",m}else return _=i(b,m,E),U(_)?o(m):_},o);return u&&(f=u.remove(f)),f};var tr=je;(function(e,t){var r=x,n=ee,s=tr;function i(a,c){var o=new s(c);return o.process(a)}t=e.exports=i,t.filterXSS=i,t.FilterXSS=s,(function(){for(var a in r)t[a]=r[a];for(var c in n)t[c]=n[c]})();function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(ce,ce.exports);var B=ce.exports,rr=function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},Ze=(function(){function e(t,r){var n=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],article:["style"],aside:["style"],audio:["autoplay","controls","loop","muted","preload"],b:[],blockquote:["style"],br:[],code:["style"],dd:["style"],del:["style"],details:["open","style"],div:["align","aria-hidden","aria-label","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],footer:["style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],header:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],main:["style"],mark:["style"],nav:["style"],ol:[],p:["style"],pre:["style"],section:["style"],source:["media","src","type"],span:["aria-hidden","aria-label","style"],strong:[],sub:["style"],summary:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],time:["style"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.arcgisCSSWhiteList=K(K({},B.getDefaultCSSWhiteList()),{"align-items":!0,"align-self":!0,flex:!0,"flex-basis":!0,"flex-direction":!0,"flex-flow":!0,"flex-grow":!0,"flex-shrink":!0,"flex-wrap":!0,float:!0,gap:!0,grid:!0,"grid-area":!0,"grid-auto-columns":!0,"grid-auto-flow":!0,"grid-auto-rows":!0,"grid-column":!0,"grid-column-end":!0,"grid-column-start":!0,"grid-row":!0,"grid-row-end":!0,"grid-row-start":!0,"grid-template":!0,"grid-template-areas":!0,"grid-template-columns":!0,"grid-template-rows":!0,"justify-content":!0,"justify-items":!0,"justify-self":!0,"line-height":!0,overflow:!0}),this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(i,l,a,c){return i==="a"&&l==="href"||(i==="img"||i==="source")&&l==="src"?n.sanitizeUrl(a):B.safeAttrValue(i,l,a,c)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var s;t&&!r?s=t:t&&r?(s=Object.create(this.arcgisFilterOptions),s.css={whiteList:this.arcgisCSSWhiteList},Object.keys(t).forEach(function(i){if(i==="whiteList")s.whiteList=n._extendObjectOfArrays([n.arcgisWhiteList,t.whiteList||{}]);else if(i==="css"){var l=t.css.whiteList;l!=null&&t.css instanceof Object&&Object.keys(l).forEach(function(a){return s.css.whiteList[a]=l[a]})}else s[i]=t[i]})):(s=Object.create(this.arcgisFilterOptions),s.whiteList=this.arcgisWhiteList,s.css={whiteList:this.arcgisCSSWhiteList}),this.xssFilterOptions=s,this._xssFilter=new B.FilterXSS(s)}return e.prototype.sanitize=function(t,r){switch(r===void 0&&(r={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,r);default:return r.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,r){var n=(r??{}).isProtocolRequired,s=n===void 0?!0:n,i=this._trim(t.substring(0,t.indexOf(":"))),l=t==="/",a=/^#/.test(t),c=i&&this.allowedProtocols.indexOf(i.toLowerCase())>-1;return l||a||c?B.escapeAttrValue(t):!i&&!s?B.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,r,n,s){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,r,n,s):B.safeAttrValue(t,r,n,s)},e.prototype.validate=function(t,r){r===void 0&&(r={});var n=this.sanitize(t,r);return{isValid:t===n,sanitized:n}},e.prototype.encodeHTML=function(t){var r=this;return String(t).replace(/[&<>"'\/]/g,function(n){return r._entityMap[n]})},e.prototype.encodeAttrValue=function(t){var r=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(n,s){return r.test(n)?n:"&#x".concat(Number(t.charCodeAt(s)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var r={};return t.forEach(function(n){Object.keys(n).forEach(function(s){Array.isArray(n[s])&&Array.isArray(r[s])?r[s]=r[s].concat(n[s]):r[s]=n[s]})}),r},e.prototype._iterateOverObject=function(t,r){var n=this;r===void 0&&(r={});try{var s=!1,i=void 0;if(Array.isArray(t))i=t.reduce(function(a,c){var o=n.validate(c,r);return o.isValid?a.concat([c]):(s=!0,a.concat([o.sanitized]))},[]);else if(rr(t)){var l=Object.keys(t);i=l.reduce(function(a,c){var o=t[c],p=n.validate(o,r);return p.isValid?a[c]=o:(s=!0,a[c]=p.sanitized),a},{})}else return r.allowUndefined&&typeof t>"u"?void 0:null;return s?i:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e})();function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var P=ke();function tt(e){P=e}var C={exec:()=>null};function D(e){let t=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),s=t[n];return s||(s=e(n),t[n]=s),s}}function d(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(w.caret,"$1"),r=r.replace(s,l),n},getRegex:()=>new RegExp(r,t)};return n}var nr=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:D(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:D(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:D(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:D(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:D(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:D(e=>new RegExp(`^ {0,${e}}>`))},sr=/^(?:[ \t]*(?:\n|$))+/,ir=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ar=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,j=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,be=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,rt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nt=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),or=d(rt).replace(/bull/g,be).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cr=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ur=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pr=d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,be).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",we=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fr=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",we).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),st=d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),hr=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",st).getRegex(),ye={blockquote:hr,code:ir,def:ur,fences:ar,heading:lr,hr:j,html:fr,lheading:nt,list:pr,newline:sr,paragraph:st,table:C,text:cr},Xe=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),gr={...ye,lheading:or,table:Xe,paragraph:d(xe).replace("hr",j).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},dr={...ye,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(xe).replace("hr",j).replace("heading",` *#{1,6} *[^
|
|
4
4
|
]`).replace("lheading",nt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,br=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,it=/^( {2,}|\\)\n(?!\s*$)/,xr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,ae=/[\s\p{P}\p{S}]/u,ve=/[^\s\p{P}\p{S}]/u,mr=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ae).getRegex(),at=/(?!~)[\p{P}\p{S}]/u,wr=/(?!~)[\s\p{P}\p{S}]/u,yr=/(?:[^\s\p{P}\p{S}]|~)/u,vr=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",nr?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),lt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ar=d(lt,"u").replace(/punct/g,F).getRegex(),Sr=d(lt,"u").replace(/punct/g,at).getRegex(),ot="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tr=d(ot,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),Rr=d(ot,"gu").replace(/notPunctSpace/g,yr).replace(/punctSpace/g,wr).replace(/punct/g,at).getRegex(),$r=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),Lr=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Er="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",_r=d(Er,"gu").replace(/notPunctSpace/g,ve).replace(/punctSpace/g,ae).replace(/punct/g,F).getRegex(),zr=d(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Cr=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ir=d(we).replace("(?:-->|$)","-->").getRegex(),Pr=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ir).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),re=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Or=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ct=d(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",me).getRegex(),ut=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),qr=d("reflink|nolink(?!\\()","g").replace("reflink",ct).replace("nolink",ut).getRegex(),Qe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ae={_backpedal:C,anyPunctuation:zr,autolink:Cr,blockSkip:vr,br:it,code:br,del:C,delLDelim:C,delRDelim:C,emStrongLDelim:Ar,emStrongRDelimAst:Tr,emStrongRDelimUnd:$r,escape:kr,link:Or,nolink:ut,punctuation:mr,reflink:ct,reflinkSearch:qr,tag:Pr,text:xr,url:C},Br={...Ae,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},he={...Ae,emStrongRDelimAst:Rr,emStrongLDelim:Sr,delLDelim:Lr,delRDelim:_r,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Qe).getRegex()},Dr={...he,br:d(it).replace("{2,}","*").getRegex(),text:d(he.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},te={normal:ye,gfm:gr,pedantic:dr},M={normal:Ae,gfm:he,breaks:Dr,pedantic:Br},Fr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ue=e=>Fr[e];function S(e,t){if(t){if(w.escapeTest.test(e))return e.replace(w.escapeReplace,Ue)}else if(w.escapeTestNoEncode.test(e))return e.replace(w.escapeReplaceNoEncode,Ue);return e}function Je(e){try{e=encodeURI(e).replace(w.percentDecode,"%")}catch{return null}return e}function Ke(e,t){let r=e.replace(w.findPipe,(i,l,a)=>{let c=!1,o=l;for(;--o>=0&&a[o]==="\\";)c=!c;return c?"|":" |"}),n=r.split(w.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(w.slashPipe,"|");return n}function $(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n;){let i=e.charAt(n-s-1);if(i===t&&!r)s++;else if(i!==t&&r)s++;else break}return e.slice(0,n-s)}function Ye(e){let t=e.split(`
|
|
5
5
|
`),r=t.length-1;for(;r>=0&&w.blankLine.test(t[r]);)r--;return t.length-r<=2?e:t.slice(0,r+1).join(`
|
|
6
6
|
`)}function Nr(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Vr(e,t=0){let r=t,n="";for(let s of e)if(s===" "){let i=4-r%4;n+=" ".repeat(i),r+=i}else n+=s,r++;return n}function et(e,t,r,n,s){let i=t.href,l=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,c}function Hr(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./3VOQD2MR.js";import"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:y},{c:p,d:w}])=>{var b=Object.defineProperty,k=Object.getOwnPropertyDescriptor,v=e=>{throw TypeError(e)},h=(e,t,r,s)=>{for(var n=s>1?void 0:s?k(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,r,n):a(n))||n);return s&&n&&b(t,r,n),n},A=(e,t,r)=>t.has(e)||v("Cannot "+r),M=(e,t,r)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r)=>(A(e,t,"access private method"),r),c,u,i=class extends w{constructor(e){super(e),M(this,c)}getAgents(){let e=Object.values(this.agentsMap);return this.defaultAgent?e.concat(this.defaultAgent):e}buildNodes(e){let t=super.buildNodes(e);return t[d]=()=>({}),t}buildEdges(e){m(this,c,u).call(this);let t=this.resolver,r=new Map;for(let[o,[a]]of Object.entries(this.agentsMap).entries())r.set(a,p(e[o],o));let{defaultAgent:s}=this,n=s?p(s,e.length-1):void 0;return[{from:d,decide:async(o,a)=>{let l=await Promise.resolve(t(o,a));if(!l)return;let f=r.get(l);if(f)return f;if(s)return n;throw new Error(`SwitchWorkflow resolver returned unknown case: ${l}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`)}}]}getEntryNode(){return d}isTerminalAgent(){return!0}validateAgents(e){m(this,c,u).call(this),super.validateAgents(e)}};c=new WeakSet;u=function(){if(!Object.keys(this.agentsMap).length)throw new Error("SwitchWorkflow requires a non-empty agentsMap.")};h([g()],i.prototype,"agentsMap",2);h([g()],i.prototype,"resolver",2);h([g()],i.prototype,"defaultAgent",2);i=h([y("SwitchWorkflow")],i);var d="__switch_decide";return i},"core/accessorSupport/decorators",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as r}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as a,h as e,n as i,v as c,z as l}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var o=a`:host{width:100%;padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}`,s=class extends c{constructor(){super(...arguments),this.#t=[],this._messages=r({blocking:!0}),this.arcgisCancel=i(),this.arcgisSubmit=i()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(n=>n.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div><calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.type==="boolean-choice"?!0:this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};l("arcgis-assistant-interrupt",s);export{s as ArcgisAssistantInterrupt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as i,c}from"./FUIGPHBH.js";export default $arcgis.t(([m,{subclass:p}])=>{function a(t){return t?Object.keys(t.shape??{}):[]}function d(t){let e={};for(let n of t)for(let s of a(n))e[s]=void 0;return e}function g(t,e){return Object.fromEntries(e.filter(n=>Object.hasOwn(t,n)).map(n=>[n,t[n]]))}function l(t,e){return`${t.id}_${e}`}function h(t,e){let n=e.inputSchema;return n?{...g(t,a(n)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function x(t,e){return t.outputSchema?g(e,a(t.outputSchema)):{}}function y(t){let e={outputMessage:t.outputMessage,status:t.status,summary:t.summary};return t.agentExecutionContext&&(e.agentExecutionContext=t.agentExecutionContext),e}function v(t,e){return async(n,s)=>{let o=await t.run(h(n,t),s),r=x(t,o);return e||o.status==="failed"?{...r,...y(o)}:{...r,outputMessage:o.outputMessage}}}var w=Object.getOwnPropertyDescriptor,E=(t,e,n,s)=>{for(var o=s>1?void 0:s?w(e,n):e,r=t.length-1,u;r>=0;r--)(u=t[r])&&(o=u(o)||o);return o},f=class extends m{generate(){let t=this.getAgents();this.validateAgents(t);for(let r of t)r.generate();let e=d(t.flatMap(r=>r.getSchemas())),n=i(e),s=this.buildNodes(t),o=this.buildEdges(t);return{workspace:n,createGraph:()=>c(s,o,n,{entryNode:this.getEntryNode(t)})}}buildNodes(t){let e={};for(let[n,s]of t.entries())e[l(s,n)]=v(s,this.isTerminalAgent(t,n));return e}validateAgents(t){if(!t.length)throw new Error("Workflow requires at least one agent.")}};f=E([p("BaseWorkflow")],f);return{a:a,b:d,c:l,d:f}},"core/Accessor","core/accessorSupport/decorators")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{g as t,h as e,t as i,u as a,v as o,z as r}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([l,{watch:n}])=>{var c=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`,s=class extends o{constructor(){super(...arguments),this.#s=i(),this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=c}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this._scrollToEnd()}),n(()=>[this.loading,this.interrupt],()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return e`<div class="messages-container"><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div ${a(this.#s)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
`)
|
|
2
|
+
import e from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{c as K,d as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as y,z as f}from"./HWKDNS4K.js";import{a as c,b}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as x,b as d,j as k,ta as _}from"./DHKUXLU3.js";import{Z as v}from"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{fetchKnowledgeGraph:B},{j:A,l:q},{K:u,L:C,M:G,N:T,O:N,P:R,Q:L,R:$,S:z,T:F,U:D,a:S,m:g,n:h,p:M}])=>{var I=[R,L,F,$,N,D,z];async function O(e,a){let r=await g("arcgis_knowledge_tool_prompt"),o=C(a),s={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},n=await q({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:s,tools:I}),i=(n.tool_calls?.length??0)>0,t=typeof n.text=="string"?n.text.trim():"",l=t.length>0,p=n.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function V(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,a){let r=new S(I,{handleToolErrors:!1});try{let o=await r.invoke({messages:e.arcgisKnowledgeMessages},a),s=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
|
|
3
|
+
|
|
4
|
+
Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);s.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${o.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let n=s.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=s[0];return i&&V(i)&&await b(J(i),a),{...e,outputMessage:n.join(`
|
|
5
|
+
`),summary:n.length?h(n.join(`
|
|
6
|
+
`)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...o.messages],arcgisKnowledgeToolResult:s}}catch(o){let s=o instanceof Error?o.message:String(o);return await c({text:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`},a),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`,status:"failed",summary:h(`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${s}`),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var H=(e,a)=>M([],"ArcgisKnowledge Agent")(e,a);async function Q(e,a){let r=(e.arcgisKnowledgeToolResult??[]).map(l=>({...l,details:void 0})),{knowledgeGraph:o}=await G(a),s=T.getDataModelTypesSummary(o.dataModel),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:r,dataModelSummary:s},i=await A({promptText:await g("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:n}),t=typeof i=="string"?i:i.content;return{...e,outputMessage:t,status:"success",summary:h(t),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new v(t)]}}function m(e){return async(a,r)=>r?.configurable?.abortSignal?.aborted?(await c({text:"Knowledge Agent execution cancelled"},r),new k({goto:d,update:{outputMessage:"Knowledge Agent execution cancelled",summary:"Knowledge Agent execution cancelled",status:"failed"}})):await e(a,r)}var X=()=>new _(u).addNode("requireArcgisKnowledgeServices",H).addNode("agent",m(O)).addNode("tools",m(P)).addNode("summarizationLLM",m(Q)).addEdge(x,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":d).addConditionalEdges("tools",e=>e.status==="failed"?d:"summarizationLLM").addEdge("summarizationLLM",d),Y=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
|
|
5
7
|
This agent has two categories of skills: those that work with an active link chart visualization of a subset of the data in the knowledge graph, and those that work with the knowledge graph data more generally against the entire dataset in the service and database.
|
|
6
8
|
For link charts, the agent enables users to interact with a link chart by adding new entities (also called nodes) or relationships (also called edges), removing existing entities or relationships,
|
|
7
9
|
expanding the graph from particular entities, finding relationships between specified entities on the link chart and adding them to the link chart, finding all relationships
|
|
@@ -39,4 +41,4 @@ _example: "Discover and add all the relationships originating at 'Entity E' to t
|
|
|
39
41
|
_example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
|
|
40
42
|
_example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
|
|
41
43
|
_example: "Find John Smith and all people he has made phone calls to in the last year"_
|
|
42
|
-
_example: "What is the average age of all people who work for Esri?"_
|
|
44
|
+
_example: "What is the average age of all people who work for Esri?"_`,j={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:Y,createGraph:X,workspace:u};var w=class extends y{constructor(){super(...arguments),this.agent=j}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#a;#e;get serviceUrl(){return this.#a}set serviceUrl(a){this.#a=a}async getContext(){let a=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...a,view:this.#t};if(this.#e)try{let r=await this.#e;return{...a,knowledgeGraph:r}}catch(r){console.error("Failed to load knowledge graph via service URL:",r)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(a){a.has("serviceUrl")&&this.serviceUrl?this.#e=B(this.serviceUrl):this.#e=void 0}load(){this.#t=E(this)??void 0,K(this)}};f("arcgis-assistant-knowledge-agent",w);return w},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","rest/knowledgeGraphService",a,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{c as r}from"./NXKKG5TK.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
|
|
@@ -97,6 +97,20 @@ Do not reinterpret the request into a different form.
|
|
|
97
97
|
|
|
98
98
|
---
|
|
99
99
|
|
|
100
|
+
## Follow-up Reference Resolution
|
|
101
|
+
|
|
102
|
+
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set", or "the previous results", then the request depends on earlier context.
|
|
103
|
+
|
|
104
|
+
This also applies to equivalent referential wording in other languages.
|
|
105
|
+
|
|
106
|
+
Resolve the reference using the most recent relevant chat history or successful prior step.
|
|
107
|
+
|
|
108
|
+
In this case, the \`assignedTask\` should be standalone and should preserve the referenced prior constraints while adding only the new constraint or question from the latest user request.
|
|
109
|
+
|
|
110
|
+
Do not leave ambiguous references like "these", "those", or "them" in \`assignedTask\` when they can be resolved from context.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
100
114
|
## Assigned Task Guidelines (IMPORTANT)
|
|
101
115
|
|
|
102
116
|
- The \`assignedTask\` must match the user\u2019s request exactly in meaning
|
|
@@ -106,6 +120,8 @@ Do not reinterpret the request into a different form.
|
|
|
106
120
|
|
|
107
121
|
- Keep the task short, specific, and directly executable
|
|
108
122
|
- Keep wording close to the user\u2019s request with minimal transformation
|
|
123
|
+
- When resolving follow-up references, only replace the ambiguous reference with the resolved prior context; keep the rest of the user\u2019s wording as close as possible.
|
|
124
|
+
|
|
109
125
|
- Use only information explicitly present in the user request or provided context
|
|
110
126
|
|
|
111
127
|
- The \`assignedTask\` may represent only part of the user\u2019s request when multiple steps are necessary
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{wc as u}from"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([d,{property:a,subclass:h}])=>{var l=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(e,t,n,r)=>{for(var o=r>1?void 0:r?m(t,n):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(o=(r?p(t,n,o):p(o))||o);return r&&o&&l(t,n,o),o},i=class extends d{constructor(e){super(e),this.resultMode="continue",this.middlewares=[]}getTool(){return u(this._executeWithMiddlewares.bind(this),{name:this.name,description:this.description,returnDirect:this.resultMode==="terminal",schema:this.inputSchema})}async _executeWithMiddlewares(e,t){let n=async r=>{let o=await this.execute(r.input,r.config);return this._validateOutput(o)};return await this.middlewares.reduceRight((r,o)=>async c=>await o.handler(c,r),n)({config:t,input:e,tool:this,toolCallId:f(t)})}_validateOutput(e){if(!this.outputSchema)return e;let t=this.outputSchema.safeParse(e);if(!t.success)throw new Error(`FunctionTool output schema validation failed: ${t.error.message}`);return t.data}};s([a()],i.prototype,"name",2);s([a()],i.prototype,"description",2);s([a()],i.prototype,"resultMode",2);s([a()],i.prototype,"inputSchema",2);s([a()],i.prototype,"outputSchema",2);s([a()],i.prototype,"middlewares",2);s([a()],i.prototype,"execute",2);i=s([h("FunctionTool")],i);function f(e){let t=e?.toolCall;return typeof t?.id=="string"?t.id:void 0}return i},"core/Accessor","core/accessorSupport/decorators")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as g}from"./
|
|
2
|
+
import{a as g}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import"./NXKKG5TK.js";import{h as u,v as c,z as h}from"./HWKDNS4K.js";import"./YIMNOUTF.js";export default $arcgis.t(([{watch:_},y,{property:m,subclass:f}])=>{var A=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(e,s,i,a)=>{for(var r=a>1?void 0:a?S(s,i):s,t=e.length-1,n;t>=0;t--)(n=e[t])&&(r=(a?n(s,i,r):n(r))||r);return a&&r&&A(s,i,r),r};function l(){return typeof window>"u"?null:window}var o=class extends y{constructor(){super(...arguments),this._utterance=null,this.state="idle",this.supported=o.isSupported()}destroy(){this.stop(),super.destroy()}start(e){let s=e.trim(),i=l(),a=i?.SpeechSynthesisUtterance,r=i?.speechSynthesis;if(this._set("supported",o.isSupported(i)),!s||!a||!r)return;this.stop();let t=new a(s);t.rate=.9,t.pitch=1.1,t.volume=1,t.onend=()=>{this._utterance===t&&this._reset()},t.onerror=()=>{this._utterance===t&&this._reset()};try{r.speak(t),this._utterance=t,this._set("state","playing")}catch{t.onend=null,t.onerror=null,this._reset()}}stop(){let e=l(),s=e?.speechSynthesis;if(this._set("supported",o.isSupported(e)),s)try{(s.speaking||s.pending)&&s.cancel()}catch{}this._reset()}toggle(e){if(this.state==="playing"){this.stop();return}this.start(e)}static isSupported(e=l()){return!!e?.speechSynthesis&&typeof e.SpeechSynthesisUtterance=="function"}_reset(){this._utterance&&(this._utterance.onend=null,this._utterance.onerror=null),this._utterance=null,this._set("state","idle")}};p([m({readOnly:!0})],o.prototype,"state",2);p([m({readOnly:!0})],o.prototype,"supported",2);o=p([f("ReadAloudController")],o);var d=class extends c{constructor(){super(...arguments),this._messages=g({blocking:!0}),this._readAloudController=new o,this.readAloudEnabled=!1}static{this.properties={readAloudEnabled:5,message:0}}loaded(){this.manager.onLifecycle(()=>[_(()=>this._readAloudController.state,()=>this.requestUpdate(),{initial:!0}),{remove:()=>{this._readAloudController.stop()}}])}_toggleReadAloud(){this._readAloudController.toggle(this.message?.content??"")}render(){return this.readAloudEnabled&&!this.message?.error&&this.message?.content?.trim()&&this._readAloudController.supported?u`<calcite-action id=action-read-aloud .icon=${this._readAloudController.state==="playing"?"sound-off":"sound"} scale=s .active=${this._readAloudController.state==="playing"} @click=${()=>this._toggleReadAloud()} text></calcite-action><calcite-tooltip reference-element=action-read-aloud overlay-positioning=fixed placement=bottom><span>${this._readAloudController.state==="playing"?this._messages.stopReadingButtonLabel:this._messages.readAloudButtonLabel}</span></calcite-tooltip>`:null}};h("arcgis-assistant-message-read-aloud",d);return d},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{g as i,h as t,v as n,z as o}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var p=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=p}_renderSuggestedPrompts(s){if(s.type!=="suggested-prompts")return null;let r=s.data?.prompts,a=Array.isArray(r)?r.filter(c=>typeof c=="string"):[];return a.length?t`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(s){switch(s.type){case"suggested-prompts":return this._renderSuggestedPrompts(s);case"text":return t`<arcgis-assistant-message-text .content=${s.data?.content}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{D as Je,M as Ve,Q as Tt,a as rt,b as S,f as $,j,k as F,la as ee,ma as Ze,na as W,oa as bt,qa as ve,ra as fe,sa as Ce,t as st,ta as _t,u as at}from"./DHKUXLU3.js";import{Ba as ze,D as $e,Db as q,Eb as Te,Gb as gt,Jb as be,Lb as wt,Ob as a,P as M,Pa as We,Qb as He,Sa as H,Sb as _e,Ta as de,U as it,Va as ct,Wa as dt,Wb as me,Xb as Z,Ya as Fe,Z as w,_a as ut,_b as ae,aa as Ue,ac as xe,ja as K,jb as ue,kb as ye,na as Be,nb as Me,nc as Ge,oa as B,pc as yt,rb as ft,tb as pt,tc as Mt,ua as lt,ub as Q,vb as ht}from"./CHPQM77M.js";import{Dd as z,s as mt}from"./ZEYIBYSF.js";var Ye=Symbol.for("AgentMiddleware");function A(e){return{[Ye]:!0,name:e.name,stateSchema:e.stateSchema,contextSchema:e.contextSchema,wrapToolCall:e.wrapToolCall,wrapModelCall:e.wrapModelCall,beforeAgent:e.beforeAgent,beforeModel:e.beforeModel,afterModel:e.afterModel,afterAgent:e.afterAgent,tools:e.tools}}var Se=class extends Error{constructor(){super("The provided LLM already has bound tools. Please provide an LLM without bound tools to createAgent. The agent will bind the tools provided in the 'tools' parameter.")}},ke=class extends Error{toolNames;constructor(e){super(`The model has called multiple tools: ${e.join(", ")} to return a structured output. This is not supported. Please provide a single structured output.`),this.toolNames=e}},Ke=class extends Error{toolName;errors;constructor(e,t){super(`Failed to parse structured output for tool '${e}':${t.map(n=>`
|
|
3
|
+
- ${n}`).join("")}.`),this.toolName=e,this.errors=t}},Ee=class extends Error{toolCall;toolError;constructor(e,t){let n=e instanceof Error?e:new Error(String(e)),o=JSON.stringify(t.args);super(`Error invoking tool '${t.name}' with kwargs ${o} with error: ${n.stack}
|
|
4
|
+
Please fix the error and try again.`),this.toolCall=t,this.toolError=n}},pe=class xt extends Error{static"~brand"="MiddlewareError";constructor(t,n){let o=t instanceof Error?t.message:String(t);super(o),this.name=t instanceof Error?t.name:`${n[0].toUpperCase()+n.slice(1)}Error`,t instanceof Error&&(this.cause=t)}static wrap(t,n){return st(t)?t:new xt(t,n)}static isInstance(t){return t instanceof Error&&"~brand"in t&&t["~brand"]==="MiddlewareError"}};function he(e){return"invoke"in e&&typeof e.invoke=="function"&&"_streamResponseChunks"in e}function ie(e){return typeof e=="object"&&e!=null&&"_queuedMethodOperations"in e&&"_getModelInstance"in e&&typeof e._getModelInstance=="function"}var vt=!0,ao=0,J=class qe{constructor(t,n,o){this.schema=t,this.tool=n,this.options=o}get name(){return this.tool.function.name}static fromSchema(t,n){function o(s){return s??`extract-${++ao}`}if(ue(t)||Me(t)){let s=_e(t);return new qe(s,{type:"function",function:{name:o(s.title),strict:!1,description:s.description??"Tool for extracting structured output from the model's response.",parameters:s}},n)}let r;return typeof t.name=="string"&&typeof t.parameters=="object"&&t.parameters!=null?r=t:r={name:o(t.title),description:t.description??"",parameters:t.schema||t},new qe(_e(t),{type:"function",function:r},n)}parse(t){let n=new He(this.schema).validate(t);if(!n.valid)throw new Ke(this.name,n.errors.map(o=>o.error));return t}},te=class Ct{_schemaType;schema;strict;constructor(t,n){if("schema"in t&&typeof t.schema=="object"&&t.schema!==null&&!("type"in t)){let o=t;this.schema=o.schema,this.strict=o.strict??vt}else this.schema=t,this.strict=n??vt}static fromSchema(t,n){return new Ct(_e(t),n)}parse(t){let n;if(typeof t.content=="string")n=t.content;else if(Array.isArray(t.content)){for(let o of t.content)if(typeof o=="object"&&o!==null&&"type"in o&&o.type==="text"&&"text"in o&&typeof o.text=="string"){n=o.text;break}}if(!(!n||n===""))try{let o=JSON.parse(n);return new He(this.schema).validate(o).valid?o:void 0}catch{}}};function St(e,t,n){if(!e)return[];if(typeof e=="object"&&e!==null&&"__responseFormatUndefined"in e)return[];if(Array.isArray(e)){if(e.every(r=>r instanceof J||r instanceof te))return e;if(e.every(r=>ue(r)))return e.map(r=>J.fromSchema(r,t));if(e.every(r=>q(r)))return e.map(r=>J.fromSchema(r,t));if(e.every(r=>typeof r=="object"&&r!==null&&!q(r)&&!ue(r)))return e.map(r=>J.fromSchema(r,t));throw new Error(`Invalid response format: list contains mixed types.
|
|
5
|
+
All items must be either InteropZodObject, Standard Schema, or plain JSON schema objects.`)}if(e instanceof J||e instanceof te)return[e];let o=io(n);if(ue(e))return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];if(q(e))return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];if(typeof e=="object"&&e!==null&&"properties"in e)return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];throw new Error(`Invalid response format: ${String(e)}`)}function io(e){return!e||!he(e)||!("profile"in e)||typeof e.profile!="object"||!e.profile?!1:"structuredOutput"in e.profile&&e.profile.structuredOutput===!0}var Xe=Symbol.for("langgraph-zod");Xe in globalThis||(globalThis[Xe]=new WeakSet);function kt(e){let t=globalThis[Xe];t.has(e)||(Object.defineProperty(e,"langgraph",{get(){let n=this;return{metadata(o){return Ce(n,{jsonSchemaExtra:o})},reducer(o,r){return Ce(n,{default:be(n),reducer:{schema:r,fn:o}})}}}}),t.add(e))}try{kt(a.ZodType.prototype),kt(z.ZodType.prototype)}catch(e){throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.",{cause:e})}var Et=class extends mt{constructor(e){super(),this.parent=e,this._map=this.parent._map}add(e,...t){let n=t[0];if(n&&!n?.default){let o=be(e);o!=null&&(n.default=o)}return super.add(e,...t)}},lo=new Et(fe);function It(e=!0,t,n=[]){let o={jumpTo:new Ze},r={},s={},i=l=>{if(W.isInstance(l)){for(let[c,d]of Object.entries(l.fields))if(!(c in o)){if(o[c]=d,c.startsWith("_"))continue;ee.isInstance(d)?(r[c]=d.inputSchema||d.valueSchema,s[c]=d.valueSchema):(r[c]=d,s[c]=d)}return}let u=Te(l);for(let[c,d]of Object.entries(u)){let g=c.startsWith("_");if(!(c in o)){if(ye(d)){let p=fe.get(d);if(p?.reducer){p.reducer.schema?(o[c]=new ee(d,{inputSchema:p.reducer.schema,reducer:p.reducer.fn}),g||(r[c]=p.reducer.schema,s[c]=d)):(o[c]=new ee(d,{reducer:p.reducer.fn}),g||(r[c]=d,s[c]=d));continue}}o[c]=d,g||(r[c]=d,s[c]=d)}}};t&&(W.isInstance(t)||q(t))&&i(t);for(let l of n)l.stateSchema&&(W.isInstance(l.stateSchema)||q(l.stateSchema))&&i(l.stateSchema);return e&&(s.structuredResponse=new Ze),{state:new W({messages:ve,...o}),input:new W({messages:ve,...r}),output:new W({messages:ve,...s})}}var Qe=/<name>(.*?)<\/name>/s,et=/<content>(.*?)<\/content>/s;function co(e,t){if(W.isInstance(e)){let n={};for(let o of Object.keys(e.fields))o in t&&(n[o]=t[o]);return n}if(Me(e))return Q(e,t);throw new Error(`Invalid state schema type: ${typeof e}`)}function Rt(e){if(!w.isInstance(e)||Ue.isInstance(e)||!e.name)return e;let{name:t}=e;if(typeof e.content=="string")return new w({...e.lc_kwargs,content:`<name>${t}</name><content>${e.content}</content>`,name:void 0});let n=[],o=0;for(let r of e.content)typeof r=="string"?(o+=1,n.push(`<name>${t}</name><content>${r}</content>`)):typeof r=="object"&&"type"in r&&r.type==="text"?(o+=1,n.push({...r,text:`<name>${t}</name><content>${r.text}</content>`})):n.push(r);return o||n.unshift({type:"text",text:`<name>${t}</name><content></content>`}),new w({...e.lc_kwargs,content:n,name:void 0})}function Ot(e){if(!w.isInstance(e)||!e.content)return e;let t=[],n;if(Array.isArray(e.content))t=e.content.filter(o=>{if(o.type==="text"&&typeof o.text=="string"){let r=o.text.match(Qe),s=o.text.match(et);return r&&(!s||s[1]==="")?(n=r[1],!1):!0}return!0}).map(o=>{if(o.type==="text"&&typeof o.text=="string"){let r=o.text.match(Qe),s=o.text.match(et);return!r||!s?o:(n=r[1],{...o,text:s[1]})}return o});else{let o=e.content,r=o.match(Qe),s=o.match(et);if(!r||!s)return e;n=r[1],t=s[1]}return new w({...Object.keys(e.lc_kwargs??{}).length>0?e.lc_kwargs:e,content:t,name:n})}function re(e){return me.isRunnable(e)}function At(e){return he(e)?"bindTools"in e&&typeof e.bindTools=="function":!1}var tt=(e,t,n={})=>{if(At(e))return e.bindTools(t,n);if(Z.isRunnableBinding(e)&&At(e.bound)){let o=e.bound.bindTools(t,n);return Z.isRunnableBinding(o)?new Z({bound:o.bound,config:{...e.config,...o.config},kwargs:{...e.kwargs,...o.kwargs},configFactories:o.configFactories??e.configFactories}):new Z({bound:o,config:e.config,kwargs:e.kwargs,configFactories:e.configFactories})}return null};function Ie(e){if(typeof e=="function")return;let t=e;if(ae.isRunnableSequence(t)&&(t=t.steps.find(n=>Z.isRunnableBinding(n))||t),!ie(t)){if(Z.isRunnableBinding(t)){let n=t.kwargs!=null&&typeof t.kwargs=="object"&&"tools"in t.kwargs&&Array.isArray(t.kwargs.tools)&&t.kwargs.tools.length>0,o=t.config!=null&&typeof t.config=="object"&&"tools"in t.config&&Array.isArray(t.config.tools)&&t.config.tools.length>0;if(n||o)throw new Se}if("tools"in t&&t.tools!==void 0&&Array.isArray(t.tools)&&t.tools.length>0)throw new Se}}function le(e){return!!(w.isInstance(e)&&e.tool_calls&&e.tool_calls.length>0)}function Nt(e){if(e==null)return new B("");if(B.isInstance(e))return e;if(typeof e=="string")return new B({content:[{type:"text",text:e}]});throw new Error(`Invalid systemPrompt type: expected string or SystemMessage, got ${typeof e}`)}async function jt(e,t,n={}){let o=tt(e,t,n);if(o)return o;if(ie(e)){let r=tt(await e._getModelInstance(),t,n);if(r)return r}if(ae.isRunnableSequence(e)){let r=e.steps.findIndex(s=>Z.isRunnableBinding(s)||he(s)||ie(s));if(r>=0){let s=tt(e.steps[r],t,n);if(s){let i=e.steps.slice();return i.splice(r,1,s),ae.from(i)}}}throw new Error(`llm ${e} must define bindTools method.`)}function uo(e){if(e.length===0)return;if(e.length===1)return e[0];function t(o,r){return async(s,i)=>o(s,async u=>r(u,i))}let n=e[e.length-1];for(let o=e.length-2;o>=0;o--)n=t(e[o],n);return n}function Pt(e){let t=e.filter(n=>n.wrapToolCall);if(t.length!==0)return uo(t.map(n=>{let o=n.wrapToolCall;return async(s,i)=>{let l=s.state,u=async c=>{let d={...l,...c.state};return i({...c,state:d})};try{let c=await o({...s,state:{messages:l.messages,...n.stateSchema?co(n.stateSchema,{...l}):{}}},u);if(!M.isInstance(c)&&!F(c))throw new Error(`Invalid response from "wrapToolCall" in middleware "${n.name}": expected ToolMessage or Command, got ${typeof c}`);return c}catch(c){throw pe.wrap(c,n.name)}}}))}async function Lt(e,t){let n={};for(let o of e){if(!o.stateSchema)continue;let r=o.stateSchema;if(W.isInstance(o.stateSchema)){let l={};for(let[u,c]of Object.entries(o.stateSchema.fields))ee.isInstance(c)?l[u]=c.inputSchema||c.valueSchema:l[u]=c;r=z.object(l)}let s=await ft(wt(r,l=>l.startsWith("_")),t);if(s.success){Object.assign(n,s.data);continue}let i=s.error.issues.filter(l=>l.code==="invalid_type").map(l=>` - ${l.path.join(".")}: Required`).join(`
|
|
6
|
+
`);throw new Error(`Middleware "${o.name}" has required state fields that must be initialized:
|
|
7
|
+
${i}
|
|
8
|
+
|
|
9
|
+
To fix this, either:
|
|
10
|
+
1. Provide default values in your middleware's state schema using .default():
|
|
11
|
+
stateSchema: z.object({
|
|
12
|
+
myField: z.string().default("default value")
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
2. Or make the fields optional using .optional():
|
|
16
|
+
stateSchema: z.object({
|
|
17
|
+
myField: z.string().optional()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
3. Or ensure you pass these values when invoking the agent:
|
|
21
|
+
agent.invoke({
|
|
22
|
+
messages: [...],
|
|
23
|
+
${s.error.issues[0]?.path.join(".")}: "value"
|
|
24
|
+
})`)}return n}function Dt(e){let t={messages:z.custom(()=>[]),structuredResponse:z.any().optional()};if(!e)return z.object(t);let n;if(W.isInstance(e)){n={};for(let[r,s]of Object.entries(e.fields))ee.isInstance(s)?n[r]=s.inputSchema||s.valueSchema:n[r]=s}else n=Te(e);let o={...t};for(let[r,s]of Object.entries(n))r.startsWith("_")?o[r]=s.optional():o[r]=s;return z.object(o)}function $t(e){if(q(e))return gt(e);if(W.isInstance(e)){let t={};for(let[n,o]of Object.entries(e.fields)){let r;ee.isInstance(o)?r=o.inputSchema||o.valueSchema:r=o,t[n]=ye(r)?r.optional():z.any().optional()}return z.object(t)}return z.object({})}function G(e){if(e){if(["model_request","tools",S].includes(e))return e;if(e==="model")return"model_request";if(e==="tools")return"tools";if(e==="end")return S;throw new Error(`Invalid jump target: ${e}, must be "model", "tools" or "end".`)}}function Ae(...e){return AbortSignal.any(e.filter(t=>t!=null&&typeof t=="object"&&"aborted"in t&&typeof t.aborted=="boolean"))}var Oe={openai:{package:"@langchain/openai",className:"ChatOpenAI"},anthropic:{package:"@langchain/anthropic",className:"ChatAnthropic"},azure_openai:{package:"@langchain/openai",className:"AzureChatOpenAI"},cohere:{package:"@langchain/cohere",className:"ChatCohere"},google:{package:"@langchain/google",className:"ChatGoogle"},"google-vertexai":{package:"@langchain/google-vertexai",className:"ChatVertexAI"},"google-vertexai-web":{package:"@langchain/google-vertexai-web",className:"ChatVertexAI"},"google-genai":{package:"@langchain/google-genai",className:"ChatGoogleGenerativeAI"},ollama:{package:"@langchain/ollama",className:"ChatOllama"},mistralai:{package:"@langchain/mistralai",className:"ChatMistralAI"},mistral:{package:"@langchain/mistralai",className:"ChatMistralAI"},groq:{package:"@langchain/groq",className:"ChatGroq"},bedrock:{package:"@langchain/aws",className:"ChatBedrockConverse"},aws:{package:"@langchain/aws",className:"ChatBedrockConverse"},deepseek:{package:"@langchain/deepseek",className:"ChatDeepSeek"},xai:{package:"@langchain/xai",className:"ChatXAI"},cerebras:{package:"@langchain/cerebras",className:"ChatCerebras"},fireworks:{package:"@langchain/fireworks",className:"ChatFireworks"},together:{package:"@langchain/together-ai",className:"ChatTogetherAI",hasCircularDependency:!0},perplexity:{package:"@langchain/perplexity",className:"ChatPerplexity"}},Bt=Object.keys(Oe);async function fo(e,t){let n;if(t)n=Oe[t];else{let o=Object.entries(Oe).find(([,r])=>r.className===e);n=o?o[1]:void 0}if(n)try{return(await import(n.package))[n.className]}catch(o){let r=o;if("code"in r&&r.code?.toString().includes("ERR_MODULE_NOT_FOUND")&&"message"in r&&typeof r.message=="string"){let s=(r.message.startsWith("Error: ")?r.message.slice(7):r.message).split("Cannot find package '")[1].split("'")[0];throw new Error(`Unable to import ${s}. Please install with \`npm install ${s}\` or \`pnpm install ${s}\``)}throw o}}async function po(e,t,n={}){let o=t||ho(e);if(!o)throw new Error(`Unable to infer model provider for { model: ${e} }, please specify modelProvider directly.`);let r=Oe[o];if(!r){let l=Bt.join(", ");throw new Error(`Unsupported { modelProvider: ${o} }.
|
|
25
|
+
|
|
26
|
+
Supported model providers are: ${l}`)}let{modelProvider:s,...i}=n;return new(await fo(r.className,o))({model:e,...i})}function ho(e){return e.startsWith("gpt-3")||e.startsWith("gpt-4")||e.startsWith("gpt-5")||e.startsWith("o1")||e.startsWith("o3")||e.startsWith("o4")?"openai":e.startsWith("claude")?"anthropic":e.startsWith("command")?"cohere":e.startsWith("accounts/fireworks")?"fireworks":e.startsWith("gemini")?"google-vertexai":e.startsWith("amazon.")?"bedrock":e.startsWith("mistral")?"mistralai":e.startsWith("sonar")||e.startsWith("pplx")?"perplexity":void 0}var Ut=class Re extends Ve{_llmType(){return"chat_model"}lc_namespace=["langchain","chat_models"];_defaultConfig={};_configurableFields="any";_configPrefix;_queuedMethodOperations={};_modelInstanceCache=new Map;_profile;constructor(t){super(t),this._defaultConfig=t.defaultConfig??{},t.configurableFields==="any"?this._configurableFields="any":this._configurableFields=t.configurableFields??["model","modelProvider"],t.configPrefix?this._configPrefix=t.configPrefix.endsWith("_")?t.configPrefix:`${t.configPrefix}_`:this._configPrefix="",this._queuedMethodOperations=t.queuedMethodOperations??this._queuedMethodOperations,this._profile=t.profile??void 0,this.metadata={...this.metadata,ls_integration:"langchain_init_chat_model"}}async _getModelInstance(t){let n=this._getCacheKey(t),o=this._modelInstanceCache.get(n);if(o)return o;let r={...this._defaultConfig,...this._modelParams(t)},s=await po(r.model,r.modelProvider,r);for(let[i,l]of Object.entries(this._queuedMethodOperations))i in s&&typeof s[i]=="function"&&(s=await s[i](...l));return this._modelInstanceCache.set(n,s),s}async _generate(t,n,o){return(await this._getModelInstance(n))._generate(t,n??{},o)}bindTools(t,n){let o={...this._queuedMethodOperations};return o.bindTools=[t,n],new Re({defaultConfig:this._defaultConfig,configurableFields:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:o})}withStructuredOutput=(t,...n)=>{let o={...this._queuedMethodOperations};return o.withStructuredOutput=[t,...n],new Re({defaultConfig:this._defaultConfig,configurableFields:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:o})};_modelParams(t){let n=t?.configurable??{},o={};for(let[r,s]of Object.entries(n))if(r.startsWith(this._configPrefix)){let i=this._removePrefix(r,this._configPrefix);o[i]=s}return this._configurableFields!=="any"&&(o=Object.fromEntries(Object.entries(o).filter(([r])=>this._configurableFields.includes(r)))),o}_removePrefix(t,n){return t.startsWith(n)?t.slice(n.length):t}withConfig(t){let n={...t||{}},o=this._modelParams(n),r=Object.fromEntries(Object.entries(n).filter(([s])=>s!=="configurable"));return r.configurable=Object.fromEntries(Object.entries(n.configurable||{}).filter(([s])=>this._configPrefix&&!Object.keys(o).includes(this._removePrefix(s,this._configPrefix)))),new Z({config:n,bound:new Re({defaultConfig:{...this._defaultConfig,...o},configurableFields:Array.isArray(this._configurableFields)?[...this._configurableFields]:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:this._queuedMethodOperations})})}async invoke(t,n){let o=await this._getModelInstance(n),r=de(n);return o.invoke(t,r)}async stream(t,n){let o=new ut({generator:await(await this._getModelInstance(n)).stream(t,n),config:n});return await o.setup,Fe.fromAsyncGenerator(o)}async batch(t,n,o){return super.batch(t,n,o)}async*transform(t,n){let o=await this._getModelInstance(n),r=de(n);yield*o.transform(t,r)}async*streamLog(t,n,o){let r=await this._getModelInstance(n),s=de(n);yield*r.streamLog(t,s,{...o,_schemaFormat:"original",includeNames:o?.includeNames,includeTypes:o?.includeTypes,includeTags:o?.includeTags,excludeNames:o?.excludeNames,excludeTypes:o?.excludeTypes,excludeTags:o?.excludeTags})}streamEvents(t,n,o){let r=this;async function*s(){let i=await r._getModelInstance(n),l=de(n),u=i.streamEvents(t,l,o);for await(let c of u)yield c}return Fe.fromAsyncGenerator(s())}get profile(){if(this._profile)return this._profile;let t=this._getCacheKey({});return this._modelInstanceCache.get(t)?.profile??{}}_getCacheKey(t){let n=t??{};if(n.configurable){let{configurable:o}=n,r={};for(let[s,i]of Object.entries(o))s.startsWith("__pregel_")||(r[s]=i);n={...n,configurable:r}}return JSON.stringify(n)}};async function X(e,t){let{configurableFields:n,configPrefix:o,modelProvider:r,profile:s,...i}={configPrefix:"",...t??{}};if(r===void 0&&e?.includes(":")){let[d,...g]=e.split(":"),p=g.length===0?[d]:[d,g.join(":")];Bt.includes(p[0])&&([r,e]=p)}let l=Array.isArray(n)?[...n]:n;!e&&l===void 0&&(l=["model","modelProvider"]),o&&l===void 0&&console.warn(`{ configPrefix: ${o} } has been set but no fields are configurable. Set { configurableFields: [...] } to specify the model params that are configurable.`);let u={...i},c;return l===void 0?c=new Ut({defaultConfig:{...u,model:e,modelProvider:r},configPrefix:o,profile:s}):(e&&(u.model=e),r&&(u.modelProvider=r),c=new Ut({defaultConfig:u,configPrefix:o,configurableFields:l,profile:s})),await c._getModelInstance(),c}var ce=class extends me{lc_namespace=["langgraph"];func;tags;config;trace=!0;recurse=!0;#e;constructor(e){super(),this.name=e.name??e.func.name,this.func=e.func,this.config=e.tags?{tags:e.tags}:void 0,this.recurse=e.recurse??this.recurse}getState(){return this.#e}setState(e){this.#e={...this.#e,...e}}async invoke(e,t){let n=H(this.config,t),o=await We.runWithConfig(n,async()=>this.func(e,n));return me.isRunnable(o)&&this.recurse?await We.runWithConfig(n,async()=>o.invoke(e,n)):(this.#e=o,o)}};function zt(e,t){let n,o;if(t==="inline")n=Rt,o=Ot;else throw new Error(`Invalid agent name mode: ${t}. Needs to be one of: "inline"`);function r(s){return s.map(n)}return ae.from([xe.from(r),e,xe.from(o)])}function go(e){return w.isInstance(e)||F(e)||typeof e=="object"&&e!==null&&"structuredResponse"in e&&"messages"in e}var O="model_request",Wt=class extends ce{#e;#o;constructor(e){super({name:e.name??"model",func:(t,n)=>this.#t(t,n)}),this.#e=e,this.#o=e.systemMessage}async#s(e,t=this.#e.responseFormat){if(!t)return;let n;ie(e)?n=await e._getModelInstance():typeof e!="string"&&(n=e);let o=St(t,void 0,n);if(o.length!==0)return o.every(r=>r instanceof te)?{type:"native",strategy:o[0]}:{type:"tool",tools:o.filter(r=>r instanceof J).reduce((r,s)=>(r[s.name]=s,r),{})}}async#t(e,t){let n=e.messages.at(-1);if(n&&M.isInstance(n)&&n.name&&this.#e.shouldReturnDirect.has(n.name))return[new j({update:{messages:[]}})];let{response:o,lastAiMessage:r,collectedCommands:s}=await this.#a(e,t);if(typeof o=="object"&&o!==null&&"structuredResponse"in o&&"messages"in o){let{structuredResponse:u,messages:c}=o;return{messages:[...e.messages,...c],structuredResponse:u}}let i=[],l=w.isInstance(o)?o:r;return l&&(l.name=this.name,l.lc_kwargs.name=this.name,this.#r(e,l)?i.push(new j({update:{messages:[new w({content:"Sorry, need more steps to process this request.",name:this.name,id:l.id})]}})):i.push(new j({update:{messages:[l]}}))),F(o)&&!s.includes(o)&&i.push(o),i.push(...s),i}#n(){if(typeof this.#e.model=="string")return X(this.#e.model);if(this.#e.model)return this.#e.model;throw new Error("No model option was provided, either via `model` option.")}async#a(e,t,n={}){let o=await this.#n(),r=t,s=this.#o,i=null,l=[],u=async p=>{Ie(p.model);let h=await this.#s(p.model,p.responseFormat),I=await this.#d(p.model,p,h),V=[...s.text===""?[]:[s],...p.messages],k=Ae(this.#e.signal,t.signal),T=await dt(I.invoke(V,{...t,signal:k}),k);if(i=T,h?.type==="native"){let D=h.strategy.parse(T);return D?{structuredResponse:D,messages:[T]}:T}if(!h||!T.tool_calls)return T;let L=T.tool_calls.filter(D=>D.name in h.tools);if(L.length===0)return T;if(L.length>1)return this.#l(T,L,h);let R=h.tools[L[0].name]?.options?.toolMessageContent;return this.#c(T,L[0],h,R??n.lastMessage)},c=this.#e.wrapModelCallHookMiddleware??[],d=u;for(let p=c.length-1;p>=0;p--){let[h,I]=c[p];if(h.wrapModelCall){let V=d,k=h,T=I;d=async L=>{let R=s,D=k.contextSchema?Q(k.contextSchema,r?.context||{}):r?.context,se=Object.freeze({context:D,store:r.store,configurable:r.configurable,writer:r.writer,interrupt:r.interrupt,signal:r.signal}),U={...L,state:{...h.stateSchema?Q($t(h.stateSchema),e):{},...T(),messages:e.messages},runtime:se},E=async x=>{s=R;let m=x.tools??[],y=new Map(this.#e.toolClasses.filter(re).map(N=>[N.name,N])),v=m.filter(N=>re(N)&&!y.has(N.name)),_=m.filter(N=>{if(!re(N))return!1;let nt=y.get(N.name);return nt!=null&&nt!==N});if(v.length>0&&!this.#e.middleware?.some(N=>N.wrapToolCall!=null))throw new Error(`You have added a new tool in "wrapModelCall" hook of middleware "${k.name}": ${v.map(N=>N.name).join(", ")}. This is not supported unless a middleware provides a "wrapToolCall" handler to execute it.`);if(_.length>0)throw new Error(`You have modified a tool in "wrapModelCall" hook of middleware "${k.name}": ${_.map(N=>N.name).join(", ")}. This is not supported.`);let C=x,f=x.systemPrompt!==s.text,b=x.systemMessage!==s;if(f&&b)throw new Error("Cannot change both systemPrompt and systemMessage in the same request.");f&&(s=new B({content:[{type:"text",text:x.systemPrompt}]}),C={...x,systemPrompt:s.text,systemMessage:s}),b&&(s=new B({...x.systemMessage}),C={...x,systemPrompt:s.text,systemMessage:s});let we=await V(C);return F(we)&&i?(l.includes(we)||l.push(we),i):we};if(!k.wrapModelCall)return E(U);try{let x=await k.wrapModelCall(U,E);if(!go(x))throw new Error(`Invalid response from "wrapModelCall" in middleware "${k.name}": expected AIMessage or Command, got ${typeof x}`);return w.isInstance(x)?i=x:F(x)&&l.push(x),x}catch(x){throw pe.wrap(x,k.name)}}}}s=this.#o;let g={model:o,responseFormat:this.#e.responseFormat,systemPrompt:s?.text,systemMessage:s,messages:e.messages,tools:this.#e.toolClasses,state:e,runtime:Object.freeze({context:r?.context,store:r.store,configurable:r.configurable,writer:r.writer,interrupt:r.interrupt,signal:r.signal})};return{response:await d(g),lastAiMessage:i,collectedCommands:l}}#l(e,t,n){let o=new ke(t.map(r=>r.name));return this.#i(o,e,t[0],n)}#c(e,t,n,o){let r=n.tools[t.name];try{let s=r.parse(t.args);return{structuredResponse:s,messages:[e,new M({tool_call_id:t.id??"",content:JSON.stringify(s),name:t.name}),new w(o??`Returning structured response: ${JSON.stringify(s)}`)]}}catch(s){return this.#i(s,e,t,n)}}async#i(e,t,n,o){let r=Object.values(o.tools).at(0)?.options?.handleError,s=n.id;if(!s)throw new Error("Tool call ID is required to handle tool output errors. Please provide a tool call ID.");if(r===!1)throw e;if(r===void 0||typeof r=="boolean"&&r||Array.isArray(r)&&r.some(i=>i instanceof ke))return new j({update:{messages:[t,new M({content:e.message,tool_call_id:s})]},goto:O});if(typeof r=="string")return new j({update:{messages:[t,new M({content:r,tool_call_id:s})]},goto:O});if(typeof r=="function"){let i=await r(e);if(typeof i!="string")throw new Error("Error handler must return a string.");return new j({update:{messages:[t,new M({content:i,tool_call_id:s})]},goto:O})}return new j({update:{messages:[t,new M({content:e.message,tool_call_id:s})]},goto:O})}#r(e,t){let n=w.isInstance(t)&&t.tool_calls?.every(r=>this.#e.shouldReturnDirect.has(r.name)),o="remainingSteps"in e?e.remainingSteps:void 0;return!!(o&&(o<1&&n||o<2&&le(e.messages.at(-1))))}async#d(e,t,n){let o={},r=Object.values(n&&"tools"in n?n.tools:{}),s=[...t?.tools??this.#e.toolClasses,...r.map(u=>u.tool)],i=t?.toolChoice||(r.length>0?"any":void 0);if(n?.type==="native"){let u=t?.modelSettings?.strict??n?.strategy?.strict??!0,c={name:n.strategy.schema?.name??"extract",description:ht(n.strategy.schema),schema:n.strategy.schema,strict:u};Object.assign(o,{response_format:{type:"json_schema",json_schema:c},outputConfig:{format:{type:"json_schema",schema:n.strategy.schema}},responseSchema:n.strategy.schema,ls_structured_output_format:{kwargs:{method:"json_schema"},schema:n.strategy.schema},strict:u})}let l=await jt(e,s,{...o,...t?.modelSettings,tool_choice:i});return this.#e.includeAgentName==="inline"?zt(l,this.#e.includeAgentName):l}getState(){let e=super.getState();return{messages:[],...e&&!F(e)?e:{}}}};var Ft=(e,t)=>`Error: ${e} is not a valid tool, try one of [${t.join(", ")}].`,P="tools",Ht=e=>Array.isArray(e)&&e.every($e.isInstance),wo=e=>typeof e=="object"&&e!=null&&"messages"in e&&Ht(e.messages),yo=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e;function Mo(e,t){return e instanceof Ee?new M({content:e.message,tool_call_id:t.id,name:t.name}):new M({content:`${e}
|
|
27
|
+
Please fix your mistakes.`,tool_call_id:t.id,name:t.name})}var Jt=class extends ce{tools;trace=!1;signal;handleToolErrors=Mo;wrapToolCall;constructor(e,t){let{name:n,tags:o,handleToolErrors:r,signal:s,wrapToolCall:i}=t??{};super({name:n,tags:o,func:(l,u)=>this.run(l,u)}),this.options=t,this.tools=e,this.handleToolErrors=r??this.handleToolErrors,this.signal=s,this.wrapToolCall=i}#e(e,t,n){if(at(e)||this.signal?.aborted||n&&this.handleToolErrors!==!0||!this.handleToolErrors)throw e;if(typeof this.handleToolErrors=="function"){let o=this.handleToolErrors(e,t);if(o&&M.isInstance(o))return o;throw e}else if(this.handleToolErrors)return new M({name:t.name,content:`${e}
|
|
28
|
+
Please fix your mistakes.`,tool_call_id:t.id});throw e}async runTool(e,t,n){let o=t,r={context:o?.context,store:o?.store,configurable:o?.configurable,writer:o?.writer,interrupt:o?.interrupt,signal:o?.signal},s=this.tools.find(u=>u.name===e.name),i=async u=>{let{toolCall:c,tool:d}=u,g=d??this.tools.find(h=>h.name===c.name);if(g===void 0){let h=this.tools.map(I=>I.name);return new M({content:Ft(c.name,h),tool_call_id:c.id,name:c.name,status:"error"})}let p=g;try{let h=await p.invoke({...c,type:"tool_call"},{...t,config:t,toolCallId:c.id,state:t.configurable?.__pregel_scratchpad?.currentTaskInput,signal:Ae(this.signal,t.signal)});return M.isInstance(h)||F(h)?h:new M({name:p.name,content:typeof h=="string"?h:JSON.stringify(h),tool_call_id:c.id})}catch(h){throw h instanceof it?new Ee(h,c):h}},l={toolCall:e,tool:s,state:n,runtime:r};if(this.wrapToolCall)try{return await this.wrapToolCall(l,i)}catch(u){return this.#e(u,e,!0)}if(!s){let u=this.tools.map(c=>c.name);return new M({content:Ft(e.name,u),tool_call_id:e.id,name:e.name,status:"error"})}try{return await i(l)}catch(u){return this.#e(u,e,!1)}}async run(e,t){let n;if(yo(e)){let{lg_tool_call:s,jumpTo:i,...l}=e;n=[await this.runTool(e.lg_tool_call,t,l)]}else{let s;if(Ht(e))s=e;else if(wo(e))s=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let i=new Set(s.filter(u=>u.getType()==="tool").map(u=>u.tool_call_id)),l;for(let u=s.length-1;u>=0;u-=1){let c=s[u];if(w.isInstance(c)){l=c;break}}if(!w.isInstance(l))throw new Error("ToolNode only accepts AIMessages as input.");n=await Promise.all(l.tool_calls?.filter(u=>u.id==null||!i.has(u.id)).map(u=>this.runTool(u,t,e))??[])}if(!n.some(F))return Array.isArray(e)?n:{messages:n};let o=[],r=null;for(let s of n)F(s)?s.graph===j.PARENT&&Array.isArray(s.goto)&&s.goto.every(i=>To(i))?r?r.goto.push(...s.goto):r=new j({graph:j.PARENT,goto:s.goto}):o.push(s):o.push(Array.isArray(e)?[s]:{messages:[s]});return r&&o.push(r),o}};function To(e){return e instanceof $}function Ne(e,t){let o=0;if(t&&t.length>0){let r=0;for(let s of t){let i=Mt(s)?Tt(s):s;r+=JSON.stringify(i).length}o+=r}for(let r of e){let s;typeof r.content=="string"?s=r.content:Array.isArray(r.content)?s=r.content.map(i=>typeof i=="string"?i:i.type==="text"&&"text"in i?i.text:"").join(""):s="",w.isInstance(r)&&Array.isArray(r.tool_calls)&&r.tool_calls.length>0&&(s+=JSON.stringify(r.tool_calls)),M.isInstance(r)&&(s+=r.tool_call_id??""),o+=s.length}return Math.ceil(o/4)}function Y(e){if(!(!e||typeof e=="function"))return e.canJumpTo}function oe(e){return typeof e=="function"?e:e.hook}var bo=class{},_o=class{},ne=class extends ce{#e;constructor(e,t){super(e),this.#e=t}async invokeMiddleware(e,t){let n={};if(this.middleware.contextSchema){let u=this.middleware.contextSchema?.shape;if(u){let c={},d=t?.context||{};for(let g of Object.keys(u))g in d&&(c[g]=d[g]);n=Q(this.middleware.contextSchema,c)}}let o={...this.#e.getState(),...e,messages:e.messages},r={context:n,store:t?.store,configurable:t?.configurable,writer:t?.writer,interrupt:t?.interrupt,signal:t?.signal},s=await this.runHook(o,Object.freeze(Object.assign(new _o,{...r,context:Object.freeze(Object.assign(new bo,n))})));if(!s)return{jumpTo:void 0};let i,l;if(this.name?.startsWith("BeforeAgentNode_")?(i=Y(this.middleware.beforeAgent),l="beforeAgent.canJumpTo"):this.name?.startsWith("BeforeModelNode_")?(i=Y(this.middleware.beforeModel),l="beforeModel.canJumpTo"):this.name?.startsWith("AfterAgentNode_")?(i=Y(this.middleware.afterAgent),l="afterAgent.canJumpTo"):this.name?.startsWith("AfterModelNode_")&&(i=Y(this.middleware.afterModel),l="afterModel.canJumpTo"),typeof s.jumpTo=="string"&&!i?.includes(s.jumpTo)){let u=i&&i.length>0?`must be one of: ${i?.join(", ")}.`:l?`no ${l} defined in middleware ${this.middleware.name}`:"";throw new Error(`Invalid jump target: ${s.jumpTo}, ${u}.`)}if(typeof s=="object"&&"type"in s){if(s.type==="terminate"){if(s.error)throw s.error;return{...o,...s.result||{},jumpTo:s.jumpTo}}throw new Error(`Invalid control action: ${JSON.stringify(s)}`)}return{...o,...s,jumpTo:s.jumpTo}}get nodeOptions(){return{input:Dt(this.middleware.stateSchema)}}};var Gt=class extends ne{lc_namespace=["langchain","agents","beforeAgentNodes"];constructor(e,t){super({name:`BeforeAgentNode_${e.name}`,func:async(n,o)=>this.invokeMiddleware(n,o)},t),this.middleware=e}runHook(e,t){return oe(this.middleware.beforeAgent)(e,t)}};var Vt=class extends ne{lc_namespace=["langchain","agents","beforeModelNodes"];constructor(e,t){super({name:`BeforeModelNode_${e.name}`,func:async(n,o)=>this.invokeMiddleware(n,o)},t),this.middleware=e}runHook(e,t){return oe(this.middleware.beforeModel)(e,t)}};var Zt=class extends ne{lc_namespace=["langchain","agents","afterModelNodes"];constructor(e,t){super({name:`AfterModelNode_${e.name}`,func:async(n,o)=>this.invokeMiddleware(n,o)},t),this.middleware=e}runHook(e,t){return oe(this.middleware.afterModel)(e,t)}};var Yt=class extends ne{lc_namespace=["langchain","agents","afterAgentNodes"];constructor(e,t){super({name:`AfterAgentNode_${e.name}`,func:async(n,o)=>this.invokeMiddleware(n,o)},t),this.middleware=e}runHook(e,t){return oe(this.middleware.afterAgent)(e,t)}};var Kt=class{#e=new Map;addNode(e,t){this.#e.set(e.name,[...this.#e.get(e.name)??[],t])}getState(e){let t=(this.#e.get(e)??[]).reduce((n,o)=>({...n,...o.getState()??{}}),{});return delete t.jumpTo,t}};var qt=class Xt{#e;#o="v2";#s;#t=new Kt;#n;constructor(t,n){if(this.options=t,this.#n=H(n??{},{metadata:{ls_integration:"langchain_create_agent"}}),t.name&&(this.#n=H(this.#n,{metadata:{lc_agent_name:t.name}})),this.#o=t.version??this.#o,!t.model)throw new Error("`model` option is required to create an agent.");typeof t.model!="string"&&Ie(t.model);let o=this.options.middleware?.filter(m=>m.tools).flatMap(m=>m.tools)??[],r=[...t.tools??[],...o],s=new Set(r.filter(re).filter(m=>"returnDirect"in m&&m.returnDirect).map(m=>m.name)),i=!!this.options.middleware?.some(m=>m.wrapModelCall),{state:l,input:u,output:c}=It(this.options.responseFormat!==void 0||i,this.options.stateSchema,this.options.middleware),d=new _t(l,{input:u,output:c,context:this.options.contextSchema}),g=[],p=[],h=[],I=[],V=[];this.#s=new Wt({model:this.options.model,systemMessage:Nt(this.options.systemPrompt),includeAgentName:this.options.includeAgentName,name:this.options.name,responseFormat:this.options.responseFormat,middleware:this.options.middleware,toolClasses:r,shouldReturnDirect:s,signal:this.options.signal,wrapModelCallHookMiddleware:V});let k=new Set,T=this.options.middleware??[];for(let m=0;m<T.length;m++){let y,v,_,C,f=T[m];if(k.has(f.name))throw new Error(`Middleware ${f.name} is defined multiple times`);if(k.add(f.name),f.beforeAgent){y=new Gt(f,{getState:()=>this.#t.getState(f.name)}),this.#t.addNode(f,y);let b=`${f.name}.before_agent`;g.push({index:m,name:b,allowed:Y(f.beforeAgent)}),d.addNode(b,y,y.nodeOptions)}if(f.beforeModel){v=new Vt(f,{getState:()=>this.#t.getState(f.name)}),this.#t.addNode(f,v);let b=`${f.name}.before_model`;p.push({index:m,name:b,allowed:Y(f.beforeModel)}),d.addNode(b,v,v.nodeOptions)}if(f.afterModel){_=new Zt(f,{getState:()=>this.#t.getState(f.name)}),this.#t.addNode(f,_);let b=`${f.name}.after_model`;h.push({index:m,name:b,allowed:Y(f.afterModel)}),d.addNode(b,_,_.nodeOptions)}if(f.afterAgent){C=new Yt(f,{getState:()=>this.#t.getState(f.name)}),this.#t.addNode(f,C);let b=`${f.name}.after_agent`;I.push({index:m,name:b,allowed:Y(f.afterAgent)}),d.addNode(b,C,C.nodeOptions)}f.wrapModelCall&&V.push([f,()=>this.#t.getState(f.name)])}d.addNode(O,this.#s);let L=T.some(m=>m.wrapToolCall),R=r.filter(re);if(R.length>0||L){let m=new Jt(R,{signal:this.options.signal,wrapToolCall:Pt(T)});d.addNode(P,m)}let D;g.length>0?D=g[0].name:p.length>0?D=p[0].name:D=O;let se=p.length>0?p[0].name:O,U=I.length>0?I[I.length-1].name:S;d.addEdge(rt,D);let E=R.length>0||L;for(let m=0;m<g.length;m++){let y=g[m],v=y.name,_=m===g.length-1?se:g[m+1].name;if(y.allowed&&y.allowed.length>0){let C=y.allowed.map(b=>G(b)).filter(b=>b!=="tools"||E),f=Array.from(new Set([_,...C.map(b=>b===S?U:b)]));d.addConditionalEdges(v,this.#d(R,_,U,E),f)}else d.addEdge(v,_)}for(let m=0;m<p.length;m++){let y=p[m],v=y.name,_=m===p.length-1?O:p[m+1].name;if(y.allowed&&y.allowed.length>0){let C=y.allowed.map(b=>G(b)).filter(b=>b!=="tools"||E),f=Array.from(new Set([_,...C]));d.addConditionalEdges(v,this.#m(R,_,E),f)}else d.addEdge(v,_)}let x=h.at(-1);if(h.length>0&&x)d.addEdge(O,x.name);else{let m=this.#a(R,!1,E).map(y=>y===S?U:y);m.length===1?d.addEdge(O,m[0]):d.addConditionalEdges(O,this.#c(U),m)}for(let m=h.length-1;m>0;m--){let y=h[m],v=y.name,_=h[m-1].name;if(y.allowed&&y.allowed.length>0){let C=y.allowed.map(b=>G(b)).filter(b=>b!=="tools"||E),f=Array.from(new Set([_,...C]));d.addConditionalEdges(v,this.#r(R,y.allowed,_,E),f)}else d.addEdge(v,_)}if(h.length>0){let m=h[0],y=m.name,v=this.#a(R,!0,E).filter(f=>f!=="tools"||E),_=!!(m.allowed&&m.allowed.length>0),C=v.map(f=>f===S?U:f);d.addConditionalEdges(y,this.#i(R,_,U,E),C)}for(let m=I.length-1;m>0;m--){let y=I[m],v=y.name,_=I[m-1].name;if(y.allowed&&y.allowed.length>0){let C=y.allowed.map(b=>G(b)).filter(b=>b!=="tools"||E),f=Array.from(new Set([_,...C]));d.addConditionalEdges(v,this.#r(R,y.allowed,_,E),f)}else d.addEdge(v,_)}if(I.length>0){let m=I[0],y=m.name;if(m.allowed&&m.allowed.length>0){let v=m.allowed.map(C=>G(C)).filter(C=>C!=="tools"||E),_=Array.from(new Set([S,...v]));d.addConditionalEdges(y,this.#r(R,m.allowed,S,E),_)}else d.addEdge(y,S)}if(E){let m=se;s.size>0?d.addConditionalEdges(P,this.#l(s,U,m),[m,U]):d.addEdge(P,m)}this.#e=d.compile({checkpointer:this.options.checkpointer,store:this.options.store,name:this.options.name,description:this.options.description})}get graph(){return this.#e}get checkpointer(){return this.#e.checkpointer}set checkpointer(t){this.#e.checkpointer=t}get store(){return this.#e.store}set store(t){this.#e.store=t}withConfig(t){return new Xt(this.options,H(this.#n,t))}#a(t,n=!1,o=t.length>0){let r=[];return o&&r.push(P),n&&r.push(O),r.push(S),r}#l(t,n,o){return r=>{let s=r.messages,i=s[s.length-1];return M.isInstance(i)&&i.name&&t.has(i.name)?this.options.responseFormat?o:n:o}}#c(t=S){return n=>{let o=n.messages.at(-1);if(!w.isInstance(o)||!o.tool_calls||o.tool_calls.length===0||o.tool_calls.every(s=>s.name.startsWith("extract-")))return t;if(this.#o==="v1")return P;let r=o.tool_calls.filter(s=>!s.name.startsWith("extract-"));return r.length===0?t:r.map(s=>new $(P,{...n,lg_tool_call:s}))}}#i(t,n,o,r=t.length>0){let s=!!this.options.responseFormat;return i=>{let l=i,u=l.messages,c=u.at(-1);if(w.isInstance(c)&&(!c.tool_calls||c.tool_calls.length===0))return o;if(n&&l.jumpTo){let T=G(l.jumpTo);return T===S?o:T==="tools"?r?new $(P,{...i,jumpTo:void 0}):o:new $(O,{...i,jumpTo:void 0})}let d=u.filter(M.isInstance),g=u.filter(w.isInstance).at(-1),p=g?.tool_calls?.filter(T=>!d.some(L=>L.tool_call_id===T.id));if(p&&p.length>0)return this.#o==="v1"?P:p.map(T=>new $(P,{...i,lg_tool_call:T}));let h=g?.tool_calls?.some(T=>T.name.startsWith("extract-"));if(p&&p.length===0&&!h&&s)return O;if(!w.isInstance(c)||!c.tool_calls||c.tool_calls.length===0)return o;let I=c.tool_calls.every(T=>T.name.startsWith("extract-")),V=c.tool_calls.some(T=>!T.name.startsWith("extract-"));if(I||!V)return o;if(this.#o==="v1")return P;let k=c.tool_calls.filter(T=>!T.name.startsWith("extract-"));return k.length===0?o:k.map(T=>new $(P,{...i,lg_tool_call:T}))}}#r(t,n,o,r=t.length>0){let s=new Set(n.map(i=>G(i)));return i=>{let l=i;if(l.jumpTo){let u=G(l.jumpTo);if(u===S&&s.has(S))return S;if(u==="tools"&&s.has("tools"))return r?new $(P,{...i,jumpTo:void 0}):S;if(u==="model_request"&&s.has("model_request"))return new $(O,{...i,jumpTo:void 0})}return o}}#d(t,n,o,r=t.length>0){return s=>{let i=s;if(!i.jumpTo)return n;let l=G(i.jumpTo);return l===S?o:l==="tools"?r?new $(P,{...s,jumpTo:void 0}):o:new $(O,{...s,jumpTo:void 0})}}#m(t,n,o=t.length>0){return r=>{let s=r;if(!s.jumpTo)return n;let i=G(s.jumpTo);return i===S?S:i==="tools"?o?new $(P,{...r,jumpTo:void 0}):S:new $(O,{...r,jumpTo:void 0})}}async#u(t,n){if(!this.options.middleware||this.options.middleware.length===0||t instanceof j||!t)return t;let o=await Lt(this.options.middleware,t),r={...(await this.#e.getState(n).catch(()=>({values:{}}))).values,...t};if(!r)return r;for(let[s,i]of Object.entries(o))s in r||(r[s]=i);return r}async invoke(t,n){let o=H(this.#n,n),r=await this.#u(t,o);return this.#e.invoke(r,o)}async stream(t,n){let o=H(this.#n,n),r=await this.#u(t,o);return this.#e.stream(r,o)}async drawMermaidPng(t){let n=await(await(await this.#e.getGraphAsync()).drawMermaidPng(t)).arrayBuffer();return new Uint8Array(n)}async drawMermaid(t){return(await this.#e.getGraphAsync()).drawMermaid(t)}streamEvents(t,n,o){let r=H(this.#n,n);return this.#e.streamEvents(t,{...r,version:n?.version??"v2"},o)}getGraphAsync(t){return this.#e.getGraphAsync(t)}getState(t,n){return this.#e.getState(t,n)}getStateHistory(t,n){return this.#e.getStateHistory(t,n)}getSubgraphs(t,n){return this.#e.getSubgraphs(t,n)}getSubgraphsAsync(t,n){return this.#e.getSubgraphsAsync(t,n)}updateState(t,n,o){return this.#e.updateState(t,n,o)}get builder(){return this.#e.builder}};function xo(e){return new qt(e)}var Co=a.function().args(a.custom(),a.custom(),a.custom()).returns(a.union([a.string(),a.promise(a.string())])),So=["approve","edit","reject"],ko=a.enum(So),Eo=a.object({allowedDecisions:a.array(ko),description:a.union([a.string(),Co]).optional(),argsSchema:a.record(a.any()).optional()}),zs=a.object({interruptOn:a.record(a.union([a.boolean(),Eo])).optional(),descriptionPrefix:a.string().default("Tool execution requires approval")});var je=`<role>
|
|
29
|
+
Context Extraction Assistant
|
|
30
|
+
</role>
|
|
31
|
+
|
|
32
|
+
<primary_objective>
|
|
33
|
+
Your sole objective in this task is to extract the highest quality/most relevant context from the conversation history below.
|
|
34
|
+
</primary_objective>
|
|
35
|
+
|
|
36
|
+
<objective_information>
|
|
37
|
+
You're nearing the total number of input tokens you can accept, so you must extract the highest quality/most relevant pieces of information from your conversation history.
|
|
38
|
+
This context will then overwrite the conversation history presented below. Because of this, ensure the context you extract is only the most important information to your overall goal.
|
|
39
|
+
</objective_information>
|
|
40
|
+
|
|
41
|
+
<instructions>
|
|
42
|
+
The conversation history below will be replaced with the context you extract in this step. Because of this, you must do your very best to extract and record all of the most important context from the conversation history.
|
|
43
|
+
You want to ensure that you don't repeat any actions you've already completed, so the context you extract from the conversation history should be focused on the most important information to your overall goal.
|
|
44
|
+
</instructions>
|
|
45
|
+
|
|
46
|
+
The user will message you with the full message history you'll be extracting context from, to then replace. Carefully read over it all, and think deeply about what information is most important to your overall goal that should be saved:
|
|
47
|
+
|
|
48
|
+
With all of this in mind, please carefully read over the entire conversation history, and extract the most important and relevant context to replace it so that you can free up space in the conversation history.
|
|
49
|
+
Respond ONLY with the extracted context. Do not include any additional information, or text before or after the extracted context.
|
|
50
|
+
|
|
51
|
+
<messages>
|
|
52
|
+
Messages to summarize:
|
|
53
|
+
{messages}
|
|
54
|
+
</messages>`,Io="Here is a summary of the conversation to date:",Pe=20,Ao=4e3,Ro=15,Qt=5,Oo=a.function().args(a.array(a.custom())).returns(a.union([a.number(),a.promise(a.number())])),ge=a.object({fraction:a.number().gt(0,"Fraction must be greater than 0").max(1,"Fraction must be less than or equal to 1").optional(),tokens:a.number().positive("Tokens must be greater than 0").optional(),messages:a.number().int("Messages must be an integer").positive("Messages must be greater than 0").optional()}).refine(e=>[e.fraction,e.tokens,e.messages].filter(t=>t!==void 0).length>=1,{message:"At least one of fraction, tokens, or messages must be provided"}),ot=a.object({fraction:a.number().min(0,"Messages must be non-negative").max(1,"Fraction must be less than or equal to 1").optional(),tokens:a.number().min(0,"Tokens must be greater than or equal to 0").optional(),messages:a.number().int("Messages must be an integer").min(0,"Messages must be non-negative").optional()}).refine(e=>[e.fraction,e.tokens,e.messages].filter(t=>t!==void 0).length===1,{message:"Exactly one of fraction, tokens, or messages must be provided"}),eo=a.object({model:a.custom(),trigger:a.union([ge,a.array(ge)]).optional(),keep:ot.optional(),tokenCounter:Oo.optional(),summaryPrompt:a.string().default(je),trimTokensToSummarize:a.number().optional(),summaryPrefix:a.string().optional(),maxTokensBeforeSummary:a.number().optional(),messagesToKeep:a.number().optional()});function Le(e){if("profile"in e&&typeof e.profile=="object"&&e.profile&&"maxInputTokens"in e.profile&&(typeof e.profile.maxInputTokens=="number"||e.profile.maxInputTokens==null))return e.profile.maxInputTokens??void 0;if("model"in e&&typeof e.model=="string")return Ge(e.model);if("modelName"in e&&typeof e.modelName=="string")return Ge(e.modelName)}function No(e){let{data:t,error:n}=pt(eo,e);if(n)throw new Error(`Invalid summarization middleware options: ${z.prettifyError(n)}`);return A({name:"SummarizationMiddleware",contextSchema:eo.extend({model:a.custom().optional()}),beforeModel:async(o,r)=>{let s=t.trigger,i=t.keep;t.maxTokensBeforeSummary!==void 0&&(console.warn("maxTokensBeforeSummary is deprecated. Use `trigger: { tokens: value }` instead."),s===void 0&&(s={tokens:t.maxTokensBeforeSummary})),t.messagesToKeep!==void 0&&(console.warn("messagesToKeep is deprecated. Use `keep: { messages: value }` instead."),(!i||i&&"messages"in i&&i.messages===Pe)&&(i={messages:t.messagesToKeep}));let l=r.context?.trigger!==void 0?r.context.trigger:s,u=r.context?.keep!==void 0?r.context.keep:i??{messages:Pe},c=ot.parse(u),d=[];l===void 0?d=[]:Array.isArray(l)?d=l.map(x=>ge.parse(x)):d=[ge.parse(l)];let g=d.some(x=>"fraction"in x)||"fraction"in c,p=typeof t.model=="string"?await X(t.model):t.model;if(g&&!Le(p))throw new Error("Model profile information is required to use fractional token limits. Use absolute token counts instead.");let h=r.context?.summaryPrompt===je?t.summaryPrompt??je:r.context?.summaryPrompt??t.summaryPrompt??je,I=r.context.summaryPrefix??t.summaryPrefix??Io,V=r.context?.trimTokensToSummarize!==void 0?r.context.trimTokensToSummarize:t.trimTokensToSummarize??Ao;jo(o.messages);let k=r.context?.tokenCounter!==void 0?r.context.tokenCounter:t.tokenCounter??Ne,T=await k(o.messages);if(!await Do(o.messages,T,d,p))return;let{systemPrompt:L,conversationMessages:R}=Po(o.messages),D=await $o(R,c,k,p);if(D<=0)return;let{messagesToSummarize:se,preservedMessages:U}=Lo(L,R,D),E=new K({content:`${I}
|
|
55
|
+
|
|
56
|
+
${await zo(se,p,h,k,V,r)}`,id:ze(),additional_kwargs:{lc_source:"summarization"}});return{messages:[new Be({id:bt}),E,...U]}}})}function jo(e){for(let t of e)t.id||(t.id=ze())}function Po(e){return e.length>0&&B.isInstance(e[0])?{systemPrompt:e[0],conversationMessages:e.slice(1)}:{conversationMessages:e}}function Lo(e,t,n){let o=t.slice(0,n),r=t.slice(n);return e&&o.unshift(e),{messagesToSummarize:o,preservedMessages:r}}async function Do(e,t,n,o){if(n.length===0)return!1;for(let r of n){let s=!0,i=!1;if(r.messages!==void 0&&(i=!0,e.length<r.messages&&(s=!1)),r.tokens!==void 0&&(i=!0,t<r.tokens&&(s=!1)),r.fraction!==void 0){i=!0;let l=Le(o);typeof l=="number"?t<Math.floor(l*r.fraction)&&(s=!1):s=!1}if(i&&s)return!0}return!1}async function $o(e,t,n,o){if("tokens"in t||"fraction"in t){let r=await Uo(e,t,n,o);return typeof r=="number"?r:to(e,Pe)}return to(e,t.messages??Pe)}async function Uo(e,t,n,o){if(e.length===0)return 0;let r;if("fraction"in t&&t.fraction!==void 0){let d=Le(o);if(typeof d!="number")return;r=Math.floor(d*t.fraction)}else if("tokens"in t&&t.tokens!==void 0)r=Math.floor(t.tokens);else return;if(r<=0&&(r=1),await n(e)<=r)return 0;let s=0,i=e.length,l=e.length,u=Math.floor(Math.log2(e.length))+1;for(let d=0;d<u&&!(s>=i);d++){let g=Math.floor((s+i)/2);await n(e.slice(g))<=r?(l=g,i=g):s=g+1}if(l===e.length&&(l=s),l>=e.length){if(e.length===1)return 0;l=e.length-1}let c=ro(e,l);if(c<=l)return c;for(let d=l;d>=0;d--)if(oo(e,d))return d;return 0}function to(e,t){if(e.length<=t)return 0;let n=e.length-t,o=ro(e,n);if(o<=n)return o;for(let r=n;r>=0;r--)if(oo(e,r))return r;return 0}function oo(e,t){if(t>=e.length)return!0;if(t<e.length&&w.isInstance(e[t])&&le(e[t]))return!1;let n=Math.max(0,t-Qt),o=Math.min(e.length,t+Qt);for(let r=n;r<o;r++){if(!le(e[r]))continue;let s=no(e[r]);if(Bo(e,r,t,s))return!1}return!0}function no(e){let t=new Set;if(e.tool_calls)for(let n of e.tool_calls){let o=typeof n=="object"&&"id"in n?n.id:null;o&&t.add(o)}return t}function ro(e,t){if(t>=e.length||!M.isInstance(e[t]))return t;let n=new Set,o=t;for(;o<e.length&&M.isInstance(e[o]);){let r=e[o];r.tool_call_id&&n.add(r.tool_call_id),o++}for(let r=t-1;r>=0;r--){let s=e[r];if(w.isInstance(s)&&le(s)){let i=no(s);for(let l of n)if(i.has(l))return r}}return o}function Bo(e,t,n,o){for(let r=t+1;r<e.length;r++){let s=e[r];if(M.isInstance(s)&&o.has(s.tool_call_id)&&t<n!=r<n)return!0}return!1}async function zo(e,t,n,o,r,s){if(!e.length)return"No previous conversation history.";let i=await Wo(e,o,r);if(!i.length)return"Previous conversation was too long to summarize.";let l=lt(i);try{let u=n.replace("{messages}",l),c=H(ct(s)??{},{metadata:{lc_source:"summarization"}}),d=(await t.invoke(u,c)).content;return typeof d=="string"?d.trim():Array.isArray(d)?d.map(g=>typeof g=="string"?g:typeof g=="object"&&g!==null&&"text"in g?g.text:"").join("").trim():"Error generating summary: Invalid response format"}catch(u){return`Error generating summary: ${u}`}}async function Wo(e,t,n){if(n===void 0)return e;try{return await Je(e,{maxTokens:n,tokenCounter:async o=>t(o),strategy:"last",allowPartial:!0,includeSystem:!0})}catch{return e.slice(-Ro)}}var da=a.object({model:a.string().or(a.instanceof(yt)).optional(),systemPrompt:a.string().optional(),maxTools:a.number().optional(),alwaysInclude:a.array(a.string()).optional()});var wa=a.object({applyToInput:a.boolean().optional(),applyToOutput:a.boolean().optional(),applyToToolResults:a.boolean().optional()});var _a=a.object({rules:a.record(a.string(),a.instanceof(RegExp).describe("Regular expression pattern to match PII")).optional()});var Fo=["continue","error","end"],Ho="continue";var Jo=a.enum(Fo).default(Ho);a.object({toolName:a.string().optional(),threadLimit:a.number().optional(),runLimit:a.number().optional(),exitBehavior:Jo});var Oa=a.object({threadToolCallCount:a.record(a.string(),a.number()).default({}),runToolCallCount:a.record(a.string(),a.number()).default({})});var Go=a.enum(["pending","in_progress","completed"]).describe("Status of the todo"),Vo=a.object({content:a.string().describe("Content of the todo item"),status:Go}),Ba=a.object({todos:a.array(Vo).default([])});var Zo="end",Yo=a.object({threadLimit:a.number().optional(),runLimit:a.number().optional(),exitBehavior:a.enum(["error","end"]).optional()}),Ko=a.object({threadModelCallCount:a.number().default(0),runModelCallCount:a.number().default(0)}),so=class extends Error{constructor({threadLimit:e,runLimit:t,threadCount:n,runCount:o}){let r=[];typeof e=="number"&&typeof n=="number"&&r.push(`thread level call limit reached with ${n} model calls`),typeof t=="number"&&typeof o=="number"&&r.push(`run level call limit reached with ${o} model calls`),super(`Model call limits exceeded${r.length>0?`: ${r.join(", ")}`:""}`),this.name="ModelCallLimitMiddlewareError"}};function qo(e){return A({name:"ModelCallLimitMiddleware",contextSchema:Yo,stateSchema:Ko,beforeModel:{canJumpTo:["end"],hook:(t,n)=>{let o=n.context.exitBehavior??e?.exitBehavior??Zo;o==="throw"&&(console.warn("The 'throw' exit behavior is deprecated. Please use 'error' instead."),o="error");let r=n.context.threadLimit??e?.threadLimit,s=n.context.runLimit??e?.runLimit,i=t.threadModelCallCount,l=t.runModelCallCount;if(typeof r=="number"&&r<=i){let u=new so({threadLimit:r,threadCount:i});if(o==="end")return{jumpTo:"end",messages:[new w(u.message)]};throw u}if(typeof s=="number"&&s<=l){let u=new so({runLimit:s,runCount:l});if(o==="end")return{jumpTo:"end",messages:[new w(u.message)]};throw u}return t}},afterModel:t=>({runModelCallCount:t.runModelCallCount+1,threadModelCallCount:t.threadModelCallCount+1}),afterAgent:()=>({runModelCallCount:0})})}var De=a.object({maxRetries:a.number().min(0).default(2),retryOn:a.union([a.function().args(a.instanceof(Error)).returns(a.boolean()),a.array(a.custom())]).default(()=>()=>!0),backoffFactor:a.number().min(0).default(2),initialDelayMs:a.number().min(0).default(1e3),maxDelayMs:a.number().min(0).default(6e4),jitter:a.boolean().default(!0)});var si=a.object({onFailure:a.union([a.literal("error"),a.literal("continue"),a.function().args(a.instanceof(Error)).returns(a.string())]).default("continue")}).merge(De);var fi=a.object({tools:a.array(a.union([a.custom(),a.custom(),a.string()])).optional(),onFailure:a.union([a.literal("error"),a.literal("continue"),a.literal("raise"),a.literal("return_message"),a.function().args(a.instanceof(Error)).returns(a.string())]).default("continue")}).merge(De);var Ci=a.object({enableCaching:a.boolean().optional(),ttl:a.enum(["5m","1h"]).optional(),minMessagesToCache:a.number().optional(),unsupportedModelBehavior:a.enum(["ignore","warn","raise"]).optional()});export{A as a,xo as b,No as c,qo as d};
|