PageSourceSearch

https://www.portlandmaps.com/assets/index-DR7DhLGA.js

js portlandmaps.com collected 2026-09-24 18:14:28 UTC 36,750 bytes, 3 lines download raw bytes

1/*! portlandmaps 3.0.1 */
2import{n as e,t}from"./utils-YrmVguXB.js";import"./site-CVMyMY-r.js";var[n,r,i,a,o,s,c,l,u,d]=await $arcgis.import([`@arcgis/core/WebMap.js`,`@arcgis/core/geometry/SpatialReference.js`,`@arcgis/core/geometry/Point.js`,`@arcgis/core/geometry/Extent.js`,`@arcgis/core/Graphic.js`,`@arcgis/core/request.js`,`@arcgis/core/core/urlUtils.js`,`@arcgis/core/geometry/support/jsonUtils.js`,`@arcgis/core/core/reactiveUtils.js`,`@arcgis/core/config.js`]),f=!!/[&?]debug\b/i.test(window.location.search),p=new e({debug:f,views:`./tpl/`}),m={},h=async()=>{f&&console.log(`construct`),m={apiUrl:`/api/<action>/`,apiKey:`7D700138A0EA40349E799EA216BF82F9`,currentPathName:document.location.pathname,defaultCenter:new i(-13656570.1717,5702965.21855,new r({wkid:3857})),defaultScale:72223.819286,fullExtent:new a({xmin:-13681012,ymin:5690742,xmax:-13612656,ymax:5714191,spatialReference:{wkid:3857}}),defaultLODs:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176},{level:20,resolution:.14929107082380833,scale:564.248588},{level:21,resolution:.07464553541190416,scale:282.124294},{level:22,resolution:.03732276770595208,scale:141.062147},{level:23,resolution:.01866138385297604,scale:70.5310735}],selectSymbolMarkerPoint:{type:`simple-marker`,style:`circle`,size:12,color:[255,0,0,1],outline:{style:`solid`,color:[255,0,0,.3],width:8}},selectSymbolMarkerPolygon:{type:`simple-fill`,style:`solid`,color:[0,0,0,0],outline:{style:`solid`,color:[255,0,0,1],width:2.5}},selectSymbolPoint:{type:`simple-marker`,style:`circle`,size:10,color:[0,255,255,1],outline:{style:`solid`,color:[0,255,255,.3],width:8}},selectSymbolLine:{type:`simple-line`,style:`solid`,width:2.5,color:[0,255,255,1]},selectSymbolPolygon:{type:`simple-fill`,style:`solid`,color:[0,0,0,0],outline:{style:`solid`,color:[0,255,255,1],width:2.5}},viewportHeight:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,viewportWidth:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,viewportMode:`fullscreen`,verticalBreakpoint:992,urlRoot:window.location.protocol+`//`+window.location.hostname,detailUrlMatchPattern:new RegExp(/.*?\/detail\/([^/]+)\/(?:[^/]+\/)*([^/]+)_did/),locationUrlMatchPattern:new RegExp(/.*?\/detail\/([^/]+)\/(?:[^/]+\/)*([^/_]+)_([^/_]+)_xy/),locationIdMatchPattern:new RegExp(/^([-.0-9]+)_([-.0-9]+)$/),propertyIdMatchPattern:new RegExp(/^[RWCMP]\d{6}$/),theme:Q(`theme`)||(window.matchMedia(`(prefers-color-scheme: dark)`)?`dark`:`light`),interface:Q(`interface`)||`right`,timer:{}},m.pathRoot=`/`,m.detailUrlRoot=`${m.pathRoot}detail/`,m.templateUrlRoot=`${m.pathRoot}tpl/`,m.lods=m.defaultLODs,m.maxScale=m.lods[m.lods.length-1].scale,m.minScale=m.lods[0].scale,m.printTaskUrl=m.urlRoot+`/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task`,m.touch=!!(`ontouchstart`in window||navigator.msMaxTouchPoints||/[&?]touch=1/i.test(window.location.search)),m.platform=navigator.userAgentData?.platform||navigator?.platform,m.ios=(/iPad|iPhone|iPod/.test(m.platform)||m.platform===`MacIntel`&&navigator.maxTouchPoints>1)&&!window.MSStream,m.android=/android/i.test(navigator.userAgent);
2try{m.recent=JSON.parse(Q(`recent`))}catch{}(!m.recent||!Array.isArray(m.recent))&&(m.recent=[]);try{m.scroll=JSON.parse(Q(`scroll`))}catch{}(!m.scroll||!Array.isArray(m.scroll))&&(m.scroll=[]);try{m.accordion=JSON.parse(Q(`accordion`))}catch{}(!m.accordion||typeof m.accordion!=`object`||Array.isArray(m.accordion))&&(m.accordion={});try{m.overlay=JSON.parse(Q(`overlay`))}catch{}(!m.overlay||typeof m.overlay!=`object`||Array.isArray(m.overlay))&&(m.overlay={}),f&&ce(`User Agent: ${navigator.userAgent}\n\nPlatform: ${m.platform}\n\nViewport Size: ${m.viewportWidth}x${m.viewportHeight}\n\nCurrent Path: ${m.currentPathName}\n\nURL Root: ${m.urlRoot}`),oe().then(e=>{d.apiKeys.scopes=[{token:e,urls:[`https://www.portlandmaps.com/private/rest/services`]}]}),E(),v(),S(),C(),await V(),k()},g=async e=>{if(f&&console.log(`loadWebmap`,e),!m.webmap||e.id!==m.webmap.id){if(m.webmap=e,m.view)m.extent=m.view.extent;else{let e=m.center?m.center.split(`,`):[];e.length===2&&!isNaN(e[0])&&!isNaN(e[1])&&(m.center=new i(e[0],e[1],new r({wkid:3857}))),(!m.center||!m.fullExtent.contains(m.center))&&delete m.center}return _(await W(`agol`,{type:`webmapdata`,id:m.webmap.id}))}return m.webmap=e,Promise.resolve()},_=async e=>{f&&console.log(`createMapView`,e);let t=e.data,r={constraints:{lods:m.defaultLODs,rotationEnabled:!1,snapToZoom:!0},popup:null};return t.baseMap=null,m.extent?r.extent=m.extent:(r.center=m.center||m.defaultCenter,r.scale=m.view?.scale||m.defaultScale),m.overlay?.[m.webmap.id]&&m.overlay[m.webmap.id].forEach(e=>{let n=t.operationalLayers.find(t=>t.url===e.url);n&&(n.visibility=e.visible,n.opacity=e.opacity)}),m.view||(m.view=document.querySelector(`arcgis-map`)),Object.assign(m.view,r),m.map=m.view.map=n.fromJSON(t),m.view.viewOnReady().then(async()=>{F(),I(),P(),L(),ie(),Z(`page`,!1)}).catch(J)},v=async()=>{f&&console.log(`initUIEvents`);let e=document.getElementById(`dialog-splash`),t=document.getElementById(`dialog-splash-dismiss`);e.componentOnReady().then(()=>{Q(`splash`)||(e.open=!0),t.addEventListener(`click`,t=>{Q(`splash`,1),e.open=!1})});let n=document.getElementById(`action-bar`),r=()=>{m.interface=n.position===`start`?`left`:`right`,O()},i=new MutationObserver(r);r(),i.observe(n,{attributes:!0,attributeFilter:[`position`,`closed`]});
2let a=document.getElementById(`support-tile-detail`);a.componentOnReady().then(()=>{let e=a.shadowRoot.querySelector(`calcite-icon`).shadowRoot?.querySelector(`svg`);e?.style&&(e.style.fill=`var(--color-portlandmaps-highlight-primary)`)});let o=document.getElementById(`support-tile-property`);o.componentOnReady().then(()=>{let e=o.shadowRoot.querySelector(`calcite-icon`).shadowRoot?.querySelector(`svg`);e?.style&&(e.style.fill=`var(--color-portlandmaps-highlight-secondary)`)});let s=document.getElementById(`detail`);s.componentOnReady().then(()=>{document.getElementById(`action-detail`).addEventListener(`click`,()=>{s.closed?(D(`detail`),s.setFocus()):D(`fullscreen`)}),s.addEventListener(`calcitePanelClose`,e=>{D(`fullscreen`)}),window.addEventListener(`scroll`,K,{passive:!0}),m.detailContainer=s.shadowRoot.querySelector(`.content-wrapper`),m.detailContainer.addEventListener(`scroll`,K,{passive:!0}),document.querySelectorAll(`#detail calcite-menu-item`).forEach(e=>{e.componentOnReady().then(()=>{let t=e.shadowRoot.querySelector(`calcite-icon`);t?.style&&(t.style.marginInlineEnd=`0`)})});let e=e=>{f&&console.log(`calcite-link.detail-select:click, calcite-button.detail-select:click, calcite-select.detail-select:change`,e);let t=e.target.nodeName===`CALCITE-SELECT`?e.target.selectedOption:e.target,n=t.getAttribute(`detail-type`),r=t.getAttribute(`property-id`),i,a,o=t.getAttribute(`detail-id`),s=o.match(m.locationIdMatchPattern);s?.length&&(i=parseFloat(s[1]),a=parseFloat(s[2]),o=null),n&&(o||i&&a)&&(A({detail_type:n,detail_id:o,property_id:r,x:i,y:a}),e.preventDefault())},t=e=>{f&&console.log(`calcite-accordion-item.toggle`,e);let t=e.target.id,n=e.type===`calciteAccordionItemExpand`;t.length&&(m.accordion[t]=n,Q(`accordion`,JSON.stringify(m.accordion)))},n=e=>{let t=document.getElementById(`detail-table`),n=document.getElementById(`detail-table-content`),r=e.parentNode,i=e.nextSibling,a=document.getElementById(`action-table-print`),o=document.getElementById(`action-table-close`),s=document.getElementById(`detail`);e.pageSize=``,n.innerHTML=``,n.appendChild(e),t.classList.add(`active`),s.hidden=m.isTableView=!0,a.setFocus(),m.isVerticalViewport&&(document.scrollingElement.scrollTop=0);let c=n=>{e.pageSize=5,r.insertBefore(e,i),t.classList.remove(`active`),s.hidden=m.isTableView=!1,q()};o.addEventListener(`click`,c,{once:!0}),e.querySelectorAll(`calcite-link`).forEach(e=>{e.addEventListener(`click`,c,{once:!0})})};new MutationObserver(r=>{s.querySelectorAll(`.detail-select`).forEach(async t=>{t.componentOnReady().then(()=>{t.addEventListener(t.nodeName===`CALCITE-SELECT`?`calciteSelectChange`:`click`,e)})}),s.querySelectorAll(`calcite-accordion-item`).forEach(async e=>{e.componentOnReady().then(()=>{m.accordion?.[e.id]!==void 0&&(e.expanded=m.accordion[e.id]),e.addEventListener(`calciteAccordionItemExpand`,t),e.addEventListener(`calciteAccordionItemCollapse`,t)})}),s.querySelectorAll(`calcite-table`).forEach(e=>{e.componentOnReady().then(()=>{let t=e.shadowRoot.querySelector(`calcite-pagination:not(:has(+ .popout))`);if(t){let r=document.createElement(`calcite-action`);r.icon=`launch`,r.title=`Expand Table`,r.classList.add(`popout`),r.addEventListener(`click`,t=>{n(e)}),t.after(r),(t.totalItems||0)<=5&&(t.style.visibility=`hidden`)}})})}).observe(s,{childList:!0,subtree:!0});let r=document.getElementById(`track`);r.componentOnReady().then(()=>{r.addEventListener(`arcgisPropertyChange`,e=>{m.isTracking=r.tracking,m.isTracking&&D(`fullscreen`)}),new MutationObserver(()=>{s.closed||r.stop()}).observe(s,{attributes:!0,attributeFilter:[`closed`]})})}),window.addEventListener(`popstate`,e=>{f&&console.log(`window.popstate`,e,window.location.href);let t=m.prevState?m.prevState.split(`#`):``,n=t[0],r=t[1],i=window.location.href.split(`#`),a=i[0],o=i[1];(n!==a||r===o)&&(m.currentPathName=document.location.pathname,m.prevState=window.location.href,k(m.prevState),e.stopImmediatePropagation())}),window.addEventListener(`resize`,e=>{f&&console.log(`window.resize`,e),!(m.android&&document.activeElement&&document.activeElement.getAttribute(`type`)===`text`)&&(m.resizeTimeout&&clearTimeout(m.resizeTimeout),m.resizeTimeout=setTimeout(E,200),e.stopImmediatePropagation())}),document.getElementById(`detail-menu-share`).addEventListener(`click`,e=>{f&&console.log(`#detail-menu-share.click`,e);let t=document.getElementById(`dialog-share`);document.getElementById(`dialog-share-url`).setAttribute(`value`,m.urlRoot+m.currentPathName+window.location.search),t.open=!0,e.stopImmediatePropagation()}),document.getElementById(`dialog-share-url`).addEventListener(`click`,e=>{f&&console.log(`#dialog-share-url.click`,e),document.getElementById(`dialog-share-url`).selectText(),e.stopImmediatePropagation()}),document.querySelectorAll(`#dialog-share calcite-tile`).forEach(e
2=>{e.addEventListener(`click`,e=>{f&&console.log(`#dialog-share calcite-tile.click`,e);let t=document.getElementById(`dialog-share`),n=e.currentTarget.id.split(`-`).pop(),r;switch(n){case`copy`:document.getElementById(`dialog-share-url`).selectText(),navigator.clipboard?navigator.clipboard.writeText(document.getElementById(`dialog-share-url`).value):document.execCommand(`copy`);return;case`message`:r=`sms:`+(m.ios?`&`:`?`)+`body=`;break;case`email`:r=`mailto:%20?subject=PortlandMaps&body=`;break;default:return}r+=encodeURIComponent(m.urlRoot+m.currentPathName+window.location.search),window.location=r,t.open=!1})}),document.getElementById(`detail-menu-print`).addEventListener(`click`,ae),document.getElementById(`detail-menu-bookmark`).addEventListener(`click`,async e=>{f&&console.log(`#detail-menu-bookmark.click`,e),await b()||await y(!0);let t=document.getElementById(`dialog-bookmark`),n=document.getElementById(`form-bookmark-action`),r=document.getElementById(`form-bookmark-id`),i=document.getElementById(`form-bookmark-link`),a=document.getElementById(`form-bookmark-title`),o=document.getElementById(`dialog-bookmark-delete`),s=m.bookmarks.find(e=>m.currentPathName.endsWith(e.link));if(s)n.value=`update`,r.value=s.id,i.innerHTML=s.link,a.value=s.title,o.hidden=!1;else{n.value=`add`,r.value=0,i.innerHTML=m.currentPathName+window.location.search;let e=G(m.identifyCurrent.type)+`: `+m.identifyCurrent.title,t=Y(`p`);m.propertyIdMatchPattern.test(t)&&(e+=` (`+t+`)`),a.value=e,o.hidden=!0}t.open=!0}),document.getElementById(`form-bookmark`).addEventListener(`submit`,e=>{f&&console.log(`#form-bookmark.submit`,e),T(),e.preventDefault()}),document.getElementById(`dialog-bookmark-cancel`).addEventListener(`click`,e=>{f&&console.log(`#dialog-bookmark-cancel.click`,e),document.getElementById(`dialog-bookmark`).open=!1}),document.getElementById(`dialog-bookmark-delete`).addEventListener(`click`,e=>{f&&console.log(`#dialog-bookmark-delete.click`,e),document.getElementById(`form-bookmark-action`).value=`delete`,T()});let c=document.getElementById(`dialog-login`);document.getElementById(`header-user`).addEventListener(`click`,()=>{c.open=!0}),document.getElementById(`dialog-login-cancel`).addEventListener(`click`,e=>{f&&console.log(`#dialog-login-cancel.click`,e),c.open=!1}),document.getElementById(`form-login`).addEventListener(`submit`,e=>{f&&console.log(`#form-login.submit`,e),y(),e.preventDefault()}),document.getElementById(`button-logout`).addEventListener(`click`,ee)},y=async e=>{f&&console.log(`loginValidate`);let t=document.getElementById(`dialog-login`),n=document.getElementById(`form-login-username`),r=document.getElementById(`form-login-password`);if(!m.loginPending){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();m.loginPending={promise:e,resolve:t,reject:n}}if(e)t.open=!0;else{let e=n.value,i=r.value;e.length&&i.length&&W(`auth`,{action:`ValidateUser`,user_name:e,password:i,contact_full:1}).then(async e=>{let n=document.getElementById(`notice-login`);if(e.data.loginvalid===!0)n.hidden=!0,await C(),t.open=!1,m.loginPending.resolve(),delete m.loginPending;else{let t=document.getElementById(`notice-login-title`);t.innerText=e.data.loginvalid===!1?`Incorrect Username/Email and Password combination`:`Sorry, an error occurred`,n.hidden=!1,x()}r.value=``,V()},J)}return m.loginPending.promise},b=async()=>(f&&console.log(`loginVerify`),W(`auth`,{action:`VerifyLogin`,contact_full:1}).then(e=>{if(e.data.loginvalid){let t=document.getElementById(`header-user`),n=document.getElementById(`login-full-name`),r=document.getElementById(`login-username`),i=document.getElementById(`login-email`),a=document.getElementById(`button-login`),o=document.getElementById(`button-logout`),s=document.getElementById(`form-login`),c=document.getElementById(`login-account`);return t.fullName=n.innerText=e.data.first_name+` `+e.data.last_name,t.username=r.innerText=e.data.user_name,t.userId=e.data.contact_id.toString(),i.innerText=e.data.email,c.hidden=!1,s.hidden=!0,a.hidden=!0,o.hidden=!1,!0}return x(),!1},J)),ee=()=>(f&&console.log(`logout`),W(`auth`,{action:`Logoff`}).then(e=>{m.bookmarks=[],document.getElementById(`bookmarks`).replaceChildren(),x(),V()},J)),x=()=>{let e=document.getElementById(`header-user`),t=document.getElementById(`login-full-name`),n=document.getElementById(`login-username`),r=document.getElementById(`login-email`),i=document.getElementById(`button-login`),a=document.getElementById(`button-logout`),o=document.getElementById(`form-login`),s=document.getElementById(`login-account`),c=document.getElementById(`form-login-password`),l=document.getElementById(`detail-menu-bookmark`),u=document.getElementById(`notice-bookmarks`);e.fullName=t.innerText=``,e.username=n.innerText=``,e.userId=``,e.thumbnail=``,r.innerText=``,s.hidden=!0,o.hidden=!1,i.hidden=!1,a.hidden=!0,c.value=``,l.iconStart=`bookmark`,u.hidden=!1},S=e=>{if(f&&console.log(`recentLoad`),e){m.recent.unshift(e);
2let t=m.recent.filter((e,t,n)=>t===n.findIndex(t=>t.id===e.id&&t.type===e.type));t.length>20&&(t=t.splice(0,20)),m.recent=t,Q(`recent`,JSON.stringify(m.recent))}document.getElementById(`recent`).replaceChildren(),m.recent.length&&m.recent.forEach((e,t)=>{te(e)})},te=e=>{f&&console.log(`recentListUpdate`);let t=document.getElementById(`recent`),n=e.title?.length?e.title:`No Address Available (`+e.id+`)`,r=m.detailUrlRoot+encodeURIComponent(e.type)+`/`+encodeURIComponent(e.id)+(e.location?`_xy`:`_did`)+`/`,i=Object.assign(document.createElement(`calcite-list-item`),{label:n,description:e.id,value:e.id,href:r});i.addEventListener(`click`,e=>{k(e.target.href)}),t.appendChild(i)},C=async()=>{f&&console.log(`bookmarkLoad`),m.bookmarks=[],document.getElementById(`bookmarks`).replaceChildren();let e=await b(),t=document.getElementById(`notice-bookmarks`);if(e)return W(`bookmark`,{action:`get`}).then(e=>{m.bookmarks=e.data.bookmarks,m.bookmarks.length&&m.bookmarks.forEach((e,t)=>{w(e,`add`)}),t.hidden=!0},J)},w=(e,t)=>{f&&console.log(`bookmarkUpdate`,e,t);let n=document.getElementById(`bookmarks`);if(t===`delete`)document.getElementById(`bookmark-`+e.id).remove(),m.currentPathName.endsWith(e.link)&&(document.getElementById(`detail-menu-bookmark`).iconStart=`bookmark`),m.bookmarks.filter(t=>t.id!=e.id);else if(t===`update`)document.getElementById(`bookmark-`+e.id).setAttribute(`label`,e.title),m.bookmarks.filter(t=>t.id==e.id)[0].title=e.title;else{let t=Object.assign(document.createElement(`calcite-list-item`),{label:e.title,id:`bookmark-`+e.id,value:e.id,href:e.link}),r=Object.assign(document.createElement(`calcite-action`),{slot:`actions-end`,icon:`pencil-square`,text:`Edit`,id:`action-bookmark-`+e.id});if(t.addEventListener(`click`,e=>{k(e.target.href)}),r.addEventListener(`click`,t=>{t.target.parentElement.value,document.getElementById(`form-bookmark-action`).value=`update`,document.getElementById(`form-bookmark-id`).value=e.id,document.getElementById(`form-bookmark-link`).innerHTML=e.link,document.getElementById(`form-bookmark-title`).value=e.title,document.getElementById(`dialog-bookmark-delete`).hidden=!1,document.getElementById(`dialog-bookmark`).open=!0,t.stopImmediatePropagation()}),t.appendChild(r),n.appendChild(t),m.currentPathName.endsWith(e.link)){let e=document.getElementById(`detail-menu-bookmark`);e.iconStart=`bookmark-f`}m.bookmarks.find(t=>t.id==e.id)||m.bookmarks.push(e)}m.bookmarks.sort((e,t)=>e.title.toLowerCase().localeCompare(t.title.toLowerCase())),Array.from(n.children).sort((e,t)=>e.label.localeCompare(t.label)).forEach(e=>n.insertBefore(e,null))},T=async()=>{f&&console.log(`bookmarkSubmit`),await b()||await y(!0);let e=document.getElementById(`dialog-bookmark`),t=document.getElementById(`form-bookmark`),n=document.getElementById(`form-bookmark-action`).value,r=m.currentPathName.replace(m.detailUrlRoot,`/detail/`),i=document.getElementById(`form-bookmark-title`).value,a=document.getElementById(`form-bookmark-id`).value;W(`bookmark`,{action:n,id:a,link:r,title:i}).then(o=>{e.open=!1,t.reset(),n===`add`&&(a=o.data.id),w({id:a,title:i,link:r},n)},J)},E=()=>
2{if(m.viewportWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,m.viewportHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,!m.headerHeight){let e=window.getComputedStyle(document.getElementById(`header`));m.headerHeight=parseInt(e.marginTop,10)+parseInt(e.borderTopWidth,10)+parseInt(e.height,10)+parseInt(e.borderBottomWidth,10)+parseInt(e.marginBottom,10)}m.viewportHeight-=m.headerHeight,m.isVerticalViewport=!(m.viewportWidth>=m.verticalBreakpoint),f&&console.log(`updateViewport:`,`viewportWidth`,m.viewportWidth,`viewportHeight`,m.viewportHeight,`headerHeight`,m.headerHeight,`isVerticalViewport`,m.isVerticalViewport);let e=document.getElementById(`detail`).offsetWidth||0,t=m.view?.offsetWidth||m.viewportWidth;m.detailWidth=e||Math.min(t*.45,680),ne();let n=document.getElementById(`header-user`);n.textDisabled=!(m.viewportWidth>=480),n.hidden=!(m.viewportWidth>=400)},ne=async e=>{f&&console.log(`adjustDetailPanel`,e);let t=document.getElementById(`detail-side`),n=document.getElementById(`detail-bottom`),r=document.getElementById(`detail`),i=document.querySelector(`calcite-shell`),a=document.getElementById(`action-detail`);await t.componentOnReady(),await r.componentOnReady();let o=!r.closed;a.active=o,m.isVerticalViewport?(n.appendChild(r),t.hidden=!0,o?(n.classList.add(`active`),i.classList.add(`detail-vertical`)):(n.classList.remove(`active`),i.classList.remove(`detail-vertical`)),r.style.minHeight=window.getComputedStyle(n).height):(t.appendChild(r),n.classList.remove(`active`),i.classList.remove(`detail-vertical`),t.hidden=!o,r.style.minHeight=`auto`),setTimeout(O,200)},D=e=>{f&&console.log(`changeViewportMode`,e);let t=e===`fullscreen`,n=document.getElementById(`detail`);m.viewportMode=t?`fullscreen`:`detail`,n.closed=t,E()},O=()=>{if(f&&console.log(`adjustIdentifyGeometry`),!m.isTracking&&m.identifyCurrent?.feature){let e=document.getElementById(`detail`),t=m.identifyCurrent.taxlot||m.identifyCurrent.feature.geometry,n=t.type===`point`?t:t.extent;e.closed&&m.view.extent.contains(n)?m.view.center=t.type===`point`?t:t.extent.center:N()}},k=e=>{f&&console.log(`urlAction`),e||=m.currentPathName;let t=e.match(m.detailUrlMatchPattern),n=e.match(m.locationUrlMatchPattern),r=Y(`p`);t?.length?A({detail_type:t[1],detail_id:t[2],property_id:m.propertyIdMatchPattern.test(r)?r:null}):n?.length?A({detail_type:n[1],x:parseFloat(n[2]),y:parseFloat(n[3])}):g(H(`property`))},A=e=>(f&&console.log(`detailSelect`,e),delete m.identifyCurrent,m.identifyGraphic&&m.view.graphics.remove(m.identifyGraphic),document.getElementById(`detail-content`).replaceChildren(),document.getElementById(`detail-menu`).hidden=!0,Z(`detail`,!0),g(H(e.detail_type)||H(`property`)).then(()=>{if(e.x){m.view.graphics.removeAll();let t=new i(e.x,e.y,new r({wkid:3857}));m.identifyGraphic=z(t),m.identifyCurrent={type:e.detail_type,id:e.x+`_`+e.y,title:`Location (`+e.x+`,`+e.y+`)`,feature:{geometry:t},location:!0},M()}else W(`detail`,{detail_type:e.detail_type,detail_id:e.detail_id,geometry:e.geometry?JSON.stringify(e.geometry):null,property_id:e.property_id===e.detail_id?null:e.property_id,sections:`geometry`,format:`json`},null,null,!0).then(t=>{if(t.data.geometry){let n;m.identifyCurrent&&(n=m.identifyCurrent.feature),t.data.geometry.spatialReference&&(n={geometry:l.fromJSON(t.data.geometry)}),t.data.geometry.detail_id&&(e.detail_id=t.data.geometry.detail_id),m.identifyCurrent={type:e.detail_type,id:e.detail_id,property_id:e.property_id,geometry:e.geometry,title:t.data.geometry.title,feature:n},n.geometry&&j(n.geometry),t.data.geometry.taxlot?(m.identifyCurrent.taxlot=l.fromJSON(t.data.geometry.taxlot),m.identifyCurrent.taxlot.graphic=z(m.identifyCurrent.taxlot),m.identifyCurrent.property_id=t.data.geometry.taxlot.attributes.id):(e.geometry&&!m.propertyIdMatchPattern.test(e.detail_id)&&z(e.geometry),delete m.identifyCurrent.property_id),M()}else e.geometry?.x?A({detail_type:e.detail_type,x:e.geometry.x,y:e.geometry.y}):D(`fullscreen`)},t=>{e.geometry?.x?A({detail_type:e.detail_type,x:e.geometry.x,y:e.geometry.y}):D(`fullscreen`)})}).catch(J)),j=e=>{if(f&&console.log(`highlightGeometry`,e),e&&`type`in e&&`spatialReference`in e){let t=[`point`,`multipoint`].indexOf(e.type)>=0?m.selectSymbolPoint:e.type===`polyline`?m.selectSymbolLine:m.selectSymbolPolygon,n=m.selectSymbolLine,r=e.style;r&&(n=n.setStyle(r),e.type===`polyline`?t=n:t.setOutline(n)),m.identifyGraphic=new o({geometry:e,symbol
2:t}),m.view.graphics.removeAll(),m.view.graphics.add(m.identifyGraphic)}},M=()=>{f&&console.log(`populateDetail`);let e=m.identifyCurrent;D(`detail`),document.title=`PortlandMaps`+(e.title?`: `+e.title:``),e.id&&m.propertyIdMatchPattern.test(e.id)&&S({id:e.id,type:`property`,title:e.title});let n;n=e.location?m.urlRoot+m.detailUrlRoot+e.type+`/`+encodeURIComponent(e.id)+`_xy/`+window.location.search+window.location.hash:m.urlRoot+m.detailUrlRoot+e.type+`/`+(e.title?.length?encodeURIComponent(e.title.replace(/[^a-zA-Z0-9]+/g,`-`))+`/`:``)+encodeURIComponent(e.id)+`_did/`+window.location.search+window.location.hash,n=e.property_id?.length&&e.property_id!==e.id?X(n,`p`,e.property_id):X(n,`p`,``),m.prevState!=n&&(f&&console.log(`pushState`,n),window.history.pushState?window.history.pushState({},``,n):n.indexOf(m.currentPathName)===-1&&(window.location=n),m.prevState=n,m.currentPathName=document.location.pathname);let r=document.getElementById(`detail-menu-bookmark`);r.iconStart=m.bookmarks.find(e=>m.currentPathName.endsWith(e.link))?`bookmark-f`:`bookmark`,f&&$(`detail`),W(`detail`,{detail_type:e.type,detail_id:e.id,geometry:e.geometry?JSON.stringify(e.geometry):null,property_id:e.property_id?e.property_id:null,sections:`*`,format:`json`,embed:!0}).then(async n=>{f&&$(`detail`,!0);let r=e.location?`location`:e.type;await U(r),!(`summary`in n.data)&&n.data.taxlot&&(n.data.summary={site_address_full:n.data.taxlot.address,site_city_state_zip:n.data.taxlot.address2},e.property_id=n.data.taxlot.property_id);let i={...n.data,...t,detail_type:e.type,detail_id:e.id,property_id:e.property_id||e.id,api_key:m.apiKey},a=document.getElementById(`action-detail`),o=document.getElementById(`detail-content`);a.disabled=!1,a.classList.add(`populated`),f&&$(`render`),o.innerHTML=p.render(r,i),f&&$(`render`,!0),o.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let n of e.attributes)t.setAttribute(n.name,n.value);t.text=e.innerHTML,e.parentNode?.replaceChild(t,e)}),document.getElementById(`detail`).style.removeProperty(`min-height`),q(),document.getElementById(`detail-menu`).hidden=!1,Z(`detail`,!1)})},N=e=>{let t=m.identifyCurrent?.feature?.geometry;if(!t||!(`type`in t)||!(`spatialReference`in t))return;if(f&&console.log(`zoomToGeometry`,t,e),t.type===`point`&&(t=new a(t.x-100,t.y-100,t.x+100,t.y+100,t.spatialReference)),m.identifyCurrent.taxlot){let e=m.identifyCurrent.taxlot.type===`point`?new a(m.identifyCurrent.taxlot.x-100,m.identifyCurrent.taxlot.y-100,m.identifyCurrent.taxlot.x+100,m.identifyCurrent.taxlot.y+100,m.identifyCurrent.taxlot.spatialReference):m.identifyCurrent.taxlot.extent;t=(t.type===`polygon`||t.type===`extent`)&&t.contains(e.center)?e:t.extent.union(e)}let n=t.extent,r=n.width,i=n.height,o=n.center.clone(),s=m.lods.slice(0).filter(t=>e||parseInt(t.scale)>282).reverse(),c=document.getElementById(`detail`),l=m.isVerticalViewport||c.closed?1:m.detailWidth/m.viewportWidth,u=m.actionBarWidth/m.viewportWidth,d=m.isVerticalViewport?1:1-l-u,p,h,g,_;s.every((t,n)=>{if(p=re(t),h=p.width*d,g=p.height,_=p.width*l,t.scale===e||!e&&r<h&&i<g){if(m.viewportMode===`detail`&&!m.isVerticalViewport&&!m.isPrintView){let e=_/2;m.interface===`right`?o.x-=e:o.x+=e}return m.view.center=o,m.view.scale=t.scale,B(),!1}return!0})},re=e=>{f&&console.log(`getExtentForScale`,e);let t=m.view.extent.center,n=m.view.offsetWidth,r=m.view.offsetHeight,i=n/2*e.resolution,o=r/2*e.resolution;return new a({xmin:t.x-i,ymin:t.y-o,xmax:t.x+i,ymax:t.y+o,spatialReference:{wkid:3857}})},P=async()=>{f&&console.log(`initSearch`),!m.search&&(m.search=document.querySelector(`arcgis-search`),m.search.componentOnReady().then(()=>{m.search.popupDisabled=!0,m.search.resultGraphicDisabled=!0,m.search.addEventListener(`arcgisSelectResult`,async e=>{if(!e.detail.result)return;let t=e.detail.result.feature.attributes,n=e.detail.result.feature.geometry;t.property_id?A({detail_type:`property`,detail_id:t.property_id}):n&&A({detail_type:`property`,x:parseFloat(n.x),y:parseFloat(n.y)}),e.stopImmediatePropagation()})}))},F=()=>
2{f&&console.log(`adjustMapControls`);let e=document.getElementById(`action-bar`);if(m.actionBarWidth=e.offsetWidth,m.view){let e=0,t=0;m.isPrintView||(m.interface===`right`?e=m.actionBarWidth:t=m.actionBarWidth),m.view.padding={right:e,left:t},m.view.style.setProperty(`--arcgis-layout-overlay-space-right`,e?e+`px`:``),m.view.style.setProperty(`--arcgis-layout-overlay-space-left`,t?t+`px`:``)}},I=async()=>{f&&console.log(`initMapEvents`);let e=document.getElementById(`zoom-in`),t=document.getElementById(`zoom-out`);await e.componentOnReady(),await t.componentOnReady(),e.addEventListener(`click`,e=>{let t=m.lods.reduce((e,t)=>Math.abs(t.scale-m.view.scale)<Math.abs(e.scale-m.view.scale)?t:e,m.lods[0]),n=m.lods.findIndex(e=>e.scale===t.scale);if(n<0||n>=m.lods.length)return;let r=m.lods[n+1].scale;m.identifyCurrent?.feature&&m.viewportMode===`detail`?(N(r),e.stopImmediatePropagation()):m.view.scale=r,e.stopImmediatePropagation()}),t.addEventListener(`click`,e=>{let t=m.lods.reduce((e,t)=>Math.abs(t.scale-m.view.scale)<Math.abs(e.scale-m.view.scale)?t:e,m.lods[m.lods.length-1]),n=m.lods.findIndex(e=>e.scale===t.scale);if(n<=0)return;let r=m.lods[n-1].scale;m.identifyCurrent?.feature&&m.viewportMode===`detail`?(N(r),e.stopImmediatePropagation()):m.view.scale=r,e.stopImmediatePropagation()}),m.view.addEventListener(`arcgisViewClick`,e=>{if(m.toolPanelOpen||m.isPrintView||m.isTableView)return;f&&console.log(`view.click`,e);let t=e.detail.mapPoint;m.clickHoldShift||e.detail.button===2?A({detail_type:m.webmap.code,x:t.x,y:t.y}):A({detail_type:m.webmap.geometry_code?.length?m.webmap.geometry_code:m.webmap.code,geometry:t}),e.stopImmediatePropagation()}),m.view.addEventListener(`arcgisViewHold`,e=>{f&&console.log(`view.hold`,e),A({detail_type:m.webmap.code,x:e.detail.mapPoint.x,y:e.detail.mapPoint.y}),e.stopImmediatePropagation()}),m.view.addEventListener(`arcgisViewKeyDown`,e=>{f&&console.log(`view.key-down`,e),(e.detail.key||e.detail.keyIdentifier)===`Shift`&&(m.clickHoldShift=!0),e.stopImmediatePropagation()}),m.view.addEventListener(`arcgisViewKeyUp`,e=>{f&&console.log(`view key-up`,e),(e.detail.key||e.detail.keyIdentifier)===`Shift`&&(m.clickHoldShift=!1),e.stopImmediatePropagation()}),u.watch(()=>m.view?.extent,e=>{f&&console.log(`view.extent change`,e),m.extent=m.view.extent,B();let t=document.getElementById(`zoom-in`),n=document.getElementById(`zoom-out`);t.disabled=m.view.scale<=m.maxScale,n.disabled=m.view.scale>=m.minScale}),u.watch(()=>m.view?.ready,e=>{e&&(f&&console.log(`view.ready watch`,e),m.view.constraints?.effectiveMaxScale&&(m.maxScale=m.view.constraints?.effectiveMaxScale,m.minScale=m.view.constraints?.effectiveMinScale,Array.isArray(m.view.constraints?.effectiveLODs)&&(m.lods=m.view.constraints.effectiveLODs)))})},L=async()=>{f&&console.log(`initOverlays`),m.overlay[m.webmap.id]=Array.from(m.map.layers).reduce((e,t)=>(t.url?.length&&(u.watch(()=>[t.visible,t.opacity],([e,n])=>{let r=m.overlay[m.webmap.id].find(e=>e.url===t.url);Object.assign(r,{visible:e,opacity:n}),Q(`overlay`,JSON.stringify(m.overlay))}),e.push({url:t.url,visible:t.visible,opacity:t.opacity})),e),[]),Q(`overlay`,JSON.stringify(m.overlay))},ie=async()=>{f&&console.log(`initPrint`),!m.print&&(m.print=document.querySelector(`arcgis-print`),m.print.componentOnReady().then(()=>{let e=document.getElementById(`action-detail-print`),t=document.getElementById(`action-table-print`),n=document.getElementById(`action-print-close`),r=document.getElementById(`detail-print-area`),i=document.getElementById(`scrim-print`),a=window.matchMedia(`print`);e.addEventListener(`click`,e=>{r.classList.add(`printing`),i.hidden=!1,setTimeout(window.print,m.isVerticalViewport?500:0)}),t.addEventListener(`click`,e=>{setTimeout(window.print,0)}),n.addEventListener(`click`,e=>{R(!1)}),a.addEventListener(`change`,e=>{e.matches||(r.classList.remove(`printing`),i.hidden=!0)}),m.ios||window.addEventListener(`afterprint`,e=>{r.classList.remove(`printing`),i.hidden=!0})}))},ae=async e=>{f&&console.log(`printDetail`,e);let t=document.getElementById(`action-detail-print`);R(!0),t.setFocus()},R=e=>{let t=document.getElementById(`detail`),n=document.getElementById(`detail-content`),r=document.getElementById(`detail-print`),i=document.getElementById(`detail-print-content`),a=document.getElementById(`detail-print-map`),o=document.getElementById(`map`),s=document.getElementById(`panel-map`);document.getElementById(`detail-print-area`).classList.remove(`printing`),m.isPrintView=e,m.isPrintView?(i.appendChild(n),a.appendChild(o),F(),n.querySelectorAll(`calcite-table`).forEach(e
2=>{e.removeAttribute(`page-size`)}),n.querySelectorAll(`calcite-link`).forEach(e=>{e.setAttribute(`disabled`,!0)}),r.classList.add(`active`),m.isVerticalViewport&&(document.scrollingElement.scrollTop=0)):(t.appendChild(n),s.appendChild(o),F(),n.querySelectorAll(`calcite-table`).forEach(e=>{e.setAttribute(`page-size`,5)}),n.querySelectorAll(`calcite-link`).forEach(e=>{e.removeAttribute(`disabled`)}),r.classList.remove(`active`)),N()},z=(e,t,n)=>{f&&console.log(`resultMarker`,e,t,n),t&&n?(m.view.center=e,m.view.scale=m.defaultScale):t&&(m.view.center=e),m.searchCenter=e;let r=new o({geometry:e,symbol:e.type===`point`?m.selectSymbolMarkerPoint:m.selectSymbolMarkerPolygon});return m.view.graphics.add(r),r},B=()=>{f&&console.log(`updateTaxlotMarker`);let e=m.identifyCurrent;if(e?.taxlot){let t=e.taxlot.graphic,n=m.view.zoom;n>=16&&t.geometry.type===`point`?(m.view.graphics.remove(t),e.taxlot.graphic=z(e.taxlot)):n<16&&t.geometry.type!==`point`&&(m.view.graphics.remove(t),e.taxlot.graphic=z(e.taxlot.extent.center))}},oe=async()=>(f&&console.log(`getApiKey`),W(`agkey`,{name:`portlandmaps`}).then(e=>e.data.api_key).catch(J)),V=async()=>(f&&console.log(`getWebmapsMetadata`),W(`agol`,{type:`webmapextra`}).then(e=>{m.webmapMetadata=e.data}).catch(J)),H=e=>(f&&console.log(`getWebmapMetadataByCode`,e),m.webmapMetadata.filter(t=>t.code==e)[0]),U=async e=>{if(f&&console.log(`getTemplate`,e),m.templates=m.templates||[],!m.templates[e]){let t=m.templateUrlRoot+e.replace(/^(crime).*/,`$1`)+`.eta`,n=H(e)?.template_date;n&&(t+=`?v=`+n);let r=await fetch(t);m.templates[e]=await r.text(),p.loadTemplate(e,m.templates[e])}},W=async(e,t,n,r,i)=>{f&&console.log(`apiRequest`,e,t,n,r);let a=m.apiUrl.replace(/<action>/,e);t.api_key=m.apiKey,f&&(t.debug=1);let o={query:t,timeout:15e3,method:[`auth`,`bookmark`].indexOf(e)>=0?`post`:`get`};return i||(o.error=e=>{e.message!=`Request canceled`&&J(e)}),r&&(o.form=r),n?o.responseType=n:o.callbackParamName=`callback`,s(a,o)},G=e=>e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),K=e=>{m.isPrintView||m.isTableView||(m.scrollTimeout&&clearTimeout(m.scrollTimeout),m.scrollTimeout=setTimeout(()=>{let e=m.isVerticalViewport?document.scrollingElement.scrollTop:m.detailContainer.scrollTop;f&&console.log(`scrollLog`,e);let t=m.identifyCurrent;if(t?.id){let n=m.scroll.find(e=>e.id===t.id&&e.type===t.type);n?n.scroll=e:m.scroll.unshift({id:t.id,type:t.type,scroll:e}),m.scroll.length>20&&(m.scroll=m.scroll.splice(0,20)),Q(`scroll`,JSON.stringify(m.scroll))}},200))},se=e=>{f&&console.log(`scrollTo`,e),m.isVerticalViewport?document.scrollingElement.scrollTop=e:m.detailContainer.scrollTop=e},q=()=>{f&&console.log(`scrollToSaved`);let e=m.identifyCurrent;if(e){let t=m.scroll.find(t=>t.id===e.id&&t.type===e.type)?.scroll;t&&setTimeout(()=>{se(t)},200)}},ce=e=>{f&&console.log(`handleAlert`,e);let t=document.getElementById(`dialog-alert`);t.innerHTML=e.replace(/\n/g,`<br />`),t.open=!0},J=e=>{f&&console.log(`handleError`,e),console.log(`error`,e);let t=document.getElementById(`dialog-error`);t.innerHTML=e.message,t.open=!0},Y=e=>{f&&console.log(`getQueryStringParameter`,e);let t=RegExp(`[?&]`+e+`=([^&#]*)`,`i`).exec(window.location.search);return t?t[1]:null},X=(e,t,n)=>{f&&console.log(`updateQueryStringParameter`,t,n);let r=RegExp(`([?&])`+t+`=.*?(&|#|$)`,`i`),i=e.indexOf(`?`)===-1?`?`:`&`;return e=!n||!n.length?e.replace(r,``):e.match(r)?e.replace(r,`$1`+t+`=`+n+`$2`):e+i+t+`=`+n,e},Z=async(e,t)=>{f&&console.log(`toggleLoader`,e,t);let n=document.getElementById(`loader-`+e);n.componentOnReady().then(()=>{n.hidden=!t})},Q=(e,t)=>{try{if(t!==void 0)localStorage.setItem(e,t);else return localStorage.getItem(e)}catch{}},$=(e,t=!1)=>{m.timer[e]?.id&&clearInterval(m.timer[e]?.id),t?console.log(`timer[`+e+`]: end `+(m.timer[e].elapsed/1e3).toFixed(3)+`s`):m.timer[e]={start:performance.now(),elapsed:0,id:setInterval(()=>{m.timer[e].elapsed=performance.now()-m.timer[e].start})}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,h):h();
3//# sourceMappingURL=index-DR7DhLGA.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.