@arcgis/ai-components 5.2.0-next.3 → 5.2.0-next.31
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 +23 -22
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -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 +36 -7
- 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/27NEUQN3.js +2 -0
- package/dist/cdn/2NMR43NW.js +2 -0
- package/dist/cdn/3AXQTBIA.js +134 -0
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4I4MCV7V.js +71 -0
- package/dist/cdn/4RZPOYZ7.js +9 -0
- package/dist/cdn/5SBLS4NW.js +2 -0
- package/dist/cdn/{AMP6IALT.js → 5W7S2RS4.js} +1 -1
- package/dist/cdn/6LZ6GOHF.js +56 -0
- package/dist/cdn/7IFCBXV7.js +2 -0
- package/dist/cdn/ADYIXCSG.js +2 -0
- package/dist/cdn/AFLQZIKS.js +180 -0
- package/dist/cdn/AMVOJNWN.js +2 -0
- package/dist/cdn/C7E7MJSR.js +2 -0
- package/dist/cdn/CAECQD75.js +2 -0
- package/dist/cdn/CIW3QMKV.js +2 -0
- package/dist/cdn/CJIV4KJZ.js +179 -0
- package/dist/cdn/CVHJMR5X.js +2 -0
- package/dist/cdn/DEAYZ3MK.js +2 -0
- package/dist/cdn/{H7422XUG.js → E2HENO3T.js} +1 -1
- package/dist/cdn/E7TMP4YV.js +3 -0
- package/dist/cdn/EBRNMPPO.js +48 -0
- package/dist/cdn/FWU6DFIB.js +2 -0
- package/dist/cdn/HBYZSLEZ.js +22 -0
- package/dist/cdn/HOCTVCHH.js +2 -0
- package/dist/cdn/{4HU7735A.js → HXOSLGWU.js} +6 -4
- package/dist/cdn/I64KIZG3.js +2 -0
- package/dist/cdn/IB4WTK74.js +2 -0
- package/dist/cdn/IC5P5NYY.js +2 -0
- package/dist/cdn/IGZWQJW7.js +3 -0
- package/dist/cdn/IKEF7ZHH.js +181 -0
- package/dist/cdn/IXAKT6L3.js +2 -0
- package/dist/cdn/JEIMRNYM.js +2 -0
- package/dist/cdn/JN744CAW.js +2 -0
- package/dist/cdn/KRE4U7V7.js +2 -0
- package/dist/cdn/{NE7E52YR.js → KTK4HNL2.js} +8 -2
- package/dist/cdn/L77BTGXY.js +2 -0
- package/dist/cdn/LEPJUN3X.js +22 -0
- package/dist/cdn/LODKJRS4.js +2 -0
- package/dist/cdn/M3SWPT3M.js +2 -0
- package/dist/cdn/MAV3DW27.js +4 -0
- package/dist/cdn/NOJYPREL.js +3 -0
- package/dist/cdn/NXKKG5TK.js +2 -0
- package/dist/cdn/O3F47IO5.js +2 -0
- package/dist/cdn/O7TGCM5P.js +6 -0
- package/dist/cdn/PBTINZTK.js +65 -0
- package/dist/cdn/PKHQW7QU.js +18 -0
- package/dist/cdn/PSWI3MFB.js +2 -0
- package/dist/cdn/Q73PK7Q7.js +2 -0
- package/dist/cdn/Q7TL5Q5N.js +2 -0
- package/dist/cdn/QSA4T3BU.js +2 -0
- package/dist/cdn/RMLXVQZ5.js +2 -0
- package/dist/cdn/RX45PCYB.js +9 -0
- package/dist/cdn/S27EJSLC.js +14 -0
- package/dist/cdn/SMADRJ67.js +2 -0
- package/dist/cdn/{ZLXN7NMF.js → T537PKP4.js} +9 -7
- package/dist/cdn/{X2ZDYHCG.js → TNMXWUXU.js} +9 -4
- package/dist/cdn/TSEQVE2H.js +36 -0
- package/dist/cdn/VKU4WAQV.js +2 -0
- package/dist/cdn/W2IHPJ54.js +34 -0
- package/dist/cdn/W2JAKE2M.js +2 -0
- package/dist/cdn/WAVKMZA6.js +2 -0
- package/dist/cdn/WDE3HN7K.js +2 -0
- package/dist/cdn/WH6QQK6N.js +2 -0
- package/dist/cdn/WNS5ZUF5.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → X7GE26KU.js} +16 -0
- package/dist/cdn/XVQJBUMY.js +2 -0
- package/dist/cdn/YJ3QQXF6.js +2 -0
- package/dist/cdn/YRBANNQ5.js +2 -0
- package/dist/cdn/YYY7HKYX.js +2 -0
- package/dist/cdn/ZEYIBYSF.js +66 -0
- package/dist/cdn/ZMSJQB65.js +99 -0
- package/dist/cdn/ZOSUDIJH.js +2 -0
- package/dist/cdn/ZPLFFLPF.js +2 -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 +1794 -1597
- package/dist/chunks/arcgisKnowledgeGraph.js +126 -71
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/converterUtils.js +39 -32
- package/dist/chunks/dataExplorationGraph.js +139 -113
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/generateLayerDescriptions.js +231 -191
- package/dist/chunks/helpGraph.js +17 -13
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +24 -20
- package/dist/chunks/navigationGraph.js +33 -28
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +267 -226
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +1 -1
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +12 -9
- package/dist/chunks/utils2.js +8 -8
- package/dist/components/arcgis-assistant/customElement.d.ts +27 -0
- package/dist/components/arcgis-assistant/customElement.js +385 -152
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +5 -1
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- 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 +11 -5
- package/dist/components/arcgis-assistant-help-agent/customElement.js +8 -2
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -8
- 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 +17 -11
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +10 -4
- 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 +5 -1
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +11 -5
- 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 +10 -8
- 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 +7 -6
- package/dist/types/lumina.d.ts +11 -5
- package/dist/types/preact.d.ts +12 -5
- package/dist/types/react.d.ts +13 -5
- package/dist/types/stencil.d.ts +11 -5
- package/dist/utils/index.d.ts +85 -42
- package/dist/utils/index.js +54 -49
- package/package.json +8 -7
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/3PKJWIC3.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AO7BQHKC.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/DHOVCT6R.js +0 -2
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FHVXO2WG.js +0 -166
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/GSEPHN3A.js +0 -106
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/JY6LLOUJ.js +0 -22
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MDVYQQUG.js +0 -14
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NAUXSHIE.js +0 -72
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/ON2V5XI2.js +0 -3
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S6W6HV4T.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/V2P4AIGG.js +0 -2
- package/dist/cdn/V5YEZSRY.js +0 -16
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YY2SBO3V.js +0 -2
package/dist/cdn/HB5A5R2E.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as s,b as i}from"./AMP6IALT.js";import{b as r}from"./OAVEHGB6.js";function c(e,n){let t=s(e.el,e.referenceElement);if(t)return t;let o=r(e.el,"arcgis-assistant"),a=s(e.el,o?.referenceElement);if(a)return a;throw new Error(`${n}: Reference element not found`)}function g(e,n){let t=c(e,n).view;if(!t)throw new Error(`${n}: Reference element does not have a view`);return t}function m(e){return typeof e=="function"}function w(e){let n=r(e.el,"arcgis-assistant");if(n===void 0)throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");n.register({agent:e.agent,getContext:async()=>await e.getContext?.()??e.context??{}})}function f(e){let n=i(e.el,e.referenceElement);if(n)return n;let t=r(e.el,"arcgis-assistant");return s(e.el,t?.referenceElement)||null}function E(e){let n=f(e);return n?n.view:null}export{g as a,m as b,w as c,E as d};
|
package/dist/cdn/JY6LLOUJ.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./FHVXO2WG.js";import a from"./GSEPHN3A.js";import{Fb as f,a as h,b as l}from"./462JBSEV.js";import{a as y,c as E}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as u,y as d}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{f:p,m:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
|
|
3
|
-
Fields: ${r}${i}`}).join(`
|
|
4
|
-
|
|
5
|
-
`);return`This map contains ${e.size} layer(s):
|
|
6
|
-
|
|
7
|
-
${t}`},k=e=>{let t=e?.list()??[];return t.length?t.map(o=>`- ${o.agent.name}: ${o.agent.description}`).join(`
|
|
8
|
-
`):"No agents currently available."};async function I(e,t){let o=await _("help_prompt"),a=m(t,"layersAndFieldsRegistry"),s=m(t,"agentRegistry");try{let r=await x({promptText:o,modelTier:"fast",tools:C,inputVariables:{layerSummary:b(a),agents:k(s),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(r.tool_calls?.length??0)>0,n=typeof r.text=="string"?r.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?r:void 0},outputMessage:i?e.outputMessage:n,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(r){let i=r instanceof Error?r.message:String(r);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var M=(e,t)=>v(["agentRegistry"],"Help Agent")(e,t);async function T(e,t){let o=new S(C);try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let s=(await o.invoke({messages:[a]},t)).messages.map(r=>r.text).join(`
|
|
9
|
-
`);return await p({text:`Finished executing help tool: ${s}`},t),{...e,outputMessage:s,status:"success",summary:s?w(s):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let s=a instanceof Error?a.message:String(a);return await p({text:`Help tool execution failed: ${s}`},t),{...e,outputMessage:`Help tool execution failed: ${s}`,status:"failed",summary:`Help tool execution failed: ${s}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var q=()=>new f(c).addNode("requireHelpServices",M).addNode("agent",I).addNode("tools",T).addEdge(h,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":l).addEdge("tools",l),A=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
|
|
10
|
-
|
|
11
|
-
_Example: “Tell me about this map”_
|
|
12
|
-
_Example: “List all layers in this map”_
|
|
13
|
-
_Example: “List fields in protected areas layer”_
|
|
14
|
-
_Example: “What agents are available to me?”_
|
|
15
|
-
_Example: “What can you do?”_
|
|
16
|
-
_Example: “What can I ask”_
|
|
17
|
-
|
|
18
|
-
Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
|
|
19
|
-
|
|
20
|
-
IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
|
|
21
|
-
_Example: "Create a chart"_
|
|
22
|
-
_Example: "Create a table"_`,$={id:"help",name:"Help Agent",description:A,createGraph:q,workspace:c};var g=class extends u{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=y(this,"arcgis-assistant-help-agent"),E(this)}};d("arcgis-assistant-help-agent",g);return g},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b)
|
package/dist/cdn/KMQ3SP4I.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./YIMNOUTF.js";var e=`## Additional System Context
|
|
3
|
-
|
|
4
|
-
In addition to the user's inquiry prompt that precedes this system context, the current link chart has entities and relationships on it already, in the format of an array of objects containing identifiers and typeNames, in case this is needed for query generation (for example 'Add all records that are connected to people on this link chart to the link chart'). If the user is asking for a query that acts on 'the current link chart', 'my link chart', or similar then the cypher query should be filtered by the ids. For example, 'Match (n:Person)-[\\r]->(m) WHERE id(n) IN [\\'identifier1','identifier2'] return r, m. Curly braces (the '{' and '}' characters) are often part of identifier strings and should not be stripped out - the process of filtering by ids should not be altering the id strings. The entities and relationships that are on the current link chart are as follows:
|
|
5
|
-
`;export{e as default};
|
package/dist/cdn/MDVYQQUG.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./YY2SBO3V.js";import b from"./FHVXO2WG.js";import a from"./GSEPHN3A.js";import{Fb as I,a as w,b as h,q as E}from"./462JBSEV.js";import{a as v,c as F}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as x,y as S}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{f:n,m:L},{A:z,B:u,a:$,m:C,o:y,p:N,q:A,r:R,s:T,t:b,u:_,v:V,w:q,x:j,y:k,z:M},D])=>{var B=.7,P=10,J=async(t,r)=>{try{await n({text:"Similarity search to find fields"},r);let e=y(r,"fieldSearch"),i=y(r,"layersAndFieldsRegistry"),o=y(r,"embeddingCache"),a=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:B,topResults:P,embeddingCache:o}),m=a.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
|
|
3
|
-
`);return`${i.get(c)?.layerItem.name??c}:
|
|
4
|
-
${g}`}).join(`
|
|
5
|
-
`),l;return a.length>0?l=`Vector search completed. Matching layers and fields with scores:
|
|
6
|
-
${m}`:l=`No vector search results found for score over ${B}.`,await n({text:l},r),{...t,vectorSearchFieldResults:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},K=.7,U=async(t,r)=>{try{await n({text:`Similarity search to find layers: ${t.agentExecutionContext.assignedTask}`},r);let e=y(r,"layerSearch"),i=y(r,"layersAndFieldsRegistry"),o=await e.searchLayers({text:t.agentExecutionContext.assignedTask,minScore:K}),a=o.map(c=>c.id),m=o.map(({id:c,score:d})=>`${i.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
|
|
7
|
-
`),l;return a.length>0?l=`Vector search completed. Matching layers with scores:
|
|
8
|
-
${m}`:l="Vector search completed. No matching layers found.",await n({text:l},r),{...t,vectorSearchLayerIds:a}}catch(e){throw await n({text:`Error during vector search: ${e instanceof Error?e.message:String(e)}`},r),new Error(`Vector search failed: ${e instanceof Error?e.message:String(e)}`)}},G=[A,R,T,b,_,V,q,j,k,M,z],H=(t,r=3)=>{let e=t.map((o,a)=>o.type==="human"?a:-1).filter(o=>o!==-1);if(e.length===0)return[];let i=e.length>r?e[e.length-r]:e[0];return t.slice(i)},O=async(t,r)=>{await n({text:"Requesting LLM for layer query results"},r);let e=await C("navigation_intent_prompt");if(!r?.configurable)throw new Error("config.configurable is required for layer query tools");let i={layerFieldInfo:t.layerFieldInfo},o=await L({promptText:e,modelTier:"advanced",messages:H(t.agentExecutionContext.messages),inputVariables:i,tools:G});return await D(o,r),{...t,agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,o]}}};async function Q(t,r){let e=await new $(G).invoke({messages:H(t.agentExecutionContext.messages)},r),i=e.messages.map(a=>a.text).join(`
|
|
9
|
-
`);await n({text:`Finished executing layer filter tool: ${i}`},r);let o=e.messages.map(a=>a.text).join(`
|
|
10
|
-
`);return{...t,outputMessage:o}}var W=async(t,r)=>(await n({text:"Exiting Layer Styling agent"},r),t),X=async(t,r)=>{try{await n({text:"Populating layer and field info"},r);let e=[];for(let i of t.vectorSearchFieldResults){let o=function(g){let s=l.get(g)?.layerItem;return s?[s.name&&`Name: ${s.name}`,s.title&&`Title: ${s.title}`,s.description&&`Description: ${s.description}`].filter(Boolean).join(" | "):g},{layerId:a,results:m}=i,l=y(r,"layersAndFieldsRegistry"),c=l.get(a)?.fieldRegistry;if(!c)continue;let d=e.find(g=>g.layerId===a);d||(d={layerId:a,layerSummary:o(a),fieldInfos:[]},e.push(d));for(let g of m){let s=c.get(g.name);s&&d.fieldInfos.push(s)}}return await n({text:"Populated layerFieldInfo"},r),{...t,layerFieldInfo:e}}catch(e){throw await n({text:"Error populating layerFieldInfo"},r),new Error(`Error populating layerFieldInfo: ${e instanceof Error?e.message:String(e)}`)}},Y=(t,r)=>{let e=t.vectorSearchLayerIds??[];if(e.length<=1)return{...t,selectedLayerId:t.vectorSearchLayerIds[0]};let{hitlResponse:i}=r.configurable;if(i?.agentId!==p.id||i.id!=="reviewLayerSelection"){let a={agentId:p.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...e]};throw new E(a)}let o=null;return Array.isArray(i.payload)&&i.payload.length>0&&(o=i.payload[0]),{...t,selectedLayerId:o??t.vectorSearchLayerIds[0]}},Z=(t,r)=>N(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(t,r),ee=()=>new I(u).addNode("requireLayerStylingServices",Z).addNode("vectorSearchLayers",U).addNode("layerSelectionHITL",Y).addNode("vectorSearchFields",J).addNode("populateLayerFieldInfo",X).addNode("agent",O).addNode("tools",Q).addNode("earlyExit",W).addEdge(w,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",t=>t.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",t=>t.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",h).addEdge("earlyExit",h),te=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
|
|
11
|
-
_Example: “Color points by sales amount”_
|
|
12
|
-
_Example: “Show population density with a color gradient”_
|
|
13
|
-
_Example: “Create a relationship map between height and depth”_
|
|
14
|
-
_Example: “Vary circle sizes according to population”_`,p={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends x{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=v(this,"arcgis-assistant-layer-styling-agent"),F(this)}};S("arcgis-assistant-layer-styling-agent",f);return f},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b,c)
|
package/dist/cdn/MH5RPXHM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as N,c as $}from"./OAVEHGB6.js";import{a as C,b as P,c as f,d as m,e as L,f as O,k as g,m as v,n as w,o as A}from"./OH64RMOR.js";var _=t=>(...s)=>{let e=m(),r=new t(...s),o=r.exports;f(e.at(-1));let n=r.component.manager;n.W(r,o),r.watchExports(n.W.bind(n,r)),L(r);let a=[r.component,...e].reverse();return v(a,i=>i===void 0?void 0:S(r,i,o),o)},S=(t,{host:s,key:e,isReactive:r},o)=>{let n=s,a=n[e]!==t.exports,i=n[e]!==o,l=o!==t.exports;if(a&&!i&&l&&(n[e]=t.exports),s===t.component){if(r){let p=t.component.manager;i&&p.W(t,n[e]),t.onUpdate(u=>{if(u.has(e)){let x=n[e];x!==t.exports&&p.W(t,x)}})}t.O=r?void 0:e}let c=t.component.constructor.elementProperties.get(e)?.readOnly;t.watchExports(()=>{n[e]!==t.exports&&(c?O(()=>{n[e]=t.exports}):n[e]=t.exports)})};var U="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),F=new Set(U),h="en",W={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},K=async(t,s,e="")=>{let r=`${s}/${e}`,o=`${r}${t}.json`;return b[o]??(b[o]=j(t,r)),await b[o]},b={},j=async(t,s)=>{let e=`${s}${t}.json`;try{let r=await fetch(e);if(r.ok)return await r.json()}catch(r){return g("error","intl",`An unknown error occurred while fetching localization strings at ${e}`,{detail:{error:r}}),{}}return t===h?{}:await j(h,s)},E=t=>{let s=$(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:k(s)}},k=t=>{let[s,e]=t.split("-"),r=s.toLowerCase(),o=r;return e&&(o=`${r}-${e.toUpperCase()}`),o=W[o]??o,F.has(o)?o:e?k(r):h},D=(t,s,e,r)=>{let o,n=()=>R(t,s(),r).then(a=>{(o?.lang!==a.lang||o.t9nLocale!==a.t9nLocale||o.t9nStrings!==a.t9nStrings)&&e(a),o=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),N(t,["lang"],n)},R=async(t,s,e=t.localName.split("-").slice(1).join("-"))=>{let{lang:r,t9nLocale:o}=E(t),n=`${s}/${e}/t9n`,i=e===null?{}:await K(o,n,"messages.");return{lang:r,t9nLocale:o,t9nStrings:i}};var T=t=>q(void 0,t);var y=class extends A{constructor(s,e){super(s);let r=this.exports;try{P(this.component);let o=e(this.component,this),n=this.exports!==r;if(C(o)){n||this.setProvisionalExports(o);let a=o.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||o!==void 0)&&(this.exports=o),queueMicrotask(()=>super.catchUpLifecycle())}catch(o){this.P.reject(o)}}catchUpLifecycle(){}},q=_(y);var at=(t,s,e)=>T((r,o)=>{let n=s,a=w({bubbles:!1,composed:!1});return o.onUpdated(i=>{if(!n.some(c=>i.has(c)))return;let l=e(V(t,n,i)),d=e(V(t,n));l.forEach((c,p)=>{d.has(p)||a.emit({...c,data:void 0})}),d.forEach((c,p)=>{let u=l.get(p);(!u||!z(u,c))&&a.emit(c)})}),a});function V(t,s,e){let r={};return s.forEach(o=>{r[o]=e?.has(o)?e.get(o):t[o]}),r}function z(t,s){if(t===s)return!0;if(!t||!s||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return!1;let e=Object.entries(t),r=Object.entries(s);return e.length!==r.length?!1:e.every(([o,n])=>z(n,s[o]))}var it=t=>(s={})=>T((e,r)=>{let o=E(e.el),n={_lang:o.lang,_t9nLocale:o.t9nLocale,_loading:!0},a=e;r.onLifecycle(()=>D(e.el,()=>t("./assets"),({t9nLocale:l,t9nStrings:d,lang:c})=>{let p={...d,_lang:c,_t9nLocale:l,_loading:!1};r.exports=p;let u=d.componentLabel;typeof u=="string"&&"label"in e&&e.label==null&&(e.label??=u),i(a.messageOverrides)},s.name));let i=l=>{let d=r.exports,c=d._original??d,p=M(c,l);l&&(p._original=c),r.exports=p};return"messageOverrides"in a&&r.onUpdate(l=>{l.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(r.setProvisionalExports(n,!1),r.ready):n}),M=(t,s)=>{if(!s)return t;let e={...t};return Object.entries(s).forEach(([r,o])=>{t[r]!==void 0&&(typeof o=="object"?e[r]=M(t[r],o):e[r]=o??t[r])}),e};export{at as a,it as b};
|
package/dist/cdn/NAUXSHIE.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
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"./OH64RMOR.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]").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} *[^
|
|
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
|
-
`),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
|
-
`)}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(`
|
|
7
|
-
`).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[a]=l;return a.length>=s.length?i.slice(s.length):i}).join(`
|
|
8
|
-
`)}var ne=class{options;rules;lexer;constructor(e){this.options=e||P}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=this.options.pedantic?t[0]:Ye(t[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Hr(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=$(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:$(t[0],`
|
|
9
|
-
`),depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:$(t[0],`
|
|
10
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=$(t[0],`
|
|
11
|
-
`).split(`
|
|
12
|
-
`),n="",s="",i=[];for(;r.length>0;){let l=!1,a=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),l=!0;else if(!l)a.push(r[c]);else break;r=r.slice(c);let o=a.join(`
|
|
13
|
-
`),p=o.replace(this.rules.other.blockquoteSetextReplace,`
|
|
14
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
15
|
-
${o}`:o,s=s?`${s}
|
|
16
|
-
${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=u,r.length===0)break;let f=i.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,g=h.raw+`
|
|
17
|
-
`+r.join(`
|
|
18
|
-
`),b=this.blockquote(g);i[i.length-1]=b,n=n.substring(0,n.length-h.raw.length)+b.raw,s=s.substring(0,s.length-h.text.length)+b.text;break}else if(f?.type==="list"){let h=f,g=h.raw+`
|
|
19
|
-
`+r.join(`
|
|
20
|
-
`),b=this.list(g);i[i.length-1]=b,n=n.substring(0,n.length-f.raw.length)+b.raw,s=s.substring(0,s.length-h.raw.length)+b.raw,r=g.substring(i.at(-1).raw.length).split(`
|
|
21
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;e;){let c=!1,o="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let u=Vr(t[2].split(`
|
|
22
|
-
`,1)[0],t[1].length),f=e.split(`
|
|
23
|
-
`,1)[0],h=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):h?g=t[1].length+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=t[1].length),h&&this.rules.other.blankLine.test(f)&&(o+=f+`
|
|
24
|
-
`,e=e.substring(f.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(g),m=this.rules.other.hrRegex(g),L=this.rules.other.fencesBeginRegex(g),E=this.rules.other.headingBeginRegex(g),_=this.rules.other.htmlBeginRegex(g),Z=this.rules.other.blockquoteBeginRegex(g);for(;e;){let N=e.split(`
|
|
25
|
-
`,1)[0],T;if(f=N,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),T=f):T=f.replace(this.rules.other.tabCharGlobal," "),L.test(f)||E.test(f)||_.test(f)||Z.test(f)||b.test(f)||m.test(f))break;if(T.search(this.rules.other.nonSpaceChar)>=g||!f.trim())p+=`
|
|
26
|
-
`+T.slice(g);else{if(h||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(u)||E.test(u)||m.test(u))break;p+=`
|
|
27
|
-
`+f}h=!f.trim(),o+=N+`
|
|
28
|
-
`,e=e.substring(N.length+1),u=T.slice(g)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0)),s.items.push({type:"list_item",raw:o,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),s.raw+=o}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let o=c.tokens[0];if(c.task&&(o?.type==="text"||o?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),o.raw=o.raw.replace(this.rules.other.listReplaceTask,""),o.text=o.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(c.raw);if(p){let u={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};c.checked=u.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1);if(!s.loose){let p=c.tokens.filter(f=>f.type==="space"),u=p.length>0&&p.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=u}}if(s.loose)for(let c of s.items){c.loose=!0;for(let o of c.tokens)o.type==="text"&&(o.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t){let r=Ye(t[0]);return{type:"html",block:!0,raw:r,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:r}}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:$(t[0],`
|
|
29
|
-
`),href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=Ke(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
30
|
-
`):[],i={type:"table",raw:$(t[0],`
|
|
31
|
-
`),header:[],align:[],rows:[]};if(r.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of s)i.rows.push(Ke(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let r=t[1].trim();return{type:"heading",raw:$(t[0],`
|
|
32
|
-
`),depth:t[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
|
|
33
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=$(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Nr(t[2],"()");if(i===-2)return;if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),et(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return et(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,c=0,o=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+s);(n=o.exec(t))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){a+=l;continue}else if((n[5]||n[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+c);let p=[...n[0]][0].length,u=e.slice(0,s+n.index+p+l);if(Math.min(s,l)%2){let h=u.slice(1,-1);return{type:"em",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(n=c.exec(t))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==s))continue;if(n[3]||n[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let o=[...n[0]][0].length,p=e.slice(0,s+n.index+o+l),u=p.slice(s,-s);return{type:"del",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},v=class ge{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||P,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:w,block:te.normal,inline:M.normal};this.options.pedantic?(r.block=te.pedantic,r.inline=M.pedantic):this.options.gfm&&(r.block=te.gfm,this.options.breaks?r.inline=M.breaks:r.inline=M.gfm),this.tokenizer.rules=r}static get rules(){return{block:te,inline:M}}static lex(t,r){return new ge(r).lex(t)}static lexInline(t,r){return new ge(r).inlineTokens(t)}lex(t){t=t.replace(w.carriageReturn,`
|
|
34
|
-
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,r))?(t=t.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=r.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
35
|
-
`:r.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
36
|
-
`)?"":`
|
|
37
|
-
`)+i.raw,a.text+=`
|
|
38
|
-
`+i.text,this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
39
|
-
`)?"":`
|
|
40
|
-
`)+i.raw,a.text+=`
|
|
41
|
-
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),r.push(i);continue}let l=t;if(this.options.extensions?.startBlock){let a=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(p=>{o=p.call({lexer:this},c),typeof o=="number"&&o>=0&&(a=Math.min(a,o))}),a<1/0&&a>=0&&(l=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let a=r.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
42
|
-
`)?"":`
|
|
43
|
-
`)+i.raw,a.text+=`
|
|
44
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i),n=l.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
45
|
-
`)?"":`
|
|
46
|
-
`)+i.raw,a.text+=`
|
|
47
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(i);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;let n=t,s=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=s[2]?s[2].length:0,n=n.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let l=!1,a="",c=1/0;for(;t;){if(t.length<c)c=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}l||(a=""),l=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let u=r.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(t,n,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(t,n,a)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),r.push(o);continue}let p=t;if(this.options.extensions?.startInline){let u=1/0,f=t.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},f),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(p=t.substring(0,u+1))}if(o=this.tokenizer.inlineText(p)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),l=!0;let u=r.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return r}infiniteLoopError(t){let r="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);else throw new Error(r)}},se=class{options;parser;constructor(e){this.options=e||P}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(w.notSpaceStart)?.[0],s=e.replace(w.endingNewline,"")+`
|
|
48
|
-
`;return n?'<pre><code class="language-'+S(n)+'">'+(r?s:S(s,!0))+`</code></pre>
|
|
49
|
-
`:"<pre><code>"+(r?s:S(s,!0))+`</code></pre>
|
|
50
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
51
|
-
${this.parser.parse(e)}</blockquote>
|
|
52
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
53
|
-
`}hr(e){return`<hr>
|
|
54
|
-
`}list(e){let t=e.ordered,r=e.start,n="";for(let l=0;l<e.items.length;l++){let a=e.items[l];n+=this.listitem(a)}let s=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+s+i+`>
|
|
55
|
-
`+n+"</"+s+`>
|
|
56
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
57
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
58
|
-
`}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let n="";for(let s=0;s<e.rows.length;s++){let i=e.rows[s];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
59
|
-
<thead>
|
|
60
|
-
`+t+`</thead>
|
|
61
|
-
`+n+`</table>
|
|
62
|
-
`}tablerow({text:e}){return`<tr>
|
|
63
|
-
${e}</tr>
|
|
64
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
65
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=Je(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+S(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=Je(e);if(s===null)return S(r);e=s;let i=`<img src="${e}" alt="${S(r)}"`;return t&&(i+=` title="${S(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}},Se=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},A=class de{options;renderer;textRenderer;constructor(t){this.options=t||P,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Se}static parse(t,r){return new de(r).parse(t)}static parseInline(t,r){return new de(r).parseInline(t)}parse(t){this.renderer.parser=this;let r="";for(let n=0;n<t.length;n++){let s=t[n];if(this.options.extensions?.renderers?.[s.type]){let l=s,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=a||"";continue}}let i=s;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,r=this.renderer){this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let i=t[s];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let l=i;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}},G=class{options;block;constructor(e){this.options=e||P}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?v.lex:v.lexInline}provideParser(e=this.block){return e?A.parse:A.parseInline}},Wr=class{defaults=ke();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=A;Renderer=se;TextRenderer=Se;Lexer=v;Tokenizer=ne;Hooks=G;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let s=n;for(let i of s.header)r=r.concat(this.walkTokens(i.tokens,t));for(let i of s.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=n;r=r.concat(this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let l=s[i].flat(1/0);r=r.concat(this.walkTokens(l,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=t.renderers[s.name];i?t.renderers[s.name]=function(...l){let a=s.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new se(this.defaults);for(let i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],c=s[l];s[l]=(...o)=>{let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ne(this.defaults);for(let i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=r.tokenizer[l],c=s[l];s[l]=(...o)=>{let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new G;for(let i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=r.hooks[l],c=s[l];G.passThroughHooks.has(i)?s[l]=o=>{if(this.defaults.async&&G.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await a.call(s,o);return c.call(s,u)})();let p=a.call(s,o);return c.call(s,p)}:s[l]=(...o)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,o);return u===!1&&(u=await c.apply(s,o)),u})();let p=a.apply(s,o);return p===!1&&(p=c.apply(s,o)),p}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),s&&(a=a.concat(s.call(this,l))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return v.lex(e,t??this.defaults)}parser(e,t){return A.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?v.lex:v.lexInline)(l,s),c=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let o=await(s.hooks?await s.hooks.provideParser(e):e?A.parse:A.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(o):o})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let l=(s.hooks?s.hooks.provideLexer(e):e?v.lex:v.lexInline)(t,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?A.parse:A.parseInline)(l,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(e,t){return r=>{if(r.message+=`
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},I=new Wr;function k(e,t){return I.parse(e,t)}k.options=k.setOptions=function(e){return I.setOptions(e),k.defaults=I.defaults,tt(k.defaults),k};k.getDefaults=ke;k.defaults=P;k.use=function(...e){return I.use(...e),k.defaults=I.defaults,tt(k.defaults),k};k.walkTokens=function(e,t){return I.walkTokens(e,t)};k.parseInline=I.parseInline;k.Parser=A;k.parser=A.parse;k.Renderer=se;k.TextRenderer=Se;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=ne;k.Hooks=G;k.parse=k;var rn=k.options,nn=k.setOptions,sn=k.use,an=k.walkTokens,ln=k.parseInline;var on=A.parse,cn=v.lex;k.use({gfm:!0,breaks:!0,async:!1});var Mr=new Ze({whiteList:{ol:["start"],li:["value"],"calcite-table":["caption","bordered","striped","layout","scale","class"],"calcite-table-row":["slot","class"],"calcite-table-header":["heading","alignment","description","class"],"calcite-table-cell":["alignment","colspan","rowspan","class"],pre:["class"],code:["class"]}},!0);function Gr(e){return Mr.sanitize(e)}function pt(e,t){let r=e.indexOf("{",t),n=e.indexOf("[",t);return r===-1?n:n===-1?r:Math.min(r,n)}function jr(e){if(e.trimStart().startsWith("```"))return null;for(let t=pt(e,0);t!==-1;t=pt(e,t+1)){let r=0,n=0;for(let s=t;s<e.length;s++){let i=e[s];if(i==="{"?r++:i==="}"?r--:i==="["?n++:i==="]"&&n--,r<0||n<0)break;if(r===0&&n===0&&s>t)return e.slice(t,s+1)}}return null}function xn(e){if(!e)return"";let t=e,r=jr(e);if(r)try{let i=JSON.parse(r),l=`
|
|
67
|
-
|
|
68
|
-
\`\`\`json
|
|
69
|
-
${JSON.stringify(i,null,2)}
|
|
70
|
-
\`\`\`
|
|
71
|
-
|
|
72
|
-
`;t=e.replace(r,l)}catch{}let n=Zr(t),s=Xr(n);return Gr(s)}function Zr(e){return e?k.parse(e,{async:!1}):""}function Xr(e){if(!e||typeof DOMParser>"u")return e;try{let t=new DOMParser().parseFromString(e,"text/html");return Array.from(t.querySelectorAll("table")).forEach((r,n)=>{let s=t.createElement("calcite-table");s.setAttribute("caption",`Table ${n+1}`),s.setAttribute("striped","true");let i=r.querySelector("thead");if(i){let a=Array.from(i.querySelectorAll("tr"));for(let c of a){let o=t.createElement("calcite-table-row");o.setAttribute("slot","table-header");let p=Array.from(c.querySelectorAll("th, td"));for(let u of p){let f=(u.textContent??"").trim(),h=t.createElement("calcite-table-header");h.setAttribute("heading",f),o.appendChild(h)}s.appendChild(o)}}let l=r.querySelector("tbody");(l?Array.from(l.querySelectorAll("tr")):Array.from(r.querySelectorAll("tr")).filter(a=>!i?.contains(a))).forEach((a,c)=>{let o=t.createElement("calcite-table-row"),p=!i&&c===0&&a.querySelectorAll("th").length>0;p&&o.setAttribute("slot","table-header");let u=Array.from(a.querySelectorAll("th, td"));for(let f of u){if(p&&f.localName==="th"){let m=(f.textContent??"").trim(),L=t.createElement("calcite-table-header");L.setAttribute("heading",m),o.appendChild(L);return}let h=t.createElement("calcite-table-cell"),g=f.getAttribute("colspan"),b=f.getAttribute("rowspan");g&&h.setAttribute("colspan",g),b&&h.setAttribute("rowspan",b),h.innerHTML=f.innerHTML,o.appendChild(h)}s.appendChild(o)}),r.replaceWith(s)}),t.body.innerHTML}catch{return e}}export{Jr as a,xn as b};
|
package/dist/cdn/NVI3I46B.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{g as e,h as t,t as a,u as i,v as o,y as l}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([r,{watch:n}])=>{var c=e`.messages-container{display:flex;flex:1;flex-direction:column}.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=a(),this.loading=!1,this.messages=new r([])}static{this.properties={loading:5,messages:0}}static{this.styles=c}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.requestUpdate(),this._scrollToEnd()}),n(()=>this.loading,()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return t`<div class="messages-container"><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div ${i(this.#s)}></div></div>`}};l("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
|
package/dist/cdn/OAVEHGB6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
var l=(n,t)=>{let e=n;for(;e;){if(e===t)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},f=(n,t,e)=>{let s=u(t).subscribe;return s(o=>{o.some(r=>l(n,r.target))&&e()})},c={},u=n=>{let t=n.join(","),e=c[t];if(e!==void 0)return e;let s=new Set,o=new MutationObserver(r=>s.forEach(a=>a(r)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:n,subtree:!0});let i={subscribe:r=>(s.add(r),()=>{s.delete(r),s.size===0&&(o.disconnect(),c[t]=void 0)})};return c[t]=i,i},d=(n,t)=>{let e=n;for(;e;){let s=e.closest?.(t);if(s)return s;let o=e.getRootNode?.();if(o===globalThis.document)return;e=o?.host}};var m=(n,t,e)=>d(n,`[${t}]`)?.getAttribute(t)??e;export{f as a,d as b,m as c};
|
package/dist/cdn/OH64RMOR.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Mt=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}},kt=o=>new M(typeof o=="string"?o:o+"",void 0,gt),$e=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,n,r)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[r+1],o[0]);return new M(e,o,gt)},jt=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),n=Y.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return kt(e)})(o):o;var{is:be,defineProperty:Ae,getOwnPropertyDescriptor:_e,getOwnPropertyNames:Ce,getOwnPropertySymbols:we,getPrototypeOf:Oe}=Object,tt=globalThis,Ht=tt.trustedTypes,Te=Ht?Ht.emptyScript:"",Se=tt.reactiveElementPolyfillSupport,k=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Te:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},j=(o,t)=>!be(o,t),zt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Ae(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:r}=_e(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:n,set(i){let a=n?.call(this);r?.call(this,i),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??zt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Oe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...Ce(e),...we(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let r=s.getPropertyOptions(n),i=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this._$Em=n;let a=i.fromAttribute(e,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,s,n=!1,r){if(t!==void 0){let i=this.constructor;if(n===!1&&(r=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??j)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,r]of s){let{wrapped:i}=r,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,Se?.({ReactiveElement:A}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Vt=o=>o,et=$t.trustedTypes,Bt=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+_,Pe=`<${At}>`,T=document,z=()=>T.createComment(""),V=o=>o===null||typeof o!="object"&&typeof o!="function",_t=Array.isArray,Qt=o=>_t(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
|
|
3
|
-
\f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wt=/-->/g,Ft=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ps=Ct(1),us=Ct(2),fs=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!_t(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Zt=(o,t)=>{let e=o.length-1,s=[],n,r=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Wt:u[1]!==void 0?i=Ft:u[2]!==void 0?(Jt.test(u[2])&&(n=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=n??H,l=-1):u[1]===void 0?l=-2:(l=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?w:u[3]==='"'?Gt:qt):i===Gt||i===qt?i=w:i===Wt||i===Ft?i=H:(i=w,n=void 0);let v=i===w&&o[a+1].startsWith("/>")?" ":"";r+=i===H?c+Pe:l>=0?(s.push(h),c.slice(0,l)+bt+c.slice(l)+_+v):c+_+(l===-2?a:v)}return[Yt(o,r+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,i=0,a=t.length-1,c=this.parts,[h,u]=Zt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(n=O.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let l of n.getAttributeNames())if(l.endsWith(bt)){let m=u[i++],v=n.getAttribute(l).split(_),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?nt:C[1]==="@"?rt:P}),n.removeAttribute(l)}else l.startsWith(_)&&(c.push({type:6,index:r}),n.removeAttribute(l));if(Jt.test(n.tagName)){let l=n.textContent.split(_),m=l.length-1;if(m>0){n.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)n.append(l[v],z()),O.nextNode(),c.push({type:2,index:++r});n.append(l[m],z())}}}else if(n.nodeType===8)if(n.data===At)c.push({type:2,index:r});else{let l=-1;for(;(l=n.data.indexOf(_,l+1))!==-1;)c.push({type:7,index:r}),l+=_.length-1}r++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,r=V(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),r===void 0?n=void 0:(n=new r(o),n._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=S(o,n._$AS(o,t.values),n,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??T).importNode(e,!0);O.currentNode=n;let r=O.nextNode(),i=0,a=0,c=s[0];for(;c!==void 0;){if(i===c.index){let h;c.type===2?h=new L(r,r.nextSibling,this,t):c.type===1?h=new c.ctor(r,c.name,c.strings,this,t):c.type===6&&(h=new it(r,this,t)),this._$AV.push(h),c=s[++a]}i!==c?.index&&(r=O.nextNode(),i++)}return O.currentNode=T,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let r=new st(n,this),i=r.u(this.options);r.p(e),this.T(i),this._$AH=r}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){_t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let r of t)n===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Vt(t).nextSibling;Vt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,n){let r=this.strings,i=!1;if(r===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,h;for(t=r[0],c=0;c<r.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),i||=!V(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+r[c+1]),this._$AH[c]=h}i&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},nt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},rt=class extends P{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,n=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Xt={M:bt,P:_,A:At,C:1,L:Zt,R:st,D:Qt,V:S,I:L,H:P,N:nt,U:rt,B:ot,F:it},Ne=$t.litHtmlPolyfillSupport;Ne?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let r=e?.renderBefore??null;s._$litPart$=n=new L(t.insertBefore(z(),r),r,void 0,e??{})}return n._$AI(o),n};var Ot=globalThis,E=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var xe=Ot.litElementPolyfillSupport;xe?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ts=(o,t,e,s)=>{let n=se(t);if(s?.once){let i=`${o}${n}${e}`;if(te.has(i))return;te.add(i)}let r;if(s?.detail){r={};for(let[i,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(r,i,{enumerable:!0,get(){return c.deref()}})}else r[i]=a;ee?.log.interceptors?.forEach(i=>i(o,n,e,r)),console[o](`[${n}]: ${e}`,r)}else ee?.log.interceptors?.forEach(i=>i(o,n,e)),console[o](`[${n}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),De=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ns=o=>typeof o?.then=="function";var F,x=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],ne=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},re=()=>N,U,xs=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Le=()=>{let o=U;return U=void 0,o},ie=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(n=>t(n,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(De(o))return o;let s=Le();if(s!==void 0)return s},at=!1,Ds=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};var ce=(o,t)=>{let e=t>Ue?Re:t/Ie,s=0,n=setInterval(()=>{s+=e,s>=t&&(clearInterval(n),o())},e);return n},Ue=4e3,Re=2e3,Ie=4;var Me=(o,t,e)=>{let s=Object.keys(o),n=s.length;R===void 0&&queueMicrotask(I),R??=new Map;let r=R.get(o);return r===void 0&&(r={callbacks:[],keyCount:n},R.set(o,r)),r.keyCount!==n&&(r.callbacks.forEach(i=>i(s)),r.callbacks=[],r.keyCount=n),r.callbacks.push(i=>{let a=h=>p(t,null,h),c=i[n];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},ke=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((n,r)=>p(t,void 0,e===r?n:void 0)),e},je=(o=[G(),...re()],t,e)=>{let s=Array.isArray(o)?o:[o],n=s.length+1,r=i=>{n-=1,i!==void 0&&(n=Math.min(n,0)),n===0&&t(i)};s.forEach(i=>Me(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of s)if("manager"in i&&i.manager.component===i){ke(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},He=(o="",t={},e=G())=>{let s={emit:n=>{o===""&&I();let r=new CustomEvent(o,{detail:n,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(r),r}};return o===""&&je(void 0,n=>o=n.key,s),s},ze=He.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#n=[],this.#r=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(ne(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#n;#r;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return x(this.#o),ie}get useRef(){return x(this.#o),ae}get useRefSync(){return x(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#n.push(t)}onUpdate(t){this.#r.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#n.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#r.forEach(le,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(le,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="function"?this.#i.push(n):typeof n=="object"&&typeof n.remove=="function"&&this.#i.push(n.remove)})}};function le(o){p(o,void 0,this)}var pe=Tt,he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,n,r){if(!((n==="exports"||n==="_exports")&&n in s&&s[n]===e)&&(n in s||n in Promise.prototype||typeof n=="symbol"))return typeof s=="function"?s[n]:Reflect.get(s,n,r)}},e=new Proxy(o,t);return e};var{I:Bs}=Xt;var lt=o=>o.strings===void 0;var Ve={},ue=(o,t=Ve)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),Fe(t)}};function Be(o){this._$AN!==void 0?(ht(this),this._$AM=o,fe(this)):this._$AM=o}function We(o,t=!1,e=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let r=e;r<s.length;r++)K(s[r],!1),ht(s[r]);else s!=null&&(K(s,!1),ht(s));else K(this,o)}var Fe=o=>{o.type==y.CHILD&&(o._$AP??=We,o._$AQ??=Be)},dt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(Ge,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ge=/[A-Z]+(?![a-z])|[A-Z]/gu;var uo="randomUUID"in crypto;var Dt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Ke=(o,t)=>function(s,n){if(!globalThis.customElements)return;let i=(n??s??{}).resourcesUrl;i&&o.setAssetPath(i);for(let[a,[c,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[l,m,v]=h.split(";"),C=l?l?.split(",").map(Qe):void 0,yt=C?.map(([D])=>D),J=class extends xt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,D])=>D).filter(D=>D!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Qe=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Je=globalThis.HTMLElement??Ut,xt=class extends Je{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#n({a:e.A}):e.B.then(async s=>{await e.K.p,t.#n(await(s.default?.then(n=>typeof n=="function"?{a:n}:n)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=Dt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#n(t){let e=this.constructor,s=e.L,n=this.#e,r=Object.values(t).find(l=>l.L===s),i=`${s}--lazy`,a=r;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Ze(a),!e.A&&(e.A=r,customElements.define(i,r)),r.N=this;let h=document.createElement(i);r.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(n).forEach(Ye,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ye([o,t]){this[o]=t}var Ze=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(n,r){e.setAttribute.call(this.el,n,r)},t.removeAttribute=function(n){e.removeAttribute.call(this.el,n)},t.hasAttribute=function(n){return e.hasAttribute.call(this.el,n)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=ce(t,Xe)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(n=>n(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Xe=1e3,mt="autoDestroyDisabled";var ts=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let n=!!t[s];n===this.st.has(s)||this.nt?.has(s)||(n?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ye="important",es=" !"+ye,ss=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let n=t[s];if(n!=null){this.ft.add(s);let r=typeof n=="string"&&n.endsWith(es);s.includes("-")||r?e.setProperty(s,r?n.slice(0,-11):n,r?ye:""):e[s]=n}}return f}});var os=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ge=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,n=e.K.o,r=o.prototype.shouldUpdate;t.#n=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==r&&(t.#e=t.shouldUpdate,t.shouldUpdate=r),n&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,n()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,n=Array.isArray(e)?e[1]:void 0,r=n?.hasChanged??j,i={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),useDefault:!!(s&128),c:!1,...n,hasChanged(a,c){let h=r(a,c);return i.c=h,h}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,s){let n=this.K,r=super.getPropertyDescriptor(t,e,s);return s.d=r,{...r,get(){return n.t?.(this.#t.get(t)),r.get?.call(this)},set(i){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);r.set.call(this,i??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#n;#r;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#r=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#i().catch(n=>{this.#n.reject(n),setTimeout(()=>{throw n})})):e&&this.requestUpdate()}#d(t){try{this.#r.clear(),this.constructor.K.r(this.#r,()=>super.update(t))}catch(e){throw this.#r.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#r?.destroy(),this.#r=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,r=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=r.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return r}async#i(){let t=this.el.G??Dt(this.el);t&&await t;let e=[];for(let n of this.M)"triggerLoad"in n?e.push(n.triggerLoad()):e.push(W(n.hostLoad,n));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(n=>n.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(n=>!n.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async n=>await n.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let n of this.M)"triggerLoaded"in n?n.triggerLoaded():p(n.hostLoaded,n);this.loaded?.(),this.#n.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#r?this.#d(t):super.update(t)}listen(t,e,s){let n=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,n,s),()=>this.el.removeEventListener(t,n,s)))}listenOn(t,e,s,n){let r=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)))}async componentOnReady(){return await this.#n.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var Ee=o=>{let t,e=n=>{t=new URL(n,globalThis.location?.href||void 0).href},s={...o,getAssetPath(n){let r=new URL(n,t);return r.origin!==globalThis.location?.origin?r.href:r.pathname},setAssetPath:e,customElement(n,r){r.K=s,r.L=n,customElements.get(n)||customElements.define(n,r)}};return e(o.defaultAssetPath),s};var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(n){return e.#t.call(this,n)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},Cn=$(It);var wn=d;var Q=Ee({defaultAssetPath:"https://jsdev.arcgis.com/5.2.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Nn,getAssetPath:xn,setAssetPath:Dn}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,x as b,ne as c,re as d,xs as e,Ds as f,$e as g,ps as h,f as i,d as j,Ts as k,oe as l,je as m,ze as n,Tt as o,Ke as p,y as q,$ as r,g as s,Xs as t,Nt as u,ge as v,wn as w,Q as x,Nn as y,xn as z};
|
package/dist/cdn/ON2V5XI2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as S,b as I}from"./7GH7VSB2.js";import{a as M}from"./H7422XUG.js";import"./MH5RPXHM.js";import a from"./GSEPHN3A.js";import{Fb as j,Q as q,W as F,a as P,b as D,eb as O,u as W}from"./462JBSEV.js";import{a as U}from"./AMP6IALT.js";import"./OAVEHGB6.js";import{g as C,h as g,l as R,n as h,t as b,u as v,v as L,w as f,y as A}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([Ie,{whenOnce:_e,watch:ke,when:$e},Ce,Y,ee,J,te,se,,,Re,{property:y,subclass:Le},{b:H,e:N,f:m,h:z,i:V,j:T}])=>{var re=async t=>{let e=await ie(),s=await H("default"),i=ee.getDefault(),r=(await Y.getCredential(`${i.url}/sharing`)).token,a={type:"generateEmbeddings",webmapEmbeddings:t,auth:{apiUrl:s,token:r}};return e.postMessage(a),await new Promise((n,c)=>{let o=l=>{l.data==="completed"&&(e.removeEventListener("message",o),n())},d=l=>{e.removeEventListener("message",o),c(l instanceof Error?l:new Error("Embeddings worker error"))};e.addEventListener("message",o),e.addEventListener("error",d,{once:!0})}),e},ie=async()=>{{let t=(await import("./23EQTPO3.js")).default;return new t}},ae=t=>{t.currentIntent="none"},ne=async(t,e)=>{if(t.agentExecutionContext.userRequest){let i=new F(t.agentExecutionContext.userRequest.trim());t.agentExecutionContext.messages=[...t.agentExecutionContext.messages,i],ae(t)}let s=e?.configurable?.services.agentRegistry.list().map(i=>i.agent.id)??[];return await m({text:`Available agents: ${[...s].join(", ")}`},e),await m({text:"Analyzing user input"},e),t},oe=async(t,e)=>(await m({text:"Exiting..."},e),t),B=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ce=(t,e)=>{if(!B(t)){t!==void 0&&console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);return}let s={};for(let[i,r]of Object.entries(t)){if(!B(r)||!("value"in r)){console.warn(`Agent "${e}" returned invalid sharedStatePatch entry for key "${i}". Ignoring that entry.`);continue}s[i]={value:r.value}}return s},de=t=>{let{previousSharedState:e,patch:s,agentId:i}=t;if(!s)return e;let r=Date.now(),a={...e};for(let[n,c]of Object.entries(s))c?.value!==void 0&&(a[n]={value:c.value,meta:{updatedByAgentId:i,updatedAt:r}});return a},G=t=>typeof t!="string"?void 0:t.trim()||void 0,le=t=>{switch(t){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},ge=(t,e)=>{let s=G(e?.outputMessage),i=G(e?.summary),r=e?.status,a=r==="success"||r==="failed"?r:"unknown";a==="unknown"&&console.warn(`Agent "${t}" returned missing/invalid status. Defaulting to "unknown".`);let n=ce(e?.sharedStatePatch,t);return{outputMessage:s,summary:i??s??le(a),status:a,sharedStatePatch:n}},Q=4e3,he=async(t,e)=>{let s=e?.configurable,{agentRegistry:i}=s.services,r=i?.get(t.currentIntent);if(!r)return console.warn(`No agent found for intent: ${t.currentIntent}`),t;await m({text:`Executing registered agent: ${r.agent.name}`},e);let a={...e??{},configurable:{...s??{},agentId:r.agent.id,context:r.getContext?await r.getContext():void 0}},n;try{let d=await r.agent.createGraph().compile().invoke({agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages],priorSteps:structuredClone(t.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(t.agentExecutionContext.sharedState??{})}},a);n=ge(r.agent.name,d),await m({text:`Finished executing registered agent: ${r.agent.name}`},e)}catch(d){if(W(d))throw d;let l=d instanceof Error?d.message:String(d);console.error(`Agent "${r.agent.name}" failed:`,d),await m({text:`Registered agent failed: ${r.agent.name}. ${l}`},e),n={status:"failed",outputMessage:`Agent execution failed: ${l}`,summary:`Agent execution failed: ${l}`}}let c=n.outputMessage,o=[...t.agentExecutionContext.messages];if(c){let d=c.length>Q?`${c.slice(0,Q-14)}
|
|
3
|
-
[truncated]`:c;o.push(new q(d))}return{...t,stepCount:t.stepCount+1,lastExecutedAgent:r.agent.id,requiresFollowUp:n.status==="failed"?!0:t.requiresFollowUp,finalOutputMessage:c??"",agentExecutionContext:{...t.agentExecutionContext,messages:o,priorSteps:[...t.agentExecutionContext.priorSteps??[],{agentId:r.agent.id,assignedTask:t.agentExecutionContext.assignedTask,summary:n?.summary||"No summary provided.",status:n?.status||"unknown"}],sharedState:de({previousSharedState:t.agentExecutionContext.sharedState,patch:n.sharedStatePatch,agentId:r.agent.id})}}},ue=3,pe=()=>new j(N).addNode("ingestInput",ne).addNode("intentLLM",V).addNode("executeRegisteredAgent",he).addNode("exit",oe).addEdge(P,"ingestInput").addEdge("ingestInput","intentLLM").addConditionalEdges("intentLLM",t=>t.currentIntent==="none"||t.currentIntent===t.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",t=>t.stepCount>=ue||!t.requiresFollowUp?"exit":"intentLLM").addEdge("exit",D),_=class{constructor(){this.agentRegistry=new Map}register(e){let{agent:s}=e;if(this.agentRegistry.has(s.id))throw new Error(`Duplicate agent id: ${s.id}`);this.agentRegistry.set(s.id,e)}get(e){return this.agentRegistry.get(e)}list(){return[...this.agentRegistry.values()]}},k=class{constructor(e,s){this.graph=e,this.config={...s}}async waitForUser(){return await new Promise((e,s)=>{this.resolveWait=e,this.rejectWait=s})}handle(e,s){try{let i={agentId:e.agentId,id:e.id,payload:s},r=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:i},subgraphs:!0,version:"v2"});this.resolveWait?.(r)}catch(i){this.rejectWait?.(i)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},me=async t=>{try{return await(await z()).embedDocuments(t)}catch(e){throw console.error("Failed to generate embeddings:",e),e}},K=async(t,e)=>{let s=e.get(t);if(s)return s;let i=await me([t]);return e.set(t,i[0]),i[0]};async function ye(t,e,s,i){let r=`req-${Date.now()}`,a={type:"layerSearch",precomputedEmbedding:i?await K(t,i):void 0,requestId:r,minScore:s};return await new Promise(n=>{let c=o=>{o.data.requestId===r&&n(o.data.results)};e.addEventListener("message",c,{once:!0}),e.postMessage(a)})}function we(t){let{worker:e}=t;return{async searchLayers({text:s,minScore:i,embeddingCache:r}){return await ye(s,e,i,r)}}}var fe=async({combinedQuery:t,layerIds:e,embeddingsWorker:s,minScore:i,topResults:r,embeddingCache:a})=>{let n=`req-${Date.now()}`,c=a?await K(t,a):void 0,o={type:"fieldSearch",layerIdForFieldsSearch:e,precomputedEmbedding:c,requestId:n,minScore:i,topResults:r};return await new Promise(d=>{let l=w=>{if(w.data.requestId!==n)return;let x=w.data.results.map(({layerId:Z,results:X})=>({layerId:Z,results:X}));d(x)};s.addEventListener("message",l,{once:!0}),s.postMessage(o)})};function be(t){let{worker:e}=t;return{async searchFields({text:s,layerIds:i,minScore:r,topResults:a,embeddingCache:n}){return await fe({combinedQuery:s,layerIds:i,embeddingsWorker:e,minScore:r,topResults:a,embeddingCache:n})}}}var ve=t=>{let e=T.safeParse(t);if(!e.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return e.data},Ee=(t,e)=>{let s=new Map,i=new Map;if(e.allLayers.forEach(r=>{r instanceof te&&i.set(r.id,r)}),t.length!==i.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let r of t){let a=i.get(r.id);if(!a)throw new Error(`Layer with ID ${r.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(r.fields.length!==a.fields.length)throw new Error(`Field count mismatch for layer ID ${r.id} during registry restoration. Regenerate embeddings.`);let n={name:r.name,title:r.title,description:r.description},c=new Map;for(let o of r.fields){let d=a.fieldsIndex.get(o.name);if(!d)throw new Error(`Field with name ${o.name} not found in the original layer ${r.id} during registry restoration. Regenerate embeddings.`);c.set(o.name,{name:o.name,alias:a.getFieldAlias(o.name)??o.alias,description:o.description,type:d.type||"unknown",valueType:d.valueType||"unknown",domain:a.getFieldDomain(o.name)??void 0})}s.set(r.id,{layerItem:n,fieldRegistry:c})}return s},xe=async t=>{try{return(await se(t,{responseType:"json"})).data}catch(e){throw new Error(`Failed to fetch data from ${t}: ${String(e)}`)}},Se=async t=>{let e=t.map;if(!e?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:s}=await e.portalItem.fetchResources(),i=s.find(a=>a.resource.path==="embeddings-v01.json");if(!i?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let r=await xe(i.resource.url);return ve(r)},E=class t{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.threadId="",this.agentRegistry=new _,this.streamEpoch=0}static async init(e){let s=new t;try{if(e.view?.map){await J.whenOnce(()=>e.view.ready);let i=await Se(e.view),r=Ee(i.layers,e.view.map);s.layersAndFieldsRegistry=r,s.embeddingsWorker=await re(i)}return e.agents?.forEach(i=>{s.agentRegistry.register(i)}),s.orchestratorReady=!0,s}catch(i){throw console.error("Orchestrator initialization failed:",i),i}}async*ask(e){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");if(++this.streamEpoch,!e.trim())return;this.threadId=String(Date.now()),this.graph||(this.graph=pe().compile({checkpointer:new O}));let s=this.embeddingsWorker?we({worker:this.embeddingsWorker}):void 0,i=this.embeddingsWorker?be({worker:this.embeddingsWorker}):void 0,r=new Map,a={version:"v2",streamMode:"custom",configurable:{thread_id:this.threadId,hitlResponse:null,services:{layerSearch:s,fieldSearch:i,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:this.agentRegistry,embeddingCache:r}},subgraphs:!0},n=this.graph?.streamEvents({agentExecutionContext:{userRequest:e,messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState}},a),c=++this.streamEpoch;for(yield*this.pipeStream(n,c);;){let d=(await this.graph.getState(a,{subgraphs:!0})).tasks.find(l=>l.interrupts.length>0)?.interrupts[0]?.value;if(!d)break;this.currentInterrupt=d,this.interruptHandler=new k(this.graph,a),yield{runId:this.threadId,timestamp:Date.now(),type:"interrupt",interrupt:d};try{let l=await this.interruptHandler.waitForUser(),w=++this.streamEpoch;yield*this.pipeStream(l,w)}catch(l){if(l){yield{runId:this.threadId,timestamp:Date.now(),type:"error",error:{message:l?.message}};return}yield{runId:this.threadId,timestamp:Date.now(),type:"cancelled"};return}}let o=(await this.graph.getState(a,{subgraphs:!0})).values;this.chatHistory=o.agentExecutionContext.messages.length?o.agentExecutionContext.messages:this.chatHistory,this.priorSteps=o.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=o.agentExecutionContext.sharedState??{},yield{runId:this.threadId,timestamp:Date.now(),type:"completed",result:{content:o.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={}}resumeInterrupt(e){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,e)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}async*pipeStream(e,s){for await(let i of e){if(s!==this.streamEpoch){console.log("Stale stream detected, aborting.");break}i.event==="on_custom_event"&&i.name==="trace_message"?yield{runId:this.threadId,timestamp:Date.now(),type:"trace",data:i.data}:i.name==="graph_ux_suggestion"&&(yield{runId:this.threadId,timestamp:Date.now(),type:"ux-suggestion",suggestion:i.data})}}dispose(){this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};var Ae=C`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%)}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}`,Me=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var r=i>1?void 0:i?Pe(e,s):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(r=(i?n(e,s,r):n(r))||r);return i&&r&&Me(e,s,r),r},u=class extends Re{constructor(t){super(t),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await _e(()=>!this.view.updating),this._set("orchestrator",await E.init({agents:[...this.agents],view:this.view??void 0})),this.addHandles([ke(()=>[this.view,this.agents],()=>{this._initialize()})])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(t,e){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let s=[],i;try{let r=this.orchestrator.ask(t);for await(let a of r){let n=a.runId;if(e?.aborted){yield{type:"cancelled",runId:n};break}switch(a.type){case"trace":{this._set("processingStep",a.data.text),s.push(a.data.text);break}case"completed":{let c=a.result,o=!!c.content.length,d=!!i?.length;if(!o&&!d){yield{type:"completed",error:"Could not process the request.",log:s,runId:n};return}let l=c.content;this._set("processingStep",""),yield{type:"completed",response:l,blocks:i,log:s,runId:n};return}case"ux-suggestion":{let c=a.suggestion;i=i?[...i,c]:[c];break}case"interrupt":{let{kind:c,message:o,metadata:d}=a.interrupt,l=Array.isArray(d)?d.filter(x=>typeof x=="string"):[],w=(()=>{switch(c){case"booleanChoice":return{type:"boolean-choice",message:o,options:l};case"singleSelection":return{type:"single-select",message:o,options:l};case"multipleSelection":return{type:"multi-select",message:o,options:l};case"textInput":return{type:"text-input",message:o};default:return{type:c,message:o,options:l}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:w,runId:n};break}case"cancelled":{yield{type:"cancelled",runId:n};return}case"error":{yield{type:"completed",error:a.error.message,log:s,runId:n};return}default:{console.warn("Unknown event type:",a);break}}}}catch(r){console.warn("Error during message processing:",r),yield{type:"completed",error:"An error occurred during message processing.",log:s,runId:"error"};return}finally{this._set("processing",!1)}}};p([y({readOnly:!0})],u.prototype,"orchestrator",2);p([y()],u.prototype,"agents",2);p([y()],u.prototype,"portal",2);p([y()],u.prototype,"view",2);p([y({readOnly:!0})],u.prototype,"loading",2);p([y({readOnly:!0})],u.prototype,"processing",2);p([y({readOnly:!0})],u.prototype,"processingStep",2);u=p([Le("OrchestratorController")],u);var De="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",We="Embeddings not found for this web map.",qe="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",$=class extends L{constructor(){super(...arguments),this._messages=M({blocking:!0}),this.#e=b(),this.#n=b(),this.#t=b(),this.#s=null,this.#o=new Map,this.#r=Ce.getDefault(),this.#i=e=>{e.stopPropagation(),this.cancelInterrupt()},this.#a=e=>{e.stopPropagation();let s=e.detail;this.submitInterrupt(s)},this.#c=e=>{e.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let s=e.detail;this._inputValue="",this.arcgisSubmit.emit(s),this.submitMessage(s)},this.#d=e=>{if(e.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this.#s?.abort()},this.#l=e=>{e.stopPropagation();let s=e.detail;this.arcgisFeedback.emit(s)},this.#g=e=>{e.stopPropagation();let s=e.detail;this._inputValue=s.prompt,this.arcgisPromptSelect.emit(s)},this.#h=e=>{this.arcgisSlottableRequest.emit(e.detail)},this._orchestratorController=null,this._interrupt=null,this._error=null,this._inputValue="",this.messages=new Ie([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.logEnabled=!1,this.copyEnabled=!1,this.voiceInputEnabled=!1,this.readAloudEnabled=!1,this.arcgisCancel=h(),this.arcgisError=h(),this.arcgisFeedback=h(),this.arcgisInterrupt=h(),this.arcgisInterruptCancel=h(),this.arcgisInterruptSubmit=h(),this.arcgisPromptSelect=h(),this.arcgisReady=h(),this.arcgisSubmit=h(),this.arcgisSlottableRequest=h({bubbles:!1,composed:!1})}static{this.properties={_orchestratorController:16,_interrupt:16,_error:16,_inputValue:16,_user:16,awaitingResponse:32,awaitingResponseStep:32,interrupt:32,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,logEnabled:5,copyEnabled:5,voiceInputEnabled:5,readAloudEnabled:5}}static{this.styles=Ae}#e;#n;#t;#s;#o;#r;#i;#a;#c;#d;#l;#g;#h;async#u(){try{let e=U(this.el,this.referenceElement);await e?.componentOnReady();let s=[...this.#o.values()];return s.length?(this._orchestratorController=new u({agents:s,portal:this.#r,view:e?.view}),await this._orchestratorController.load(),!0):(this._error="No agents found.",!1)}catch(e){return this._error=e?.message??"Error initializing orchestrator.",R(this)(e),!1}}get _user(){return this.#r?.user?.fullName||this.#r?.user?.username}get awaitingResponse(){return this._orchestratorController?.processing??!1}get awaitingResponseStep(){return this._orchestratorController?.processingStep??""}get interrupt(){return this._interrupt}get orchestrator(){return this._orchestratorController?.orchestrator}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}cancelInterrupt(){this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null}register(e){this.#o.set(e.agent.id,e)}async submitMessage(e){let s=e.trim();if(!s||(this.messages.push({id:Date.now().toString(),role:"user",content:s}),!this._orchestratorController))return;let i=this._orchestratorController.ask(s,this.#s?.signal);for await(let r of i){let a=r.runId;switch(r.type){case"completed":this.messages.push({role:"assistant",content:r.response,blocks:r.blocks,log:r.log,error:r.error,id:a});break;case"interrupt":this._interrupt={...r.payload,id:a},this.arcgisInterrupt.emit(this._interrupt);break;case"cancelled":this.messages.push({role:"assistant",error:"Request cancelled.",id:a});break}}}submitInterrupt(e){this.arcgisInterruptSubmit.emit(e),this.orchestrator?.resumeInterrupt(e),this._interrupt=null}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#e.value?.addEventListener("arcgisPromptSelect",this.#g),this.#e.value?.addEventListener("arcgisSubmit",this.#c),this.#e.value?.addEventListener("arcgisCancel",this.#d),this.#e.value?.addEventListener("arcgisFeedback",this.#l);let e=$e(()=>!!this._interrupt&&!!this.#t.value,()=>{let s=this.#t.value;s.removeEventListener("arcgisSubmit",this.#a),s.removeEventListener("arcgisCancel",this.#i),s.addEventListener("arcgisSubmit",this.#a,{once:!0}),s.addEventListener("arcgisCancel",this.#i,{once:!0})});return queueMicrotask(()=>{this.#u().then(s=>{s?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))})}),()=>{e.remove(),this.#e.value?.removeEventListener("arcgisPromptSelect",this.#g),this.#t.value?.removeEventListener("arcgisSubmit",this.#a),this.#t.value?.removeEventListener("arcgisCancel",this.#i),this.#e.value?.removeEventListener("arcgisSubmit",this.#c),this.#e.value?.removeEventListener("arcgisCancel",this.#d),this.#e.value?.removeEventListener("arcgisFeedback",this.#l),this._orchestratorController?.destroy(),this._orchestratorController=null}})}_reset(){this.#s?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null,this._inputValue=""}_renderEntryMessage(){return this._interrupt?g`<slot name=interrupt><arcgis-assistant-interrupt .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${v(this.#t)}></arcgis-assistant-interrupt></slot>`:this._error?this._renderErrorNotice():this.entryMessage?this.messages.length>0?null:g`<calcite-notice open kind=info closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>`:g`<slot name=entry-message></slot>`}_renderErrorNotice(){return this._error?g`<calcite-notice closable slot=entry-message open kind=danger icon width=full>${this._error===De?g`<div slot=message>${We}</div><calcite-link slot=link .href=${qe} target=_blank title="Learn about web map embeddings">Read more</calcite-link>`:g`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}_renderSuggestedPrompts(){return this.suggestedPrompts?.length?g`<div class="suggested-prompts-container"><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>`:null}render(){return g`<calcite-panel .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} ${v(this.#e)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map(e=>e.role==="assistant"?g`<arcgis-assistant-message .message=${e} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#h}><slot name=${S(e.id)??f} slot=${S(e.id)??f}>${e?.error?g`<calcite-notice class="error-notice" open icon kind=warning width=full><div slot=message>${e.error}</div></calcite-notice>`:g`<arcgis-assistant-message-text .content=${e?.content}></arcgis-assistant-message-text>`}</slot>${e.blocks?.map((s,i)=>g`<slot name=${I(e.id,i)??f} slot=${I(e.id,i)??f}><arcgis-assistant-message-block .block=${s}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>`:g`<arcgis-assistant-user-message .message=${e} .user=${this._user}></arcgis-assistant-user-message>`)}</slot><slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep}></arcgis-assistant-message-loading></slot></arcgis-assistant-chat></div>${this._renderSuggestedPrompts()}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} ${v(this.#n)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} @click=${()=>{this.#n.value?.submitMessage()}} round>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`}};A("arcgis-assistant",$);return $},"core/Collection","core/reactiveUtils","portal/Portal","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","identity/IdentityManager","layers/FeatureLayer","core/Accessor","core/accessorSupport/decorators",a)
|
package/dist/cdn/P6OPJQMC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as e,b as n}from"./NAUXSHIE.js";import{g as r,h as i,v as s,y as c}from"./OH64RMOR.js";import"./YIMNOUTF.js";var l=r`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,o=class extends s{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:0}}static{this.styles=l}render(){return this.log?.length&&this.showLog&&this.logEnabled?i`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
|
|
3
|
-
`)||a.length>70;return i`<calcite-accordion-item .heading=${t?`${a.substring(0,70)}...`:a} .expanded=${t}><div class="entry">${t?e(n(a)):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}};c("arcgis-assistant-message-log",o);export{o as ArcgisAssistantMessageLog};
|
package/dist/cdn/QR54T33D.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{g as C,h as S,n as l,v as R,w as m,y}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([{when:k,watch:u},I,{property:d,subclass:f}])=>{var T=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends I{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&M(t,s,r),r},c=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":O.find(e=>window.MediaRecorder.isTypeSupported(e))??""}initialize(){c.isSupported()&&this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!c.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?this._set("errorCode","not-allowed"):this._set("errorCode","recording-failed"))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],c.prototype,"_mimeType",1);g([d()],c.prototype,"handleRecording",2);g([d()],c.prototype,"chunkTimeSlice",2);c=g([f("MediaRecorderController")],c);var $=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?$(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function w(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=w();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t,this.addHandles(k(()=>!!this.errorCode,()=>{this._set("state","error")}))}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!w()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=l(),this.arcgisVoiceInputError=l(),this.arcgisVoiceInputInterimTranscription=l(),this.arcgisVoiceInputStart=l(),this.arcgisVoiceInputStop=l(),this.arcgisVoiceInputTranscription=l(),this.arcgisVoiceInputTranscriptionStreamChunk=l()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=T}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new c({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":c.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
|
package/dist/cdn/RVOAPUBN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{A as z,Ab as _,B as A,Bb as $,C as B,Cb as aa,Fb as ba,Gb as ca,Hb as da,Ib as ea,Jb as fa,Kb as ga,Lb as ha,Mb as ia,Nb as ja,Ob as ka,Pb as la,a,b,bb as C,c,cb as D,d,db as E,e,eb as F,f,fb as G,gb as H,h as g,hb as I,i as h,ib as J,j as i,jb as K,k as j,kb as L,l as k,lb as M,m as l,mb as N,n as m,nb as O,o as n,ob as P,p as o,pb as Q,q as p,r as q,rb as R,s as r,sb as S,t as s,tb as T,u as t,ub as U,v as u,vb as V,w as v,wb as W,x as w,xb as X,y as x,yb as Y,z as y,zb as Z}from"./462JBSEV.js";import"./YIMNOUTF.js";export{L as Annotation,H as AsyncBatchedStore,J as BaseChannel,E as BaseCheckpointSaver,k as BaseLangGraphError,G as BaseStore,K as BinaryOperatorAggregate,d as COMMAND_SYMBOL,i as Command,e as CommandInstance,ca as CompiledStateGraph,b as END,v as EmptyChannelError,u as EmptyInputError,R as Graph,l as GraphBubbleUp,o as GraphInterrupt,m as GraphRecursionError,n as GraphValueError,c as INTERRUPT,I as InMemoryStore,w as InvalidUpdateError,F as MemorySaver,da as MessageGraph,ia as MessagesAnnotation,aa as MessagesValue,ja as MessagesZodMeta,ka as MessagesZodState,x as MultipleSubgraphsError,p as NodeInterrupt,g as Overwrite,q as ParentCommand,_ as REMOVE_ALL_MESSAGES,X as ReducedValue,z as RemoteException,a as START,f as Send,ba as StateGraph,A as StateGraphInputError,Z as StateSchema,y as UnreachableNodeError,Y as UntrackedValue,W as UntrackedValueChannel,$ as addMessages,D as copyCheckpoint,C as emptyCheckpoint,ga as entrypoint,O as getConfig,P as getCurrentTaskInput,U as getJsonSchemaFromSchema,ha as getPreviousState,V as getSchemaDefaultGetter,M as getStore,B as getSubgraphsSeenSet,N as getWriter,Q as interrupt,j as isCommand,s as isGraphBubbleUp,t as isGraphInterrupt,h as isInterrupted,r as isParentCommand,T as isSerializableSchema,S as isStandardSchema,$ as messagesStateReducer,ea as pushMessage,fa as task,la as writer};
|