// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("require ../chunks/tslib.es6 ../core/Collection ../core/deprecate ../core/Identifiable ../core/Logger ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../support/actions/actionUtils ./Widget ./BasemapLayerList/BasemapLayerListViewModel ./BasemapLayerList/BasemapLayerListVisibleElements ./BasemapLayerList/css ./LayerList/ListItem ./LayerList/support/layerListUtils ../chunks/componentsUtils ./support/globalCss ./support/Heading ./support/widgetUtils ./support/decorators/messageBundle ./support/decorators/vmEvent ./support/jsxFactory".split(" "), function(w,g,f,B,L,C,M,h,W,X,N,F,O,J,G,m,P,u,Q,D,R,Y,K,S,e){function H(a){return a?.getAttribute("data-basemap-layer-type")}const T=f.ofType(P);f=class extends L.IdentifiableMixin(O){constructor(a,b){super(a,b);this._activeItem=null;this._tooltipReferenceMap=new Map;this._editTitleInput=null;this._focusCatalogFlowItem=this._focusEditingFlowItem=this._focusPanelFlowItem=this._focusRootFlowItem=!1;this._selectedDragItemLayerUid=this._lastDragDetail=null;this._rootGroupUid=`basemap-${this.uid}`;this.catalogOptions= this.catalogLayerList=null;this.editingTitle=this.dragEnabled=this.collapsed=!1;this.referenceFilterText=this.baseFilterText=this.filterPlaceholder="";this.listItemCanReceiveFunction=this.listItemCanGiveFunction=null;this.headingLevel=2;this.messagesCommon=this.messages=null;this.minFilterItems=u.minFilterItems;this.openCatalogItem=null;this.selectedItems=new T;this.selectionMode="none";this.viewModel=new J;this.visibilityAppearance="default";this.visibleElements=new G;this._canMove=({dragEl:c,fromEl:d, toEl:k},l)=>{l="pull"===l?this.listItemCanGiveFunction:this.listItemCanReceiveFunction;c=u.getItem(c);if(!c?.sortable)return!1;var q=u.getItem(d),r=u.getLayerType(d),n=u.getItem(k),x=u.getLayerType(k);r=!!r&&!!x&&r===x;x={selected:c,from:q,to:n};d=d.group;k=k.group;q=q?.layer?.type??"";n=n?.layer?.type??"";const t=new Set(["map-image","catalog","knowledge-graph"]);return d&&k&&"function"===typeof l?l.call(null,x):r&&!t.has(q)&&!t.has(n)&&"sublayer"!==c?.layer?.type};this._clearActiveItem=()=>{this._activeItem= null};this._setActiveItem=c=>{"default"===this.visibilityAppearance&&(c=Array.from(c.composedPath()).find(d=>d.classList?.contains(m.css.item)),this._activeItem=u.getItem(c))};this._onCalciteListOrderChange=c=>{const {_lastDragDetail:d}=this,{toEl:k,fromEl:l,dragEl:q,newIndex:r}=c;l&&k&&(d?.newIndex!==r||d?.dragEl!==q||d?.toEl!==k||d?.fromEl!==l)&&(this._lastDragDetail=c,l===k?(c=Array.from(l.children).filter(n=>n?.matches("calcite-list-item")).map(n=>n.value),this._sortLayers(l,c)):this._moveLayerFromChildList({toEl:k, fromEl:l,dragEl:q,newIndex:r}))}}initialize(){this.addHandles([M.watch(()=>this.openCatalogItem,a=>a?this._createCatalog():this._destroyCatalog())])}normalizeCtorArgs(a){return null!=a?.editingEnabled&&null!=a.visibleElements?{...a,visibleElements:new G({...a.visibleElements,editTitleButton:a.editingEnabled})}:a}loadDependencies(){return Q.loadCalciteComponents({action:()=>new Promise((a,b)=>w(["../chunks/calcite-action"],a,b)),"action-group":()=>new Promise((a,b)=>w(["../chunks/calcite-action-group"], a,b)),"action-menu":()=>new Promise((a,b)=>w(["../chunks/calcite-action-menu"],a,b)),block:()=>new Promise((a,b)=>w(["../chunks/calcite-block"],a,b)),label:()=>new Promise((a,b)=>w(["../chunks/calcite-label"],a,b)),input:()=>new Promise((a,b)=>w(["../chunks/calcite-input"],a,b)),button:()=>new Promise((a,b)=>w(["../chunks/calcite-button"],a,b)),flow:()=>new Promise((a,b)=>w(["../chunks/calcite-flow"],a,b)),"flow-item":()=>new Promise((a,b)=>w(["../chunks/calcite-flow-item"],a,b)),icon:()=>new Promise((a, b)=>w(["../chunks/calcite-icon"],a,b)),list:()=>new Promise((a,b)=>w(["../chunks/calcite-list"],a,b)),"list-item":()=>new Promise((a,b)=>w(["../chunks/calcite-list-item"],a,b)),notice:()=>new Promise((a,b)=>w(["../chunks/calcite-notice"],a,b)),tooltip:()=>new Promise((a,b)=>w(["../chunks/calcite-tooltip"],a,b))})}destroy(){this._tooltipReferenceMap.clear()}get _totalBaseItems(){return this.viewModel.baseItems.flatten(a=>a.children.filter(b=>"catalog-dynamic-group"!==b.layer.type)).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(a=> a.children.filter(b=>"catalog-dynamic-group"!==b.layer.type)).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.visibleElements.filter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.visibleElements.filter}get basemapTitle(){return this.viewModel.basemapTitle}set basemapTitle(a){this.viewModel.basemapTitle=a}get baseListItemCreatedFunction(){return this.viewModel.baseListItemCreatedFunction}set baseListItemCreatedFunction(a){this.viewModel.baseListItemCreatedFunction= a}get editingEnabled(){B.deprecatedProperty(C.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0});return"none"!==this.selectionMode&&this.dragEnabled&&this.visibleElements.editTitleButton}set editingEnabled(a){B.deprecatedProperty(C.getLogger(this),"editingEnabled",{replacement:"selectionMode, dragEnabled, visibleElements.editTitleButton",version:"4.29",warnOnce:!0});this.dragEnabled=a;this.selectionMode=(this.visibleElements.editTitleButton= a)?this.multipleSelectionEnabled?"multiple":"single":"none"}get icon(){return"layers"}set icon(a){this._overrideIfSome("icon",a)}get label(){return this.messages?.widgetLabel??""}set label(a){this._overrideIfSome("label",a)}get multipleSelectionEnabled(){B.deprecatedProperty(C.getLogger(this),"multipleSelectionEnabled",{replacement:"selectionMode",version:"4.29",warnOnce:!0});return"multiple"===this.selectionMode}set multipleSelectionEnabled(a){B.deprecatedProperty(C.getLogger(this),"multipleSelectionEnabled", {replacement:"selectionMode",version:"4.29",warnOnce:!0});this.selectionMode=a?"multiple":this.editingEnabled?"single":"none"}get referenceListItemCreatedFunction(){return this.viewModel.referenceListItemCreatedFunction}set referenceListItemCreatedFunction(a){this.viewModel.referenceListItemCreatedFunction=a}get baseItems(){return this.viewModel.baseItems}get referenceItems(){return this.viewModel.referenceItems}get view(){return this.viewModel.view}set view(a){this.viewModel.view=a}triggerAction(a, b){return this.viewModel.triggerAction(a,b)}render(){const {state:a}=this.viewModel;return e.tsx("div",{class:this.classes(m.css.base,D.globalCss.widget,D.globalCss.panel,{[D.globalCss.hidden]:"loading"===a,[D.globalCss.disabled]:"disabled"===a})},this._renderItems())}_renderItemTooltip(a){return a?e.tsx("calcite-tooltip",{key:`tooltip-${a.layer.uid}`,referenceElement:this._tooltipReferenceMap.get(a.layer.uid)},this.messages.layerIncompatibleTooltip):null}_renderItemTooltipNodes(a){return a.incompatible? this._renderItemTooltip(a):a.children?.filter(b=>!b.hidden).toArray().map(b=>this._renderItemTooltipNodes(b))}_renderItemTooltips(a){return a?.toArray().map(b=>this._renderItemTooltipNodes(b))}async _createCatalog(){this._destroyCatalog();const {default:a}=await new Promise((y,p)=>w(["./CatalogLayerList"],I=>y(Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}))),p)),{headingLevel:b,catalogOptions:c,view:d,filterPlaceholder:k,baseListItemCreatedFunction:l, referenceListItemCreatedFunction:q,minFilterItems:r,selectionMode:n,visibilityAppearance:x,openCatalogItem:t,referenceItems:v}=this,z=t&&v.flatten(y=>y.children).includes(t)?"reference":"base";this._set("catalogLayerList",new a({headingLevel:b,view:d,filterPlaceholder:k,minFilterItems:r,selectionMode:n,listItemCreatedFunction:"base"===z?l:q,visibilityAppearance:x,...c,catalogLayer:this.openCatalogItem?.layer}))}_destroyCatalog(){this.catalogLayerList?.destroy();this._set("catalogLayerList",null)}_renderCatalogFlowItem(){const {openCatalogItem:a, messages:b}=this;if(!a)return null;const c=this._getLayerTitle(a);return e.tsx("calcite-flow-item",{afterCreate:this._focusCatalogFlowItemNode,afterUpdate:this._focusCatalogFlowItemNode,bind:this,description:c,heading:b.catalogLayers,headingLevel:this.headingLevel,key:`flow-catalog-${a.uid}`,onCalciteFlowItemBack:d=>{d.preventDefault();this.openCatalogItem=null;this._focusRootFlowItem=!0}},this.catalogLayerList?.render())}_focusCatalogFlowItemNode(a){this._focusCatalogFlowItem&&(this._focusCatalogFlowItem= !1,requestAnimationFrame(()=>a?.setFocus()))}_renderPanelFlowItems(a){return a?a.flatten(b=>b.children).filter(({hidden:b,panel:c})=>!b&&c?.open&&!c.disabled&&c.flowEnabled).toArray().map(({title:b,panel:c})=>{const d=()=>this._handlePanelFlowItemBack(c);return e.tsx("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:b,heading:c.title,headingLevel:this.headingLevel,key:`flow-panel-${c.uid}`,onCalciteFlowItemBack:k=>{k.preventDefault(); d()}},c.render(),e.tsx("calcite-button",{appearance:"transparent",onclick:d,slot:"footer-actions",width:"full"},this.messagesCommon.back))}):[]}_handlePanelFlowItemBack(a){a.open=!1;this._focusRootFlowItem=!0}_focusEditingFlowItemNode(a){this._focusEditingFlowItem&&(this._focusEditingFlowItem=!1,requestAnimationFrame(()=>a?.setFocus()))}_focusRootFlowItemNode(a){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame(()=>a?.setFocus()))}_focusPanelFlowItemNode(a){this._focusPanelFlowItem&& (this._focusPanelFlowItem=!1,requestAnimationFrame(()=>a?.setFocus()))}_renderItemMessage(a){return a.error?e.tsx("div",{class:m.css.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},e.tsx("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},e.tsx("div",{slot:"message"},this.messages.layerError))):a.incompatible?e.tsx("div",{class:m.css.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},e.tsx("calcite-notice",{afterCreate:b=> this._setTooltipReference(b,a),afterRemoved:()=>this._removeTooltipReference(a),icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},e.tsx("div",{slot:"message"},this.messages.layerIncompatible))):null}_getLayerTitle(a){return a.title||this.messages.untitledLayer}_renderItem(a,b,c,d,k){const {_activeItem:l,_selectedDragItemLayerUid:q,selectionMode:r,selectedItems:n,messages:x,visibleElements:t}=this,v=this._getLayerTitle(a),z=a.visibleAtCurrentTimeExtent?a.visibleAtCurrentScale? v:`${v} (${x.layerInvisibleAtScale})`:`${v} (${x.layerInvisibleAtTime})`,y=this._filterActions(a.actionsSections),p=this._countActions(y),I="catalog"===a.parent?.layer?.type;var E="catalog-dynamic-group"===a.layer?.type;const U="catalog-footprint"===a.layer?.type?e.tsx("calcite-icon",{class:m.css.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null,V=t.catalogLayerList&&E?e.tsx("calcite-icon",{class:m.css.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset", scale:"s",slot:"content-start"}):null;E=E?e.tsx("calcite-action",{appearance:"transparent",icon:"chevron-right",iconFlipRtl:!0,onclick:()=>{this.openCatalogItem=d;this._focusCatalogFlowItem=!0},scale:"s",slot:"actions-end",text:v}):null;return e.tsx("calcite-list-item",{afterCreate:A=>this._focusSelectedDragEl(A,a),afterUpdate:A=>this._focusSelectedDragEl(A,a),class:this.classes(m.css.item,{[m.css.itemActive]:l===a}),"data-item":a,"data-layer-id":a.layer.id,dragDisabled:!a.sortable||c||I,dragSelected:a.layer.uid=== q,id:a.layer.uid,key:`list-item-${a.layer.uid}`,label:v,metadata:{parentTitles:k,title:v},open:a.open,selected:"none"!==r?n.includes(a):!1,title:z,value:a.layer.uid,onCalciteListItemDragHandleChange:A=>this._handleCalciteListItemDragHandleChange(A,a),onCalciteListItemSelect:A=>this._handleCalciteListItemSelect(A,a,d),onCalciteListItemToggle:A=>this._handleCalciteListItemToggle(A,a)},U,V,e.tsx("div",{class:this.classes({[m.css.itemContent]:!0,[m.css.itemInvisible]:!a.visibleAtCurrentScale||!a.visibleAtCurrentTimeExtent}), slot:"content"},v),this._renderItemStatus(a,d),this._renderItemToggle(a,d),E,this._renderItemTemporaryIcon(a),this._renderChildList(a,b,k),this._renderItemMessage(a),this._renderPanel(a.panel),this._renderPanelAction(a.panel),1
this._toggleVisibility(a,b),scale:"s", slot:r?"actions-start":"actions-end",text:n,title:n},r?null:e.tsx("calcite-icon",{class:this.classes({[m.css.visibleIcon]:"exclusive"!==l&&k}),icon:q,scale:"s"}))}_renderPanel(a){return!a?.open||a.disabled||a.flowEnabled?null:e.tsx("div",{class:m.css.itemContentBottom,key:`content-panel-${a.uid}`,slot:"content-bottom"},a.render())}_renderPanelAction(a){if(!a?.visible)return null;const {open:b,title:c,disabled:d}=a;return e.tsx("calcite-action",{active:b,appearance:"transparent",disabled:d,icon:F.getActionIcon(a), key:`action-${a.uid}`,onclick:()=>this._togglePanel(a),scale:"s",slot:"actions-end",text:c??"",title:c??void 0},this._renderFallbackIcon(a))}_renderActionsSections(a,b){const c=this.messagesCommon.options;return e.tsx("calcite-action-menu",{appearance:"transparent",class:m.css.actionMenu,key:"item-action-menu",label:this.messagesCommon.menu,open:a.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",slot:"actions-end",onCalciteActionMenuOpen:d=>a.actionsOpen=d.target.open},e.tsx("calcite-action", {appearance:"transparent",icon:"ellipsis",scale:"s",slot:"trigger",text:c,title:c}),b.toArray().map((d,k)=>this._renderActionSection(a,d,k)))}_renderActionSection(a,b,c){return e.tsx("calcite-action-group",{class:m.css.actionGroup,key:`action-section-${c}`},b.toArray().map(d=>this._renderAction({item:a,action:d,textEnabled:!0})))}_renderFallbackIcon(a){const {className:b,icon:c}=a;if(c)return null;a="image"in a?a.image:void 0;const d={[m.css.itemActionIcon]:!!b,[m.css.itemActionImage]:!!a};b&&(d[b]= !0);return a||b?e.tsx("span",{"aria-hidden":"true",class:this.classes(m.css.itemActionIcon,d),key:"icon",styles:F.getActionStyles(a)}):null}_renderAction(a){const {item:b,action:c,textEnabled:d}=a;if(!c)return null;const {active:k,disabled:l,title:q,type:r,indicator:n}=c;return e.tsx("calcite-action",{active:"toggle"===r?c.value:!1,appearance:"transparent",disabled:l,icon:F.getActionIcon(c),indicator:n,key:`action-${c.uid}`,loading:k,onclick:()=>this._triggerAction(b,c),scale:"s",slot:d?void 0:"actions-end", text:q??"",textEnabled:d,title:q??void 0},this._renderFallbackIcon(c))}_setTooltipReference(a,b){this._tooltipReferenceMap.set(b.layer.uid,a)}_removeTooltipReference(a){this._tooltipReferenceMap.delete(a.layer.uid)}_moveLayerFromChildList({toEl:a,fromEl:b,dragEl:c,newIndex:d}){c=u.getItem(c);const k=u.getItem(a),l=u.getItem(b);b=H(b);a=H(a);b&&a&&this.viewModel.moveListItem({targetItem:c,fromParentItem:l,toParentItem:k,newIndex:d,from:b,to:a})}_handleCalciteListDragEnd(a){const {fromEl:b,dragEl:c, oldIndex:d}=a;b.insertBefore(c,b.children[d])}_sortLayers(a,b){a&&(a.group===this._rootGroupUid?(a=H(a),u.sortLayersToIds("base"===a?this.view?.map?.basemap?.baseLayers:"reference"===a?this.view?.map?.basemap?.referenceLayers:null,b)):(a=u.getItem(a))&&u.sortChildLayersToIds(a,b))}_getSingleAction(a){return a.reduce(b=>b).find(b=>b&&("button"===b.type||"toggle"===b.type))}_filterActions(a){return a.map(b=>b.filter(c=>c.visible))}_countActions(a){return a.reduce((b,c)=>b+c.length,0)}_triggerAction(a, b){b&&a&&("toggle"===b.type&&(b.value=!b.value),this.triggerAction(b,a))}_handleCalciteListChange(a){const {selectionMode:b,selectedItems:c}=this;"none"!==b&&(a=a.target.selectedItems.map(d=>u.getItem(d)).filter(Boolean),c.removeAll(),c.addMany(a))}_handleCalciteListItemToggle(a,b){a.stopPropagation();b.open=a.target.open}_focusSelectedDragEl(a,b){this._selectedDragItemLayerUid===b.layer.uid&&requestAnimationFrame(()=>a?.setFocus())}_handleCalciteListItemDragHandleChange(a,b){a.stopPropagation(); this._selectedDragItemLayerUid=a.target.dragSelected?b.layer.uid:null}_handleCalciteListItemSelect(a,b,c){u.getItem(a.target)===b&&"none"===this.selectionMode&&"inherited"!==c?.visibilityMode&&this._toggleVisibility(b,c)}_togglePanel(a){a.open=!a.open;a.open&&(this._focusPanelFlowItem=!0)}_toggleVisibility(a,b){!a||"exclusive"===b?.visibilityMode&&a.visible||(a.visible=!a.visible)}_renderEditingInput(){const {messages:a}=this,{basemapTitle:b}=this.viewModel;return e.tsx("div",{class:m.css.editing}, e.tsx("calcite-label",null,a.basemapTitle,e.tsx("calcite-input",{afterCreate:c=>this._editTitleInput=c,label:a.basemapTitle,name:"basemaptitle",pattern:".*\\S+.*",placeholder:a.basemapTitle,required:!0,title:a.basemapTitle,type:"text",value:b??void 0})))}_renderCancelButton(){const {messagesCommon:{cancel:a}}=this;return e.tsx("calcite-button",{appearance:"outline",bind:this,label:a,onclick:this._toggleEditingTitle,slot:"footer",title:a,width:"half"},a)}_renderSubmitButton(){const {messagesCommon:a}= this;return e.tsx("calcite-button",{label:a.form.submit,slot:"footer",title:a.form.submit,type:"submit",width:"half"},a.form.ok)}_renderEditingForm(){return this.editingTitle?e.tsx("form",{bind:this,onsubmit:this._formSubmit},e.tsx("calcite-flow-item",{afterCreate:this._focusEditingFlowItemNode,afterUpdate:this._focusEditingFlowItemNode,bind:this,heading:this.visibleElements.heading?this.messages.basemapTitle:void 0,headingLevel:this.headingLevel,onCalciteFlowItemBack:a=>{a.preventDefault();this._toggleEditingTitle()}}, this._renderEditingInput(),this._renderCancelButton(),this._renderSubmitButton())):null}_renderEditTitleButton(){const {editingTitle:a,visibleElements:b,messagesCommon:c}=this,d=c.edit;return b.editTitleButton&&!a?e.tsx("calcite-action",{bind:this,icon:"pencil",onclick:this._toggleEditingTitle,slot:"header-actions-end",text:d,title:d}):null}_renderNoLayersInfoMessage(a){return e.tsx("div",{slot:"message"},a)}_renderNoLayersInfo(a,b){return e.tsx("div",{class:m.css.itemMessage},e.tsx("calcite-notice", {icon:"information",key:b,kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(a)))}_getFilteredItems(a){return a?.filter(b=>!b.hidden&&(this.visibleElements.errors||!b.error))}_renderItems(){const {collapsed:a,visible:b,visibleElements:{closeButton:c,collapseButton:d,heading:k,flow:l},messages:q,viewModel:r,referenceItems:n,baseItems:x}=this,t=this.visibleElements.referenceLayers?this._getFilteredItems(n):null,v=this.visibleElements.baseLayers?this._getFilteredItems(x):null,z=[e.tsx("calcite-flow-item", {afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:c,closed:!b,collapsed:a,collapsible:d,heading:k?r.basemapTitle??q.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",onCalciteFlowItemClose:()=>this.visible=!1},this._renderEditTitleButton(),this._renderReferenceSection(t),this._renderBaseSection(v,1===v?.length)),this._renderEditingForm(),this._renderPanelFlowItems(v),this._renderPanelFlowItems(t),this._renderCatalogFlowItem()]; return b?[l?e.tsx("calcite-flow",{key:"root-flow"},z):z,this._renderItemTooltips(t),this._renderItemTooltips(v)]:null}_renderChildList(a,b,c=[]){const {_rootGroupUid:d,dragEnabled:k,viewModel:{listModeDisabled:l},selectionMode:q}=this,{children:r}=a,n="catalog-dynamic-group"!==a.layer?.type&&u.listItemHasChildren(a),x=!(l?0:u.areChildrenHidden(a.layer))&&!n&&k&&"group"===a.layer?.type;return n||x?e.tsx("calcite-list",{canPull:t=>this._canMove(t,"pull"),canPut:t=>this._canMove(t,"put"),"data-basemap-layer-type":b, "data-item":a,"data-layer-type":d,dragEnabled:k?a.childrenSortable&&u.canSortSublayers(a):!1,group:`${d}-${a.layer.uid}`,key:`child-list-${a.layer.uid}`,selectionAppearance:"border",selectionMode:q},r?.filter(t=>!t.hidden).toArray().map(t=>this._renderItem(t,b,!1,a,[...c,a.title]))):null}_renderList(a,b,c){const {messages:d,dragEnabled:k,selectionMode:l,filterPlaceholder:q,baseFilterText:r,referenceFilterText:n,_baseFilterEnabled:x,_referenceFilterEnabled:t,_rootGroupUid:v}=this,z="reference"===b? d.noReferenceLayers:d.noBaseLayers,y="reference"===b?t:x;return e.tsx("calcite-block",{class:m.css.section,collapsible:!0,heading:"reference"===b?d.referenceHeading:d.baseHeading,headingLevel:R.incrementHeadingLevel(this.headingLevel),key:`block-${b}`,open:!0},0===a?.length?this._renderNoLayersInfo(z,b):null,e.tsx("calcite-list",{afterCreate:p=>{p.addEventListener("focusin",this._setActiveItem);p.addEventListener("focusout",this._clearActiveItem)},afterRemoved:p=>{p.removeEventListener("focusin", this._setActiveItem);p.removeEventListener("focusout",this._clearActiveItem)},canPull:p=>this._canMove(p,"pull"),canPut:p=>this._canMove(p,"put"),"data-basemap-layer-type":b,"data-layer-type":v,dragEnabled:k,filterEnabled:y,filterPlaceholder:q,filterText:y?"reference"===b?n:r:"",group:v,key:`list-${b}`,label:d.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:l,onCalciteListChange:p=>this._handleCalciteListChange(p),onCalciteListDragEnd:p=> this._handleCalciteListDragEnd(p.detail),onCalciteListFilter:p=>this["reference"===b?"referenceFilterText":"baseFilterText"]=p.target?.filterText??"",onCalciteListOrderChange:p=>this._onCalciteListOrderChange(p.detail)},a?.toArray().map(p=>this._renderItem(p,b,c)),a?.length&&y?e.tsx("div",{class:m.css.filterNoResults,slot:"filter-no-results"},e.tsx("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoLayersInfoMessage(z))):null))}_renderBaseSection(a,b){return this.visibleElements.baseLayers? this._renderList(a,"base",b):null}_renderReferenceSection(a){return this.visibleElements.referenceLayers?this._renderList(a,"reference",!1):null}_toggleEditingTitle(){var {editingTitle:a}=this;(this.editingTitle=a=!a)?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0}_formSubmit(a){a.preventDefault();a=this._editTitleInput?.value;a?.trim()&&(this.basemapTitle=a);this._toggleEditingTitle()}};g.__decorate([h.property()],f.prototype,"_activeItem",void 0);g.__decorate([h.property()],f.prototype, "_tooltipReferenceMap",void 0);g.__decorate([h.property()],f.prototype,"_focusRootFlowItem",void 0);g.__decorate([h.property()],f.prototype,"_focusPanelFlowItem",void 0);g.__decorate([h.property()],f.prototype,"_focusEditingFlowItem",void 0);g.__decorate([h.property()],f.prototype,"_focusCatalogFlowItem",void 0);g.__decorate([h.property()],f.prototype,"_totalBaseItems",null);g.__decorate([h.property()],f.prototype,"_totalReferenceItems",null);g.__decorate([h.property()],f.prototype,"_baseFilterEnabled", null);g.__decorate([h.property()],f.prototype,"_referenceFilterEnabled",null);g.__decorate([h.property()],f.prototype,"basemapTitle",null);g.__decorate([h.property({readOnly:!0})],f.prototype,"catalogLayerList",void 0);g.__decorate([h.property()],f.prototype,"catalogOptions",void 0);g.__decorate([h.property()],f.prototype,"collapsed",void 0);g.__decorate([h.property()],f.prototype,"dragEnabled",void 0);g.__decorate([h.property()],f.prototype,"editingTitle",void 0);g.__decorate([h.property()],f.prototype, "filterPlaceholder",void 0);g.__decorate([h.property()],f.prototype,"baseFilterText",void 0);g.__decorate([h.property()],f.prototype,"referenceFilterText",void 0);g.__decorate([h.property()],f.prototype,"listItemCanGiveFunction",void 0);g.__decorate([h.property()],f.prototype,"listItemCanReceiveFunction",void 0);g.__decorate([h.property()],f.prototype,"baseListItemCreatedFunction",null);g.__decorate([h.property()],f.prototype,"editingEnabled",null);g.__decorate([h.property()],f.prototype,"headingLevel", void 0);g.__decorate([h.property()],f.prototype,"icon",null);g.__decorate([h.property()],f.prototype,"label",null);g.__decorate([h.property(),K.messageBundle("esri/widgets/BasemapLayerList/t9n/BasemapLayerList")],f.prototype,"messages",void 0);g.__decorate([h.property(),K.messageBundle("esri/t9n/common")],f.prototype,"messagesCommon",void 0);g.__decorate([h.property()],f.prototype,"minFilterItems",void 0);g.__decorate([h.property()],f.prototype,"multipleSelectionEnabled",null);g.__decorate([h.property()], f.prototype,"referenceListItemCreatedFunction",null);g.__decorate([h.property({readOnly:!0})],f.prototype,"baseItems",null);g.__decorate([h.property()],f.prototype,"openCatalogItem",void 0);g.__decorate([h.property({readOnly:!0})],f.prototype,"referenceItems",null);g.__decorate([h.property()],f.prototype,"selectedItems",void 0);g.__decorate([h.property()],f.prototype,"selectionMode",void 0);g.__decorate([h.property()],f.prototype,"view",null);g.__decorate([S.vmEvent("trigger-action"),h.property({type:J})], f.prototype,"viewModel",void 0);g.__decorate([h.property()],f.prototype,"visibilityAppearance",void 0);g.__decorate([h.property({type:G,nonNullable:!0})],f.prototype,"visibleElements",void 0);return f=g.__decorate([N.subclass("esri.widgets.BasemapLayerList")],f)});