@arcgis/portal-components 5.2.0-next.4 → 5.2.0-next.6

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 (32) hide show
  1. package/dist/cdn/DFTUMKSN.js +3 -0
  2. package/dist/cdn/G6QT6MYP.js +65 -0
  3. package/dist/cdn/{GNOZCQ34.js → L3BQK62N.js} +1 -1
  4. package/dist/cdn/{5DPWJ7DI.js → MX3F5ZCL.js} +1 -1
  5. package/dist/cdn/{N6G6Z7BF.js → T25WZ6OL.js} +47 -47
  6. package/dist/cdn/{2UUZHENH.js → UPEVTVNZ.js} +1 -1
  7. package/dist/cdn/{CI5ENGVT.js → X5NBQPTM.js} +1 -1
  8. package/dist/cdn/YVJRXWM3.js +3 -0
  9. package/dist/cdn/assets/portal-user-popup/t9n/messages.en.json +1 -0
  10. package/dist/cdn/index.js +1 -1
  11. package/dist/cdn/main.css +1 -1
  12. package/dist/chunks/user2.js +26 -25
  13. package/dist/components/arcgis-portal-ai-assistant/customElement.js +2 -2
  14. package/dist/components/arcgis-portal-ai-assistant-interrupt/customElement.js +10 -10
  15. package/dist/components/arcgis-portal-user-popup/customElement.d.ts +111 -0
  16. package/dist/components/arcgis-portal-user-popup/customElement.js +231 -0
  17. package/dist/components/arcgis-portal-user-popup/index.d.ts +1 -0
  18. package/dist/components/arcgis-portal-user-popup/index.js +5 -0
  19. package/dist/docs/api.json +1 -1
  20. package/dist/docs/docs.json +1 -1
  21. package/dist/docs/vscode.html-custom-data.json +1 -1
  22. package/dist/docs/web-types.json +1 -1
  23. package/dist/index.d.ts +10 -0
  24. package/dist/loader.js +4 -3
  25. package/dist/types/lumina.d.ts +7 -0
  26. package/dist/types/preact.d.ts +8 -0
  27. package/dist/types/react.d.ts +9 -0
  28. package/dist/types/stencil.d.ts +7 -0
  29. package/dist/types/tracking.d.ts +10 -0
  30. package/dist/types/user.d.ts +2 -2
  31. package/package.json +5 -5
  32. package/dist/cdn/SM4GWLRA.js +0 -66
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as u,b as g,c as k}from"./5VSDGPHH.js";export default $arcgis.t(([q,x])=>{var c={},l={},d={};async function y({requester:t,key:r,id:o,cacheOption:a}){let e=d[r]?.[o]?.expireAt,n=!!e&&new Date().getTime()>e;if(c[r]?.[o]&&!n)return c[r][o];l[r]||(l[r]={}),(!l[r][o]||n)&&(l[r][o]=t());let i=await l[r][o];if(c[r]||(c[r]={}),d[r]||(d[r]={}),c[r][o]=i,a){let{expireAfter:m,getExpireAfterFromResult:s}=a,f=s||m?new Date().getTime()+(s?.(i)??m??0):null;d[r][o]={...d[r][o],expireAt:f}}return i}async function A({url:t,portal:r,params:o={},options:a={},method:e,abortControllerId:n,excludeJson:i}){let m=T(n)?.signal,{customToken:s,addTokenManually:f,addSSL:S,useProxy:b}=a,w={...o};if(!t.includes("f=")&&!i&&(w.f="json"),s)w.token=s;else if(f!==!1){let h=await E(r);h&&(w.token=h)}let C=S?M(t,r):t,P={query:w,method:e||"auto",...a,timeout:a.timeout||0,useProxy:b,...a?.disableIdentityLookup?{authMode:"anonymous"}:{}},$=await x(C,{signal:m,...P});return n&&(p[n]=void 0),$.data}var p={};function T(t){if(t)return p[t]&&p[t].abort(),p[t]=new AbortController,p[t]}var E=async t=>{let r=k(t);if(!t?.isPortal||!r)return g(t);let o=t?.user;if(!o&&r)return;let{token:a}=await y({requester:async()=>await I(t),key:"platformSelf",id:o?.id??t.id??"<unknown>",cacheOption:{getExpireAfterFromResult:e=>e.expires_in}});return a},I=async t=>{let r={"X-Esri-Auth-Client-Id":await L(t),"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/u,"")};return(await x(`${u(t)}/oauth2/platformSelf`,{authMode:"no-prompt",headers:r,withCredentials:!0,method:"post"})).data},L=async t=>(await y({requester:async()=>await q.getCredential(u(t),{oAuthPopupConfirmation:!1}),key:"credential",id:t.user?.id??"<unknown>"})).oAuthState?.appId??"arcgisonline";function M(t,r){return window.location.protocol==="https:"||r.allSSL?t.replace("http:","https:"):t}async function D(t,r,o){let a=`${o?"https://www.arcgis.com/sharing/rest/":u(r)}community/users/${t}`,e=a?.includes("www.arcgis.com")&&r.isPortal,n=a?.includes(".arcgis.com")&&!r.isPortal&&!r.user,i=e||n?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await y({requester:async()=>{try{return await A({url:a,portal:r,options:i})}catch{return{username:t}}},key:"user",id:a})}var U=async t=>{let r=`${u(t)}/portals/${t.id}/users`;return await A({url:r,portal:t,params:{num:100,sortField:"lastlogin",sortOrder:"desc"}})};return{a:y,b:D,c:U}},"identity/IdentityManager","request")
2
+ import{a as u,b as g,c as k}from"./5VSDGPHH.js";export default $arcgis.t(([q,x])=>{var c={},l={},d={};async function y({requester:t,key:r,id:o,cacheOption:a}){let e=d[r]?.[o]?.expireAt,n=!!e&&new Date().getTime()>e;if(c[r]?.[o]&&!n)return c[r][o];l[r]||(l[r]={}),(!l[r][o]||n)&&(l[r][o]=t());let i=await l[r][o];if(c[r]||(c[r]={}),d[r]||(d[r]={}),c[r][o]=i,a){let{expireAfter:m,getExpireAfterFromResult:s}=a,f=s||m?new Date().getTime()+(s?.(i)??m??0):null;d[r][o]={...d[r][o],expireAt:f}}return i}async function A({url:t,portal:r,params:o={},options:a={},method:e,abortControllerId:n,excludeJson:i}){let m=T(n)?.signal,{customToken:s,addTokenManually:f,addSSL:S,useProxy:b}=a,w={...o};if(!t.includes("f=")&&!i&&(w.f="json"),s)w.token=s;else if(f!==!1){let h=await E(r);h&&(w.token=h)}let C=S?M(t,r):t,P={query:w,method:e||"auto",...a,timeout:a.timeout||0,useProxy:b,...a?.disableIdentityLookup?{authMode:"anonymous"}:{}},$=await x(C,{signal:m,...P});return n&&(p[n]=void 0),$.data}var p={};function T(t){if(t)return p[t]&&p[t].abort(),p[t]=new AbortController,p[t]}var E=async t=>{let r=k(t);if(!t?.isPortal||!r)return g(t);let o=t?.user;if(!o&&r)return;let{token:a}=await y({requester:async()=>await I(t),key:"platformSelf",id:o?.id??t.id??"<unknown>",cacheOption:{getExpireAfterFromResult:e=>e.expires_in}});return a},I=async t=>{let r={"X-Esri-Auth-Client-Id":await L(t),"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/u,"")};return(await x(`${u(t)}/oauth2/platformSelf`,{authMode:"no-prompt",headers:r,withCredentials:!0,method:"post"})).data},L=async t=>(await y({requester:async()=>await q.getCredential(u(t),{oAuthPopupConfirmation:!1}),key:"credential",id:t.user?.id??"<unknown>"})).oAuthState?.appId??"arcgisonline";function M(t,r){return window.location.protocol==="https:"||r.allSSL?t.replace("http:","https:"):t}async function D(t,r,o){let a=`${o?"https://www.arcgis.com/sharing/rest/":u(r)}community/users/${t}`,e=a?.includes("www.arcgis.com")&&r.isPortal,n=a?.includes(".arcgis.com")&&!r.isPortal&&!r.user,i=e||n?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await y({requester:async()=>{try{return await A({url:a,portal:r,options:i})}catch{return{username:t}}},key:"user",id:a})}var U=async t=>{let r=`${u(t)}/portals/${t.id}/users`;return await A({url:r,portal:t,params:{num:100,sortField:"lastlogin",sortOrder:"desc"}})};return{a:y,b:A,c:D,d:U}},"identity/IdentityManager","request")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./2UUZHENH.js";import a from"./RNLVNDGG.js";import"./5VSDGPHH.js";import{c as R}from"./KEKBRUUC.js";import{A as M,B as S,E,H as P,I as g,J as D,K as v,P as L,h as k,j as d,l as A,v as u}from"./DHHSKOUY.js";import"./YIMNOUTF.js";export default $arcgis.t(([{a:O,c:U},{a:x,c:_}])=>{var F=(a,e=100)=>{let s;return(...n)=>{let i=()=>{clearTimeout(s),a(...n)};clearTimeout(s),s=setTimeout(i,e)}};var q=M(class extends S{constructor(){super(...arguments),this.key=A}render(a,e){return this.key=a,e}update(a,[e,s]){return e!==this.key&&(E(a),this.key=e),s}});var y=["@","#","$"],V=400;function Q(a,e){let s=null;for(let n of e){let i=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new RegExp(`${i}"([^"\\n]*)"?$`,"u"),t=a.match(r);if(t){let c=t[0],l=a.length-c.length,h=t[1]??"";(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}let o=new RegExp(`${i}[\\p{L}\\p{N}_-]+$`,"u"),m=a.match(o);if(m){let c=m[0],l=a.length-c.length,h=c.slice(n.length);(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}}return s}var N=a=>y.includes(a)?a:"@",G=R(a=>{let e=[],s=async r=>await x({requester:async()=>await O(a.portal,r,{num:3}),key:"items",id:r}),n=async r=>await x({requester:async()=>await U(a.portal,{query:`title:${r}`,num:3}),key:"groups",id:r}),i=F(async(r,t)=>{a.isFetchingEntities=!0;let o=r.toLowerCase();switch(N(t)){case"@":let m=10;a.filteredItemsInfo={type:"user",items:e.filter(h=>h.username?.toLowerCase().includes(o)||h.fullName?.toLowerCase().includes(o)).slice(0,m)};break;case"#":let{result:c}=await s(o);a.filteredItemsInfo={type:"item",items:c?.results??[]};break;case"$":let{results:l}=await n(o);a.filteredItemsInfo={type:"group",items:l};break}(a.filteredItemsInfo?.items?.length??0)===0&&await a.closePopover(),a.isFetchingEntities=!1},V);return{fetchUsers:async()=>{try{let{users:r}=await _(a.portal);e=r??[]}catch(r){e=[],console.error("error fetching org users:",r)}},filterItems:i,getItemText:(r,t)=>{let o="";switch(N(t)){case"@":o=r.username;break;case"#":o=r.title??"";break;case"$":o=r.title??"";break}return o.trim()}}}),$=({id:a,label:e,selected:s,description:n,contentStart:i,onSelect:r})=>q(a,d`<calcite-list-item class=${v({selected:s})} .label=${e} .description=${n} .selected=${s} @pointerdown=${async t=>{t.preventDefault(),t.stopPropagation(),await r()}} ${g(t=>{s&&t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${i}</calcite-list-item>`),j=k`.selected{--calcite-list-background-color: var(--calcite-color-foreground-2)}.mentionable-list{max-height:13rem;overflow-y:auto;padding:.25rem;width:min(100vw,24rem)}.mentionable-list--loading{min-height:10rem}`,w=class extends D{constructor(){super(...arguments),this.calciteTextAreaRef=P(),this.mentionableEntityController=G(this),this.handleInput=e=>{let{bubbleNewValueChange:s,checkForMention:n}=this,i=e.target.value;this._value=i,s(this._value);let r=this.nativeTextAreaRef?.selectionStart??0;n(i,r)},this.handleKeyDown=e=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(e),this.arcgisMentionableTextAreaKeyDown.emit(e);return}switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":e.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":e.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":e.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=e=>{this.arcgisUserMentionableTextAreaChange.emit(e),this.arcgisMentionableTextAreaChange.emit(e)},this.checkForMention=(e,s)=>{let n=e.substring(0,s),i=Q(n,this.starters??y);if(i){let{starter:r}=i;this.currentStarter=r,this.filterMentionItems(i),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=e=>{let{mentionText:s,query:n,starter:i,startIndex:r}=e;this.currentMentionQuery=s,this.mentionStartPosition=r;let t=n.toLowerCase();this.mentionableEntityController.filterItems(t,i),this.selectedItemIndex=0},this.popoverOpen=!1,this.currentMentionQuery="",this.mentionStartPosition=0,this.selectedItemIndex=0,this.currentStarter=null,this._value="",this.filteredItemsInfo=null,this.isFetchingEntities=!1,this.popoverPlacement="bottom-start",this.disabled=!1,this.scale="m",this.rows=3,this.starters=y,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=u(),this.arcgisMentionableTextAreaChange=u(),this.arcgisMentionableTextAreaKeyDown=u(),this.arcgisUserMentionableTextAreaChange=u(),this.arcgisUserMentionableTextAreaKeyDown=u(),this.renderItemInfo=()=>{let{filteredItemsInfo:e,selectedItemIndex:s,portal:n}=this;if(!e)return null;let{items:i,type:r}=e;switch(r){case"user":return i.map((t,o)=>$({id:t.id,label:`@${t.username}`,description:t.fullName,selected:o===s,contentStart:d`<arcgis-portal-user-avatar slot=content-start .user=${t} .portal=${n} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(t)}));case"item":return i.map((t,o)=>$({id:t.id??`item-${o}`,label:`#${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return i.map((t,o)=>$({id:t.id??`group-${o}`,label:`${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}))}}}static{this.properties={popoverOpen:16,currentMentionQuery:16,mentionStartPosition:16,selectedItemIndex:16,currentStarter:16,_value:16,filteredItemsInfo:16,isFetchingEntities:16,popoverListLabel:1,popoverPlacement:1,disabled:5,portal:0,user:0,scale:1,value:1,maxLength:9,rows:9,starters:0,placeholder:1,readOnly:5}}static{this.styles=j}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(e){let{currentStarter:s,_value:n,mentionStartPosition:i,currentMentionQuery:r,handleClosePopover:t,calciteTextAreaRef:o,nativeTextAreaRef:m,bubbleNewValueChange:c}=this;if(!e||!s)return;let l=this.mentionableEntityController.getItemText(e,s).replaceAll('"',"").trim(),h=/\s/u.test(l)?`${s}"${l}"`:`${s}${l}`,f=(n??"").substring(0,i),p=(n??"").substring(i+r.length),I=`${f}${h} ${p}`;this._value=I,c(this._value);let b=i+h.length+1;t(),await this.updateComplete,o.value?.setFocus(),m&&(m.selectionEnd=b)}willUpdate(e){e.has("value")&&(this._value=this.value??""),e.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let e=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");e&&(this.nativeTextAreaRef=e)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:e,scale:s,_value:n,maxLength:i,rows:r,placeholder:t,readOnly:o,popoverOpen:m,closePopover:c,handleInput:l,handleKeyDown:h,disabled:f,isFetchingEntities:p,filteredItemsInfo:I,renderItemInfo:b,popoverListLabel:T}=this,C=this.calciteTextAreaRef.value,K=I?.items??[];return d`<calcite-text-area .placeholder=${t} .value=${n} .maxLength=${i} .rows=${r} .scale=${s} .readOnly=${o} .disabled=${f} @blur=${c} @calciteTextAreaInput=${l} @keydown=${h} ${g(this.calciteTextAreaRef)}></calcite-text-area>${C&&d`<calcite-popover .open=${m} .placement=${e} class="mention-popover" .label=${T} .referenceElement=${C} trigger-disabled pointer-disabled focus-trap-disabled><div class=${v({"mentionable-list":!0,"mentionable-list--loading":p})}>${p&&d`<calcite-scrim .loading=${p}></calcite-scrim>`||""}${K.length>0&&d`<calcite-list .label=${T}>${b()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};L("arcgis-portal-mentionable-text-area",w);return w},a,b)
2
+ import b from"./UPEVTVNZ.js";import a from"./RNLVNDGG.js";import"./5VSDGPHH.js";import{c as R}from"./KEKBRUUC.js";import{A as M,B as S,E,H as P,I as g,J as D,K as v,P as L,h as k,j as d,l as A,v as u}from"./DHHSKOUY.js";import"./YIMNOUTF.js";export default $arcgis.t(([{a:O,c:U},{a:x,d:_}])=>{var F=(a,e=100)=>{let s;return(...n)=>{let i=()=>{clearTimeout(s),a(...n)};clearTimeout(s),s=setTimeout(i,e)}};var q=M(class extends S{constructor(){super(...arguments),this.key=A}render(a,e){return this.key=a,e}update(a,[e,s]){return e!==this.key&&(E(a),this.key=e),s}});var y=["@","#","$"],V=400;function Q(a,e){let s=null;for(let n of e){let i=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new RegExp(`${i}"([^"\\n]*)"?$`,"u"),t=a.match(r);if(t){let c=t[0],l=a.length-c.length,h=t[1]??"";(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}let o=new RegExp(`${i}[\\p{L}\\p{N}_-]+$`,"u"),m=a.match(o);if(m){let c=m[0],l=a.length-c.length,h=c.slice(n.length);(!s||l>s.startIndex)&&(s={starter:n,mentionText:c,query:h,startIndex:l})}}return s}var N=a=>y.includes(a)?a:"@",G=R(a=>{let e=[],s=async r=>await x({requester:async()=>await O(a.portal,r,{num:3}),key:"items",id:r}),n=async r=>await x({requester:async()=>await U(a.portal,{query:`title:${r}`,num:3}),key:"groups",id:r}),i=F(async(r,t)=>{a.isFetchingEntities=!0;let o=r.toLowerCase();switch(N(t)){case"@":let m=10;a.filteredItemsInfo={type:"user",items:e.filter(h=>h.username?.toLowerCase().includes(o)||h.fullName?.toLowerCase().includes(o)).slice(0,m)};break;case"#":let{result:c}=await s(o);a.filteredItemsInfo={type:"item",items:c?.results??[]};break;case"$":let{results:l}=await n(o);a.filteredItemsInfo={type:"group",items:l};break}(a.filteredItemsInfo?.items?.length??0)===0&&await a.closePopover(),a.isFetchingEntities=!1},V);return{fetchUsers:async()=>{try{let{users:r}=await _(a.portal);e=r??[]}catch(r){e=[],console.error("error fetching org users:",r)}},filterItems:i,getItemText:(r,t)=>{let o="";switch(N(t)){case"@":o=r.username;break;case"#":o=r.title??"";break;case"$":o=r.title??"";break}return o.trim()}}}),$=({id:a,label:e,selected:s,description:n,contentStart:i,onSelect:r})=>q(a,d`<calcite-list-item class=${v({selected:s})} .label=${e} .description=${n} .selected=${s} @pointerdown=${async t=>{t.preventDefault(),t.stopPropagation(),await r()}} ${g(t=>{s&&t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})})}>${i}</calcite-list-item>`),j=k`.selected{--calcite-list-background-color: var(--calcite-color-foreground-2)}.mentionable-list{max-height:13rem;overflow-y:auto;padding:.25rem;width:min(100vw,24rem)}.mentionable-list--loading{min-height:10rem}`,w=class extends D{constructor(){super(...arguments),this.calciteTextAreaRef=P(),this.mentionableEntityController=G(this),this.handleInput=e=>{let{bubbleNewValueChange:s,checkForMention:n}=this,i=e.target.value;this._value=i,s(this._value);let r=this.nativeTextAreaRef?.selectionStart??0;n(i,r)},this.handleKeyDown=e=>{if(!this.popoverOpen){this.arcgisUserMentionableTextAreaKeyDown.emit(e),this.arcgisMentionableTextAreaKeyDown.emit(e);return}switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedItemIndex=Math.min(this.selectedItemIndex+1,this.filteredItems.length-1);break;case"ArrowUp":e.preventDefault(),this.selectedItemIndex=Math.max(this.selectedItemIndex-1,0);break;case"Enter":e.preventDefault(),this.selectItem(this.filteredItems[this.selectedItemIndex]);break;case"Escape":e.preventDefault(),this.closePopover.bind(this)();break}},this.handleClosePopover=()=>{this.popoverOpen=!1,this.currentMentionQuery="",this.selectedItemIndex=0,this.currentStarter=null},this.bubbleNewValueChange=e=>{this.arcgisUserMentionableTextAreaChange.emit(e),this.arcgisMentionableTextAreaChange.emit(e)},this.checkForMention=(e,s)=>{let n=e.substring(0,s),i=Q(n,this.starters??y);if(i){let{starter:r}=i;this.currentStarter=r,this.filterMentionItems(i),this.popoverOpen=!0;return}this.handleClosePopover()},this.filterMentionItems=e=>{let{mentionText:s,query:n,starter:i,startIndex:r}=e;this.currentMentionQuery=s,this.mentionStartPosition=r;let t=n.toLowerCase();this.mentionableEntityController.filterItems(t,i),this.selectedItemIndex=0},this.popoverOpen=!1,this.currentMentionQuery="",this.mentionStartPosition=0,this.selectedItemIndex=0,this.currentStarter=null,this._value="",this.filteredItemsInfo=null,this.isFetchingEntities=!1,this.popoverPlacement="bottom-start",this.disabled=!1,this.scale="m",this.rows=3,this.starters=y,this.readOnly=!1,this.arcgisMentionableSelectedIndexChange=u(),this.arcgisMentionableTextAreaChange=u(),this.arcgisMentionableTextAreaKeyDown=u(),this.arcgisUserMentionableTextAreaChange=u(),this.arcgisUserMentionableTextAreaKeyDown=u(),this.renderItemInfo=()=>{let{filteredItemsInfo:e,selectedItemIndex:s,portal:n}=this;if(!e)return null;let{items:i,type:r}=e;switch(r){case"user":return i.map((t,o)=>$({id:t.id,label:`@${t.username}`,description:t.fullName,selected:o===s,contentStart:d`<arcgis-portal-user-avatar slot=content-start .user=${t} .portal=${n} scale=m></arcgis-portal-user-avatar>`,onSelect:async()=>await this.selectItem(t)}));case"item":return i.map((t,o)=>$({id:t.id??`item-${o}`,label:`#${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}));case"group":return i.map((t,o)=>$({id:t.id??`group-${o}`,label:`${t.title}`,description:t.id??void 0,selected:o===s,onSelect:async()=>await this.selectItem(t),contentStart:d`<calcite-avatar slot=content-start .fullName=${t.title??void 0} .thumbnail=${t.thumbnailUrl??void 0} scale=m></calcite-avatar>`}))}}}static{this.properties={popoverOpen:16,currentMentionQuery:16,mentionStartPosition:16,selectedItemIndex:16,currentStarter:16,_value:16,filteredItemsInfo:16,isFetchingEntities:16,popoverListLabel:1,popoverPlacement:1,disabled:5,portal:0,user:0,scale:1,value:1,maxLength:9,rows:9,starters:0,placeholder:1,readOnly:5}}static{this.styles=j}get filteredItems(){return this.filteredItemsInfo?.items??[]}async closePopover(){this.handleClosePopover()}async focusTextArea(){await this.calciteTextAreaRef.value?.setFocus()}async selectItem(e){let{currentStarter:s,_value:n,mentionStartPosition:i,currentMentionQuery:r,handleClosePopover:t,calciteTextAreaRef:o,nativeTextAreaRef:m,bubbleNewValueChange:c}=this;if(!e||!s)return;let l=this.mentionableEntityController.getItemText(e,s).replaceAll('"',"").trim(),h=/\s/u.test(l)?`${s}"${l}"`:`${s}${l}`,f=(n??"").substring(0,i),p=(n??"").substring(i+r.length),I=`${f}${h} ${p}`;this._value=I,c(this._value);let b=i+h.length+1;t(),await this.updateComplete,o.value?.setFocus(),m&&(m.selectionEnd=b)}willUpdate(e){e.has("value")&&(this._value=this.value??""),e.has("selectedItemIndex")&&this.arcgisMentionableSelectedIndexChange.emit(this.selectedItemIndex)}loaded(){this.updateComplete.then(()=>{let e=this.calciteTextAreaRef.value?.shadowRoot?.querySelector("textarea");e&&(this.nativeTextAreaRef=e)}),this.mentionableEntityController.fetchUsers()}render(){let{popoverPlacement:e,scale:s,_value:n,maxLength:i,rows:r,placeholder:t,readOnly:o,popoverOpen:m,closePopover:c,handleInput:l,handleKeyDown:h,disabled:f,isFetchingEntities:p,filteredItemsInfo:I,renderItemInfo:b,popoverListLabel:T}=this,C=this.calciteTextAreaRef.value,K=I?.items??[];return d`<calcite-text-area .placeholder=${t} .value=${n} .maxLength=${i} .rows=${r} .scale=${s} .readOnly=${o} .disabled=${f} @blur=${c} @calciteTextAreaInput=${l} @keydown=${h} ${g(this.calciteTextAreaRef)}></calcite-text-area>${C&&d`<calcite-popover .open=${m} .placement=${e} class="mention-popover" .label=${T} .referenceElement=${C} trigger-disabled pointer-disabled focus-trap-disabled><div class=${v({"mentionable-list":!0,"mentionable-list--loading":p})}>${p&&d`<calcite-scrim .loading=${p}></calcite-scrim>`||""}${K.length>0&&d`<calcite-list .label=${T}>${b()}</calcite-list>`||""}</div></calcite-popover>`||""}`}};L("arcgis-portal-mentionable-text-area",w);return w},a,b)
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as z}from"./35SKVD6F.js";import a from"./UPEVTVNZ.js";import{a as x}from"./5VSDGPHH.js";import{a as L}from"./DFTUMKSN.js";import{a as B}from"./LQ3DMZ3K.js";import"./KEKBRUUC.js";import{H as y,I as U,J as A,K as I,L as R,P as N,h as P,j as u,v as k}from"./DHHSKOUY.js";import"./YIMNOUTF.js";export default $arcgis.t(([{a:w,b:v,c:_}])=>{function q(e){let r=/(https?:\/\/[^\s]+)/gu;return e?.replace(r,t=>`<a href="${t}" target="_blank">${t}</a>`)}function S(e){return e?.replace(/(?:\r)/gu,"&#10;").replace(/(?:\n)/gu,"&#13;")}function E(e){return e?.replace(/(?:&#10;)/gu,"\r").replace(/(?:&#13;)/gu,`
3
+ `)}function F(e){return e?.replace(/&#10;&#13;|&#10;|&#13;|\r\n|\r|\n/gu,"<br>")}function H(e){return F(S(q(E(e))))}function G(e){return e?.endsWith("/")?e.slice(0,e.length-1):e}var J=P`:host{display:flex}.button{display:flex;align-items:center;max-width:100%;cursor:pointer;white-space:normal;border-style:none;padding:0;font-size:.75rem;color:var(--calcite-color-text-2);outline:2px solid transparent;outline-offset:2px;transition-property:all;outline-color:transparent;background:transparent;font-family:inherit;line-height:1.5;&:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px}}.button--outline{box-sizing:border-box;width:100%;padding:.5rem .75rem;transition-property:all;border:1px solid var(--calcite-color-border-3);&:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}}.name{overflow:hidden;white-space:nowrap;margin-inline-start:.5rem;text-overflow:ellipsis}.popover__wrapper{background-color:var(--calcite-color-foreground-1);width:min(32rem,80vw)}.popover__header{padding:1.25rem 1rem}.popover__avatar{max-width:100%}.popover__content{padding:.5rem 1rem 1.25rem}.popover__description{margin:0;overflow:auto;padding:0;padding-bottom:1rem;font-size:.875rem;color:var(--calcite-color-text-2);max-height:21.25rem}.popover__fade{position:relative;z-index:10;margin-bottom:.25rem;display:block;height:1rem;width:100%;background:linear-gradient(to bottom,transparent,var(--calcite-color-foreground-1) 100%);margin-top:-1rem}.popover__buttons{display:grid;grid-auto-flow:column;grid-gap:.5rem}.popover__buttons--no-description{padding-top:1rem}.popover__button{min-width:0px}.popover__loader{--calcite-loader-padding: 0}`;function M(e){return new L().sanitize(e)}function D(e){let r=M(e),t=document.createElement("div");return t.innerHTML=r,t.textContent||t.innerText||""}async function K(e,r,t,a,o){let s=e.portal?.portalHostname||a?.portalHostname||a?.restUrl?.replace("/sharing/rest",""),n=o?`https://www.arcgis.com/sharing/rest/portals/${r}`:`https://${s}/sharing/rest/portals/${r}`;if(!s&&!o)return null;let i=o?{disableIdentityLookup:!0,addTokenManually:!1}:{},l=await v({url:n,portal:a,options:i}),{urlKey:p,thumbnail:h,customBaseUrl:c}=l,f=`https://${p}.${c}/`,d=h?`${f}sharing/rest/portals/self/resources/${h}`:null,m="",$="";try{let g=await v({url:`${n}/resources/localizedOrgProperties`,portal:a,params:{start:1,num:100},options:i});if(g){let b=g[t]||g.default;m=b.name,$=b.description}}catch{}return{name:m||l.name,description:D($||l.description),url:`${f}home/`,thumbnail:d}}async function W(e,r,t,a){let o=e.sourceJSON?.orgId??e.portal?.id??t?.id;return await w({requester:async()=>await K(e,o,r,t,a),key:"verified",id:o})}var T=e=>e?.sourceJSON?.contentStatus==="public_authoritative";async function j(e,r,t,a){if(T(e)){let o=e.owner||"",s=await W(e,t,r,a);if(!s)return await _(o,r,a);let{description:n,name:i,thumbnail:l,url:p}=s;return{description:n?M(n):"",fullName:i,username:o,thumbnail:l,id:e.portal.id,url:p}}return await _(e.owner||"",r,a)}async function V(e,r,t){let a=t?"https://www.arcgis.com/sharing/rest/":x(r),o=t?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await w({requester:async()=>await v({url:`${a}community/groups`,portal:r,params:{q:`(owner:"${e}")`,num:100},options:o}),key:"userGroups",id:e})}async function X(e,r,t){let a=t?"https://www.arcgis.com/sharing/rest/":x(r),o=t?{disableIdentityLookup:!0,addTokenManually:!1}:{};return await w({requester:async()=>(await v({url:`${a}search`,portal:r,params:{q:`(owner:"${e}") -typekeywords:"recyclebin"`,num:1},options:o})).total,key:"userItemsTotal",id:e})}function C({baseUrl:e,user:r,type:t}){let a=G(e),o=encodeURIComponent(r.username||"");return o?`${a}/${t}.html?user=${o}`:`${a}/${t}.html`}var O=class extends A{constructor(){super(...arguments),this.messages=B({blocking:!0}),this.buttonRef=y(),this.popoverRef=y(),this.isPopoverOpen=!1,this.scale="m",this.showAvatar=!0,this.showName=!0,this.showUsername=!1,this.appearance="transparent",this.arcgisUserPopupInternalUIAction=k(),this.arcgisUserPopupClose=k()}static{this.properties={itemUserInfo:16,groups:16,total:16,isPopoverOpen:16,user:0,username:1,fullName:1,item:0,scale:3,portal:0,baseUrl:1,underline:5,showAvatar:5,showName:5,showUsername:5,wrap:5,appearance:1,zIndex:9,avatarAriaHidden:5,checkOnline:5}}static{this.styles=J}async setFocus(){this.buttonRef.value?.focus()}async openPopup(){this.buttonRef.value?.click()}connectedCallback(){super.connectedCallback(),this.init()}updated(r){r.has("isPopoverOpen")&&this.isPopoverOpen&&this.setPopoverOpen(!0)}get resolvedBaseUrl(){return this.baseUrl||`${this.portal.url}/home`}async init(){let{item:r,username:t,portal:a,fullName:o,messages:s}=this;if(!(!s._lang||!a)){if(r){this.itemUserInfo=await j(r,a,s._lang,this.checkOnline);return}if(t){let n=await _(t,a,this.checkOnline);!n.fullName&&o&&(n.fullName=o),this.itemUserInfo=n}}}async fetchItemsAndGroups(){let{user:r,itemUserInfo:t,item:a,portal:o,username:s,checkOnline:n}=this,i=s||r?.username||a?.owner||t?.username;if(!(!i||!o)){if(!this.groups){let l=await V(i,o,n);this.groups=l}this.total=await X(i,o,n)}}setPopoverOpen(r){requestAnimationFrame(()=>{this.popoverRef.value&&(this.popoverRef.value.open=r)})}openLink(r,t){r.preventDefault(),window.open(t,"_blank")}renderOrgButtons(r){let{messages:t}=this,a=(r.url||this.resolvedBaseUrl).replace(/\/$/u,"");return u`<calcite-button appearance=outline-fill kind=neutral .href=${a} target=_blank @click=${o=>this.openLink(o,a)}>${t.homepage}</calcite-button><calcite-button appearance=outline-fill kind=neutral .href=${`${a}/gallery.html`} target=_blank @click=${o=>this.openLink(o,`${a}/gallery.html`)}>${t.gallery}</calcite-button>`}renderUserButtons(r){let{total:t,groups:a,messages:o}=this,s=r.username||"";if(typeof t!="number"||!a)return u`<calcite-loader .label=${o.loadingUserInformation} scale=s class="popover__loader"></calcite-loader>`;let n=C({baseUrl:this.resolvedBaseUrl,user:{username:s},type:"groups"}),i=C({baseUrl:this.resolvedBaseUrl,user:{username:s},type:"content"}),l=`${this.resolvedBaseUrl.replace(/\/$/u,"")}/user.html?user=${encodeURIComponent(s)}`;return u`${!!a.total&&u`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${n} target=_blank @click=${p=>{this.openLink(p,n),this.arcgisUserPopupInternalUIAction.emit({category:"profile popup",action:"view all groups"})}}>${o.groups.replace("${number}",new Intl.NumberFormat(o._lang).format(a.total))}</calcite-button>`||""}${!!t&&u`<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${i} target=_blank @click=${p=>{this.openLink(p,i),this.arcgisUserPopupInternalUIAction.emit({category:"profile popup",action:"view all content"})}}>${o.items.replace("${number}",new Intl.NumberFormat(o._lang).format(t))}</calcite-button>`||""}<calcite-button class="popover__button" appearance=outline-fill kind=neutral .href=${l} target=_blank @click=${p=>{this.openLink(p,l),this.arcgisUserPopupInternalUIAction.emit({category:"profile popup",action:"view profile"})}}>${o.profile}</calcite-button>`}render(){let{user:r,itemUserInfo:t,portal:a,item:o,appearance:s,scale:n,isPopoverOpen:i,showName:l,showUsername:p,messages:h}=this,c=r||t;if(!h._lang||!c)return u`<arcgis-portal-user-avatar scale=s show-name .checkOnline=${this.checkOnline}></arcgis-portal-user-avatar>`;let f=T(o),d=c.username||"",m=H(c.description||"")||"",$=z(c,h._lang),g=f?h.itemManagedBy.replace("${username}",d):d;return u`<button class=${I({button:!0,"button--outline":s==="outline"})} @click=${()=>{this.isPopoverOpen||(this.isPopoverOpen=!0),this.fetchItemsAndGroups()}} ${U(this.buttonRef)}><slot><arcgis-portal-user-avatar .user=${c} .scale=${n} .portal=${a} .showName=${l} .description=${p?d:""} .hideAvatar=${!this.showAvatar} .underline=${this.underline} .checkOnline=${this.checkOnline} .wrap=${this.wrap}></arcgis-portal-user-avatar></slot></button>${i&&this.buttonRef.value&&c&&u`<calcite-popover class="popover" .label=${$} pointer-disabled .referenceElement=${this.buttonRef.value} placement=auto .id=${`${d}-popover`} auto-close style=${R({"--calcite-popover-z-index":this.zIndex?.toString()||"12"})} @calcitePopoverOpen=${()=>{this.arcgisUserPopupInternalUIAction.emit({category:"profile popup",action:"open profile popup"})}} @calcitePopoverClose=${()=>{this.isPopoverOpen=!1,this.arcgisUserPopupClose.emit()}} @keydown=${b=>{b.key==="Escape"&&setTimeout(()=>{this.buttonRef.value?.focus()},200)}} ${U(this.popoverRef)}><div class="popover__wrapper"><div class="popover__header"><arcgis-portal-user-avatar class="popover__avatar" .user=${c} scale=l .portal=${a} show-name .description=${g} .checkOnline=${this.checkOnline}></arcgis-portal-user-avatar></div><div class="popover__content">${!!m&&u`<p class="popover__description">${m}</p>`||""}${!!m&&u`<div class="popover__fade"></div>`||""}<div class=${I({popover__buttons:!0,"popover__buttons--no-description":!m})}>${f?this.renderOrgButtons(c):this.renderUserButtons(c)}</div></div></div></calcite-popover>`||""}`}};N("arcgis-portal-user-popup",O);return O},a)
@@ -0,0 +1 @@
1
+ {"expand":"Expand","showLess":"Show less","homepage":"Home page","gallery":"Gallery","profile":"Profile","groups":"Groups (${number})","items":"Items (${number})","viewAll":"View all","loadingUserInformation":"Loading user information","itemManagedBy":"Item managed by: ${username}"}
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{O as t,y as e}from"./DHHSKOUY.js";import"./YIMNOUTF.js";var a=e(t,{"arcgis-portal-ai-assistant":[()=>import("./N6G6Z7BF.js"),"autoDestroyDisabled,config:,defaultClosed,portal:,t9n:,user:"],"arcgis-portal-ai-assistant-interrupt":[()=>import("./SM4GWLRA.js"),"_messages:,message,options:,type"],"arcgis-portal-classification-banner":[()=>import("./YMPTDKT6.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./BEHLBKKM.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./JNRN6DTV.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./G47ZZQYL.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./GHQ3ZW4U.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./K3HS2LQ7.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./YG5YYL6X.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-item-type":[()=>import("./TMYTUOSS.js"),"ellipsis,hideIcon,hideText,item:,messages:,portal:,scale,serviceInfo:,showHosted,user:"],"arcgis-portal-mentionable-text-area":[()=>import("./CI5ENGVT.js"),"disabled,maxLength,placeholder,popoverListLabel,popoverPlacement,portal:,readOnly,rows,scale,starters:,user:,value;closePopover,focusTextArea,selectItem"],"arcgis-portal-replacement-item-redirect":[()=>import("./GNOZCQ34.js"),"itemId,messages:,portal:,user:;setFocus"],"arcgis-portal-user-avatar":[()=>import("./5DPWJ7DI.js"),"checkOnline,description,heading,hideAvatar,messages:,portal:,scale,showName,underline,user:,username,wrap"],"arcgis-portal-voice-input":[()=>import("./ZTHTFEYA.js"),"language;clearText,startListening,stopListening"]});a({resourcesUrl:import.meta.url});var s=new CSSStyleSheet;s.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-voice-input){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,s];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,t)
2
+ import{O as a,y as e}from"./DHHSKOUY.js";import"./YIMNOUTF.js";var t=e(a,{"arcgis-portal-ai-assistant":[()=>import("./T25WZ6OL.js"),"autoDestroyDisabled,config:,defaultClosed,portal:,t9n:,user:"],"arcgis-portal-ai-assistant-interrupt":[()=>import("./G6QT6MYP.js"),"_messages:,message,options:,type"],"arcgis-portal-classification-banner":[()=>import("./YMPTDKT6.js"),"autoDestroyDisabled,messages:,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],"arcgis-portal-classification-config":[()=>import("./BEHLBKKM.js"),"autoDestroyDisabled,messages:,portalItem:,status,valid,values;destroy,resetForm,validateForm"],"arcgis-portal-classification-favorite":[()=>import("./JNRN6DTV.js"),"attributeExpressionResults:,classificationValue:,favoriteClassifications:,messages:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],"arcgis-portal-classification-form-element":[()=>import("./G47ZZQYL.js"),"attribute:,attributeKey,isRequiredErrors:,messages:,renderingInfo:,value:"],"arcgis-portal-extent-picker":[()=>import("./GHQ3ZW4U.js"),"active,contentOnly,extentService,extentValue:,isArea,itemId,messages:,portal:;;getExtent"],"arcgis-portal-extent-picker-coord-field":[()=>import("./K3HS2LQ7.js"),"errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],"arcgis-portal-field-delete":[()=>import("./YG5YYL6X.js"),"config:,fieldNames:,layer:,mapView:,messages:,options:"],"arcgis-portal-item-type":[()=>import("./TMYTUOSS.js"),"ellipsis,hideIcon,hideText,item:,messages:,portal:,scale,serviceInfo:,showHosted,user:"],"arcgis-portal-mentionable-text-area":[()=>import("./X5NBQPTM.js"),"disabled,maxLength,placeholder,popoverListLabel,popoverPlacement,portal:,readOnly,rows,scale,starters:,user:,value;closePopover,focusTextArea,selectItem"],"arcgis-portal-replacement-item-redirect":[()=>import("./L3BQK62N.js"),"itemId,messages:,portal:,user:;setFocus"],"arcgis-portal-user-avatar":[()=>import("./MX3F5ZCL.js"),"checkOnline,description,heading,hideAvatar,messages:,portal:,scale,showName,underline,user:,username,wrap"],"arcgis-portal-user-popup":[()=>import("./YVJRXWM3.js"),"appearance,avatarAriaHidden,baseUrl,checkOnline,fullName,item:,messages:,portal:,scale,showAvatar,showName,showUsername,underline,user:,username,wrap,zIndex;openPopup,setFocus"],"arcgis-portal-voice-input":[()=>import("./ZTHTFEYA.js"),"language;clearText,startListening,stopListening"]});t({resourcesUrl:import.meta.url});var s=new CSSStyleSheet;s.replaceSync("@layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-user-popup,arcgis-portal-voice-input){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,s];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
package/dist/cdn/main.css CHANGED
@@ -1 +1 @@
1
- @layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-voice-input){visibility:hidden}}
1
+ @layer{:not([hydrated]):is(arcgis-portal-ai-assistant,arcgis-portal-ai-assistant-interrupt,arcgis-portal-classification-banner,arcgis-portal-classification-config,arcgis-portal-classification-favorite,arcgis-portal-classification-form-element,arcgis-portal-extent-picker,arcgis-portal-field-delete,arcgis-portal-item-type,arcgis-portal-mentionable-text-area,arcgis-portal-replacement-item-redirect,arcgis-portal-user-avatar,arcgis-portal-user-popup,arcgis-portal-voice-input){visibility:hidden}}
@@ -3,28 +3,28 @@ import { i as C, a as b, g as w } from "./portal.js";
3
3
  import E from "@arcgis/core/identity/IdentityManager.js";
4
4
  import A from "@arcgis/core/request.js";
5
5
  const u = {}, f = {}, l = {};
6
- async function p({ requester: t, key: e, id: n, cacheOption: s }) {
7
- const r = l[e]?.[n]?.expireAt, i = !!r && (/* @__PURE__ */ new Date()).getTime() > r;
8
- if (u[e]?.[n] && !i)
9
- return u[e][n];
10
- f[e] || (f[e] = {}), (!f[e][n] || i) && (f[e][n] = t());
11
- const o = await f[e][n];
12
- if (u[e] || (u[e] = {}), l[e] || (l[e] = {}), u[e][n] = o, s) {
13
- const { expireAfter: a, getExpireAfterFromResult: c } = s, h = c || a ? (/* @__PURE__ */ new Date()).getTime() + (c?.(o) ?? a ?? 0) : null;
14
- l[e][n] = { ...l[e][n], expireAt: h };
6
+ async function p({ requester: t, key: e, id: s, cacheOption: n }) {
7
+ const r = l[e]?.[s]?.expireAt, i = !!r && (/* @__PURE__ */ new Date()).getTime() > r;
8
+ if (u[e]?.[s] && !i)
9
+ return u[e][s];
10
+ f[e] || (f[e] = {}), (!f[e][s] || i) && (f[e][s] = t());
11
+ const o = await f[e][s];
12
+ if (u[e] || (u[e] = {}), l[e] || (l[e] = {}), u[e][s] = o, n) {
13
+ const { expireAfter: a, getExpireAfterFromResult: c } = n, h = c || a ? (/* @__PURE__ */ new Date()).getTime() + (c?.(o) ?? a ?? 0) : null;
14
+ l[e][s] = { ...l[e][s], expireAt: h };
15
15
  }
16
16
  return o;
17
17
  }
18
18
  async function x({
19
19
  url: t,
20
20
  portal: e,
21
- params: n = {},
22
- options: s = {},
21
+ params: s = {},
22
+ options: n = {},
23
23
  method: r,
24
24
  abortControllerId: i,
25
25
  excludeJson: o
26
26
  }) {
27
- const a = R(i)?.signal, { customToken: c, addTokenManually: h, addSSL: P, useProxy: S } = s, m = { ...n };
27
+ const a = R(i)?.signal, { customToken: c, addTokenManually: h, addSSL: P, useProxy: S } = n, m = { ...s };
28
28
  if (!t.includes("f=") && !o && (m.f = "json"), c)
29
29
  m.token = c;
30
30
  else if (h !== !1) {
@@ -34,10 +34,10 @@ async function x({
34
34
  const T = P ? U(t, e) : t, q = {
35
35
  query: m,
36
36
  method: r || "auto",
37
- ...s,
38
- timeout: s.timeout || 0,
37
+ ...n,
38
+ timeout: n.timeout || 0,
39
39
  useProxy: S,
40
- ...s?.disableIdentityLookup ? { authMode: "anonymous" } : {}
40
+ ...n?.disableIdentityLookup ? { authMode: "anonymous" } : {}
41
41
  }, y = await A(T, { signal: a, ...q });
42
42
  return i && (d[i] = void 0), y.data;
43
43
  }
@@ -50,24 +50,24 @@ const $ = async (t) => {
50
50
  const e = C(t);
51
51
  if (!t?.isPortal || !e)
52
52
  return b(t);
53
- const n = t?.user;
54
- if (!n && e)
53
+ const s = t?.user;
54
+ if (!s && e)
55
55
  return;
56
- const { token: s } = await p({
56
+ const { token: n } = await p({
57
57
  requester: async () => await L(t),
58
58
  key: "platformSelf",
59
- id: n?.id ?? t.id ?? "<unknown>",
59
+ id: s?.id ?? t.id ?? "<unknown>",
60
60
  cacheOption: { getExpireAfterFromResult: (r) => r.expires_in }
61
61
  });
62
- return s;
62
+ return n;
63
63
  }, L = async (t) => {
64
- const n = {
64
+ const s = {
65
65
  "X-Esri-Auth-Client-Id": await M(t),
66
66
  "X-Esri-Auth-Redirect-Uri": window.location.href.replace(/#.*$/u, "")
67
67
  };
68
68
  return (await A(`${w(t)}/oauth2/platformSelf`, {
69
69
  authMode: "no-prompt",
70
- headers: n,
70
+ headers: s,
71
71
  withCredentials: !0,
72
72
  method: "post"
73
73
  })).data;
@@ -79,8 +79,8 @@ const $ = async (t) => {
79
79
  function U(t, e) {
80
80
  return window.location.protocol === "https:" || e.allSSL ? t.replace("http:", "https:") : t;
81
81
  }
82
- async function B(t, e, n) {
83
- const r = `${n ? "https://www.arcgis.com/sharing/rest/" : w(e)}community/users/${t}`, i = r?.includes("www.arcgis.com") && e.isPortal, o = r?.includes(".arcgis.com") && !e.isPortal && !e.user, a = i || o ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
82
+ async function B(t, e, s) {
83
+ const r = `${s ? "https://www.arcgis.com/sharing/rest/" : w(e)}community/users/${t}`, i = r?.includes("www.arcgis.com") && e.isPortal, o = r?.includes(".arcgis.com") && !e.isPortal && !e.user, a = i || o ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
84
84
  return await p({
85
85
  requester: async () => {
86
86
  try {
@@ -109,5 +109,6 @@ const k = async (t) => {
109
109
  export {
110
110
  p as a,
111
111
  k as b,
112
- B as f
112
+ B as f,
113
+ x as r
113
114
  };
@@ -104,7 +104,7 @@ const W = K(
104
104
  userMessage: e,
105
105
  hasSummaryContext: String(a)
106
106
  }), c = await Q({
107
- model: await F("fast"),
107
+ model: await F({ modelTier: "fast" }),
108
108
  tools: [W],
109
109
  systemPrompt: r,
110
110
  responseFormat: gt,
@@ -675,7 +675,7 @@ const Yt = async (s, t) => {
675
675
  question: a,
676
676
  response: e
677
677
  }), c = await Q({
678
- model: await F("default"),
678
+ model: await F({ modelTier: "default" }),
679
679
  tools: [W, Ht],
680
680
  systemPrompt: r,
681
681
  responseFormat: j,
@@ -1,18 +1,18 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as l } from "../../chunks/runtime.js";
3
- import { css as o, html as n } from "lit";
4
- import { LitElement as u, createEvent as a } from "@arcgis/lumina";
2
+ import { c } from "../../chunks/runtime.js";
3
+ import { css as o, html as a } from "lit";
4
+ import { LitElement as u, createEvent as n } from "@arcgis/lumina";
5
5
  import m from "@esri/arcgis-html-sanitizer";
6
6
  import { unsafeHTML as p } from "lit/directives/unsafe-html.js";
7
7
  import { marked as r } from "marked";
8
8
  import { u as g } from "../../chunks/useT9n.js";
9
9
  import { a as d } from "../../chunks/functionalities.js";
10
- const h = o`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}// \`:where()\` to reset styles of common elements in the message content without increasing specificity .interrupt-message :where(p){margin:0}// \`:where()\` to reset styles of list elements and add consistent indentation for nested lists without increasing specificity .interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;
10
+ const h = o`.interrupt-container{display:flex;flex-direction:column;gap:.75rem}.interrupt-actions{display:flex;justify-content:flex-end;gap:.5rem}.interrupt-message{white-space:normal}.interrupt-message :where(p){margin:0}.interrupt-message :where(ul,ol){margin:0;padding-inline-start:1.25rem}`;
11
11
  r.use({ gfm: !0, breaks: !0, async: !1 });
12
12
  const f = new m();
13
13
  class b extends u {
14
14
  constructor() {
15
- super(...arguments), this.#t = [], this._messages = g({ blocking: !0 }), this.arcgisCancel = a(), this.arcgisSubmit = a();
15
+ super(...arguments), this.#t = [], this._messages = g({ blocking: !0 }), this.arcgisCancel = n(), this.arcgisSubmit = n();
16
16
  }
17
17
  static {
18
18
  this.properties = { type: 1, message: 1, options: 0 };
@@ -29,11 +29,11 @@ class b extends u {
29
29
  const { _messages: t, type: i, options: s } = this;
30
30
  switch (i) {
31
31
  case "single-select":
32
- return n`<calcite-list class="interrupt-list" .label=${t.singleSelectLabel} selection-mode=single-persist @calciteListChange=${(e) => this.#t = e.target.selectedItems[0]?.value}>${s?.map((e) => n`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
32
+ return a`<calcite-list class="interrupt-list" .label=${t.singleSelectLabel} selection-mode=single-persist @calciteListChange=${(e) => this.#t = e.target.selectedItems[0]?.value}>${s?.map((e) => a`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
33
33
  case "multi-select":
34
- return n`<calcite-list class="interrupt-list" .label=${t.multiSelectLabel} selection-mode=multiple @calciteListChange=${(e) => this.#t = e.target.selectedItems.map((c) => c.value)}>${s?.map((e) => n`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
34
+ return a`<calcite-list class="interrupt-list" .label=${t.multiSelectLabel} selection-mode=multiple @calciteListChange=${(e) => this.#t = e.target.selectedItems.map((l) => l.value)}>${s?.map((e) => a`<calcite-list-item .label=${e} .value=${e}></calcite-list-item>`)}</calcite-list>`;
35
35
  case "text-input":
36
- return n`<calcite-input class="interrupt-input" .label=${t.textInputLabel} @calciteInputInput=${(e) => this.#t = e.target.value}></calcite-input>`;
36
+ return a`<calcite-input class="interrupt-input" .label=${t.textInputLabel} @calciteInputInput=${(e) => this.#t = e.target.value}></calcite-input>`;
37
37
  case "boolean-choice":
38
38
  return null;
39
39
  default:
@@ -42,10 +42,10 @@ class b extends u {
42
42
  }
43
43
  render() {
44
44
  const { _messages: t, type: i } = this, s = i === "boolean-choice";
45
- return n`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s ? t.titleConfirm : t.titleInput}</div><div slot=message class="interrupt-message">${p(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${() => this.arcgisCancel.emit()}>${s ? t.cancelButton : t.skipButton}</calcite-button><calcite-button appearance=solid @click=${() => this.arcgisSubmit.emit(i === "boolean-choice" ? !0 : this.#t)}>${s ? t.confirmButton : t.submitButton}</calcite-button></div></div>`;
45
+ return a`<div class="interrupt-container"><calcite-notice open kind=neutral width=full><div slot=title>${s ? t.titleConfirm : t.titleInput}</div><div slot=message class="interrupt-message">${p(this._renderMessageContent())}</div></calcite-notice>${this._renderInterruptInput()}<div class="interrupt-actions"><calcite-button appearance=outline @click=${() => this.arcgisCancel.emit()}>${s ? t.cancelButton : t.skipButton}</calcite-button><calcite-button appearance=solid @click=${() => this.arcgisSubmit.emit(i === "boolean-choice" ? !0 : this.#t)}>${s ? t.confirmButton : t.submitButton}</calcite-button></div></div>`;
46
46
  }
47
47
  }
48
- l("arcgis-portal-ai-assistant-interrupt", b);
48
+ c("arcgis-portal-ai-assistant-interrupt", b);
49
49
  export {
50
50
  b as ArcgisPortalAiAssistantInterrupt
51
51
  };
@@ -0,0 +1,111 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type Portal from "@arcgis/core/portal/Portal.js";
3
+ import type PortalItem from "@arcgis/core/portal/PortalItem.js";
4
+ import type PortalUser from "@arcgis/core/portal/PortalUser.js";
5
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
+ import type { InternalUIAction } from "../../types/tracking.js";
7
+ import type { Scale } from "../../types/ui.js";
8
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
9
+
10
+ export abstract class ArcgisPortalUserPopup extends LitElement {
11
+ /**
12
+ * Choose outline for a full-width outlined button.
13
+ *
14
+ * @default "transparent"
15
+ */
16
+ accessor appearance: "outline" | "transparent";
17
+ /**
18
+ * Set to true to hide avatar from screen readers.
19
+ *
20
+ * @default false
21
+ */
22
+ accessor avatarAriaHidden: boolean | undefined;
23
+ /** Fully qualified path to portal home root. */
24
+ accessor baseUrl: string | undefined;
25
+ /**
26
+ * @default false
27
+ * @internal
28
+ */
29
+ accessor checkOnline: boolean | undefined;
30
+ /** Optional full name fallback if user information does not include it. */
31
+ accessor fullName: string | undefined;
32
+ /** Passing an item will show org info for publicly verified items, user info for standard items. */
33
+ accessor item: PortalItem | undefined;
34
+ /** @internal */
35
+ protected messages: {
36
+ expand: string;
37
+ showLess: string;
38
+ homepage: string;
39
+ gallery: string;
40
+ profile: string;
41
+ groups: string;
42
+ items: string;
43
+ viewAll: string;
44
+ loadingUserInformation: string;
45
+ itemManagedBy: string;
46
+ } & T9nMeta<{
47
+ expand: string;
48
+ showLess: string;
49
+ homepage: string;
50
+ gallery: string;
51
+ profile: string;
52
+ groups: string;
53
+ items: string;
54
+ viewAll: string;
55
+ loadingUserInformation: string;
56
+ itemManagedBy: string;
57
+ }>;
58
+ /** The current portal instance. */
59
+ accessor portal: Portal;
60
+ /**
61
+ * Scale of the component.
62
+ *
63
+ * @default "m"
64
+ */
65
+ accessor scale: Scale;
66
+ /**
67
+ * Set to false to hide the avatar and show username only.
68
+ *
69
+ * @default true
70
+ */
71
+ accessor showAvatar: boolean;
72
+ /**
73
+ * Set to false to show only the avatar.
74
+ *
75
+ * @default true
76
+ */
77
+ accessor showName: boolean;
78
+ /**
79
+ * Set to true to show username in description.
80
+ *
81
+ * @default false
82
+ */
83
+ accessor showUsername: boolean;
84
+ /**
85
+ * Set to true to underline the name.
86
+ *
87
+ * @default false
88
+ */
89
+ accessor underline: boolean | undefined;
90
+ /** Passing a user will always show thumbnail for that user (use either user or item). */
91
+ accessor user: PortalUser | undefined;
92
+ /** Passing a username will perform a fetch for the user information on load. */
93
+ accessor username: string | undefined;
94
+ /**
95
+ * Allow the name to wrap lines (max 2).
96
+ *
97
+ * @default false
98
+ */
99
+ accessor wrap: boolean | undefined;
100
+ /** The z-index of the popover. */
101
+ accessor zIndex: number | undefined;
102
+ openPopup(): Promise<void>;
103
+ setFocus(): Promise<void>;
104
+ readonly arcgisUserPopupClose: import("@arcgis/lumina").TargetedEvent<this, void>;
105
+ /** Fires on internal component interaction - used by telemetry. */
106
+ readonly arcgisUserPopupInternalUIAction: import("@arcgis/lumina").TargetedEvent<this, InternalUIAction>;
107
+ readonly "@eventTypes": {
108
+ arcgisUserPopupClose: ArcgisPortalUserPopup["arcgisUserPopupClose"]["detail"];
109
+ arcgisUserPopupInternalUIAction: ArcgisPortalUserPopup["arcgisUserPopupInternalUIAction"]["detail"];
110
+ };
111
+ }