// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/BrowseItems","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/window dojo/_base/event dojo/dom-class dojo/dom-style dojo/dom-attr dojo/string dojo/on dojo/aspect dojo/has dojo/dom dojo/dom-construct dojo/mouse dojo/topic dojo/query dojo/parser dijit/registry dijit/TooltipDialog dijit/popup dojo/promise/all dojo/Deferred dgrid/Grid dgrid/extensions/Pagination dgrid/extensions/DijitRegistry dgrid/OnDemandGrid dgrid/Selection dgrid/selector dgrid/Keyboard dgrid/util/mouse dgrid/util/touch put-selector/put dojo/store/Observable dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../arcgis/Portal ../Evented ../PluginTarget dojo/i18n!../nls/jsapi ./_AppTemplateFiltersMixin ./_RefreshMixin ../kernel ../lang ../config ../geometry/webMercatorUtils ../tasks/GeometryService ../SpatialReference dojo/NodeList-dom".split(" "),
function(p,d,f,v,w,g,t,k,y,q,ba,I,l,m,J,K,e,ca,z,L,A,da,B,C,M,D,N,E,ea,fa,F,ga,O,P,Q,R,S,r,ha,T,U,ia,G,V,u,W,x,X,ja){var Y=p(null,{idProperty:"id",constructor:function(a){p.safeMixin(this,a)},get:function(a,b){return r.PortalUtil.request(this.portalUrl+"content/items/"+a,b).then(function(a){return new r.PortalItem(d.mixin(a,{portal:this.portal}))})},getIdentity:function(a){return a[this.idProperty]},query:function(a,b){var c=d.isObject(a)?a:{q:a},e=null;if(b){c=d.mixin(c,{num:b.count,start:(b.start||
0)+1});if(b.sort&&b.sort.length)var h=b.sort[0],c=d.mixin(c,{sortField:encodeURIComponent("created"===h.attribute?"uploaded":h.attribute),sortOrder:h.descending?"desc":"asc"});b.useExtent&&b.extent&&(c.bbox=b.extent);b.queryType&&"group"===b.queryType&&(e="group")}c="group"===e?this.portal.queryGroups(c,!0).then(function(a){a.results.total=a.total;return a.results}):this.portal.queryItems(c,!0).then(function(a){a.results.total=a.total;return a.results});return r.PortalResult(c)}});v=p([Q,R,S,T],{templateString:'\x3cdiv\x3e\x3cdiv class\x3d"top-bar"\x3e\x3cdiv  class\x3d"esriFloatLeading instructions"\x3e\x3cspan class\x3d"messageLeft hide" data-dojo-attach-point\x3d"messageNodeLeft"\x3e\x3c/span\x3e\x3cspan class\x3d"messageRight hide" data-dojo-attach-point\x3d"messageNodeRight"\x3e\x3c/span\x3e\x3ca tabIndex\x3d"-1" data-dojo-attach-point\x3d"helpLink" class\x3d"esriHelpIcon hide" title\x3d"${i18n.browseItems.learnMoreConfigurableApps}" href\x3d"#" target\x3d"_blank"\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv id\x3d"${id}_search"class\x3d"searchBar esriFloatTrailing"\x3e\x3cinput tabIndex\x3d"1" placeholder\x3d"${i18n.browseItems.searchTitle}" class\x3d"esriSearchBox dijitTextBox" type\x3d"search"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"gallery"\x3e\x3cdiv class\x3d"gallery-left  quiet-scroll"\x3e\x3cul class\x3d"filters"\x3e\x3c/ul\x3e\x3c/div\x3e\x3cdiv class\x3d"templates gallery-right"\x3e\x3cp id\x3d"${id}_filterTitle" class\x3d"filter-title hide" data-dojo-attach-point\x3d"filterDescription"\x3e\x3c/p\x3e\x3cdiv id\x3d"${id}_grid"class\x3d"dgrid-autoheight quiet-scroll"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv  class\x3d"loaderWrap" data-dojo-attach-point\x3d"loaderWrap"\x3e\x3c/div\x3e\x3cdiv  class\x3d"js-info-panel templateInfoPanel" data-dojo-attach-point\x3d"infoPanel"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
galleryTemplate:"\x3cdiv style\x3d'opacity:1;' class\x3d'grid-item gallery-view'\x3e${item:_formatThumbnail}${item:_formatItemTitle}\x3cp class\x3d\"template-overlay\" style\x3d\"display:none;\"\x3e${i18n.browseItems.selectDetails}\x3c/p\x3e\x3c/div\x3e",infoPanelTemplate:'\x3cdiv\x3e\x3cdiv class\x3d"template-info-showing"\x3e\x3cdiv class\x3d"thumbnail"\x3e\x3cimg src\x3d"${item:_formatInfoPanelImage}"\x3e\x3c/div\x3e\x3ch4\x3e${item.title}\x3c/h4\x3e\x3cdiv class\x3d"template-info"\x3e\x3cp class\x3d"quiet-scroll"\x3e${item.snippet}\x3c/p\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"panel-actions"\x3e\x3cbutton class\x3d"btn blue btn-main" id\x3d"on-next"\x3e${i18n.browseItems.configure}\x3c/button\x3e\x3cbutton class\x3d"btn btn-cancel" id\x3d"close-panel"\x3e${i18n.common.close}\x3c/button\x3e\x3c/div\x3e\x3cdiv\x3e',
_popupTemplate:'\x3cdiv class\x3d"esriBrowsePopup quiet-scroll"\x3e\x3cp\x3e{summary}\x3c/p\x3e\x3c/div\x3e',showInfoPanel:!0,isAutoClose:!0,showTooltip:!1,checkIsButtonEnabled:!1,baseClass:"esriBrowseItemsCtr",i18n:U,postMixInProperties:function(){this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.self?(this._portal=new r.Portal({url:this.portalUrl,self:this.self}),this._init(),this._portal.on("load",d.hitch(this,this._fetchData))):(this._portal=new r.Portal(this.portalUrl),
this._portal.signIn().then(d.hitch(this,function(){this._init();this._fetchData()})))},_init:function(){this._canSearchPublic=this.self?this.self.canSearchPublic:this._portal.canSearchPublic;this.query=d.mixin(this.query||{},{get:function(a){return this[a]&&this[a].length?"("+this[a].join(" OR ")+") ":""},toString:function(){return{q:this.get("groups")+this.get("tags")+this.get("persistentTypekeywords")+this.get("typekeywords")+this.get("types")+this.get("owners")+this.get("orgids")+this.get("custom")+
(this.query||"")+(this.search||"")+' -type:"Attachment" -tags:"mature support"'}}});this.self?this.self.canSearchPublic=!0:this._portal.canSearchPublic=!0;this.galleryTemplate=this.plugIn&&this.plugIn.galleryTemplate||this.galleryTemplate;this.infoPanelTemplate=this.plugIn&&this.plugIn.infoPanelTemplate||this.infoPanelTemplate;if(this.helpLinkUrl=this.plugIn&&this.plugIn.helpLinkUrl||"")k.set(this.helpLink,"href",this.helpLinkUrl),g.remove(this.helpLink,"hide");e(".templates",this.domNode).addClass("fade");
e(".dgrid-footer",this.domNode).addClass("hide");t.set(this.infoPanel,"display","none")},destroy:function(){this.inherited(arguments);this._grid&&this._grid.destroy();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove());this._queryTimer&&clearTimeout(this._queryTimer);this._grid=this._portal=null},closeInfoPanel:function(){l.byId("close-panel").click()},_setItemQueryAttr:function(a){this.itemQuery=a},_setPluginAttr:function(a){this.addPlugin(a)},_setMessageAttr:function(a){this.set("messageRight",
a)},_setMessageRightAttr:function(a){"string"===typeof a?k.set(this.messageNodeRight,"innerHTML",a):a instanceof HTMLElement&&m.place(a,this.messageNodeRight);g.remove(this.messageNodeRight,"hide")},_setMessageLeftAttr:function(a){"string"===typeof a?k.set(this.messageNodeLeft,"innerHTML",a):a instanceof HTMLElement&&m.place(a,this.messageNodeLeft);g.remove(this.messageNodeLeft,"hide")},_setDisabledAttr:function(a){var b=z.findWidgets(this.domNode).concat(z.findWidgets(this._content));f.forEach(b,
function(b){b.set("disabled",a)});g[a?"add":"remove"](this._interval.domNode,"dijitTextBoxDisabled")},_setSortAttr:function(a){this.sortAttribute=a},_setSortDescendingAttr:function(a){this.sortDescending=a},_getSelectionAttr:function(){var a=this._grid.selection,b;for(b in a)if(a.hasOwnProperty(b))break;return b&&this._grid.row(b).data},_setGalleryTemplateAttr:function(a){u.isDefined(a)&&(this.galleryTemplate=a)},_setFormatThumbnailAttr:function(a){u.isDefined(a)&&"function"===typeof a&&(this._formatThumbnail=
a)},_setFormatItemTitleAttr:function(a){u.isDefined(a)&&"function"===typeof a&&(this._formatItemTitle=a)},_setRowsPerPageAttr:function(a){this._set("rowsPerPage",a)},_setPagingLinksAttr:function(a){this._set("pagingLinks",a)},_getQueryAttr:function(){return this.query},_setQueryAttr:function(a){this._set("query",a);this._grid&&this._grid.set("query",a.toString())},_setExtentAttr:function(a){a&&this._set("extent",this._extentToString(a))},_setUseExtentAttr:function(a){this._set("useExtent",a)},_setQueryTypeAttr:function(a){this._set("queryType",
a)},_setFetchTimeoutAttr:function(a){this._set("fetchTimeout",a)},_setShowInfoPanelAttr:function(a){this._set("showInfoPanel",a)},_setSelectionModeAttr:function(a){-1===f.indexOf(["extended","toggle","multiple","single","none"],a)&&(console.log("Incorrect Value provided for selectionMode. It is one of the following: extended, toggle, multiple, single, none"),a="single");this._set("selectionMode",a)},_setDemandListAttr:function(a){this._set("demandList",a)},_validate:function(){return!!this.get("selection")},
reset:function(){e(".esriSearchBox",l.byId(this.id+"_search")).forEach(function(a){k.set(a,"value","")});this.query.search="";if(this.plugIn.filters){var a=[],b=[],c=[],d=[];e("li.active",this.domNode).forEach(function(h){g.remove(h,"active");var e=this.plugIn.filters[h.childNodes[0].id];h=f.map(e.tags,function(a){return'tags:"'+a+'"'},this);var Z=f.map(e.owners,function(a){return'owner:"'+a+'"'},this),aa=f.map(e.orgids,function(a){return'orgid:"'+a+'"'},this),e=f.map(e.typekeywords,function(a){return'typekeywords:"'+
a+'"'},this);a.push(h);c.push(Z);d.push(aa);b.push(e)},this);this.query.tags=f.filter(this.query.tags,function(b){return-1!==f.indexOf(a,b)});this.query.owners=f.filter(this.query.owners,function(a){return-1!==f.indexOf(c,a)});this.query.orgids=f.filter(this.query.orgids,function(a){return-1!==f.indexOf(d,a)});this.query.typekeywords=f.filter(this.query.typekeywords,function(a){return-1!==f.indexOf(b,a)});l.byId("all").click()}},_showPopup:function(a){if(!this._isInsideTooltipDialog){this._closePopup();
var b=this._grid.row(a);a=e("img",b.element)[0];if(b={summary:b.data.snippet},b.summary)this._tooltip=new L({content:d.replace(this._popupTemplate,b),onMouseEnter:d.hitch(this,function(){this._isInsideTooltipDialog=!0}),onMouseLeave:d.hitch(this,function(){this._isInsideTooltipDialog=!1;this._closePopup()})}),A.open({className:"esriBrowsePopupCtr",popup:this._tooltip,around:a,orient:["after-centered","before-centered"]}),this._onCloseConnect=e(".dijitDialogCloseIcon",this._tooltip.domNode).on("click",
d.hitch(this,function(a){a.preventDefault();this._closePopup()}))}},_closePopup:function(){this._tooltip&&(this._onCloseConnect&&this._onCloseConnect.remove(),A.close(this._tooltip),this._tooltip.destroyRecursive(),this._tooltip=this._onCloseConnect=void 0)},_clearQueryTimeout:function(){clearTimeout(this._queryTimer);this._queryTimer=null},_clearClosePanelTimeout:function(){clearTimeout(this._panelClosing);this._panelClosing=null;f.forEach(this._panelClickHandles,"item.remove();");m.empty(this.infoPanel)},
_createGrid:function(){var a=p([C,M,E,G,D]),b=new P(new Y({portal:this._portal})),c=this.query,n=d.hitch(this,function(a){a.snippet=a.snippet||"";var b=O("div");a=y.substitute(this.galleryTemplate,{item:a,i18n:this.i18n},null,this);m.place(a,b);return b}),h={};this.get("demandList")&&(a=p([C,N,E,G,D]));this.get("useExtent")&&(h.extent=this.get("extent"),h.useExtent=this.get("useExtent"));this.get("queryType")&&(h.queryType=this.get("queryType"));var H={store:b,query:c.toString(),selectionMode:this.selectionMode||
"single",pagingLinks:this.get("pagingLinks")||2,rowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||6,loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:n,noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===this.selectionMode||"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:h};this.get("demandList")&&(H={store:b,query:c.toString(),
minRowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||50,selectionMode:this.selectionMode||"single",loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:n,pagingMethod:"throttleDelayed",noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===this.selectionMode||"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:h});this._grid=new a(H,
this.id+"_grid");this._grid.startup();this.own(q(this.domNode,"click",d.hitch(this,function(a){l.byId("close-panel")&&this.isAutoClose&&l.byId("close-panel").click()})),this._grid.on(F.enterRow,d.hitch(this,function(a){!1===g.contains(this.domNode,"showing")&&this.showInfoPanel&&this._showOverlay(!0,a);this.showTooltip&&!this.showInfoPanel&&this._showPopup(a)})),this._grid.on(F.leaveRow,d.hitch(this,function(a){this._showOverlay(!1,a);this.showTooltip&&!this.showInfoPanel&&this._closePopup(a)})),
this._grid.on(".dgrid-row:click",d.hitch(this,function(a){var b;this.emit("grid-row-click",a);!1===g.contains(this.domNode,"showing")&&this.showInfoPanel&&(a.preventDefault(),w.stop(a),this._clearClosePanelTimeout(),b=this.get("selection"),this._showOverlay(!1,a),this.showInfoPanel&&this.infoPanelTemplate?(t.set(this.infoPanel,"display","block"),m.place(y.substitute(this.infoPanelTemplate,{item:b,i18n:this.i18n},function(a){return u.isDefined(a)?a:""},this),this.infoPanel)):t.set(this.infoPanel,"display",
"none"),this.emit("show-info-panel"),g.add(this.domNode,"showing"),this._panelClickHandles=[e(".template-info-showing .thumbnail img",this.domNode).on("error",d.hitch(this,function(a){k.set(a.target,"src",b.thumbnailUrl)})),e(".panel-actions .btn").on("click",d.hitch(this,function(a){a.preventDefault();w.stop(a);this.checkIsButtonEnabled&&g.contains(a.target,"disabled")||("close-panel"===a.target.id?(g.remove(this.domNode,"showing"),t.set(this.infoPanel,"display","none"),this._panelClosing=setTimeout(d.hitch(this,
function(){f.forEach(void 0,"item.remove();");m.empty(this.infoPanel)},250))):(K.publish("/esri/browseitems/close",a.target.id,this.get("selection")),a={selection:this.get("selection"),action:a.target.id},this.emit("browseitems-close",a)))})),e(".js-info-panel",this.domNode).on("click",d.hitch(this,function(a){this.isAutoClose&&(a.preventDefault(),w.stop(a))})),q(e(".dgrid-footer,.dgrid-header",this._grid.domNode),J.leave,d.hitch(this,function(a){this.showTooltip&&!this.showInfoPanel&&this._closePopup()}))])})),
this._grid.on("dgrid-refresh-complete",d.hitch(this,function(a){e(".templates",this.domNode).removeClass("fade");e(".loaderWrap",this.domNode).addClass("hide");e(".dgrid-footer",this.domNode)[this._grid._total<=this._grid.rowsPerPage?"addClass":"removeClass"]("hide");this.showTooltip&&!this.showInfoPanel&&this._closePopup()})),this._grid.on("refresh",d.hitch(this,function(){this.showTooltip&&!this.showInfoPanel&&this._closePopup();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove(),
this._img_connect_error=this._img_connect=null);this._img_connect=e(".grid-item-thumb",this._grid.domNode).on("load",d.hitch(this,function(a){(a=this._grid.row(a))&&a.element&&e(".grid-item",a.element).addClass("fadeIn").style("opacity","1")}));this._img_connect_error=e(".grid-item-thumb",this._grid.domNode).on("error",d.hitch(this,function(a){k.set(a.target,"src",this._portal.staticImagesUrl+"/desktopapp.png")}))})),q(l.byId(this.id+"_search"),"keyup",d.hitch(this,function(a){a.preventDefault();
this._clearQueryTimeout();this._queryTimer=setTimeout(d.hitch(this,function(){this.query.search=k.get(a.target,"value");this._fetchItems(this.query).then(d.hitch(this,function(){this._clearQueryTimeout()}))}),this.searchKeypressDelay||450)})),q(l.byId(this.id+"_search"),"search",d.hitch(this,function(a){this._queryTimer||(a.preventDefault(),this.query.search=k.get(a.target,"value"),this._fetchItems(this.query))})),this.watch("extent",d.hitch(this,function(a,b,c){this._grid.queryOptions.extent=this.get("extent");
this._grid.queryOptions.useExtent=this.get("useExtent");this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})),this.watch("useExtent",d.hitch(this,function(a,b,c){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=c;this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})));this.showInfoPanel||("single"===this._grid.selectionMode?this.own(this._grid.on("dgrid-select,dgrid-deselect",
d.hitch(this,function(a){a={selection:this.get("selection")};this.emit("select-change",a)}))):-1!==f.indexOf(["toggle","multiple","extended"],this._grid.selectionMode)&&this.own(this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(a){a=a.grid.selection;var b,c=[];for(b in a)a[b]&&c.push(this._grid.row(b).data);this.emit("select-change",{selection:c})}))));this.emit("grid-ready",{grid:this._grid,ready:!0})},_createFilters:function(){if(this.plugIn&&this.plugIn.filters){var a=this.plugIn.filters,
b=this.plugIn.filterStrings,c,n=e(".filters",this.domNode)[0];for(c in a)m.create("li",{"class":"all"===c?"active":"",innerHTML:"\x3ca id\x3d'"+c+"'  href\x3d'#'\x3e"+b[c].title+"\x3c/a\x3e"},n);this.own(q(n,"li a:click",d.hitch(this,function(c){c.preventDefault();var h=c.target;e(".active",n).removeClass("active");g.add(h.parentNode,"active");e(".templates",this.domNode).addClass("fade");setTimeout(d.hitch(this,function(){g["all"===h.id?"add":"remove"](this.filterDescription,"hide");k.set(this.filterDescription,
"innerHTML",b[h.id].description||"")}),225);c=d.mixin({},a[h.id]||{});this.query.tags=f.map(c.tags||[],function(a){return'tags:"'+a+'"'});this.query.owners=f.map(c.owners,function(a){return'owner:"'+a+'"'});this.query.orgids=f.map(c.orgids,function(a){return'orgid:"'+a+'"'});this.query.typekeywords=[].concat(f.map(c.typekeywords||[],function(a){return'typekeywords:"'+a+'"'}));this.query.groups=f.map(c.groups,function(a){return'group:"'+a+'"'});this._fetchItems(this.query)})));g.add(this.domNode,"filters")}else g.add(this.domNode,
"nofilters"+(this.plugIn&&this.plugIn.extraClasses?" "+this.plugIn.extraClasses.join(" "):""))},_showOverlay:function(a,b){var c=this._grid.row(b);c&&e(".template-overlay",c.element).style("display",a?"":"none")},_fetchData:function(){this._user=this._portal.getPortalUser();return this.plugIn&&this.plugIn.fetchData?this.plugIn.fetchData():this._fetchItems(this.itemQuery)},_fetchItems:function(a,b){var c={sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}]},f=new B;this.get("useExtent")&&
(c.extent=this.get("extent"),c.useExtent=this.get("useExtent"));this.get("queryType")&&(c.queryType=this.get("queryType"));e(".templates",this.domNode).addClass("fade");e(".dgrid-footer",this.domNode).addClass("hide");e(".loaderWrap",this.domNode).removeClass("hide");setTimeout(d.hitch(this,function(){this.query=d.mixin(this.query,a);this._grid?this._grid.set("query",this.query.toString(),c):(this._createFilters(),this._createGrid());f.resolve(this._grid)}),60);return f},_formatThumbnail:function(a){var b=
a.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png";a.thumbnailUrl=b;return"\x3cimg class\x3d'grid-item-thumb' width\x3d'187px' height\x3d'125px' alt\x3d'' src\x3d'"+b+"'\x3e"},_formatInfoPanelImage:function(a){var b=a.screenshots&&a.screenshots.length?a.screenshots[0]:null;return b?a.itemUrl+"/info/"+b:a.thumbnailUrl},_formatItemTitle:function(a){return"\x3ch5\x3e"+(a.title||a.name||"\x3cNo Title\x3e")+"\x3c/h5\x3e"},clear:function(){this._grid.clearSelection()},doProject:function(a,b){var c=
[102113,102100,3857],d=new B,e,f,g;e=function(a,b){!(a&&0<a.length&&a[0]&&"extent"==a[0].type)||isNaN(a[0].xmin)||isNaN(a[0].ymin)||isNaN(a[0].xmax)||isNaN(a[0].ymax)?a&&0<a.length&&a[0]&&"point"==a[0].type&&!isNaN(a[0].x)&&!isNaN(a[0].y)&&d.resolve(a,b):d.resolve(a,b)};null!=a.spatialReference.wkid&&4326==a.spatialReference.wkid&&null!=b.wkid&&this.contains(c,b.wkid)?(a.ymin=Math.max(a.ymin,-89.99),a.ymax=Math.min(a.ymax,89.99),c=x.geographicToWebMercator(a),(e=c.spatialReference._getInfo())&&c.xmin>
c.xmax&&(f=e.valid[1]-c.xmin,g=c.xmax-e.valid[0],f>g?c.xmax=e.valid[1]+g:c.xmin=e.valid[0]-f),c.spatialReference.wkid=b.wkid,d.resolve([c])):null!=a.spatialReference.wkid&&this.contains(c,a.spatialReference.wkid)&&null!=b.wkid&&4326==b.wkid?(c=x.webMercatorToGeographic(a),(e=c.spatialReference._getInfo())&&c.xmin>c.xmax&&(f=e.valid[1]-c.xmin,g=c.xmax-e.valid[0],f>g?c.xmax=e.valid[1]+g:c.xmin=e.valid[0]-f),d.resolve([c])):(this.geometryService||(this.geometryService=new X(W.defaults.geometryService)),
this.geometryService.project([a],b,e));return d},contains:function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1},_extentToGCS:function(a){a=a.shiftCentralMeridian(!0);return x.webMercatorToGeographic(a)},_extentToString:function(a){var b="";null!=a&&(a=this._extentToGCS(a),b=this._roundValue(a.xmin,1E4)+","+this._roundValue(a.ymin,1E4)+","+this._roundValue(a.xmax,1E4)+","+this._roundValue(a.ymax,1E4));return b},_roundValue:function(a,b){return Math.round(a*b)/b}});I("extend-esri")&&
d.setObject("dijit.BrowseItems",v,V);return v});