@esri/solutions-components 1.2.0-next.184 → 1.2.0-next.186

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.
Files changed (68) hide show
  1. package/dist/cdn/{T4BABRET.js → 2Z4TOYVC.js} +1 -1
  2. package/dist/cdn/{UJRIZPZV.js → 3A7PC2RZ.js} +1 -1
  3. package/dist/cdn/{AHSUDDTV.js → 3HWKU2CT.js} +1 -1
  4. package/dist/cdn/{3OBXQOE4.js → 4CPDEFIT.js} +1 -1
  5. package/dist/cdn/{GXGL7E5C.js → 6TJ6HIGG.js} +1 -1
  6. package/dist/cdn/{2J5B4RQM.js → 7M3GJY6J.js} +1 -1
  7. package/dist/cdn/AS6FGEVT.js +2 -0
  8. package/dist/cdn/BEC6A65P.js +2 -0
  9. package/dist/cdn/BHSNNVIL.js +2 -0
  10. package/dist/cdn/{FYIT6WMR.js → BT66JT22.js} +1 -1
  11. package/dist/cdn/{WSU4ELZX.js → C7DWPTJL.js} +1 -1
  12. package/dist/cdn/{HUWZTPMY.js → CN4TSLTZ.js} +1 -1
  13. package/dist/cdn/{IZAAOTKA.js → DOFNBU4Q.js} +1 -1
  14. package/dist/cdn/{D4YDAIIJ.js → EERFOEDZ.js} +1 -1
  15. package/dist/cdn/{RSJOED5F.js → FP5UBHCW.js} +1 -1
  16. package/dist/cdn/{KNOAIRGH.js → FWFL23CM.js} +1 -1
  17. package/dist/cdn/FY4GDFB5.js +2 -0
  18. package/dist/cdn/{YUXRMEUI.js → HEW273HR.js} +1 -1
  19. package/dist/cdn/{G7PIGNB5.js → I3ERNQTX.js} +1 -1
  20. package/dist/cdn/{TQ6UUSC6.js → LN36O3EB.js} +1 -1
  21. package/dist/cdn/MVNKOMSZ.js +2 -0
  22. package/dist/cdn/OQVULF2Q.js +2 -0
  23. package/dist/cdn/{UPCW6ZJC.js → OUH4HVG4.js} +28 -24
  24. package/dist/cdn/{YJCIONLF.js → PFQDRDKQ.js} +1 -1
  25. package/dist/cdn/{FQDOIGWN.js → PJ2IZ77K.js} +1 -1
  26. package/dist/cdn/{DPOINX2J.js → QPEQNTE2.js} +1 -1
  27. package/dist/cdn/{6KZ7BPYY.js → R6QJKOAM.js} +1 -1
  28. package/dist/cdn/RG6FVRCW.js +2 -0
  29. package/dist/cdn/RYK5PICU.js +2 -0
  30. package/dist/cdn/{G6YTMDRE.js → U3MPHGGT.js} +1 -1
  31. package/dist/cdn/{VCNW2JFC.js → V25NUVVQ.js} +1 -1
  32. package/dist/cdn/{VWSBR3EG.js → VHA56S7W.js} +1 -1
  33. package/dist/cdn/{JZEB6HZ4.js → W4DGTEPL.js} +1 -1
  34. package/dist/cdn/{YN3QQTPJ.js → WI7VFPQ3.js} +1 -1
  35. package/dist/cdn/Y2S3AB43.js +2 -0
  36. package/dist/cdn/{YOUPERBP.js → YBZ4RYD3.js} +1 -1
  37. package/dist/cdn/{SYHSZMOM.js → ZVLL5DZC.js} +1 -1
  38. package/dist/cdn/index.js +1 -1
  39. package/dist/chunks/cardFetchingUtils.js +66 -58
  40. package/dist/chunks/cardsHelpers.js +2 -2
  41. package/dist/chunks/interfaces.js +295 -293
  42. package/dist/chunks/solutions-deploy-app-nav.js +10 -10
  43. package/dist/components/arcgis-solutions-assistant/customElement.js +79 -69
  44. package/dist/components/solution-details-card/customElement.js +8 -8
  45. package/dist/components/solution-details-panel/customElement.js +50 -50
  46. package/dist/components/solution-resource-card/customElement.js +11 -11
  47. package/dist/components/solution-snapshot-gallery/customElement.js +17 -17
  48. package/dist/components/solution-social-share/customElement.js +5 -5
  49. package/dist/components/solutions-all-panel/customElement.js +22 -21
  50. package/dist/components/solutions-deploy-app/customElement.js +12 -11
  51. package/dist/components/solutions-deployed-panel/customElement.d.ts +2 -2
  52. package/dist/components/solutions-deployed-panel/customElement.js +42 -27
  53. package/dist/docs/api.json +1 -1
  54. package/dist/docs/docs.json +1 -1
  55. package/dist/docs/vscode.html-custom-data.json +1 -1
  56. package/dist/docs/web-types.json +1 -1
  57. package/dist/solutions-components_commit.txt +7 -7
  58. package/dist/utils/interfaces.d.ts +1 -0
  59. package/package.json +1 -1
  60. package/dist/cdn/5HY4G5MJ.js +0 -2
  61. package/dist/cdn/7QFCHNYA.js +0 -2
  62. package/dist/cdn/BU24GNCR.js +0 -2
  63. package/dist/cdn/EMCLBWJH.js +0 -2
  64. package/dist/cdn/ETZI55AM.js +0 -2
  65. package/dist/cdn/EVTIE353.js +0 -2
  66. package/dist/cdn/K3V6XHE4.js +0 -2
  67. package/dist/cdn/LEBOMHXU.js +0 -2
  68. package/dist/cdn/QAT4TZD4.js +0 -2
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
2
- import a from"./K3V6XHE4.js";import{b as we}from"./W4773WDH.js";import{b as be}from"./77CU4WA2.js";import"./T4PIUXJ7.js";import{a as me}from"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import{b as xe}from"./RFGSSUZF.js";import{G as j,H as fe,J as G,L as W,h as he,i as x,k as pe,l as H,m as T,r as ue,w as de,x as ge,y as ke}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([{I:ve,u:_e}])=>{var L=class extends ke{constructor(e){if(super(e),this.it=H,e.type!==de.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===H||e==null)return this._t=void 0,this.it=e;if(e===pe)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};L.directiveName="unsafeHTML",L.resultType=1;var X=ge(L);var Ue=he`:host{display:block;height:100%}.display-flex-row{display:flex;flex-direction:row}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-foreground-3);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-background);border-radius:10px;padding:10px}.chat-panel{--calcite-dialog-header-background-color: var(--calcite-color-brand);--calcite-dialog-header-action-background-color: var(--calcite-color-brand);--calcite-dialog-heading-text-color: var(--calcite-color-background);--calcite-dialog-header-action-text-color: var(--calcite-color-background);--calcite-dialog-header-action-text-color-press: var(--calcite-color-background);--calcite-dialog-min-size-y: 90vh;--calcite-dialog-max-size-y: 90vh}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-background, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-foreground-2);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-foreground-3);--calcite-card-border-color: var(--calcite-color-foreground-3);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-foreground-3);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-foreground-3);--calcite-card-border-color: var(--calcite-color-foreground-3)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-foreground-3)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-background)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;function te(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=te();function Ae(i){A=i}var R={exec:()=>null};function d(i,e=""){let t=typeof i=="string"?i:i.source,n={replace:(s,a)=>{let r=typeof a=="string"?a:a.source;return r=r.replace(b.caret,"$1"),t=t.replace(s,r),n},getRegex:()=>new RegExp(t,e)};return n}var Fe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},Oe=/^(?:[ \t]*(?:\n|$))+/,Ze=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,He=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,B=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,je=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,se=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ce=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ze=d(Ce).replace(/bull/g,se).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(),Ge=d(Ce).replace(/bull/g,se).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(),ne=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,We=/^[^\n]+/,ie=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Xe=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ie).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Je=d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,se).getRegex(),O="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",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ke=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",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=d(ne).replace("hr",B).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",O).getRegex(),Ve=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Le).getRegex(),ae={blockquote:Ve,code:Ze,def:Xe,fences:He,heading:je,hr:B,html:Ke,lheading:ze,list:Je,newline:Oe,paragraph:Le,table:R,text:We},ye=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",B).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",O).getRegex(),Ye={...ae,lheading:Ge,table:ye,paragraph:d(ne).replace("hr",B).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).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",O).getRegex()},et={...ae,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).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:R,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(ne).replace("hr",B).replace("heading",` *#{1,6} *[^
3
- ]`).replace("lheading",ze).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,st=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pe=/^( {2,}|\\)\n(?!\s*$)/,nt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Z=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,qe=/[^\s\p{P}\p{S}]/u,it=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),Ee=/(?!~)[\p{P}\p{S}]/u,rt=/(?!~)[\s\p{P}\p{S}]/u,at=/(?:[^\s\p{P}\p{S}]|~)/u,Be=/(?![*_])[\p{P}\p{S}]/u,ot=/(?![*_])[\s\p{P}\p{S}]/u,lt=/(?:[^\s\p{P}\p{S}]|[*_])/u,ct=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Fe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Me=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ht=d(Me,"u").replace(/punct/g,Z).getRegex(),pt=d(Me,"u").replace(/punct/g,Ee).getRegex(),Ne="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ut=d(Ne,"gu").replace(/notPunctSpace/g,qe).replace(/punctSpace/g,oe).replace(/punct/g,Z).getRegex(),dt=d(Ne,"gu").replace(/notPunctSpace/g,at).replace(/punctSpace/g,rt).replace(/punct/g,Ee).getRegex(),gt=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qe).replace(/punctSpace/g,oe).replace(/punct/g,Z).getRegex(),kt=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Be).getRegex(),ft="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",xt=d(ft,"gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,ot).replace(/punct/g,Be).getRegex(),mt=d(/\\(punct)/,"gu").replace(/punct/g,Z).getRegex(),bt=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(),wt=d(re).replace("(?:-->|$)","-->").getRegex(),_t=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",wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),D=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vt=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",D).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qe=d(/^!?\[(label)\]\[(ref)\]/).replace("label",D).replace("ref",ie).getRegex(),De=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",ie).getRegex(),yt=d("reflink|nolink(?!\\()","g").replace("reflink",Qe).replace("nolink",De).getRegex(),Se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,le={_backpedal:R,anyPunctuation:mt,autolink:bt,blockSkip:ct,br:Pe,code:st,del:R,delLDelim:R,delRDelim:R,emStrongLDelim:ht,emStrongRDelimAst:ut,emStrongRDelimUnd:gt,escape:tt,link:vt,nolink:De,punctuation:it,reflink:Qe,reflinkSearch:yt,tag:_t,text:nt,url:R},St={...le,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",D).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",D).getRegex()},J={...le,emStrongRDelimAst:dt,emStrongLDelim:pt,delLDelim:kt,delRDelim:xt,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Se).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",Se).getRegex()},$t={...J,br:d(Pe).replace("{2,}","*").getRegex(),text:d(J.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:ae,gfm:Ye,pedantic:et},P={normal:le,gfm:J,breaks:$t,pedantic:St},Tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=i=>Tt[i];function S(i,e){if(e){if(b.escapeTest.test(i))return i.replace(b.escapeReplace,$e)}else if(b.escapeTestNoEncode.test(i))return i.replace(b.escapeReplaceNoEncode,$e);return i}function Te(i){try{i=encodeURI(i).replace(b.percentDecode,"%")}catch{return null}return i}function Re(i,e){let t=i.replace(b.findPipe,(a,r,l)=>{let o=!1,h=r;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),n=t.split(b.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(b.slashPipe,"|");return n}function q(i,e,t){let n=i.length;if(n===0)return"";let s=0;for(;s<n&&i.charAt(n-s-1)===e;)s++;return i.slice(0,n-s)}function Rt(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function It(i,e=0){let t=e,n="";for(let s of i)if(s===" "){let a=4-t%4;n+=" ".repeat(a),t+=a}else n+=s,t++;return n}function Ie(i,e,t,n,s){let a=e.href,r=e.title||null,l=i[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:r,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,o}function At(i,e,t){let n=i.match(t.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
2
+ import a from"./MVNKOMSZ.js";import{b as _e}from"./W4773WDH.js";import{b as we}from"./77CU4WA2.js";import"./T4PIUXJ7.js";import{a as be}from"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import{b as xe}from"./RFGSSUZF.js";import{G,H as me,J as W,L as X,h as pe,i as m,k as ue,l as j,m as T,r as de,w as ge,x as ke,y as fe}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([{I:ye,q:ve,r:Q}])=>{var L=class extends fe{constructor(e){if(super(e),this.it=j,e.type!==ge.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||e==null)return this._t=void 0,this.it=e;if(e===ue)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};L.directiveName="unsafeHTML",L.resultType=1;var J=ke(L);var Fe=pe`:host{display:block;height:100%}.display-flex-row{display:flex;flex-direction:row}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-foreground-3);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-background);border-radius:10px;padding:10px}.chat-panel{--calcite-dialog-header-background-color: var(--calcite-color-brand);--calcite-dialog-header-action-background-color: var(--calcite-color-brand);--calcite-dialog-heading-text-color: var(--calcite-color-background);--calcite-dialog-header-action-text-color: var(--calcite-color-background);--calcite-dialog-header-action-text-color-press: var(--calcite-color-background);--calcite-dialog-min-size-y: 90vh;--calcite-dialog-max-size-y: 90vh}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-background, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-foreground-2);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-foreground-3);--calcite-card-border-color: var(--calcite-color-foreground-3);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-foreground-3);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-foreground-3);--calcite-card-border-color: var(--calcite-color-foreground-3)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-foreground-3)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-background)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;function se(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=se();function Ce(i){A=i}var R={exec:()=>null};function d(i,e=""){let t=typeof i=="string"?i:i.source,n={replace:(s,a)=>{let r=typeof a=="string"?a:a.source;return r=r.replace(b.caret,"$1"),t=t.replace(s,r),n},getRegex:()=>new RegExp(t,e)};return n}var Oe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},Ze=/^(?:[ \t]*(?:\n|$))+/,He=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,je=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,B=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ge=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ne=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ze=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=d(ze).replace(/bull/g,ne).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(),We=d(ze).replace(/bull/g,ne).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(),ie=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xe=/^[^\n]+/,re=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Je=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",re).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ke=d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ne).getRegex(),Z="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",ae=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ve=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",ae).replace("tag",Z).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pe=d(ie).replace("hr",B).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",Z).getRegex(),Ye=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pe).getRegex(),oe={blockquote:Ye,code:He,def:Je,fences:je,heading:Ge,hr:B,html:Ve,lheading:Le,list:Ke,newline:Ze,paragraph:Pe,table:R,text:Xe},Se=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",B).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",Z).getRegex(),et={...oe,lheading:We,table:Se,paragraph:d(ie).replace("hr",B).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Se).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",Z).getRegex()},tt={...oe,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae).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:R,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(ie).replace("hr",B).replace("heading",` *#{1,6} *[^
3
+ ]`).replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},st=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qe=/^( {2,}|\\)\n(?!\s*$)/,it=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,H=/[\p{P}\p{S}]/u,le=/[\s\p{P}\p{S}]/u,Ee=/[^\s\p{P}\p{S}]/u,rt=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,le).getRegex(),Be=/(?!~)[\p{P}\p{S}]/u,at=/(?!~)[\s\p{P}\p{S}]/u,ot=/(?:[^\s\p{P}\p{S}]|~)/u,Me=/(?![*_])[\p{P}\p{S}]/u,lt=/(?![*_])[\s\p{P}\p{S}]/u,ct=/(?:[^\s\p{P}\p{S}]|[*_])/u,ht=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Oe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ne=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pt=d(Ne,"u").replace(/punct/g,H).getRegex(),ut=d(Ne,"u").replace(/punct/g,Be).getRegex(),Qe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dt=d(Qe,"gu").replace(/notPunctSpace/g,Ee).replace(/punctSpace/g,le).replace(/punct/g,H).getRegex(),gt=d(Qe,"gu").replace(/notPunctSpace/g,ot).replace(/punctSpace/g,at).replace(/punct/g,Be).getRegex(),kt=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ee).replace(/punctSpace/g,le).replace(/punct/g,H).getRegex(),ft=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Me).getRegex(),mt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",xt=d(mt,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,lt).replace(/punct/g,Me).getRegex(),bt=d(/\\(punct)/,"gu").replace(/punct/g,H).getRegex(),wt=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(),_t=d(ae).replace("(?:-->|$)","-->").getRegex(),vt=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",_t).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),U=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,yt=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",U).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),De=d(/^!?\[(label)\]\[(ref)\]/).replace("label",U).replace("ref",re).getRegex(),Ue=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",re).getRegex(),St=d("reflink|nolink(?!\\()","g").replace("reflink",De).replace("nolink",Ue).getRegex(),$e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ce={_backpedal:R,anyPunctuation:bt,autolink:wt,blockSkip:ht,br:qe,code:nt,del:R,delLDelim:R,delRDelim:R,emStrongLDelim:pt,emStrongRDelimAst:dt,emStrongRDelimUnd:kt,escape:st,link:yt,nolink:Ue,punctuation:rt,reflink:De,reflinkSearch:St,tag:vt,text:it,url:R},$t={...ce,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",U).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U).getRegex()},K={...ce,emStrongRDelimAst:gt,emStrongLDelim:ut,delLDelim:ft,delRDelim:xt,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$e).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",$e).getRegex()},Tt={...K,br:d(qe).replace("{2,}","*").getRegex(),text:d(K.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},D={normal:oe,gfm:et,pedantic:tt},P={normal:ce,gfm:K,breaks:Tt,pedantic:$t},Rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Te=i=>Rt[i];function S(i,e){if(e){if(b.escapeTest.test(i))return i.replace(b.escapeReplace,Te)}else if(b.escapeTestNoEncode.test(i))return i.replace(b.escapeReplaceNoEncode,Te);return i}function Re(i){try{i=encodeURI(i).replace(b.percentDecode,"%")}catch{return null}return i}function Ie(i,e){let t=i.replace(b.findPipe,(a,r,l)=>{let o=!1,h=r;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),n=t.split(b.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(b.slashPipe,"|");return n}function q(i,e,t){let n=i.length;if(n===0)return"";let s=0;for(;s<n&&i.charAt(n-s-1)===e;)s++;return i.slice(0,n-s)}function It(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function At(i,e=0){let t=e,n="";for(let s of i)if(s===" "){let a=4-t%4;n+=" ".repeat(a),t+=a}else n+=s,t++;return n}function Ae(i,e,t,n,s){let a=e.href,r=e.title||null,l=i[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:r,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,o}function Ct(i,e,t){let n=i.match(t.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
4
4
  `).map(a=>{let r=a.match(t.other.beginningSpace);if(r===null)return a;let[l]=r;return l.length>=s.length?a.slice(s.length):a}).join(`
5
- `)}var U=class{options;rules;lexer;constructor(i){this.options=i||A}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:q(t,`
6
- `)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],n=At(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let n=q(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:q(e[0],`
5
+ `)}var F=class{options;rules;lexer;constructor(i){this.options=i||A}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:q(t,`
6
+ `)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],n=Ct(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let n=q(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:q(e[0],`
7
7
  `)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=q(e[0],`
8
8
  `).split(`
9
9
  `),n="",s="",a=[];for(;t.length>0;){let r=!1,l=[],o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))l.push(t[o]),r=!0;else if(!r)l.push(t[o]);else break;t=t.slice(o);let h=l.join(`
@@ -15,16 +15,16 @@ ${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
15
15
  `),w=this.blockquote(f);a[a.length-1]=w,n=n.substring(0,n.length-g.raw.length)+w.raw,s=s.substring(0,s.length-g.text.length)+w.text;break}else if(u?.type==="list"){let g=u,f=g.raw+`
16
16
  `+t.join(`
17
17
  `),w=this.list(f);a[a.length-1]=w,n=n.substring(0,n.length-u.raw.length)+w.raw,s=s.substring(0,s.length-g.raw.length)+w.raw,t=f.substring(a.at(-1).raw.length).split(`
18
- `);continue}}return{type:"blockquote",raw:n,tokens:a,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),n=t.length>1,s={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");let a=this.rules.other.listItemRegex(t),r=!1;for(;i;){let o=!1,h="",c="";if(!(e=a.exec(i))||this.rules.block.hr.test(i))break;h=e[0],i=i.substring(h.length);let p=It(e[2].split(`
18
+ `);continue}}return{type:"blockquote",raw:n,tokens:a,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),n=t.length>1,s={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");let a=this.rules.other.listItemRegex(t),r=!1;for(;i;){let o=!1,h="",c="";if(!(e=a.exec(i))||this.rules.block.hr.test(i))break;h=e[0],i=i.substring(h.length);let p=At(e[2].split(`
19
19
  `,1)[0],e[1].length),u=i.split(`
20
20
  `,1)[0],g=!p.trim(),f=0;if(this.options.pedantic?(f=2,c=p.trimStart()):g?f=e[1].length+1:(f=p.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=p.slice(f),f+=e[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+`
21
- `,i=i.substring(u.length+1),o=!0),!o){let w=this.rules.other.nextBulletRegex(f),M=this.rules.other.hrRegex(f),N=this.rules.other.fencesBeginRegex(f),m=this.rules.other.headingBeginRegex(f),_=this.rules.other.htmlBeginRegex(f),C=this.rules.other.blockquoteBeginRegex(f);for(;i;){let z=i.split(`
22
- `,1)[0],$;if(u=z,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),$=u):$=u.replace(this.rules.other.tabCharGlobal," "),N.test(u)||m.test(u)||_.test(u)||C.test(u)||w.test(u)||M.test(u))break;if($.search(this.rules.other.nonSpaceChar)>=f||!u.trim())c+=`
23
- `+$.slice(f);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(p)||m.test(p)||M.test(p))break;c+=`
21
+ `,i=i.substring(u.length+1),o=!0),!o){let w=this.rules.other.nextBulletRegex(f),M=this.rules.other.hrRegex(f),N=this.rules.other.fencesBeginRegex(f),x=this.rules.other.headingBeginRegex(f),_=this.rules.other.htmlBeginRegex(f),C=this.rules.other.blockquoteBeginRegex(f);for(;i;){let z=i.split(`
22
+ `,1)[0],$;if(u=z,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),$=u):$=u.replace(this.rules.other.tabCharGlobal," "),N.test(u)||x.test(u)||_.test(u)||C.test(u)||w.test(u)||M.test(u))break;if($.search(this.rules.other.nonSpaceChar)>=f||!u.trim())c+=`
23
+ `+$.slice(f);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(p)||x.test(p)||M.test(p))break;c+=`
24
24
  `+u}g=!u.trim(),h+=z+`
25
- `,i=i.substring(z.length+1),p=$.slice(f)}}s.loose||(r?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(r=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let o of s.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=c.checked,s.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=c.raw+o.tokens[0].raw,o.tokens[0].text=c.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(c)):o.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):o.tokens.unshift(c)}}if(!s.loose){let h=o.tokens.filter(p=>p.type==="space"),c=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=c}}if(s.loose)for(let o of s.items){o.loose=!0;for(let h of o.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:s}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Re(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
26
- `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===n.length){for(let r of n)this.rules.other.tableAlignRight.test(r)?a.align.push("right"):this.rules.other.tableAlignCenter.test(r)?a.align.push("center"):this.rules.other.tableAlignLeft.test(r)?a.align.push("left"):a.align.push(null);for(let r=0;r<t.length;r++)a.header.push({text:t[r],tokens:this.lexer.inline(t[r]),header:!0,align:a.align[r]});for(let r of s)a.rows.push(Re(r,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
27
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=q(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=Rt(e[2],"()");if(a===-2)return;if(a>-1){let r=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let n=e[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],s=a[3])}else s=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),Ie(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[n.toLowerCase()];if(!s){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return Ie(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(i);if(!(!n||n[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!t||this.rules.inline.punctuation.exec(t))){let s=[...n[0]].length-1,a,r,l=s,o=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+s);(n=h.exec(e))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(r=[...a].length,n[3]||n[4]){l+=r;continue}else if((n[5]||n[6])&&s%3&&!((s+r)%3)){o+=r;continue}if(l-=r,l>0)continue;r=Math.min(r,r+l+o);let c=[...n[0]][0].length,p=i.slice(0,s+n.index+c+r);if(Math.min(s,r)%2){let g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}let u=p.slice(2,-2);return{type:"strong",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let n=this.rules.inline.delLDelim.exec(i);if(n&&(!n[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...n[0]].length-1,a,r,l=s,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*i.length+s);(n=o.exec(e))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a||(r=[...a].length,r!==s))continue;if(n[3]||n[4]){l+=r;continue}if(l-=r,l>0)continue;r=Math.min(r,r+l);let h=[...n[0]][0].length,c=i.slice(0,s+n.index+h+r),p=c.slice(s,-s);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,n;if(e[2]==="@")t=e[0],n="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},v=class K{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new U,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 t={other:b,block:Q.normal,inline:P.normal};this.options.pedantic?(t.block=Q.pedantic,t.inline=P.pedantic):this.options.gfm&&(t.block=Q.gfm,this.options.breaks?t.inline=P.breaks:t.inline=P.gfm),this.tokenizer.rules=t}static get rules(){return{block:Q,inline:P}}static lex(e,t){return new K(t).lex(e)}static lexInline(e,t){return new K(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
25
+ `,i=i.substring(z.length+1),p=$.slice(f)}}s.loose||(r?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(r=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let o of s.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(o.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};o.checked=c.checked,s.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=c.raw+o.tokens[0].raw,o.tokens[0].text=c.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(c)):o.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):o.tokens.unshift(c)}}if(!s.loose){let h=o.tokens.filter(p=>p.type==="space"),c=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=c}}if(s.loose)for(let o of s.items){o.loose=!0;for(let h of o.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:s}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ie(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
26
+ `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===n.length){for(let r of n)this.rules.other.tableAlignRight.test(r)?a.align.push("right"):this.rules.other.tableAlignCenter.test(r)?a.align.push("center"):this.rules.other.tableAlignLeft.test(r)?a.align.push("left"):a.align.push(null);for(let r=0;r<t.length;r++)a.header.push({text:t[r],tokens:this.lexer.inline(t[r]),header:!0,align:a.align[r]});for(let r of s)a.rows.push(Ie(r,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
27
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=q(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=It(e[2],"()");if(a===-2)return;if(a>-1){let r=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let n=e[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],s=a[3])}else s=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),Ae(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[n.toLowerCase()];if(!s){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return Ae(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(i);if(!(!n||n[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!t||this.rules.inline.punctuation.exec(t))){let s=[...n[0]].length-1,a,r,l=s,o=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+s);(n=h.exec(e))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(r=[...a].length,n[3]||n[4]){l+=r;continue}else if((n[5]||n[6])&&s%3&&!((s+r)%3)){o+=r;continue}if(l-=r,l>0)continue;r=Math.min(r,r+l+o);let c=[...n[0]][0].length,p=i.slice(0,s+n.index+c+r);if(Math.min(s,r)%2){let g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}let u=p.slice(2,-2);return{type:"strong",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let n=this.rules.inline.delLDelim.exec(i);if(n&&(!n[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...n[0]].length-1,a,r,l=s,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*i.length+s);(n=o.exec(e))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a||(r=[...a].length,r!==s))continue;if(n[3]||n[4]){l+=r;continue}if(l-=r,l>0)continue;r=Math.min(r,r+l);let h=[...n[0]][0].length,c=i.slice(0,s+n.index+h+r),p=c.slice(s,-s);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,n;if(e[2]==="@")t=e[0],n="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},v=class V{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new F,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 t={other:b,block:D.normal,inline:P.normal};this.options.pedantic?(t.block=D.pedantic,t.inline=P.pedantic):this.options.gfm&&(t.block=D.gfm,this.options.breaks?t.inline=P.breaks:t.inline=P.gfm),this.tokenizer.rules=t}static get rules(){return{block:D,inline:P}}static lex(e,t){return new V(t).lex(e)}static lexInline(e,t){return new V(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
28
28
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(r=>(s=r.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let r=t.at(-1);s.raw.length===1&&r!==void 0?r.raw+=`
29
29
  `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
30
30
  `)?"":`
@@ -38,7 +38,7 @@ ${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
38
38
  `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s),n=a.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
39
39
  `)?"":`
40
40
  `)+s.raw,r.text+=`
41
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(e){let r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,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 a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=s[2]?s[2].length:0,n=n.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,l="";for(;e;){r||(l=""),r=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=t.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,l)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,l)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(g=>{u=g.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(o=this.tokenizer.inlineText(h)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),r=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},F=class{options;parser;constructor(i){this.options=i||A}space(i){return""}code({text:i,lang:e,escaped:t}){let n=(e||"").match(b.notSpaceStart)?.[0],s=i.replace(b.endingNewline,"")+`
41
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(e){let r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,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 a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=s[2]?s[2].length:0,n=n.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,l="";for(;e;){r||(l=""),r=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=t.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,l)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,l)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(g=>{u=g.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(o=this.tokenizer.inlineText(h)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),r=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):t.push(o);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},O=class{options;parser;constructor(i){this.options=i||A}space(i){return""}code({text:i,lang:e,escaped:t}){let n=(e||"").match(b.notSpaceStart)?.[0],s=i.replace(b.endingNewline,"")+`
42
42
  `;return n?'<pre><code class="language-'+S(n)+'">'+(t?s:S(s,!0))+`</code></pre>
43
43
  `:"<pre><code>"+(t?s:S(s,!0))+`</code></pre>
44
44
  `}blockquote({tokens:i}){return`<blockquote>
@@ -56,10 +56,10 @@ ${this.parser.parse(i)}</blockquote>
56
56
  `}tablerow({text:i}){return`<tr>
57
57
  ${i}</tr>
58
58
  `}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
59
- `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${S(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let n=this.parser.parseInline(t),s=Te(i);if(s===null)return n;i=s;let a='<a href="'+i+'"';return e&&(a+=' title="'+S(e)+'"'),a+=">"+n+"</a>",a}image({href:i,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));let s=Te(i);if(s===null)return S(t);i=s;let a=`<img src="${i}" alt="${t}"`;return e&&(a+=` title="${S(e)}"`),a+=">",a}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:S(i.text)}},ce=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},y=class V{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new F,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ce}static parse(e,t){return new V(t).parse(e)}static parseInline(e,t){return new V(t).parseInline(e)}parse(e){let t="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let r=s,l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){t+=l||"";continue}}let a=s;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let r='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return t}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){let a=e[s];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=l||"";continue}}let r=a;switch(r.type){case"escape":{n+=t.text(r);break}case"html":{n+=t.html(r);break}case"link":{n+=t.link(r);break}case"image":{n+=t.image(r);break}case"checkbox":{n+=t.checkbox(r);break}case"strong":{n+=t.strong(r);break}case"em":{n+=t.em(r);break}case"codespan":{n+=t.codespan(r);break}case"br":{n+=t.br(r);break}case"del":{n+=t.del(r);break}case"text":{n+=t.text(r);break}default:{let l='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},E=class{options;block;constructor(i){this.options=i||A}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?v.lex:v.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},Ct=class{defaults=te();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=F;TextRenderer=ce;Lexer=v;Tokenizer=U;Hooks=E;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let n of i)switch(t=t.concat(e.call(this,n)),n.type){case"table":{let s=n;for(let a of s.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of s.rows)for(let r of a)t=t.concat(this.walkTokens(r.tokens,e));break}case"list":{let s=n;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let r=s[a].flat(1/0);t=t.concat(this.walkTokens(r,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=e.renderers[s.name];a?e.renderers[s.name]=function(...r){let l=s.renderer.apply(this,r);return l===!1&&(l=a.apply(this,r)),l}:e.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 a=e[s.level];a?a.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),t.renderer){let s=this.defaults.renderer||new F(this.defaults);for(let a in t.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let r=a,l=t.renderer[r],o=s[r];s[r]=(...h)=>{let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c||""}}n.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new U(this.defaults);for(let a in t.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let r=a,l=t.tokenizer[r],o=s[r];s[r]=(...h)=>{let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c}}n.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new E;for(let a in t.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let r=a,l=t.hooks[r],o=s[r];E.passThroughHooks.has(a)?s[r]=h=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(a))return(async()=>{let p=await l.call(s,h);return o.call(s,p)})();let c=l.call(s,h);return o.call(s,c)}:s[r]=(...h)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(s,h);return p===!1&&(p=await o.apply(s,h)),p})();let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c}}n.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,a=t.walkTokens;n.walkTokens=function(r){let l=[];return l.push(a.call(this,r)),s&&(l=l.concat(s.call(this,r))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return v.lex(i,e??this.defaults)}parser(i,e){return y.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let n={...t},s={...this.defaults,...n},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return a(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 e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let r=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer():i?v.lex:v.lexInline)(r,s),o=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(o,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():i?y.parse:y.parseInline)(o,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(e=s.hooks.preprocess(e));let r=(s.hooks?s.hooks.provideLexer():i?v.lex:v.lexInline)(e,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():i?y.parse:y.parseInline)(r,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(r){return a(r)}}}onError(i,e){return t=>{if(t.message+=`
60
- Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+S(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},I=new Ct;function k(i,e){return I.parse(i,e)}k.options=k.setOptions=function(i){return I.setOptions(i),k.defaults=I.defaults,Ae(k.defaults),k};k.getDefaults=te;k.defaults=A;k.use=function(...i){return I.use(...i),k.defaults=I.defaults,Ae(k.defaults),k};k.walkTokens=function(i,e){return I.walkTokens(i,e)};k.parseInline=I.parseInline;k.Parser=y;k.parser=y.parse;k.Renderer=F;k.TextRenderer=ce;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=U;k.Hooks=E;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;y.parse;v.lex;var Y=class{constructor(e=""){this._text="",this._displayedText="",this._pendingText="",this._text=e,this._pendingText=e}setText(e){this._text=e,this._displayedText&&e.includes(this._displayedText)?this._pendingText=e.substring(this._displayedText.length):(this._pendingText=this._text,this._displayedText="")}getText(){return this._displayedText}clearText(){this._displayedText="",this._text="",this._pendingText=""}updateDisplayText(){if(this._pendingText.length>0){let e=this._pendingText[0];if(e==="["||e==="<"||e==="!"){let t=this._matchMarkdownPattern(this._displayedText+this._pendingText,this._displayedText.length);if(t){let n=t.end-t.start,s=this._pendingText.substring(0,n);this._displayedText+=s,this._pendingText=this._pendingText.substring(n)}else this._displayedText+=e,this._pendingText=this._pendingText.substring(1)}else this._displayedText+=e,this._pendingText=this._pendingText.substring(1)}}_matchMarkdownPattern(e,t){let n=[/<sup>\[\[[^\]]+\]\]\([^)]+\)<\/sup>/,/\[\[[^\]]+\]\]\([^)]+\)/,/\[[^\]]+\]\([^)]+\)/,/!\[[^\]]*\]\([^)]+\)/],s=e.substring(t);for(let a of n){let r=s.match(a);if(r&&r.index===0)return{start:t,end:t+r[0].length}}return null}},zt="https://links.esri.com/solutions/agol-organizational-account",Lt="https://links.esri.com/solutions/configure-assistants",ee=class extends fe{constructor(){super(),this.serverRoot="https://aiservices-beta.arcgis.com",this.open=!1,this.userFirstName="",this.conversationStore={conversationId:null,inquiryId:null,ackSequenceNumber:null},this._currentResponse="",this._isAutoScroll=!1,this._isLoading=!1,this._isLoadingText="",this.messages=[],this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._translations=me({name:"arcgis-solutions-assistant",blocking:!0}),this._isTyping=!1,this._configContextConsumer=be({context:we,subscribe:!0,callback:e=>{e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings,this._getAIServiceUrl())}}),this.closeAssistant=ue(),this._resetConversation=()=>{this.conversationStore.conversationId=null,this.conversationStore.inquiryId=null,this.conversationStore.ackSequenceNumber=null},this._setMessageContainerRef=e=>{this._chatContainer=e},this._setInputRef=e=>{this._inputRef=e,this._inputRef.addEventListener("keydown",t=>{t.key==="Enter"&&!t.shiftKey&&!this._isLoading&&!this._isTyping&&(t.preventDefault(),this._inputRef&&(this.handleSendMessage(this._inputRef.value.trim()),this._inputRef.value=""))}),setTimeout(()=>{this._inputRef?.focus()},100)},this._submitQuestion=e=>{this.handleSendMessage(e)},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"submitQuestion",e=>{this._submitQuestion(e.detail)})}static{this.properties={serverRoot:1,open:5,userFirstName:1,conversationStore:16,_currentResponse:16,_isAutoScroll:16,_isLoading:16,_isLoadingText:16,messages:16,_orgSettings:16,_translations:16,_isTyping:16}}static{this.styles=Ue}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}get solutionAIurl(){return`${this.serverRoot}/skills/solution_deployment/chat`}get docAIurl(){return`${this.serverRoot}/skills/doc_ai_assistant/chat`}async handleSendMessage(e){this._isLoading=!0;let t={message:e,context:{debug:!1,kind:"SolutionRequest"}};if(this.conversationStore.conversationId!==null){t.conversationId=this.conversationStore.conversationId;let n={author:"human",conversationId:this.conversationStore.conversationId?this.conversationStore.conversationId:"",message:e,render:this._renderSimpleTextMessage(e,"human","","Other")};this.messages=[...this.messages,n];let s=await this.requestAIServer(t,this.solutionAIurl);this.loopRequest(s,this.solutionAIurl)}else{let n={author:"human",message:e,render:this._renderSimpleTextMessage(e,"human","","Other")};this.messages=[...this.messages,n];let s=await this.requestAIServer(t,this.solutionAIurl);this.conversationStore.conversationId=s.conversationId,this.conversationStore.inquiryId=s.inquiryId,this.conversationStore.ackSequenceNumber=s.sequenceNumber,this.loopRequest(s,this.solutionAIurl)}}async loopRequest(e,t){let n=Date.now(),s,a=t;this._isLoading=!0;let r=document.createElement("div");r.classList.add("response-message","message-content");let l=document.createElement("div");l.classList.add("display-none");let o=document.createElement("div");o.classList.add("display-none");let h=e.conversationId+Date.now(),c=this._renderResponseBlock(r,l,o,h),p=new Y(this._currentResponse),u={author:"ai",conversationId:e.conversationId,message:e.message??"",render:c};for(this.messages.push(u),this.requestUpdate(),this._isAutoScroll=!0;e.hasMore;){await new Promise(_=>setTimeout(_,500));let m={conversationId:e.conversationId,ackSequenceNumber:e.sequenceNumber,inquiryId:e.inquiryId};if(e.context)if(this.conversationStore.context=e.context,e.context.results&&!e.context.intent)for(let _ of e.context.results)this._currentResponse=_.reply,this._currentResponse!==""&&(this._isLoading=!1,this._isTyping=!0,this._showCardById(h),this._startTypeWriter(p,this._currentResponse,r,l,o)),e=await this.requestAIServer(m,a);else if(e.context.intent==="Solution question"){s=e.context.intent;let _={message:e.message,conversationId:m.conversationId,context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions"}}};a=this.docAIurl,e=await this.requestAIServer(_,a)}else this._currentResponse=e.message??"",e.context.kind&&e.context.kind.toLowerCase()==="ArcGISErrorAsContext".toLowerCase()&&(this._currentResponse=this._translations.genericErrorMessage),this._currentResponse!==""&&(this._isLoading=!1,this._isTyping=!0,this._showCardById(h),this._startTypeWriter(p,this._currentResponse,r,l,o)),e=await this.requestAIServer(m,a);else e=await this.requestAIServer(m,a)}this._isLoading=!1;let{context:g}=this.conversationStore,f=this.messages.length>=2?this._getMostRecentQuestion():"",w=typeof f=="string"?"":f?.message??"",M=_e(n),N=s||g?.intent||"Unknown";if(this._telemetry?.logEvent({category:ve.ASSISTANT,action:"Chat",dimensions:[N],metrics:[M]}),g&&g.intent)switch(g.intent){case"Recommend solution":{if(g.results){let m=g.results,_=m.map($=>`- ${$.title}`).join(`
61
- `),C=this._renderSuggestedSolutions(m),z=this._renderFeedback(this._currentResponse+`
62
- `+_,w,this.conversationStore.conversationId,g.intent);T(C,l),T(z,o)}else l.innerHTML="";this._scrollToBottom();break}default:{let m=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,g.intent);T(m,o),this._scrollToBottom();break}}else{if(g&&g.results&&!g.intent)for(let m of g.results){let _=this._renderSolutionsQuestionTable(m.ref,m.followupQuestions),C=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,"Solution question");T(_,l),T(C,o)}else if(g&&g.kind&&g.kind.toLowerCase()==="ArcGISErrorAsContext".toLowerCase()){let m=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,"Error");T(m,o)}this._scrollToBottom()}}async requestAIServer(e,t){try{let n=this._configContextConsumer.value?.userSession?.token??"",s=await(await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",token:n},body:JSON.stringify(e)})).json();if(s)return s;throw new Error("No data returned")}catch(n){throw new Error(`Request failed: ${n}`)}}resetChat(){let e=this.messages[this.messages.length-1];if(e.author!=="system"&&e.conversationId!=="-1"){this._resetConversation();let t={author:"system",conversationId:"-1",message:this._translations.newConversationStarted,render:this._renderSimpleTextMessage(this._translations.newConversationStarted,"system","","Other","speech-bubble-plus")};this.messages=[...this.messages,t],this._inputRef&&(this._inputRef.value="")}}loaded(){this._checkURLOpenParameter();let e=this._chatContainer;e&&e.addEventListener("scroll",()=>{this._isAutoScroll=this._isAtBottom(e)})}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){if(this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI&&this.messages.length===0&&this._translations.defaultStartUpMessage){let t=this._translations.defaultStartUpMessage.replace("{{name}}",this.userFirstName),n=Object.values(this._translations.defaultFollowUpQuestions),s=this._renderSolutionQuestionFollowup(n);this.messages=[{author:"ai",conversationId:"",message:t,render:this._renderSimpleTextMessage(t,"ai","","Other",void 0,s,"margin-top-0")}]}(e.has("_isLoading")||e.has("_isTyping"))&&this.renderRoot.querySelectorAll(".assistant-followup-chip").forEach(t=>{t.disabled=this._isLoading||this._isTyping})}updated(e){(e.size||this._isLoading)&&this._scrollToBottom()}_renderFeedback(e,t,n,s){let a=Date.now();return x`
59
+ `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${S(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let n=this.parser.parseInline(t),s=Re(i);if(s===null)return n;i=s;let a='<a href="'+i+'"';return e&&(a+=' title="'+S(e)+'"'),a+=">"+n+"</a>",a}image({href:i,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));let s=Re(i);if(s===null)return S(t);i=s;let a=`<img src="${i}" alt="${t}"`;return e&&(a+=` title="${S(e)}"`),a+=">",a}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:S(i.text)}},he=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},y=class Y{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new O,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new he}static parse(e,t){return new Y(t).parse(e)}static parseInline(e,t){return new Y(t).parseInline(e)}parse(e){let t="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let r=s,l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){t+=l||"";continue}}let a=s;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let r='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return t}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){let a=e[s];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=l||"";continue}}let r=a;switch(r.type){case"escape":{n+=t.text(r);break}case"html":{n+=t.html(r);break}case"link":{n+=t.link(r);break}case"image":{n+=t.image(r);break}case"checkbox":{n+=t.checkbox(r);break}case"strong":{n+=t.strong(r);break}case"em":{n+=t.em(r);break}case"codespan":{n+=t.codespan(r);break}case"br":{n+=t.br(r);break}case"del":{n+=t.del(r);break}case"text":{n+=t.text(r);break}default:{let l='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},E=class{options;block;constructor(i){this.options=i||A}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?v.lex:v.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},zt=class{defaults=se();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=O;TextRenderer=he;Lexer=v;Tokenizer=F;Hooks=E;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let n of i)switch(t=t.concat(e.call(this,n)),n.type){case"table":{let s=n;for(let a of s.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of s.rows)for(let r of a)t=t.concat(this.walkTokens(r.tokens,e));break}case"list":{let s=n;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let r=s[a].flat(1/0);t=t.concat(this.walkTokens(r,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=e.renderers[s.name];a?e.renderers[s.name]=function(...r){let l=s.renderer.apply(this,r);return l===!1&&(l=a.apply(this,r)),l}:e.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 a=e[s.level];a?a.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),t.renderer){let s=this.defaults.renderer||new O(this.defaults);for(let a in t.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let r=a,l=t.renderer[r],o=s[r];s[r]=(...h)=>{let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c||""}}n.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new F(this.defaults);for(let a in t.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let r=a,l=t.tokenizer[r],o=s[r];s[r]=(...h)=>{let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c}}n.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new E;for(let a in t.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let r=a,l=t.hooks[r],o=s[r];E.passThroughHooks.has(a)?s[r]=h=>{if(this.defaults.async&&E.passThroughHooksRespectAsync.has(a))return(async()=>{let p=await l.call(s,h);return o.call(s,p)})();let c=l.call(s,h);return o.call(s,c)}:s[r]=(...h)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(s,h);return p===!1&&(p=await o.apply(s,h)),p})();let c=l.apply(s,h);return c===!1&&(c=o.apply(s,h)),c}}n.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,a=t.walkTokens;n.walkTokens=function(r){let l=[];return l.push(a.call(this,r)),s&&(l=l.concat(s.call(this,r))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return v.lex(i,e??this.defaults)}parser(i,e){return y.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let n={...t},s={...this.defaults,...n},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return a(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 e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let r=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer():i?v.lex:v.lexInline)(r,s),o=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(o,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():i?y.parse:y.parseInline)(o,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(e=s.hooks.preprocess(e));let r=(s.hooks?s.hooks.provideLexer():i?v.lex:v.lexInline)(e,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():i?y.parse:y.parseInline)(r,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(r){return a(r)}}}onError(i,e){return t=>{if(t.message+=`
60
+ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+S(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},I=new zt;function k(i,e){return I.parse(i,e)}k.options=k.setOptions=function(i){return I.setOptions(i),k.defaults=I.defaults,Ce(k.defaults),k};k.getDefaults=se;k.defaults=A;k.use=function(...i){return I.use(...i),k.defaults=I.defaults,Ce(k.defaults),k};k.walkTokens=function(i,e){return I.walkTokens(i,e)};k.parseInline=I.parseInline;k.Parser=y;k.parser=y.parse;k.Renderer=O;k.TextRenderer=he;k.Lexer=v;k.lexer=v.lex;k.Tokenizer=F;k.Hooks=E;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;y.parse;v.lex;var ee=class{constructor(e=""){this._text="",this._displayedText="",this._pendingText="",this._text=e,this._pendingText=e}setText(e){this._text=e,this._displayedText&&e.includes(this._displayedText)?this._pendingText=e.substring(this._displayedText.length):(this._pendingText=this._text,this._displayedText="")}getText(){return this._displayedText}clearText(){this._displayedText="",this._text="",this._pendingText=""}updateDisplayText(){if(this._pendingText.length>0){let e=this._pendingText[0];if(e==="["||e==="<"||e==="!"){let t=this._matchMarkdownPattern(this._displayedText+this._pendingText,this._displayedText.length);if(t){let n=t.end-t.start,s=this._pendingText.substring(0,n);this._displayedText+=s,this._pendingText=this._pendingText.substring(n)}else this._displayedText+=e,this._pendingText=this._pendingText.substring(1)}else this._displayedText+=e,this._pendingText=this._pendingText.substring(1)}}_matchMarkdownPattern(e,t){let n=[/<sup>\[\[[^\]]+\]\]\([^)]+\)<\/sup>/,/\[\[[^\]]+\]\]\([^)]+\)/,/\[[^\]]+\]\([^)]+\)/,/!\[[^\]]*\]\([^)]+\)/],s=e.substring(t);for(let a of n){let r=s.match(a);if(r&&r.index===0)return{start:t,end:t+r[0].length}}return null}},Lt="https://links.esri.com/solutions/agol-organizational-account",Pt="https://links.esri.com/solutions/configure-assistants",te=class extends me{constructor(){super(),this.serverRoot="https://aiservices-beta.arcgis.com",this.open=!1,this.userFirstName="",this.conversationStore={conversationId:null,inquiryId:null,ackSequenceNumber:null},this._currentResponse="",this._isAutoScroll=!1,this._isLoading=!1,this._isLoadingText="",this.messages=[],this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._translations=be({name:"arcgis-solutions-assistant",blocking:!0}),this._isTyping=!1,this._configContextConsumer=we({context:_e,subscribe:!0,callback:e=>{e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings,this._getAIServiceUrl())}}),this.closeAssistant=de(),this._resetConversation=()=>{this.conversationStore.conversationId=null,this.conversationStore.inquiryId=null,this.conversationStore.ackSequenceNumber=null},this._setMessageContainerRef=e=>{this._chatContainer=e},this._setInputRef=e=>{this._inputRef=e,this._inputRef.addEventListener("keydown",t=>{t.key==="Enter"&&!t.shiftKey&&!this._isLoading&&!this._isTyping&&(t.preventDefault(),this._inputRef&&(this.handleSendMessage(this._inputRef.value.trim()),this._inputRef.value=""))}),setTimeout(()=>{this._inputRef?.focus()},100)},this._submitQuestion=e=>{this.handleSendMessage(e)},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"submitQuestion",e=>{this._submitQuestion(e.detail)})}static{this.properties={serverRoot:1,open:5,userFirstName:1,conversationStore:16,_currentResponse:16,_isAutoScroll:16,_isLoading:16,_isLoadingText:16,messages:16,_orgSettings:16,_translations:16,_isTyping:16}}static{this.styles=Fe}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}get solutionAIurl(){return`${this.serverRoot}/skills/solution_deployment/chat`}get docAIurl(){return`${this.serverRoot}/skills/doc_ai_assistant/chat`}async handleSendMessage(e){this._isLoading=!0;let t={message:e,context:{debug:!1,kind:"SolutionRequest"}};if(this.conversationStore.conversationId!==null){t.conversationId=this.conversationStore.conversationId;let n={author:"human",conversationId:this.conversationStore.conversationId?this.conversationStore.conversationId:"",message:e,render:this._renderSimpleTextMessage(e,"human","","Other")};this.messages=[...this.messages,n];let s=await this.requestAIServer(t,this.solutionAIurl);this.loopRequest(s,this.solutionAIurl)}else{let n={author:"human",message:e,render:this._renderSimpleTextMessage(e,"human","","Other")};this.messages=[...this.messages,n];let s=await this.requestAIServer(t,this.solutionAIurl);this.conversationStore.conversationId=s.conversationId,this.conversationStore.inquiryId=s.inquiryId,this.conversationStore.ackSequenceNumber=s.sequenceNumber,this.loopRequest(s,this.solutionAIurl)}}async loopRequest(e,t){let n=Date.now(),s,a=t;this._isLoading=!0;let r=document.createElement("div");r.classList.add("response-message","message-content");let l=document.createElement("div");l.classList.add("display-none");let o=document.createElement("div");o.classList.add("display-none");let h=e.conversationId+Date.now(),c=this._renderResponseBlock(r,l,o,h),p=new ee(this._currentResponse),u={author:"ai",conversationId:e.conversationId,message:e.message??"",render:c};for(this.messages.push(u),this.requestUpdate(),this._isAutoScroll=!0;e.hasMore;){await new Promise(_=>setTimeout(_,500));let x={conversationId:e.conversationId,ackSequenceNumber:e.sequenceNumber,inquiryId:e.inquiryId};if(e.context)if(this.conversationStore.context=e.context,e.context.results&&!e.context.intent)for(let _ of e.context.results)this._currentResponse=_.reply,this._currentResponse!==""&&(this._isLoading=!1,this._isTyping=!0,this._showCardById(h),this._startTypeWriter(p,this._currentResponse,r,l,o)),e=await this.requestAIServer(x,a);else if(e.context.intent==="Solution question"){s=e.context.intent;let _={message:e.message,conversationId:x.conversationId,context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions"}}};a=this.docAIurl,e=await this.requestAIServer(_,a)}else this._currentResponse=e.message??"",e.context.kind&&e.context.kind.toLowerCase()==="ArcGISErrorAsContext".toLowerCase()&&(this._currentResponse=this._translations.genericErrorMessage),this._currentResponse!==""&&(this._isLoading=!1,this._isTyping=!0,this._showCardById(h),this._startTypeWriter(p,this._currentResponse,r,l,o)),e=await this.requestAIServer(x,a);else e=await this.requestAIServer(x,a)}this._isLoading=!1;let{context:g}=this.conversationStore,f=this.messages.length>=2?this._getMostRecentQuestion():"",w=typeof f=="string"?"":f?.message??"",M=ve(n),N=s||g?.intent||"Unknown";if(this._telemetry?.logEvent({category:ye.ASSISTANT,action:"Chat",dimensions:[N],metrics:[M]}),g&&g.intent)switch(g.intent){case"Recommend solution":{if(g.results){let x=g.results,_=x.map($=>`- ${$.title}`).join(`
61
+ `),C=this._renderSuggestedSolutions(x),z=this._renderFeedback(this._currentResponse+`
62
+ `+_,w,this.conversationStore.conversationId,g.intent);T(C,l),T(z,o)}else l.innerHTML="";this._scrollToBottom();break}default:{let x=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,g.intent);T(x,o),this._scrollToBottom();break}}else{if(g&&g.results&&!g.intent)for(let x of g.results){let _=this._renderSolutionsQuestionTable(x.ref,x.followupQuestions),C=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,"Solution question");T(_,l),T(C,o)}else if(g&&g.kind&&g.kind.toLowerCase()==="ArcGISErrorAsContext".toLowerCase()){let x=this._renderFeedback(this._currentResponse,w,this.conversationStore.conversationId,"Error");T(x,o)}this._scrollToBottom()}}async requestAIServer(e,t){try{let n=this._configContextConsumer.value?.userSession?.token??"",s=await(await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",token:n},body:JSON.stringify(e)})).json();if(s)return s;throw new Error("No data returned")}catch(n){throw new Error(`Request failed: ${n}`)}}resetChat(){let e=this.messages[this.messages.length-1];if(e.author!=="system"&&e.conversationId!=="-1"){this._resetConversation();let t={author:"system",conversationId:"-1",message:this._translations.newConversationStarted,render:this._renderSimpleTextMessage(this._translations.newConversationStarted,"system","","Other","speech-bubble-plus")};this.messages=[...this.messages,t],this._inputRef&&(this._inputRef.value="")}}loaded(){this._checkURLOpenParameter();let e=this._chatContainer;e&&e.addEventListener("scroll",()=>{this._isAutoScroll=this._isAtBottom(e)})}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){if(this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI&&this.messages.length===0&&this._translations.defaultStartUpMessage){let t=this._translations.defaultStartUpMessage.replace("{{name}}",this.userFirstName),n=Object.values(this._translations.defaultFollowUpQuestions),s=this._renderSolutionQuestionFollowup(n);this.messages=[{author:"ai",conversationId:"",message:t,render:this._renderSimpleTextMessage(t,"ai","","Other",void 0,s,"margin-top-0")}]}(e.has("_isLoading")||e.has("_isTyping"))&&this.renderRoot.querySelectorAll(".assistant-followup-chip").forEach(t=>{t.disabled=this._isLoading||this._isTyping})}updated(e){(e.size||this._isLoading)&&this._scrollToBottom()}_renderFeedback(e,t,n,s){let a=Date.now();return m`
63
63
  <div>
64
64
  <calcite-button
65
65
  appearance='transparent'
@@ -103,26 +103,28 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
103
103
  <span>${this._translations.tooltips.copyButton}</span>
104
104
  </calcite-tooltip>
105
105
  </div>
106
- `}_renderSolutionQuestionReferences(e){return x`
107
- ${e.map(t=>x`
106
+ `}_renderSolutionQuestionReferences(e){return m`
107
+ ${e.map(t=>m`
108
108
  <div class='message-content-pad'>
109
109
  <a href=${t.url} target='_blank'>
110
110
  ${t.title}
111
111
  </a>
112
112
  </div>
113
113
  `)}
114
- `}_renderSolutionQuestionFollowup(e){return x`
115
- ${e.map(t=>x`
114
+ `}_renderSolutionQuestionFollowup(e){return m`
115
+ ${e.map(t=>m`
116
116
  <calcite-chip
117
117
  class='chip-content cursor-pointer assistant-followup-chip'
118
118
  kind='brand'
119
119
  label=${t}
120
+ tabindex='0'
120
121
  @click=${()=>{this._submitFollowupQuestion(t)}}
122
+ @keydown=${n=>{Q(n,()=>this._submitFollowupQuestion(t))}}
121
123
  >
122
124
  ${t}
123
125
  </calcite-chip>
124
126
  `)}
125
- `}_renderSolutionsQuestionTable(e,t){let n=this._renderSolutionQuestionReferences(e),s=this._renderSolutionQuestionFollowup(t);return x`
127
+ `}_renderSolutionsQuestionTable(e,t){let n=this._renderSolutionQuestionReferences(e),s=this._renderSolutionQuestionFollowup(t);return m`
126
128
  <div slot='description' class='message-content'>
127
129
  <div style='display: flex; justify-content: flex-start;'>
128
130
  <calcite-button
@@ -144,11 +146,13 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
144
146
  <div class='padding-top-10'>
145
147
  ${s}
146
148
  </div>
147
- `}_renderSolutionCard(e){return x`
149
+ `}_renderSolutionCard(e){return m`
148
150
  <a
149
151
  class='solution-card'
150
152
  id='${e.id}'
153
+ tabindex='0'
151
154
  @click=${()=>this._emitItemIdFromAI(e.id)}
155
+ @keydown=${t=>{Q(t,()=>this._emitItemIdFromAI(e.id))}}
152
156
  >
153
157
  <calcite-card thumbnail-position='inline-start'>
154
158
  <div slot='thumbnail'>
@@ -163,8 +167,8 @@ Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error
163
167
  <span slot='description' class='solution-snippet'>${e.snippet}</span>
164
168
  </calcite-card>
165
169
  </a>
166
- `}_renderResponseBlock(e,t,n,s){return x`<calcite-card id=${s??W} class="system-message display-none">${e}${t}${n}</calcite-card>`}_renderSimpleTextMessage(e,t,n,s,a,r,l){let o=this.messages.length>=2?this._getMostRecentQuestion():"",h=typeof o=="string"?"":o?.message??"";return t==="system"?x`<div class="message-content message-content-alignment">${a&&x`<calcite-icon .icon=${a}></calcite-icon>`||""}${e}</div>`:x`<calcite-card class=${G(t==="human"?"user-message":"system-message")}><div class=${G(l?`${l} message-content`:"message-content")}>${X(e)}${r}${t==="ai"&&n!==""&&this._renderFeedback(e,h,n,s)||""}</div></calcite-card>`}_renderSuggestedSolutions(e){let t=e.map(n=>this._renderSolutionCard(n));return x`
170
+ `}_renderResponseBlock(e,t,n,s){return m`<calcite-card id=${s??X} class="system-message display-none">${e}${t}${n}</calcite-card>`}_renderSimpleTextMessage(e,t,n,s,a,r,l){let o=this.messages.length>=2?this._getMostRecentQuestion():"",h=typeof o=="string"?"":o?.message??"";return t==="system"?m`<div class="message-content message-content-alignment">${a&&m`<calcite-icon .icon=${a}></calcite-icon>`||""}${e}</div>`:m`<calcite-card class=${W(t==="human"?"user-message":"system-message")}><div class=${W(l?`${l} message-content`:"message-content")}>${J(e)}${r}${t==="ai"&&n!==""&&this._renderFeedback(e,h,n,s)||""}</div></calcite-card>`}_renderSuggestedSolutions(e){let t=e.map(n=>this._renderSolutionCard(n));return m`
167
171
  <div class='message-content'>
168
172
  ${t}
169
173
  </div>
170
- `}_renderNoSign(){return x`<calcite-notice open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??W} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return x`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${X(this._translations.noPermissionMessage.replace("{{orgUrl}}",zt).replace("{{configAI}}",Lt))}</div></calcite-notice>`}render(){return x`<calcite-dialog class="chat-panel" .open=${this.open} .heading=${this._translations.solutionAssistantTitle} placement=bottom-start @calciteDialogClose=${()=>{this.closeAssistant.emit(!0),this.open=!1}}><span class="chat-panel-heading" slot=header-content><span class="padding-right-8">${this._translations.solutionAssistantTitle}</span><calcite-chip .label=${this._translations.betaTag} .value=${this._translations.betaTag}>${this._translations.betaTag}</calcite-chip></span>${this.messages.length>1?x`<calcite-button appearance=transparent class="icon-color-background" .disabled=${!!this._isLoading||this._isTyping} id=newChatButton icon-end=speech-bubble-plus kind=neutral label="New conversation" @click=${this.resetChat} scale=l slot=header-actions-end></calcite-button><calcite-tooltip placement=bottom reference-element=newChatButton><span>${this._translations.tooltips.newConversation}</span></calcite-tooltip>`:""}<div class="chat-messages" ${j(this._setMessageContainerRef)}>${this.messages.map(e=>e.render)}${this._isLoading&&x`<calcite-card class="loader-message"><div class="message-content display-flex-row"><calcite-loader .label=${this._isLoadingText} inline scale=s></calcite-loader>${this._isLoadingText!=""&&x`<div class="padding-left-10">${this._isLoadingText}</div>`||""}</div></calcite-card>`||""}${this._chatContainer&&!this._isAtBottom(this._chatContainer)&&!this._isAutoScroll&&x`<calcite-fab icon=arrow-down @click=${()=>{this._isAutoScroll=!0,this._scrollToBottom(),setTimeout(()=>{this.requestUpdate()},100)}} scale=m></calcite-fab>`||""}${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?"":this._renderNoPermission():this._renderNoSign()}</div><div slot=footer class="width-100"><div class="chat-input"><calcite-text-area .disabled=${!this._configContextConsumer.value?.userSession?.token||!this._configContextConsumer.value?.authentication?.CanUseAI} resize=none rows=3 .placeholder=${this._translations.sendMessage} value ${j(this._setInputRef)}></calcite-text-area><calcite-button appearance=outline .disabled=${!!this._isLoading||this._isTyping||!this._configContextConsumer.value?.userSession?.token||!this._configContextConsumer.value?.authentication?.CanUseAI} icon-start=send id=sendQuestion kind=neutral icon-flip-rtl=start @click=${()=>{this._inputRef&&(this.handleSendMessage(this._inputRef.value.trim()),this._inputRef.value="")}}></calcite-button><calcite-tooltip placement=bottom reference-element=sendQuestion><span>${this._translations.tooltips.sendQuestion}</span></calcite-tooltip></div><div class="disclaimer-div padding-top-10" slot=footer><calcite-icon icon=information scale=s></calcite-icon>${this._translations.disclaimerMessage}<a href=https://links.esri.com/solutions/security-concern target=_blank>${this._translations.reportConcern}</a></div></div></calcite-dialog>`}_scrollToBottom(){this._chatContainer&&this._isAutoScroll&&setTimeout(()=>{this._chatContainer&&(this._chatContainer.scrollTop=this._chatContainer.scrollHeight)},100)}_emitItemIdFromAI(e){let t=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(t)}_submitFollowupQuestion(e){let t=new CustomEvent("submitQuestion",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(t)}_getMostRecentQuestion(){return[...this.messages].reverse().find(e=>e.author==="human")||null}_sendFeedback(e,t,n,s,a){let r=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(t)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({intent:a}))}&field:conversation_id=${encodeURIComponent(s)}&field:version=${encodeURIComponent("v1")}`;window.open(r,"_blank")}_copyResponseToClipboard(e,t){navigator.clipboard.writeText(e);let n=t.currentTarget;n.iconStart="check",setTimeout(()=>{n.iconStart="copy"},3e3)}_startTypeWriter(e,t,n,s,a){if(t.length>0){e.setText(t);let r=async()=>{e.updateDisplayText();let l=e.getText(),o=await k.parse(l);n.innerHTML=o.replace(/<a\s+/g,'<a target="_blank" '),l.length<this._currentResponse.length?(this._scrollToBottom(),setTimeout(r,5)):(this._isTyping=!1,this._isAutoScroll=!1,s.classList.remove("display-none"),a.classList.remove("display-none"))};r()}}_showCardById(e){let t=this.renderRoot.querySelector(`#${e}`);t&&t.classList.remove("display-none")}_isAtBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-5}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let t=e.fullName.split(" ")[0];this.userFirstName=t}}catch{}}_getAIServiceUrl(){if(this._configContextConsumer.value){let e=this._configContextConsumer.value;e.authentication&&e.authentication?.Portal&&e.authentication?.Portal.helperServices.aiAssistantServices&&(this.serverRoot=e.authentication?.Portal.helperServices.aiAssistantServices.url)}}};xe("arcgis-solutions-assistant",ee);return ee},a)
174
+ `}_renderNoSign(){return m`<calcite-notice open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??X} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return m`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${J(this._translations.noPermissionMessage.replace("{{orgUrl}}",Lt).replace("{{configAI}}",Pt))}</div></calcite-notice>`}render(){return m`<calcite-dialog class="chat-panel" .open=${this.open} .heading=${this._translations.solutionAssistantTitle} placement=bottom-start @calciteDialogClose=${()=>{this.closeAssistant.emit(!0),this.open=!1}}><span class="chat-panel-heading" slot=header-content><span class="padding-right-8">${this._translations.solutionAssistantTitle}</span><calcite-chip .label=${this._translations.betaTag} .value=${this._translations.betaTag}>${this._translations.betaTag}</calcite-chip></span>${this.messages.length>1?m`<calcite-button appearance=transparent class="icon-color-background" .disabled=${!!this._isLoading||this._isTyping} id=newChatButton icon-end=speech-bubble-plus kind=neutral label="New conversation" @click=${this.resetChat} scale=l slot=header-actions-end></calcite-button><calcite-tooltip placement=bottom reference-element=newChatButton><span>${this._translations.tooltips.newConversation}</span></calcite-tooltip>`:""}<div class="chat-messages" ${G(this._setMessageContainerRef)}>${this.messages.map(e=>e.render)}${this._isLoading&&m`<calcite-card class="loader-message"><div class="message-content display-flex-row"><calcite-loader .label=${this._isLoadingText} inline scale=s></calcite-loader>${this._isLoadingText!=""&&m`<div class="padding-left-10">${this._isLoadingText}</div>`||""}</div></calcite-card>`||""}${this._chatContainer&&!this._isAtBottom(this._chatContainer)&&!this._isAutoScroll&&m`<calcite-fab icon=arrow-down @click=${()=>{this._isAutoScroll=!0,this._scrollToBottom(),setTimeout(()=>{this.requestUpdate()},100)}} scale=m></calcite-fab>`||""}${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?"":this._renderNoPermission():this._renderNoSign()}</div><div slot=footer class="width-100"><div class="chat-input"><calcite-text-area .disabled=${!this._configContextConsumer.value?.userSession?.token||!this._configContextConsumer.value?.authentication?.CanUseAI} resize=none rows=3 .placeholder=${this._translations.sendMessage} value ${G(this._setInputRef)}></calcite-text-area><calcite-button appearance=outline .disabled=${!!this._isLoading||this._isTyping||!this._configContextConsumer.value?.userSession?.token||!this._configContextConsumer.value?.authentication?.CanUseAI} icon-start=send id=sendQuestion kind=neutral icon-flip-rtl=start @click=${()=>{this._inputRef&&(this.handleSendMessage(this._inputRef.value.trim()),this._inputRef.value="")}} @keydown=${e=>Q(e,()=>{this._inputRef&&(this.handleSendMessage(this._inputRef.value.trim()),this._inputRef.value="")})}></calcite-button><calcite-tooltip placement=bottom reference-element=sendQuestion><span>${this._translations.tooltips.sendQuestion}</span></calcite-tooltip></div><div class="disclaimer-div padding-top-10" slot=footer><calcite-icon icon=information scale=s></calcite-icon>${this._translations.disclaimerMessage}<a href=https://links.esri.com/solutions/security-concern target=_blank>${this._translations.reportConcern}</a></div></div></calcite-dialog>`}_scrollToBottom(){this._chatContainer&&this._isAutoScroll&&setTimeout(()=>{this._chatContainer&&(this._chatContainer.scrollTop=this._chatContainer.scrollHeight)},100)}_emitItemIdFromAI(e){let t=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(t)}_submitFollowupQuestion(e){let t=new CustomEvent("submitQuestion",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(t)}_getMostRecentQuestion(){return[...this.messages].reverse().find(e=>e.author==="human")||null}_sendFeedback(e,t,n,s,a){let r=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(t)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({intent:a}))}&field:conversation_id=${encodeURIComponent(s)}&field:version=${encodeURIComponent("v1")}`;window.open(r,"_blank")}_copyResponseToClipboard(e,t){navigator.clipboard.writeText(e);let n=t.currentTarget;n.iconStart="check",setTimeout(()=>{n.iconStart="copy"},3e3)}_startTypeWriter(e,t,n,s,a){if(t.length>0){e.setText(t);let r=async()=>{e.updateDisplayText();let l=e.getText(),o=await k.parse(l);n.innerHTML=o.replace(/<a\s+/g,'<a target="_blank" '),l.length<this._currentResponse.length?(this._scrollToBottom(),setTimeout(r,5)):(this._isTyping=!1,this._isAutoScroll=!1,s.classList.remove("display-none"),a.classList.remove("display-none"))};r()}}_showCardById(e){let t=this.renderRoot.querySelector(`#${e}`);t&&t.classList.remove("display-none")}_isAtBottom(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-5}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let t=e.fullName.split(" ")[0];this.userFirstName=t}}catch{}}_getAIServiceUrl(){if(this._configContextConsumer.value){let e=this._configContextConsumer.value;e.authentication&&e.authentication?.Portal&&e.authentication?.Portal.helperServices.aiAssistantServices&&(this.serverRoot=e.authentication?.Portal.helperServices.aiAssistantServices.url)}}};xe("arcgis-solutions-assistant",te);return te},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
2
- import b from"./LEBOMHXU.js";import a from"./K3V6XHE4.js";import"./W4773WDH.js";import"./77CU4WA2.js";import"./T4PIUXJ7.js";import"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import"./RFGSSUZF.js";import"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([,a])=>{return a},a,b)
2
+ import b from"./RG6FVRCW.js";import a from"./MVNKOMSZ.js";import"./W4773WDH.js";import"./77CU4WA2.js";import"./T4PIUXJ7.js";import"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import"./RFGSSUZF.js";import"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([,a])=>{return a},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
2
- import b from"./YN3QQTPJ.js";import a from"./K3V6XHE4.js";import"./W4773WDH.js";import"./77CU4WA2.js";import"./T4PIUXJ7.js";import"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import"./RFGSSUZF.js";import"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([,{b:o}])=>{return o},a,b)
2
+ import b from"./WI7VFPQ3.js";import a from"./MVNKOMSZ.js";import"./W4773WDH.js";import"./77CU4WA2.js";import"./T4PIUXJ7.js";import"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import"./RFGSSUZF.js";import"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([,{b:o}])=>{return o},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
2
- import d from"./K3V6XHE4.js";import{b as x}from"./W4773WDH.js";import{b}from"./77CU4WA2.js";import"./T4PIUXJ7.js";import{a as m}from"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import{b as g}from"./RFGSSUZF.js";import{F as a,G as n,H as f,K as t,L as c,h as v,i as e,j as h}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([k,R,{I:y,r:w}])=>{var L=v`:host{display:block;--solutions-social-share-action-width: initial;--solutions-social-share-width--s: 200px;--solutions-social-share-width--m: 280px;--solutions-social-share-width--l: 320px;--solutions-social-share-width-horizontal--s: 300px;--solutions-social-share-width-horizontal--m: 380px;--solutions-social-share-width-horizontal--l: 420px;--solutions-social-share-background-color: var(--calcite-color-foreground-1);--solutions-social-share-popover-button-background-color: transparent;--solutions-social-share-popover-button-icon-color: var(--calcite-ui-icon-color);--solutions-social-share-border: 1px solid var(--calcite-color-border-1);position:relative;display:flex;block-size:100%;flex:1 1 auto;flex-flow:column;align-items:stretch}.solutions-social-share__popover-button{background-color:var(--solutions-social-share-popover-button-background-color);--calcite-color-focus: initial}.solutions-social-share__popover-button calcite-icon{color:var(--solutions-social-share-popover-button-icon-color)}.solutions-social-share__dialog{background-color:var(--solutions-social-share-background-color);border:var(--solutions-social-share-border);box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px;color:var(--calcite-color-text-1)}.solutions-social-share__options{margin:0;padding:1% 0 0;list-style-type:none}.solutions-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color .15s ease-out 0s}.solutions-social-share__options li .solutions-social-share__icon,.solutions-social-share__options li .solutions-social-share__option-text{display:inline-block}.solutions-social-share__options li .solutions-social-share__icon{display:flex;align-items:center}.solutions-social-share__options li .solutions-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}.solutions-social-share__options li .solutions-social-share__option-text--rtl{margin-left:0;margin-right:10px}.solutions-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.solutions-social-share__x-logo{color:var(--calcite-color-text-1)}.solutions-social-share__success{display:flex;flex-direction:column;padding:15px}.solutions-social-share__success-header{display:flex;align-items:center;font-weight:700;margin-bottom:10px}.solutions-social-share__success-icon{display:flex;align-items:center;margin-right:5px}.solutions-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}.solutions-social-share__success-message{line-height:16px}.solutions-social-share__layout--horizontal .solutions-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}.solutions-social-share__layout--horizontal .solutions-social-share__options li{flex-direction:column;padding:0}.solutions-social-share__layout--horizontal .solutions-social-share__options li .solutions-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}.solutions-social-share__layout--horizontal .solutions-social-share__options li:hover{background-color:unset}.solutions-social-share__icon-container{display:flex;align-items:center}calcite-action{width:var(--solutions-social-share-action-width)}:host([scale=s]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--s)}:host([scale=s]) .solutions-social-share__icon{width:16px;height:16px}:host([scale=s]) .solutions-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--s)}:host([scale=m]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--m)}:host([scale=m]) .solutions-social-share__icon{width:24px;height:24px}:host([scale=m]) .solutions-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--m)}:host([scale=l]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--l)}:host([scale=l]) .solutions-social-share__icon{width:32px;height:32px}:host([scale=l]) .solutions-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--l)}`,S=".calcite-mode-dark",P={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}",bluesky:"https://bsky.app/intent/compose?text={url}"},C="https://arcg.is/prod/shorten",u=class extends f{constructor(){super(...arguments),this.actionApperance="transparent",this.autoUpdateShareUrl=!0,this.buttonAppearance="transparent",this.inlineSuccessPopoverPlacement="trailing",this.mode="popover",this.popoverButtonIconScale="m",this.popoverPositioning="absolute",this.removePopoverOffset=!1,this.scale="s",this.shareButtonKind="neutral",this.shareButtonScale="m",this.shareButtonText="",this.shareButtonType="button",this.shareIconsLayout="vertical",this.shareText="",this.shareUrl=window.location.href,this.shortenShareUrl=!0,this.socialMedia=!0,this.solutionId="",this.solutionTitle="",this.solutionVersion="",this.successMessage="",this._copied=!1,this._inlineCopyLinkOpened=!1,this._opened=!1,this._translations=m({name:"solution-social-share",blocking:!0}),this._configContextConsumer=b({context:x,subscribe:!0}),this._copyLinkPopoverRef=a(),this._dialogContentRef=a(),this._popoverActionRef=a(),this._popoverButtonRef=a(),this._popoverRef=a(),this._shareListRef=a()}static{this.properties={actionApperance:1,autoUpdateShareUrl:5,buttonAppearance:1,inlineSuccessPopoverPlacement:3,mode:3,popoverButtonIconScale:3,popoverPositioning:3,removePopoverOffset:7,scale:3,shareButtonKind:3,shareButtonScale:3,shareButtonText:1,shareButtonType:3,shareIconsLayout:3,shareText:3,shareUrl:1,shortenShareUrl:7,socialMedia:7,solutionId:1,solutionTitle:1,solutionVersion:1,successMessage:3,_copied:16,_inlineCopyLinkOpened:16,_opened:16,_translations:16}}static{this.styles=L}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}loaded(){this._setupAutoCloseListeners(),this.mode==="popover"&&this._popoverRef.value&&(this._opened&&(this._popoverRef.value.open=!0),this.listenOn(this._popoverRef.value,"calcitePopoverOpen",()=>{this._shareListRef.value&&this._shareListRef.value.children[0].focus()}),this.listenOn(this._popoverRef.value,"keydown",this._handlePopoverRefKeyDown))}render(){let o=this._copied&&this.mode==="popover"?this._renderSuccess():e`<div class=solutions-social-share__dialog-content>${this._renderOptions()}</div>`,s=this.shareIconsLayout==="vertical"?" solutions-social-share__layout--vertical":" solutions-social-share__layout--horizontal",i=` calcite-mode-${this.el.closest(S)?"dark":"light"}`,l=e`<div class=${`solutions-social-share__dialog${s}${i}`} ${n(this._dialogContentRef)}>${o}</div>`,r=this.removePopoverOffset?0:6;return this.mode==="popover"?[e`<calcite-popover .label=${this._translations.share?.label??""} reference-element=shareButton placement=bottom-start .scale=${this.scale} overlay-positioning=${this.popoverPositioning??c} offset-distance=${r??c} pointer-disabled=${this.removePopoverOffset??c} ${n(this._popoverRef)}>${l}</calcite-popover>`,this._renderButton()]:[l,e`<calcite-popover .label=${this._translations.share?.label??""} reference-element=copyToClipboard .placement=${this.inlineSuccessPopoverPlacement} .scale=${this.scale} overlay-positioning=fixed ${n(this._copyLinkPopoverRef)}>${this._renderSuccess()}</calcite-popover>`]}_setupAutoCloseListeners(){this.listenOn(document.documentElement,"click",this._autoCloseCallback),this.mode==="popover"&&this._popoverRef.value?(this.listenOn(this._popoverRef.value,"click",this._stopPropagationCallback),this.listenOn(this._popoverRef.value,"calcitePopoverClose",this._resetPopoverCopyState)):this._dialogContentRef.value&&this.listenOn(this._dialogContentRef.value,"click",this._stopPropagationCallback)}_handlePopoverRefKeyDown(o){if(o.code==="Tab"){if(!this._shareListRef.value)return;let s=o.target,i=this._shareListRef.value.children[0],l=this._shareListRef.value.children[this._shareListRef.value.children.length-1];o.shiftKey&&s===i?(o.preventDefault(),l.focus()):!o.shiftKey&&s===l&&(o.preventDefault(),i.focus())}else o.code==="Escape"&&(this._closePopover(),this.shareButtonType==="button"?this._popoverButtonRef.value?.setFocus():this._popoverActionRef.value?.setFocus())}_autoCloseCallback(){this.mode==="popover"?(this._opened=!1,this._popoverRef.value.open=this._opened):(this._copyLinkPopoverRef.value&&(this._copyLinkPopoverRef.value.open=!1),this._inlineCopyLinkOpened=!1)}_stopPropagationCallback(o){o.stopPropagation()}_resetPopoverCopyState(){this.shareButtonType==="button"?this._popoverButtonRef.value?.setFocus():this._popoverActionRef.value?.setFocus(),setTimeout(()=>{this._copied=!1},200)}_renderButton(){let o=this.shareButtonScale!=null?this.shareButtonScale:this.scale;return this.shareButtonType==="button"?e`<calcite-button .appearance=${this.buttonAppearance} class=solutions-social-share__popover-button id=shareButton .kind=${this.shareButtonKind} .label=${this._translations.share?.label} @click=${this._togglePopover.bind(this)} .scale=${o} title=${this._translations.share?.label??c} ${n(this._popoverButtonRef)}>${this.shareButtonText}</calcite-button>`:e`<calcite-action alignment=center .appearance=${this.actionApperance} class=solutions-social-share__popover-button id=shareButton .label=${this._translations.share?.label} @click=${this._togglePopover.bind(this)} .scale=${o} text title=${this._translations.share?.label??c} ${n(this._popoverActionRef)}><div class=solutions-social-share__icon-container><calcite-icon icon=share .scale=${this.popoverButtonIconScale}></calcite-icon></div></calcite-action>`}_renderSuccess(){let o=this._translations.success;return e`<div class=solutions-social-share__success><span class=solutions-social-share__success-header><span class=solutions-social-share__success-icon><calcite-icon icon=check-circle-f .scale=${this.scale}></calcite-icon></span>${o?.label}</span><span class=solutions-social-share__success-message>${this.successMessage||o?.url}</span></div>`}_renderOptions(){let o=this._translations.options,s=document.dir==="rtl"?" solutions-social-share__option-text--rtl":"";return e`<ul class=solutions-social-share__options role=menu ${n(this._shareListRef)}><li id=copyToClipboard @click=${this._handleShareItem.bind(this,"link")} @keydown=${this._handleOptionKeyDown("link")} role=menuitem tabindex=0><span class=solutions-social-share__icon><calcite-icon icon=link .scale=${this.scale}></calcite-icon></span><span class=${`solutions-social-share__option-text${s}`}>${o?.link?.label}</span></li>${this.socialMedia?[e`<li @click=${this._handleShareItem.bind(this,"facebook")} @keydown=${this._handleOptionKeyDown("facebook")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderFacebookIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.facebook?.label}</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"x")} @keydown=${this._handleOptionKeyDown("x")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderXIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>\r\n X</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"linkedIn")} @keydown=${this._handleOptionKeyDown("linkedIn")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderLinkedInIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.linkedIn?.label}</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"bluesky")} @keydown=${this._handleOptionKeyDown("bluesky")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderBlueSkyIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.blueSky?.label}</span></li>`]:null}</ul>`}_handleOptionKeyDown(o){return s=>{let i=s.code;(i==="Space"||i==="Enter")&&this._handleShareItem(o)}}_renderFacebookIcon(){return e`<svg height=100% style=${t({fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"})} version=1.1 viewBox="0 0 512 512" width=100% xmlns=http://www.w3.org/2000/svg>${h`<g><path d="M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z" style=${t({fill:"#1877f2",fillRule:"nonzero"})} /><path d="M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z" style=${t({fill:"#fff",fillRule:"nonzero"})} /></g>`}</svg>`}_renderXIcon(){return e`<svg class="solutions-social-share__x-logo" viewBox="0 0 1200 1227" fill=none xmlns=http://www.w3.org/2000/svg>${h`<rect height=400 style=${t({fill:"none"})} width=400 x=56 y=56 /><path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill=currentColor />`}</svg>`}_renderBlueSkyIcon(){return e`<svg fill=#0f85fe xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512">${h`<path d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z" />`}</svg>`}_renderLinkedInIcon(){return e`<svg height=100% style=${t({fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"})} version=1.1 viewBox="0 0 512 512" width=100% xmlns=http://www.w3.org/2000/svg>${h`<g id=g5891><path d="M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z" id=background style=${t({fill:"#2867b2"})} /><g id=shapes><rect height=257.962 id=rect11 style=${t({fill:"#fff"})} width=85.76 x=61.053 y=178.667 /><path d="M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z" id=path13-0 style=${t({fill:"#fff",fillRule:"nonzero"})} /><path d="M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z" id=path15 style=${t({fill:"#fff",fillRule:"nonzero"})} /></g></g>`}</svg>`}_togglePopover(o){o.stopPropagation(),this._opened=!this._opened,this._popoverRef.value.open=this._opened}_closePopover(){this._opened=!1,this._popoverRef.value.open=this._opened}async _handleShareItem(o){this._telemetry?.logEvent({category:y.SOLUTION_DETAILS,action:"Share",dimensions:[this.solutionTitle,this.solutionId,this.solutionVersion,w(o)]}),this.shareUrl=await this._generateShareUrl();let s=null,i=navigator?.userAgent?.includes("Chrome")??!1,l=(navigator?.userAgent?.includes("Safari")??!1)&&!i;!l&&this.shortenShareUrl&&(s=await this._shortenUrl(this.shareUrl));let r=s||this.shareUrl;switch(o){case"link":navigator.clipboard.writeText(r),this.mode==="inline"&&(this._copyLinkPopoverRef.value.open=!0,setTimeout(()=>this._copyLinkPopoverRef.value.open=!1,3e3)),this._inlineCopyLinkOpened=!0,this._copied=!0,this.mode==="popover"&&setTimeout(()=>this._closePopover(),2e3);return;case"facebook":case"bluesky":case"x":case"linkedIn":{let p;l&&(p=window.open("","_blank"),this.shortenShareUrl&&(r=await this._shortenUrl(this.shareUrl)||r));let _={url:encodeURI(r)},$=o==="x"?{..._,text:this.shareText}:_,d=k.substitute(P[o],$);this.mode==="popover"&&this._closePopover(),l&&p?(p.location=d,p.focus()):window.open(encodeURI(d),"_blank")}return}}async _shortenUrl(o){let s=(await R(C,{query:{longUrl:o,f:"json"}}))?.data?.data?.url;if(s)return s.replace("http://","https://")}_generateShareUrl(){return this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),this.shareUrl}};g("solution-social-share",u);return u},"intl","request",d)
2
+ import d from"./MVNKOMSZ.js";import{b as x}from"./W4773WDH.js";import{b}from"./77CU4WA2.js";import"./T4PIUXJ7.js";import{a as m}from"./6D3THEX6.js";import"./5IZMQFRP.js";import"./FOQPGXXA.js";import"./ED6SUP22.js";import"./E6P6PYNW.js";import"./IKKBLHLZ.js";import"./CUA2IUXX.js";import"./4UZDZNJD.js";import"./KOTG6W5Z.js";import"./6SC7YR5Y.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./ZYQ4P2ON.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./JEJ23R3P.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import"./44A5XEM4.js";import{b as g}from"./RFGSSUZF.js";import{F as a,G as n,H as f,K as i,L as c,h as v,i as e,j as h}from"./5CQPQ7AE.js";import"./3QPJ2JCA.js";export default $arcgis.t(([k,R,{I:y,n:w}])=>{var L=v`:host{display:block;--solutions-social-share-action-width: initial;--solutions-social-share-width--s: 200px;--solutions-social-share-width--m: 280px;--solutions-social-share-width--l: 320px;--solutions-social-share-width-horizontal--s: 300px;--solutions-social-share-width-horizontal--m: 380px;--solutions-social-share-width-horizontal--l: 420px;--solutions-social-share-background-color: var(--calcite-color-foreground-1);--solutions-social-share-popover-button-background-color: transparent;--solutions-social-share-popover-button-icon-color: var(--calcite-ui-icon-color);--solutions-social-share-border: 1px solid var(--calcite-color-border-1);position:relative;display:flex;block-size:100%;flex:1 1 auto;flex-flow:column;align-items:stretch}.solutions-social-share__popover-button{background-color:var(--solutions-social-share-popover-button-background-color);--calcite-color-focus: initial}.solutions-social-share__popover-button calcite-icon{color:var(--solutions-social-share-popover-button-icon-color)}.solutions-social-share__dialog{background-color:var(--solutions-social-share-background-color);border:var(--solutions-social-share-border);box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px;color:var(--calcite-color-text-1)}.solutions-social-share__options{margin:0;padding:1% 0 0;list-style-type:none}.solutions-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color .15s ease-out 0s}.solutions-social-share__options li .solutions-social-share__icon,.solutions-social-share__options li .solutions-social-share__option-text{display:inline-block}.solutions-social-share__options li .solutions-social-share__icon{display:flex;align-items:center}.solutions-social-share__options li .solutions-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}.solutions-social-share__options li .solutions-social-share__option-text--rtl{margin-left:0;margin-right:10px}.solutions-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.solutions-social-share__x-logo{color:var(--calcite-color-text-1)}.solutions-social-share__success{display:flex;flex-direction:column;padding:15px}.solutions-social-share__success-header{display:flex;align-items:center;font-weight:700;margin-bottom:10px}.solutions-social-share__success-icon{display:flex;align-items:center;margin-right:5px}.solutions-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}.solutions-social-share__success-message{line-height:16px}.solutions-social-share__layout--horizontal .solutions-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}.solutions-social-share__layout--horizontal .solutions-social-share__options li{flex-direction:column;padding:0}.solutions-social-share__layout--horizontal .solutions-social-share__options li .solutions-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}.solutions-social-share__layout--horizontal .solutions-social-share__options li:hover{background-color:unset}.solutions-social-share__icon-container{display:flex;align-items:center}calcite-action{width:var(--solutions-social-share-action-width)}:host([scale=s]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--s)}:host([scale=s]) .solutions-social-share__icon{width:16px;height:16px}:host([scale=s]) .solutions-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--s)}:host([scale=m]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--m)}:host([scale=m]) .solutions-social-share__icon{width:24px;height:24px}:host([scale=m]) .solutions-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--m)}:host([scale=l]) .solutions-social-share__dialog{width:var(--solutions-social-share-width--l)}:host([scale=l]) .solutions-social-share__icon{width:32px;height:32px}:host([scale=l]) .solutions-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .solutions-social-share__dialog.solutions-social-share__layout--horizontal{width:var(--solutions-social-share-width-horizontal--l)}`,S=".calcite-mode-dark",P={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}",bluesky:"https://bsky.app/intent/compose?text={url}"},C="https://arcg.is/prod/shorten",u=class extends f{constructor(){super(...arguments),this.actionApperance="transparent",this.autoUpdateShareUrl=!0,this.buttonAppearance="transparent",this.inlineSuccessPopoverPlacement="trailing",this.mode="popover",this.popoverButtonIconScale="m",this.popoverPositioning="absolute",this.removePopoverOffset=!1,this.scale="s",this.shareButtonKind="neutral",this.shareButtonScale="m",this.shareButtonText="",this.shareButtonType="button",this.shareIconsLayout="vertical",this.shareText="",this.shareUrl=window.location.href,this.shortenShareUrl=!0,this.socialMedia=!0,this.solutionId="",this.solutionTitle="",this.solutionVersion="",this.successMessage="",this._copied=!1,this._inlineCopyLinkOpened=!1,this._opened=!1,this._translations=m({name:"solution-social-share",blocking:!0}),this._configContextConsumer=b({context:x,subscribe:!0}),this._copyLinkPopoverRef=a(),this._dialogContentRef=a(),this._popoverActionRef=a(),this._popoverButtonRef=a(),this._popoverRef=a(),this._shareListRef=a()}static{this.properties={actionApperance:1,autoUpdateShareUrl:5,buttonAppearance:1,inlineSuccessPopoverPlacement:3,mode:3,popoverButtonIconScale:3,popoverPositioning:3,removePopoverOffset:7,scale:3,shareButtonKind:3,shareButtonScale:3,shareButtonText:1,shareButtonType:3,shareIconsLayout:3,shareText:3,shareUrl:1,shortenShareUrl:7,socialMedia:7,solutionId:1,solutionTitle:1,solutionVersion:1,successMessage:3,_copied:16,_inlineCopyLinkOpened:16,_opened:16,_translations:16}}static{this.styles=L}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}loaded(){this._setupAutoCloseListeners(),this.mode==="popover"&&this._popoverRef.value&&(this._opened&&(this._popoverRef.value.open=!0),this.listenOn(this._popoverRef.value,"calcitePopoverOpen",()=>{this._shareListRef.value&&this._shareListRef.value.children[0].focus()}),this.listenOn(this._popoverRef.value,"keydown",this._handlePopoverRefKeyDown))}render(){let o=this._copied&&this.mode==="popover"?this._renderSuccess():e`<div class=solutions-social-share__dialog-content>${this._renderOptions()}</div>`,s=this.shareIconsLayout==="vertical"?" solutions-social-share__layout--vertical":" solutions-social-share__layout--horizontal",t=` calcite-mode-${this.el.closest(S)?"dark":"light"}`,l=e`<div class=${`solutions-social-share__dialog${s}${t}`} ${n(this._dialogContentRef)}>${o}</div>`,r=this.removePopoverOffset?0:6;return this.mode==="popover"?[e`<calcite-popover .label=${this._translations.share?.label??""} reference-element=shareButton placement=bottom-start .scale=${this.scale} overlay-positioning=${this.popoverPositioning??c} offset-distance=${r??c} pointer-disabled=${this.removePopoverOffset??c} ${n(this._popoverRef)}>${l}</calcite-popover>`,this._renderButton()]:[l,e`<calcite-popover .label=${this._translations.share?.label??""} reference-element=copyToClipboard .placement=${this.inlineSuccessPopoverPlacement} .scale=${this.scale} overlay-positioning=fixed ${n(this._copyLinkPopoverRef)}>${this._renderSuccess()}</calcite-popover>`]}_setupAutoCloseListeners(){this.listenOn(document.documentElement,"click",this._autoCloseCallback),this.mode==="popover"&&this._popoverRef.value?(this.listenOn(this._popoverRef.value,"click",this._stopPropagationCallback),this.listenOn(this._popoverRef.value,"calcitePopoverClose",this._resetPopoverCopyState)):this._dialogContentRef.value&&this.listenOn(this._dialogContentRef.value,"click",this._stopPropagationCallback)}_handlePopoverRefKeyDown(o){if(o.code==="Tab"){if(!this._shareListRef.value)return;let s=o.target,t=this._shareListRef.value.children[0],l=this._shareListRef.value.children[this._shareListRef.value.children.length-1];o.shiftKey&&s===t?(o.preventDefault(),l.focus()):!o.shiftKey&&s===l&&(o.preventDefault(),t.focus())}else o.code==="Escape"&&(this._closePopover(),this.shareButtonType==="button"?this._popoverButtonRef.value?.setFocus():this._popoverActionRef.value?.setFocus())}_autoCloseCallback(){this.mode==="popover"?(this._opened=!1,this._popoverRef.value.open=this._opened):(this._copyLinkPopoverRef.value&&(this._copyLinkPopoverRef.value.open=!1),this._inlineCopyLinkOpened=!1)}_stopPropagationCallback(o){o.stopPropagation()}_resetPopoverCopyState(){this.shareButtonType==="button"?this._popoverButtonRef.value?.setFocus():this._popoverActionRef.value?.setFocus(),setTimeout(()=>{this._copied=!1},200)}_renderButton(){let o=this.shareButtonScale!=null?this.shareButtonScale:this.scale;return this.shareButtonType==="button"?e`<calcite-button .appearance=${this.buttonAppearance} class=solutions-social-share__popover-button id=shareButton .kind=${this.shareButtonKind} .label=${this._translations.share?.label} @click=${this._togglePopover.bind(this)} .scale=${o} title=${this._translations.share?.label??c} ${n(this._popoverButtonRef)}>${this.shareButtonText}</calcite-button>`:e`<calcite-action alignment=center .appearance=${this.actionApperance} class=solutions-social-share__popover-button id=shareButton .label=${this._translations.share?.label} @click=${this._togglePopover.bind(this)} .scale=${o} text title=${this._translations.share?.label??c} ${n(this._popoverActionRef)}><div class=solutions-social-share__icon-container><calcite-icon icon=share .scale=${this.popoverButtonIconScale}></calcite-icon></div></calcite-action>`}_renderSuccess(){let o=this._translations.success;return e`<div class=solutions-social-share__success><span class=solutions-social-share__success-header><span class=solutions-social-share__success-icon><calcite-icon icon=check-circle-f .scale=${this.scale}></calcite-icon></span>${o?.label}</span><span class=solutions-social-share__success-message>${this.successMessage||o?.url}</span></div>`}_renderOptions(){let o=this._translations.options,s=document.dir==="rtl"?" solutions-social-share__option-text--rtl":"";return e`<ul class=solutions-social-share__options role=menu ${n(this._shareListRef)}><li id=copyToClipboard @click=${this._handleShareItem.bind(this,"link")} @keydown=${this._handleOptionKeyDown("link")} role=menuitem tabindex=0><span class=solutions-social-share__icon><calcite-icon icon=link .scale=${this.scale}></calcite-icon></span><span class=${`solutions-social-share__option-text${s}`}>${o?.link?.label}</span></li>${this.socialMedia?[e`<li @click=${this._handleShareItem.bind(this,"facebook")} @keydown=${this._handleOptionKeyDown("facebook")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderFacebookIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.facebook?.label}</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"x")} @keydown=${this._handleOptionKeyDown("x")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderXIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>\r\n X</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"linkedIn")} @keydown=${this._handleOptionKeyDown("linkedIn")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderLinkedInIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.linkedIn?.label}</span></li>`,e`<li @click=${this._handleShareItem.bind(this,"bluesky")} @keydown=${this._handleOptionKeyDown("bluesky")} role=menuitem tabindex=0><span class=solutions-social-share__icon>${this._renderBlueSkyIcon()}</span><span class=${`solutions-social-share__option-text${s}`}>${o?.blueSky?.label}</span></li>`]:null}</ul>`}_handleOptionKeyDown(o){return s=>{let t=s.code;(t==="Space"||t==="Enter"||t==="NumpadEnter")&&this._handleShareItem(o)}}_renderFacebookIcon(){return e`<svg height=100% style=${i({fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"})} version=1.1 viewBox="0 0 512 512" width=100% xmlns=http://www.w3.org/2000/svg>${h`<g><path d="M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z" style=${i({fill:"#1877f2",fillRule:"nonzero"})} /><path d="M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z" style=${i({fill:"#fff",fillRule:"nonzero"})} /></g>`}</svg>`}_renderXIcon(){return e`<svg height=100% width=100% class="solutions-social-share__x-logo" viewBox="0 0 1200 1227" fill=none xmlns=http://www.w3.org/2000/svg>${h`<rect height=400 style=${i({fill:"none"})} width=400 x=56 y=56 /><path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill=currentColor />`}</svg>`}_renderBlueSkyIcon(){return e`<svg height=100% width=100% fill=#0f85fe xmlns=http://www.w3.org/2000/svg viewBox="0 0 512 512">${h`<path d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z" />`}</svg>`}_renderLinkedInIcon(){return e`<svg height=100% style=${i({fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"})} version=1.1 viewBox="0 0 512 512" width=100% xmlns=http://www.w3.org/2000/svg>${h`<g id=g5891><path d="M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z" id=background style=${i({fill:"#2867b2"})} /><g id=shapes><rect height=257.962 id=rect11 style=${i({fill:"#fff"})} width=85.76 x=61.053 y=178.667 /><path d="M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z" id=path13-0 style=${i({fill:"#fff",fillRule:"nonzero"})} /><path d="M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z" id=path15 style=${i({fill:"#fff",fillRule:"nonzero"})} /></g></g>`}</svg>`}_togglePopover(o){o.stopPropagation(),this._opened=!this._opened,this._popoverRef.value.open=this._opened}_closePopover(){this._opened=!1,this._popoverRef.value.open=this._opened}async _handleShareItem(o){this._telemetry?.logEvent({category:y.SOLUTION_DETAILS,action:"Share",dimensions:[this.solutionTitle,this.solutionId,this.solutionVersion,w(o)]}),this.shareUrl=await this._generateShareUrl();let s=null,t=navigator?.userAgent?.includes("Chrome")??!1,l=(navigator?.userAgent?.includes("Safari")??!1)&&!t;!l&&this.shortenShareUrl&&(s=await this._shortenUrl(this.shareUrl));let r=s||this.shareUrl;switch(o){case"link":navigator.clipboard.writeText(r),this.mode==="inline"&&(this._copyLinkPopoverRef.value.open=!0,setTimeout(()=>this._copyLinkPopoverRef.value.open=!1,3e3)),this._inlineCopyLinkOpened=!0,this._copied=!0,this.mode==="popover"&&setTimeout(()=>this._closePopover(),2e3);return;case"facebook":case"bluesky":case"x":case"linkedIn":{let p;l&&(p=window.open("","_blank"),this.shortenShareUrl&&(r=await this._shortenUrl(this.shareUrl)||r));let _={url:encodeURI(r)},$=o==="x"?{..._,text:this.shareText}:_,d=k.substitute(P[o],$);this.mode==="popover"&&this._closePopover(),l&&p?(p.location=d,p.focus()):window.open(encodeURI(d),"_blank")}return}}async _shortenUrl(o){let s=(await R(C,{query:{longUrl:o,f:"json"}}))?.data?.data?.url;if(s)return s.replace("http://","https://")}_generateShareUrl(){return this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),this.shareUrl}};g("solution-social-share",u);return u},"intl","request",d)