@esri/solutions-components 0.10.36 → 0.10.37
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +2 -2
- package/dist/cjs/calcite-block_5.cjs.entry.js +2 -2
- package/dist/cjs/{constants-0a4fc296.js → constants-51cf394f.js} +57 -1
- package/dist/cjs/{helpers-415179ad.js → helpers-afcac967.js} +1 -1
- package/dist/cjs/instant-apps-app-guide.cjs.entry.js +26 -13
- package/dist/cjs/instant-apps-export.cjs.entry.js +1086 -59
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +8 -4
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +10 -5
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +52 -12
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +9 -3
- package/dist/cjs/instant-apps-landing-page.cjs.entry.js +19 -13
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +3 -2
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-popover.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-sign-in.cjs.entry.js +13 -9
- package/dist/cjs/instant-apps-splash.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-time-filter.cjs.entry.js +11 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-item-accordion.cjs.entry.js +7 -3
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +7 -3
- package/dist/collection/demos/solution-item-accordion.html +32 -0
- package/dist/components/instant-apps-app-guide.js +28 -14
- package/dist/components/instant-apps-export.js +1119 -76
- package/dist/components/instant-apps-interactive-legend-classic2.js +8 -4
- package/dist/components/instant-apps-interactive-legend-count2.js +6 -3
- package/dist/components/instant-apps-interactive-legend-layer-element-caption2.js +5 -2
- package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +52 -12
- package/dist/components/instant-apps-interactive-legend.js +13 -4
- package/dist/components/instant-apps-landing-page.js +19 -13
- package/dist/components/instant-apps-language-switcher.js +3 -1
- package/dist/components/instant-apps-language-translator2.js +57 -1
- package/dist/components/instant-apps-measurement-tool2.js +2 -2
- package/dist/components/instant-apps-measurement.js +2 -2
- package/dist/components/instant-apps-popover.js +1 -1
- package/dist/components/instant-apps-scoreboard.js +1 -1
- package/dist/components/instant-apps-sign-in2.js +14 -9
- package/dist/components/instant-apps-social-share2.js +2 -2
- package/dist/components/instant-apps-splash.js +1 -1
- package/dist/components/instant-apps-time-filter.js +11 -9
- package/dist/components/solution-item-accordion.js +7 -3
- package/dist/components/store.js +1 -1
- package/dist/esm/calcite-action-pad_2.entry.js +2 -2
- package/dist/esm/calcite-block_5.entry.js +2 -2
- package/dist/esm/{constants-045d6a1b.js → constants-886c7c2c.js} +57 -1
- package/dist/esm/{helpers-f9bf9c0b.js → helpers-91087955.js} +1 -1
- package/dist/esm/instant-apps-app-guide.entry.js +26 -13
- package/dist/esm/instant-apps-export.entry.js +1086 -59
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +8 -4
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +10 -5
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +1 -1
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +52 -12
- package/dist/esm/instant-apps-interactive-legend.entry.js +9 -3
- package/dist/esm/instant-apps-landing-page.entry.js +19 -13
- package/dist/esm/instant-apps-language-switcher.entry.js +3 -2
- package/dist/esm/instant-apps-language-translator.entry.js +1 -1
- package/dist/esm/instant-apps-measurement.entry.js +2 -2
- package/dist/esm/instant-apps-popover.entry.js +1 -1
- package/dist/esm/instant-apps-scoreboard.entry.js +1 -1
- package/dist/esm/instant-apps-sign-in.entry.js +13 -9
- package/dist/esm/instant-apps-splash.entry.js +1 -1
- package/dist/esm/instant-apps-time-filter.entry.js +11 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/solution-item-accordion.entry.js +7 -3
- package/dist/esm/solutions-components.js +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-app-guide/instant-apps-app-guide.css +0 -5
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-export/instant-apps-export.css +4 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-classic/instant-apps-interactive-legend-classic.css +14 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-count/instant-apps-interactive-legend-count.css +9 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-layer-element-caption/instant-apps-interactive-legend-layer-element-caption.css +5 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-legend-element-caption/instant-apps-interactive-legend-legend-element-caption.css +29 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +8 -0
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +22 -0
- package/dist/solutions-components/demos/solution-item-accordion.html +32 -0
- package/dist/solutions-components/p-1e14b3d0.entry.js +6 -0
- package/dist/solutions-components/p-2542d5c9.entry.js +6 -0
- package/dist/solutions-components/{p-70ecc979.entry.js → p-374ddead.entry.js} +1 -1
- package/dist/solutions-components/{p-146acd9a.entry.js → p-3fc18283.entry.js} +1 -1
- package/dist/solutions-components/p-43699470.entry.js +6 -0
- package/dist/solutions-components/p-5585dcd3.entry.js +6 -0
- package/dist/solutions-components/{p-3a513c67.entry.js → p-5b3c0418.entry.js} +1 -1
- package/dist/solutions-components/{p-f7e7b830.entry.js → p-6438d1ea.entry.js} +1 -1
- package/dist/solutions-components/p-750b3277.entry.js +6 -0
- package/dist/solutions-components/p-8779ee41.entry.js +6 -0
- package/dist/solutions-components/p-90fc786f.entry.js +6 -0
- package/dist/solutions-components/{p-43165ebd.entry.js → p-9c170b30.entry.js} +1 -1
- package/dist/solutions-components/p-a5b751e2.entry.js +6 -0
- package/dist/solutions-components/p-af573e0d.js +6 -0
- package/dist/solutions-components/p-bb8b1ee2.entry.js +6 -0
- package/dist/solutions-components/{p-b79f296d.entry.js → p-c48be45f.entry.js} +2 -2
- package/dist/solutions-components/p-ca3cbd29.entry.js +6 -0
- package/dist/solutions-components/p-ceb1030b.js +6 -0
- package/dist/solutions-components/{p-29047e77.entry.js → p-e1391389.entry.js} +1 -1
- package/dist/solutions-components/p-f3b71784.entry.js +6 -0
- package/dist/solutions-components/{p-759d0beb.entry.js → p-f728af86.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/package.json +7 -7
- package/dist/solutions-components/p-07a194e6.entry.js +0 -6
- package/dist/solutions-components/p-14d78748.entry.js +0 -6
- package/dist/solutions-components/p-24e3f09f.entry.js +0 -6
- package/dist/solutions-components/p-3a33ef72.entry.js +0 -6
- package/dist/solutions-components/p-402301cb.js +0 -6
- package/dist/solutions-components/p-41a6f03d.entry.js +0 -6
- package/dist/solutions-components/p-4db86c5e.entry.js +0 -6
- package/dist/solutions-components/p-750f234e.entry.js +0 -6
- package/dist/solutions-components/p-7e97d4d6.entry.js +0 -6
- package/dist/solutions-components/p-7eb5d31a.js +0 -6
- package/dist/solutions-components/p-90d2aadc.entry.js +0 -6
- package/dist/solutions-components/p-b78a4ce7.entry.js +0 -6
- package/dist/solutions-components/p-efb4cb43.entry.js +0 -6
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{l}from"./p-4cd4cb85.js";import{c as n}from"./p-dc9d4be3.js";async function o(n,o,i){const[u]=await l(["esri/layers/effects/jsonUtils"]),{toJSON:v,fromJSON:d}=u,t=null==o?void 0:o.layer;if(!n)return(null==t?void 0:t.effect)?t.effect:(null==t?void 0:t.featureEffect)?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:null;const e=v(n);let r;r=t.featureEffect?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:t.effect;const a=r?v(r):null;if(!a)return d(e);let c=[...a];return e&&e.forEach((l=>{c.forEach((n=>{const{value:o}=n;if(o)o.forEach(((i,u)=>{i.type===l.type?o[u]=l:!n.value.find((l=>l.type===e[0].type))&&(n.value=[...n.value,...e])}));else{const o=!c.find((l=>l.type===n.type));!c.find((n=>n.type===l.type))&&(c=[...c,l]),o&&(c=[...c,n])}}))})),d(c)}const i=n({data:{},relationshipRampExpandStates:{},compact:!1}),u=i.state,v=i;async function d(l,n,o){var i,u,v,d,t,e,r,a,c;try{const s="group"===(null===(i=null==n?void 0:n.layer)||void 0===i?void 0:i.type),f=null===(v=null===(u=null==n?void 0:n.layer)||void 0===u?void 0:u.layers)||void 0===v?void 0:v.some((l=>l.visible)),$=null===(t=null===(d=null==n?void 0:n.layer)||void 0===d?void 0:d.layers)||void 0===t?void 0:t.every((l=>!(null==l?void 0:l.legendEnabled)));await o.whenOnce((()=>"ready"===(null==l?void 0:l.state))),!s||s&&f?s&&$?await o.whenOnce((()=>{var l;return null===(l=null==n?void 0:n.layer)||void 0===l?void 0:l.loaded})):await o.whenOnce((()=>null==n?void 0:n.ready)):await o.whenOnce((()=>null==n?void 0:n.legendElements));const y=null===(e=null==n?void 0:n.legendElements)||void 0===e?void 0:e[0],m=new Map,p=n.layer,N=await l.view.whenLayerView(p);await o.whenOnce((()=>!1===(null==N?void 0:N.updating)));const O=null===(r=p.renderer)||void 0===r?void 0:r.field;return void 0!==y&&(null===(a=null==y?void 0:y.infos)||void 0===a||a.forEach((l=>{var n;if("symbol-table"===l.type){const n=[];l.infos.forEach((l=>{n.push({count:null,selected:!1,legendElementInfo:l})})),m.set(l.title,{count:null,selected:!1,legendElementInfo:l,nestedInfos:n})}else m.set(null!==(n=l.label)&&void 0!==n?n:p.id,{count:null,selected:!1,legendElementInfo:l})}))),Promise.resolve({activeLayerInfo:n,title:null===(c=null==N?void 0:N.layer)||void 0===c?void 0:c.title,categories:m,field:O,queryExpressions:[],totalCount:null,fLayerView:N,legendElement:y})}catch(l){return Promise.resolve(null)}}async function t(l,n){const o={},i=[];l.activeLayerInfos.forEach(function(l,n,o){return i=>{var u;const v=null===(u=null==i?void 0:i.layer)||void 0===u?void 0:u.type;if("feature"===v||"group"===v){const u=d(n,i,o).then((l=>l));u&&l.push(u);const v=i=>{const u=d(n,i,o).then((l=>l));u&&l.push(u)};i.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{v(l)}))}))}))}}}(i,l,n));try{return(await Promise.all(i)).forEach((l=>{var n,i;return o[null===(i=null===(n=null==l?void 0:l.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.id]=l})),Promise.resolve(o)}catch(l){return Promise.reject(null)}}function e(l){return Array.from(l).map((l=>l[1]))}function r(l,n,o,i,u){var v,d,t;return i?null===(v=null==i?void 0:i.nestedInfos)||void 0===v?void 0:v[u]:null===(d=null==l?void 0:l.categories)||void 0===d?void 0:d.get(null!==(t=null==o?void 0:o.label)&&void 0!==t?t:null==n?void 0:n.id)}function a(l){var n;return null===(n=null==u?void 0:u.data)||void 0===n?void 0:n[null==l?void 0:l.id]}async function c(n,i,u,v,d){var t,e,r,a,c;const[$,m]=await l(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]),{queryExpressions:p,fLayerView:N}=n;!function(l,n,o,i){var u,v,d,t;const{field:e,legendElement:r,categories:a,fLayerView:c}=l,$=null==l?void 0:l.queryExpressions;i&&Array.from(l.categories).map((l=>l[1])).forEach((l=>{var n,o;(null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected)))&&(null===(o=l.nestedInfos)||void 0===o||o.forEach((l=>{const n=e?`${e} = '${l.legendElementInfo.value}'`:null,o=n?$.indexOf(n):-1;n&&-1!==o&&$.splice(o,1)})))}));const m=null==r?void 0:r.infos,p=y(c);let N=p?s(n,c):f(n,e,o,r,m,"");const O=a?i?null===(v=null===(u=a.get(i.title))||void 0===u?void 0:u.nestedInfos)||void 0===v?void 0:v[o]:a.get(null!==(d=n.label)&&void 0!==d?d:null===(t=null==c?void 0:c.layer)||void 0===t?void 0:t.id):null;O&&(O.selected=!(null==O?void 0:O.selected));const A=m&&1===m.length,w=$.indexOf(N);if(p){const l=$.indexOf(N);0===$.length||-1===l?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]?$[0]="1=0":$&&1===$.length||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]?$[0]=null:$.splice(l,1),$.join(" OR ")}else 0===$.length||-1===w?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]&&!A?$[0]="1=0":$&&1===$.length&&!A||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]&&!A?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]&&!A?$[0]=null:$.splice(w,1);if(i){const n=[];Array.from(l.categories).map((l=>l[1])).forEach((l=>{var o,i;(null===(o=l.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=l.nestedInfos)||void 0===i||i.forEach((l=>{e&&`${e} = '${l.legendElementInfo.value}'`&&n.push(`${e} = '${l.legendElementInfo.value}'`)})))})),n.forEach((l=>{-1===$.indexOf(l)&&$.push(l)}))}}(n,i,u,d);const O=p.every((l=>l&&l.includes("<>")))?" AND ":" OR ",A=p.join(O),w=null!==(c=null!==(e=null===(t=null==N?void 0:N.filter)||void 0===t?void 0:t.timeExtent)&&void 0!==e?e:null===(a=null===(r=null==N?void 0:N.featureEffect)||void 0===r?void 0:r.filter)||void 0===a?void 0:a.timeExtent)&&void 0!==c?c:null,{type:E}=v;if("filter"===E)N.filter=new $({where:A,timeExtent:w});else if(v.effect){const{includedEffect:l,excludedEffect:n}=v.effect,i=await o(n,N,"excludedEffect"),u=await o(l,N,"includedEffect");N.featureEffect=new m({filter:new $({where:A,timeExtent:w}),includedEffect:u,excludedEffect:i})}return Promise.resolve()}function s(l,n){const o=n?n.layer.renderer.authoringInfo:null,i=o?o.fields:null,u=[];if(!i)return"";if(l.hasOwnProperty("value"))return i.forEach((n=>{l.value!==n&&u.push(`(${l.value} > ${n} OR (${n} IS NULL AND ${l.value} IS NOT NULL AND (${l.value} > 0 OR ${l.value} < 0)))`)})),u.join(" AND ");{const l=[];i.forEach((n=>{l.push(`${n} = 0`)}));const n=[];if(i.length>2){i.forEach((l=>{i.forEach((o=>{if(l===o)return;const u=[];i.forEach((n=>{l!==n&&o!==n&&u.push(`${l} = ${o} AND (${l} > ${n} OR ${l} >= ${n})`)})),n.push(`(${u.join(" AND ")})`)}))}));const o=[];return i.forEach((l=>{o.push(`${l} IS NULL`)})),`(${l.join(" AND ")}) OR (${n.join(" OR ")}) OR (${o.join(" AND ")})`}{const n=[];i.forEach((o=>{i.forEach((i=>{o!==i&&(n.push(`${o} = ${i}`),n.push(`(${l.join(" AND ")})`))}))}));const o=[];return i.forEach((l=>{i.forEach((n=>{l!==n&&o.push(`(${l} = 0 AND ${n} IS NULL) OR (${l} IS NULL AND ${n} IS NULL)`)}))})),`(${n.join(" OR ")}) OR (${o.join(" OR ")})`}}}function f(l,n,o,i,u,v){const{value:d}=l;if("symbol-table"===(null==i?void 0:i.type)){if(!l.hasOwnProperty("value")||Array.isArray(l.value)&&1===(null==u?void 0:u.length)){if((null==u?void 0:u[0].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[0].value)&&(null==u?void 0:u[(null==u?void 0:u.length)-2])&&(null==u?void 0:u[(null==u?void 0:u.length)-2].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[(null==u?void 0:u.length)-2].value))return v?`((${n}/${v}) > ${null==u?void 0:u[0].value[1]}) OR ((${n}/${v}) < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]}) OR ${v} = 0 OR ${v} IS NULL`:`${n} > ${null==u?void 0:u[0].value[1]} OR ${n} < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]} OR ${n} IS NULL`;if(1===(null==u?void 0:u.length))return"1=0";{const l=[];null==u||u.forEach((o=>{if(null==o?void 0:o.value){const{value:i}=o,u=-1!==i.indexOf("'")?i.split("'").join("''"):null,v=u?`${n} <> '${u}'`:isNaN(i)||"string"==typeof i&&!i.trim()?`${n} <> '${i}'`:`${n} <> ${i} AND ${n} <> '${i}'`;l.push(v)}}));const o=l.join(" AND ");return n&&o?`${o} OR ${n} IS NULL`:""}}{const i=-1!==d.indexOf("'")?d.split("'").join("''"):null,t=Array.isArray(l.value),e=(null==u?void 0:u.length)-1===o,r=!(null==u?void 0:u[(null==u?void 0:u.length)-1].hasOwnProperty("value")),a=o===(null==u?void 0:u.length)-2;return t?v?e||r&&a?`(${n}/${v}) >= ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:`(${n}/${v}) > ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:e||r&&a?`${n} >= ${d[0]} AND ${n} <= ${d[1]}`:`${n} > ${d[0]} AND ${n} <= ${d[1]}`:1===(null==u?void 0:u.length)&&n?isNaN(d)||!d.trim().length?`${n} <> '${d}'`:`${n} <> ${d} OR ${n} <> '${d}'`:i?`${n} = '${i}'`:isNaN(d)||!d.trim().length?`${n} = '${d}'`:`${n} = ${d} OR ${n} = '${d}'`}}return""}function $(l){return Array.isArray(l)?l.every((l=>!l.selected)):l&&Array.from(l.categories.entries()).every((l=>!l[1].selected))&&"1=0"!==l.queryExpressions[0]}function y(l){var n,o,i;return"predominance"===(null===(i=null===(o=null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.renderer)||void 0===o?void 0:o.authoringInfo)||void 0===i?void 0:i.type)}function m(l){var n;return"relationship-ramp"===(null===(n=null==l?void 0:l.legendElements[1])||void 0===n?void 0:n.type)}function p(l,n,o){var i,u,v,d,t,e,r,a,c,s,f,$,m,p,N,O,A,w,E;const b=l.layer,R=null===(i=null==b?void 0:b.renderer)||void 0===i?void 0:i.field,L=null==n?void 0:n.type,D=null==l?void 0:l.layerView,I=null===(v=null===(u=null==D?void 0:D.layer)||void 0===u?void 0:u.renderer)||void 0===v?void 0:v.classBreakInfos,x=(null===(t=null===(d=null==D?void 0:D.layer)||void 0===d?void 0:d.renderer)||void 0===t?void 0:t.uniqueValueInfos)&&R,g="size-ramp"===L,h="color-ramp"===L,P="opacity-ramp"===L,S="heatmap-ramp"===L,U=D&&I&&I.length>1,z=null===(a=null===(r=null===(e=null==D?void 0:D.layer)||void 0===e?void 0:e.renderer)||void 0===r?void 0:r.authoringInfo)||void 0===a?void 0:a.type,F="class-breaks-color"===z,k="class-breaks-size"===z,q=1===(null===(c=null==n?void 0:n.infos)||void 0===c?void 0:c.length)&&!R,V="relationship"===z&&"size-ramp"!==(null==n?void 0:n.type)&&"symbol-table"!==(null==n?void 0:n.type),C="feature"===(null===(s=null==l?void 0:l.layer)||void 0===s?void 0:s.type),J=C&&R&&!h&&!g&&U,T=!(!C||!R||h||g||U),M=!!(T||y(D)&&!g||F&&R||k&&R||q&&!R&&null!==R||V||x),B=(null===(f=null==l?void 0:l.layer)||void 0===f?void 0:f.featureReduction)&&"size-ramp"===(null===(m=null===($=null==l?void 0:l.legendElements)||void 0===$?void 0:$[o])||void 0===m?void 0:m.type),G="symbol-table"===(null==n?void 0:n.type)&&1===(null===(p=null==n?void 0:n.infos)||void 0===p?void 0:p.length),H=!(null==l?void 0:l.legendElements.every((l=>"color-ramp"!==l.type))),K=!(null==l?void 0:l.legendElements.every((l=>"size-ramp"!==l.type))),Q=G&&H,W=G&&K,X=null===(N=null==n?void 0:n.infos)||void 0===N?void 0:N.every((l=>"number"==typeof l.value)),Y="symbol-table"===(null===(A=null===(O=null==l?void 0:l.legendElements)||void 0===O?void 0:O[0])||void 0===A?void 0:A.type)&&"color-ramp"===(null===(E=null===(w=null==l?void 0:l.legendElements)||void 0===w?void 0:w[1])||void 0===E?void 0:E.type),Z="dot-density"===z,_=j(null==l?void 0:l.layer,R);return!(!C||B||P||S||Q||W||X||Y||Z||!_)&&(I?J||M:T||M)}function N(l){var n,o,i,u,v;return l.queryExpressions=[],(null===(o=null===(n=null==l?void 0:l.fLayerView)||void 0===n?void 0:n.filter)||void 0===o?void 0:o.where)&&(l.fLayerView.filter.where=""),(null===(v=null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.featureEffect)||void 0===u?void 0:u.filter)||void 0===v?void 0:v.where)&&(l.fLayerView.featureEffect=null),l.categories.forEach((l=>{l.selected=!1})),l}function O(l,n){var o,i,u,v,d,t,e,r,a,c,s;const f=l.categories.get(n);null===(o=null==f?void 0:f.nestedInfos)||void 0===o||o.forEach((n=>{const o=l.queryExpressions.indexOf(`${l.field} = '${n.legendElementInfo.value}'`);-1!==o&&l.queryExpressions.splice(o,1),n.selected=!1}));const $=[],y=Array.from(l.categories).map((l=>l[1]));y.forEach((n=>{var o,i;(null===(o=n.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=n.nestedInfos)||void 0===i||i.forEach((n=>{$.push(`${l.field} = '${n.legendElementInfo.value}'`)})))})),$.forEach((n=>{-1===l.queryExpressions.indexOf(n)&&l.queryExpressions.push(n)}));let m=l.queryExpressions.join(" OR ");const p=y.every((l=>{var n;return null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected))}));return p?((null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.filter)||void 0===u?void 0:u.where)&&(l.fLayerView.filter.where=""),(null===(t=null===(d=null===(v=null==l?void 0:l.fLayerView)||void 0===v?void 0:v.featureEffect)||void 0===d?void 0:d.filter)||void 0===t?void 0:t.where)&&(l.fLayerView.featureEffect=null),l.queryExpressions=[]):((null===(r=null===(e=null==l?void 0:l.fLayerView)||void 0===e?void 0:e.filter)||void 0===r?void 0:r.where)&&(l.fLayerView.filter.where=m),(null===(s=null===(c=null===(a=null==l?void 0:l.fLayerView)||void 0===a?void 0:a.featureEffect)||void 0===c?void 0:c.filter)||void 0===s?void 0:s.where)&&(l.fLayerView.featureEffect.filter.where=m)),l}async function A(l,n,o){var i,u;const v=l.fLayerView.createQuery();if(o)if(o.nestedInfos.every((l=>!l.selected))){const n=o.nestedInfos.map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=o.nestedInfos.filter((l=>l.selected)).map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=l.queryExpressions.join(" OR ");v.where=n}try{const{extent:o}=await(null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.layer)||void 0===u?void 0:u.queryExtent(v));await n.goTo(o)}catch(l){}}function w(l){return l.map((l=>null==l?void 0:l.count)).reduce(((l,n)=>l+n))}function E(l){return l.map((l=>{var n;return null===(n=null==l?void 0:l.nestedInfos)||void 0===n?void 0:n.map((l=>l.count)).reduce(((l,n)=>l+n))})).reduce(((l,n)=>l+n))}async function b(l,n,o,i,u,v,d,t){var e,r,a;if(!n)return;if(!j(null==n?void 0:n.layer,o))return;const c="feature"===(null===(e=null==n?void 0:n.layer)||void 0===e?void 0:e.type)?n.createQuery():null,$=y(n)?s(i,n):i.type?f(d,o,t,i,i.infos):f(i,o,u,v,v.infos);c&&$&&(c.where="1=0"===$?"1=1":$,c.geometry=l);try{const l=c?await n.queryFeatureCount(c):null;return Promise.resolve({[null!==(r=i.label)&&void 0!==r?r:null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.id]:l})}catch(l){console.error("FAILURE AT 'getInfoCount': ",l)}return Promise.resolve(null)}async function R(l,n){let o=Object.assign({},n);const{activeLayerInfos:i}=l;let u={};const v={};i.forEach((async o=>{var i,u,d,t;const e=o.legendElements[0],r=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,a=null===(d=o.layer.renderer)||void 0===d?void 0:d.field,c=[];v[o.layer.id]=[],null===(t=null==e?void 0:e.infos)||void 0===t||t.forEach(((n,i)=>{var u;const d=null===(u=e.infos)||void 0===u?void 0:u.every((l=>"symbol-table"===l.type));if(d){const u=[];n.infos.forEach(((o,v)=>{const d=b(l.view.extent,r,a,n,i,e,o,v);u.push(d)})),v[o.layer.id].push(u)}else c.push(b(l.view.extent,r,a,n,i,e)),v[o.layer.id]=c}));const s=o=>{var i,u,d,t;const e=[],r=o.legendElements[0],a=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,c=null===(d=o.layer.renderer)||void 0===d?void 0:d.field;null===(t=null==r?void 0:r.infos)||void 0===t||t.forEach(((n,o)=>e.push(b(l.view.extent,a,c,n,o,r)))),v[o.layer.id]=e};o.children.forEach((async l=>{var n;s(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;s(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{s(l)}))}))}))}));for(const l in v){let n=u[l];n||(n=u[l]={});const o=await Promise.all(v[l]);if(o.every((l=>Array.isArray(l)))){const i=await Promise.all(o.map((async l=>(await Promise.all(l)).map((l=>l&&Object.values(l)[0])))));n[l]=i,u[l]=Object.assign({},n[l])}else{const i={};o.forEach((l=>{if(!l)return;const n=Object.keys(l)[0];i[n]=l[n]})),l&&(n[l]=i),u[l]=Object.assign({},n[l])}}return i.forEach((l=>{var o;const i=n[l.layer.id],v=l.layer.id;null===(o=null==i?void 0:i.categories)||void 0===o||o.forEach(((n,o)=>{var d;const t=Array.from(null==i?void 0:i.categories).findIndex((l=>l[0]===o));if(null==n?void 0:n.nestedInfos)null==n||n.nestedInfos.forEach(((n,o)=>{var i,v,d;const e=null===(d=null===(v=null==u?void 0:u[null===(i=null==l?void 0:l.layer)||void 0===i?void 0:i.id])||void 0===v?void 0:v[t])||void 0===d?void 0:d[o];n.count=isNaN(e)?null:e}));else{const l=null===(d=null==u?void 0:u[v])||void 0===d?void 0:d[o];n.count=isNaN(l)?null:l}}));const d=l=>{var o;const i=l.layer.id,v=n[i];null===(o=null==v?void 0:v.categories)||void 0===o||o.forEach(((l,n)=>{var o;const v=null===(o=null==u?void 0:u[i])||void 0===o?void 0:o[n];l.count=v}))};l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{d(l)}))}))}))})),Promise.resolve(o)}function L(l,n){var o;return null===(o=null==l?void 0:l.nestedInfos)||void 0===o?void 0:o[n]}function D(l){return Array.from(l).map((l=>l[1])).every((l=>!!(null==l?void 0:l.nestedInfos)))}function I(l){var n,o,i,u;return!!(null===(u=null===(i=null===(o=null===(n=null==l?void 0:l.legendElements)||void 0===n?void 0:n[0])||void 0===o?void 0:o.infos)||void 0===i?void 0:i.every)||void 0===u?void 0:u.call(i,(l=>"symbol-table"===(null==l?void 0:l.type))))}function x(l,n){var o;return null===(o=null==l?void 0:l.categories)||void 0===o?void 0:o.get(null==n?void 0:n.title)}function g(l){const n="calcite-mode-",o=`${n}light`,i=`${n}dark`;return l.classList.contains(i)?i:o}function h(l){if(l.layerId&&l.intLegendLayerData){const n=l.layerId,o=l.intLegendLayerData,i=Object.assign(Object.assign({},u.data),{[n]:o});v.set("data",i)}}function P(n,i){const{type:u}=n;"filter"===u?function(l){var n,o;null===(o=null===(n=null==l?void 0:l.allLayerViews)||void 0===n?void 0:n.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})))||void 0===o||o.forEach((l=>{const n=S(l);l.filter=n,l.set("featureEffect",null)}))}(i):"effect"===u&&function(n,i){var u;null===(u=null==i?void 0:i.allLayerViews)||void 0===u||u.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})).forEach((async i=>{if((null==n?void 0:n.effect)&&i){const[u]=await l(["esri/layers/support/FeatureEffect"]),{includedEffect:v,excludedEffect:d}=n.effect,t=await o(d,i,"excludedEffect"),e=await o(v,i,"includedEffect"),r=S(i);i.featureEffect=new u({filter:r,includedEffect:e,excludedEffect:t}),i.set("filter",null)}}))}(n,i)}function S(l){var n;return(null==l?void 0:l.filter)||(null===(n=null==l?void 0:l.featureEffect)||void 0===n?void 0:n.filter)}function j(l,n){const o=null==l?void 0:l.fields,i=o&&o.map((l=>l.name));return!n||i&&i.includes(n)}function U(l){const n=[];return l.forEach((l=>z(l,n))),n}function z(l,n){n.push(l),l.children&&l.children.length>0&&l.children.forEach((l=>{z(l,n)}))}export{x as a,r as b,$ as c,R as d,t as e,U as f,g,P as h,u as i,d as j,c as k,a as l,I as m,m as n,O as o,N as p,o as q,e as r,v as s,D as t,h as u,p as v,E as w,w as x,L as y,A as z}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as e,H as i,g as a}from"./p-4e6eb06e.js";import{g as s}from"./p-5ff711ee.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";class n{constructor(){this.pages=[],this.headerText="",this.pages=[]}setPages(t){this.pages=t,this.setDefaultHeaderText()}setDefaultHeaderText(){this.headerText=this.pages.length?this.pages[0].title:""}}const r=class{constructor(e){t(this,e),this._viewModel=new n,this.header=!0,this.data=void 0,this.messages=void 0,this.headerText=void 0}watchPropHandler(t){this._setContent(t)}watchStateHandler(t){this._viewModel.headerText=t}componentWillLoad(){this._setContent(null==this?void 0:this.data)}componentDidLoad(){s(this)}render(){const t=this._renderAppGuidePages(this._viewModel.pages),a=this._renderAppGuideHeader();return e(i,{key:"a6969274bbb9e917869c4c09910ef04b2d40c49a"},e("calcite-panel",{key:"f203f430978eed0db5aa0058ae53bd811ba0fdfe",scale:"s"},a,e("calcite-carousel",{key:"afd572b169f27b03616e568b9146cb2e52f04cae",onCalciteCarouselChange:()=>this._updateHeaderText(),ref:t=>this._carouselRef=t,"arrow-type":this._getArrowType()},t)))}_setContent(t){this._viewModel.setPages(t),this.headerText=this._viewModel.headerText}_updateHeaderText(){var t;const{_viewModel:e,_carouselRef:i,messages:a}=this,s=Array.from(i.childNodes).indexOf(i.selectedItem),n=null==e?void 0:e.pages,r=null!==(t=null==n?void 0:n[s])&&void 0!==t?t:n[0];this.headerText=(null==r?void 0:r.title)||(null==a?void 0:a.headerText)}_getArrowType(){return this._viewModel.pages.length>2?"inline":"none"}_renderAppGuideHeader(){const{messages:t,header:i,headerText:a}=this;return i&&(null==t?void 0:t.headerText)?e("span",{slot:"header-content"},a||(null==t?void 0:t.headerText)," ",e("calcite-icon",{icon:"lightbulb",scale:"s"})):null}_renderAppGuidePages(t){return t.map(((t,i)=>{const{content:a,type:s}=t;return e("calcite-carousel-item",{key:`page_${i}`},e("div",{class:"instant-apps-app-guide__content-wrapper"},this._renderContentItems(a,s)))}))}_renderContentItems(t,i){return"list"===i?e("ol",{class:"instant-apps-app-guide__content-list"},t.map(((t,i)=>e("li",{key:`content-list-item-${i}`,class:"instant-apps-app-guide__content-list--item"},t)))):t.map(((t,i)=>e("p",{key:`content-paragraph-${i}`},t)))}get el(){return a(this)}static get watchers(){return{data:["watchPropHandler"],headerText:["watchStateHandler"]}}};r.style=":host{--instant-apps-app-guide-width:300px;--instant-apps-app-guide-height:400px;--instant-apps-app-guide-list-item-bubble-size:22px;width:var(--instant-apps-app-guide-width);height:var(--instant-apps-app-guide-height);display:block}:host calcite-panel{max-width:var(--instant-apps-app-guide-width);max-height:var(--instant-apps-app-guide-height);display:flex}:host calcite-carousel{flex:1;overflow:scroll;height:-moz-fit-content;height:fit-content;background-color:var(--calcite-color-foreground-1)}:host [slot=header-content]{display:flex;gap:var(--calcite-spacing-sm);padding-inline-start:0.25rem;font-weight:var(--calcite-font-weight-bold)}:host calcite-carousel-item{flex-grow:1;display:flex;flex-direction:column}:host .instant-apps-app-guide__content-wrapper{padding-block-start:0.5rem;padding-inline:0.5rem;flex-shrink:1;flex-grow:0}:host calcite-icon{--calcite-ui-icon-color:var(--calcite-color-brand)}:host .instant-apps-app-guide__content-list{counter-set:item-counter;margin-inline:0;padding-inline-start:var(--calcite-spacing-xxxl);padding-inline-end:var(--calcite-spacing-lg);position:relative}:host .instant-apps-app-guide__content-list .instant-apps-app-guide__content-list--item{counter-increment:item-counter;margin-block-start:var(--calcite-spacing-lg);display:flex;align-items:flex-start}:host .instant-apps-app-guide__content-list .instant-apps-app-guide__content-list--item::before{content:counter(item-counter);background-color:var(--calcite-color-text-2);color:var(--calcite-color-text-inverse);line-height:var(--calcite-font-line-height-fixed-xl);width:var(--instant-apps-app-guide-list-item-bubble-size);left:0;border-radius:var(--calcite-corner-radius-pill);display:flex;justify-content:center;font-size:var(--calcite-font-size-sm);position:absolute;max-height:var(--instant-apps-app-guide-list-item-bubble-size)}:host .instant-apps-app-guide__content-list .instant-apps-app-guide__content-list--item::marker{color:var(--calcite-color-transparent)}";export{r as instant_apps_app_guide}
|
@@ -3,9 +3,9 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as e,h as i,H as s,g as
|
6
|
+
import{r as t,c as e,h as i,H as s,g as o}from"./p-4e6eb06e.js";import{c as a,d as n}from"./p-5e25a0b8.js";import{e as r}from"./p-621ad249.js";import{s as c,a as d,c as l}from"./p-ad9d1221.js";import{c as h,d as p}from"./p-895e7b9c.js";import{u,c as m,d as b,s as v}from"./p-efaa77a0.js";import{t as f,E as g}from"./p-347f341e.js";import{c as x}from"./p-ff336351.js";import{l as y}from"./p-4cd4cb85.js";import"./p-7d542581.js";import"./p-91371f97.js";import"./p-4f82eb55.js";import"./p-233f219c.js";import"./p-54e5a55d.js";import"./p-3cfc1e2e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
10
10
|
* v2.13.0
|
11
|
-
*/const w=class{constructor(i){t(this,i),this.calciteActionPadToggle=e(this,"calciteActionPadToggle",6),this.mutationObserver=x("mutation",(()=>this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group"))))),this.actionMenuOpenHandler=t=>{if(t.target.menuOpen){const e=t.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach((t=>{e.includes(t)||(t.menuOpen=!1)}))}},this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionPadToggle.emit()},this.handleDefaultSlotChange=t=>{const e=
|
11
|
+
*/const w=class{constructor(i){t(this,i),this.calciteActionPadToggle=e(this,"calciteActionPadToggle",6),this.mutationObserver=x("mutation",(()=>this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group"))))),this.actionMenuOpenHandler=t=>{if(t.target.menuOpen){const e=t.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach((t=>{e.includes(t)||(t.menuOpen=!1)}))}},this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionPadToggle.emit()},this.handleDefaultSlotChange=t=>{const e=r(t).filter((t=>t?.matches("calcite-action-group")));this.setGroupLayout(e)},this.handleTooltipSlotChange=t=>{const e=r(t).filter((t=>t?.matches("calcite-tooltip")));this.expandTooltip=e[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.overlayPositioning="absolute",this.expandTooltip=void 0,this.effectiveLocale="",this.defaultMessages=void 0}expandedHandler(t){f({el:this.el,expanded:t})}layoutHandler(){this.updateGroups()}onMessagesChange(){}effectiveLocaleChange(){u(this,this.effectiveLocale)}connectedCallback(){a(this),h(this),m(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectedCallback(){p(this),b(this),n(this),this.mutationObserver?.disconnect()}async componentWillLoad(){c(this);const{el:t,expanded:e}=this;f({el:t,expanded:e}),await v(this)}componentDidLoad(){d(this)}async setFocus(){await l(this),this.el?.focus()}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(t){t.forEach((t=>t.layout=this.layout))}renderBottomActionGroup(){const{expanded:t,expandDisabled:e,messages:s,el:o,position:a,toggleExpand:n,scale:r,layout:c,actionsEndGroupLabel:d,overlayPositioning:l}=this,h=e?null:i(g,{collapseLabel:s.collapseLabel,collapseText:s.collapse,el:o,expandLabel:s.expandLabel,expandText:s.expand,expanded:t,position:a,scale:r,toggle:n,tooltip:this.expandTooltip});return h?i("calcite-action-group",{class:"action-group--end",label:d,layout:c,overlayPositioning:l,scale:r},i("slot",{name:"expand-tooltip",onSlotchange:this.handleTooltipSlotChange}),h):null}render(){return i(s,{key:"ca50c5f475d78b92b5347ab912727587420ceea5",onCalciteActionMenuOpen:this.actionMenuOpenHandler},i("div",{key:"81b26e9b6bd0a04357fe00ef55111c6bb609f4e7",class:"container"},i("slot",{key:"e346dc6cfab0e26cfc694b43063715d7b845ae32",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup()))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return o(this)}static get watchers(){return{expanded:["expandedHandler"],layout:["layoutHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};w.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:block}@keyframes in{0%{opacity:0}100%{opacity:1}}:host{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;border-radius:var(--calcite-action-pad-corner-radius, 0.125rem);background:transparent}:host([expanded][layout=vertical]) .container{max-inline-size:var(--calcite-action-pad-expanded-max-width, auto)}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:1px}.container{display:inline-flex;flex-direction:column;overflow-y:auto;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);gap:var(--calcite-action-pad-items-space, 0);border-radius:calc(var(--calcite-action-pad-corner-radius, 0.125rem) * 2);background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}.action-group--bottom{flex-grow:1;justify-content:flex-end;padding-block-end:0px}:host([layout=horizontal]) .container{flex-direction:row}:host([layout=horizontal]) .container .action-group--bottom{padding:0px}:host([layout=horizontal]) .container ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:1px}:host([hidden]){display:none}[hidden]{display:none}";const j="instant-apps-measurement-tool",k={base:j,hide:`${j}__hide`},_=class{constructor(e){t(this,e),this.view=void 0,this.measureConfiguration=void 0,this.activeTool=void 0}async componentWillLoad(){await this._initModules()}componentDidLoad(){this._init()}render(){return i(s,{key:"eabd8e43ae6d095e02bcc99935a2069ba620d66a"},i("div",{key:"5bb33f7f1785e60e4cde37ee8ba08bae4681751d",class:k.base},i("div",{key:"8826eb9665c17f8eed640e0bcab3cff50a02ec23",ref:t=>{this._measureElement=t}}),i("div",{key:"0e3b7364403866976f5e6578c08b8fdc50d1e33f",class:k.hide,ref:t=>{this._coordinateElement=t}})))}disconnectedCallback(){var t,e;null===(t=this._measureWidget)||void 0===t||t.destroy(),null===(e=this._coordinateWidget)||void 0===e||e.destroy()}async _initModules(){const[t,e,i]=await y(["esri/widgets/Measurement","esri/widgets/CoordinateConversion","esri/widgets/CoordinateConversion/support/Conversion"]);this.Measurement=t,this.CoordinateConversion=e,this.Conversion=i}_init(){this._initMeasurementWidget(),this._initCoordinateWidget()}_updateToolType(t){this._setActiveTool(t)}_initMeasurementWidget(){this.view&&this._measureElement&&!this._measureWidget&&(this._measureWidget=new this.Measurement(Object.assign({view:this.view,container:this._measureElement},this.measureConfiguration)),this.measureConfiguration.activeToolType&&this._setActiveTool(this.measureConfiguration.activeToolType))}_setActiveTool(t){var e,i,s;const o=this.view.type;this._measureWidget.clear(),null===(e=this._coordinateElement)||void 0===e||e.classList.add(k.hide),"distance"===t?this._measureWidget.activeTool="2d"===o?"distance":"direct-line":"area"===t?this._measureWidget.activeTool="area":"point"===t&&(null===(s=null===(i=this._coordinateElement)||void 0===i?void 0:i.classList)||void 0===s||s.remove(k.hide))}_initCoordinateWidget(){var t,e;const{activeToolType:i,coordinateFormat:s}=this.measureConfiguration;if((null==this?void 0:this.view)&&this._coordinateElement&&!this._coordinateWidget&&(this._coordinateWidget=new this.CoordinateConversion({view:this.view,storageEnabled:!1,container:this._coordinateElement}),null!=s)){const i=this._coordinateWidget.formats.find((t=>t.name===s));null===(e=null===(t=this._coordinateWidget)||void 0===t?void 0:t.conversions)||void 0===e||e.splice(0,0,new this.Conversion({format:i}))}null!=i&&this._setActiveTool(i)}get el(){return o(this)}static get watchers(){return{activeTool:["_updateToolType"]}}};_.style=".sc-instant-apps-measurement-tool-h .esri-measurement.sc-instant-apps-measurement-tool,.sc-instant-apps-measurement-tool-h .esri-coordinate-conversion.sc-instant-apps-measurement-tool{width:300px}.sc-instant-apps-measurement-tool-h .instant-apps-measurement-tool__hide.sc-instant-apps-measurement-tool{display:none}";export{w as calcite_action_pad,_ as instant_apps_measurement_tool}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as n,h as i,H as s,g as e}from"./p-4e6eb06e.js";import{l as o}from"./p-4cd4cb85.js";import{g as r}from"./p-5ff711ee.js";import{g as a}from"./p-a9a72626.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const p=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function c(t){const n=[];for(let i=0,s=t.length;i<s;i++)n.push(t[i]);return n}function l(t,n){const i=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(n);return i?parseFloat(i.replace("px","")):0}function h(t,n={}){return{width:n.width||function(t){const n=l(t,"border-left-width"),i=l(t,"border-right-width");return t.clientWidth+n+i}(t),height:n.height||function(t){const n=l(t,"border-top-width"),i=l(t,"border-bottom-width");return t.clientHeight+n+i}(t)}}const u=16384;function d(t){return new Promise(((n,i)=>{const s=new Image;s.decode=()=>n(s),s.onload=()=>n(s),s.onerror=i,s.crossOrigin="anonymous",s.decoding="async",s.src=t}))}const f=(t,n)=>{if(t instanceof n)return!0;const i=Object.getPrototypeOf(t);return null!==i&&(i.constructor.name===n.name||f(i,n))};function g(t,n,i){const s=window.getComputedStyle(t,i),e=s.getPropertyValue("content");if(""===e||"none"===e)return;const o=p();try{n.className=`${n.className} ${o}`}catch(t){return}const r=document.createElement("style");r.appendChild(function(t,n,i){const s=`.${t}:${n}`,e=i.cssText?function(t){const n=t.getPropertyValue("content");return`${t.cssText} content: '${n.replace(/'|"/g,"")}';`}(i):function(t){return c(t).map((n=>`${n}: ${t.getPropertyValue(n)}${t.getPropertyPriority(n)?" !important":""};`)).join(" ")}(i);return document.createTextNode(`${s}{${e}}`)}(o,i,s)),n.appendChild(r)}const v="application/font-woff",x="image/jpeg",m={woff:v,woff2:v,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:x,jpeg:x,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function _(t){const n=function(t){const n=/\.([^./]*?)$/g.exec(t);return n?n[1]:""}(t).toLowerCase();return m[n]||""}function b(t){return-1!==t.search(/^(data:)/)}function w(t,n){return`data:${n};base64,${t}`}async function y(t,n,i){const s=await fetch(t,n);if(404===s.status)throw new Error(`Resource "${s.url}" not found`);const e=await s.blob();return new Promise(((t,n)=>{const o=new FileReader;o.onerror=n,o.onloadend=()=>{try{t(i({res:s,result:o.result}))}catch(t){n(t)}},o.readAsDataURL(e)}))}const k={};async function P(t,n,i){const s=function(t,n,i){let s=t.replace(/\?.*/,"");return i&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),n?`[${n}]${s}`:s}(t,n,i.includeQueryParams);if(null!=k[s])return k[s];let e;i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const s=await y(t,i.fetchRequestInit,(({res:t,result:i})=>(n||(n=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(i))));e=w(s,n)}catch(n){e=i.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;n&&(s="string"==typeof n?n:n.message),s&&console.warn(s)}return k[s]=e,e}const $=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function S(t,n,i){return i||!n.filter||n.filter(t)?Promise.resolve(t).then((t=>async function(t,n){return f(t,HTMLCanvasElement)?async function(t){const n=t.toDataURL();return"data:,"===n?t.cloneNode(!1):d(n)}(t):f(t,HTMLVideoElement)?async function(t,n){if(t.currentSrc){const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t.clientWidth,n.height=t.clientHeight,null==i||i.drawImage(t,0,0,n.width,n.height),d(n.toDataURL())}const i=t.poster,s=_(i);return d(await P(i,s,n))}(t,n):f(t,HTMLIFrameElement)?async function(t){var n;try{if(null===(n=null==t?void 0:t.contentDocument)||void 0===n?void 0:n.body)return await S(t.contentDocument.body,{},!0)}catch(t){}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,n))).then((i=>async function(t,n,i){var s,e;let o=[];return o=$(t)&&t.assignedNodes?c(t.assignedNodes()):f(t,HTMLIFrameElement)&&(null===(s=t.contentDocument)||void 0===s?void 0:s.body)?c(t.contentDocument.body.childNodes):c((null!==(e=t.shadowRoot)&&void 0!==e?e:t).childNodes),0===o.length||f(t,HTMLVideoElement)||await o.reduce(((t,s)=>t.then((()=>S(s,i))).then((t=>{t&&n.appendChild(t)}))),Promise.resolve()),n}(t,i,n))).then((n=>function(t,n){return f(n,Element)&&(function(t,n){const i=n.style;if(!i)return;const s=window.getComputedStyle(t);s.cssText?(i.cssText=s.cssText,i.transformOrigin=s.transformOrigin):c(s).forEach((e=>{let o=s.getPropertyValue(e);if("font-size"===e&&o.endsWith("px")){const t=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1;o=`${t}px`}f(t,HTMLIFrameElement)&&"display"===e&&"inline"===o&&(o="block"),"d"===e&&n.getAttribute("d")&&(o=`path(${n.getAttribute("d")})`),i.setProperty(e,o,s.getPropertyPriority(e))}))}(t,n),function(t,n){g(t,n,":before"),g(t,n,":after")}(t,n),function(t,n){f(t,HTMLTextAreaElement)&&(n.innerHTML=t.value),f(t,HTMLInputElement)&&n.setAttribute("value",t.value)}(t,n),function(t,n){if(f(t,HTMLSelectElement)){const i=Array.from(n.children).find((n=>t.value===n.getAttribute("value")));i&&i.setAttribute("selected","")}}(t,n)),n}(t,n))).then((t=>async function(t,n){const i=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===i.length)return t;const s={};for(let e=0;e<i.length;e++){const o=i[e].getAttribute("xlink:href");if(o){const i=t.querySelector(o),e=document.querySelector(o);i||!e||s[o]||(s[o]=await S(e,n,!0))}}const e=Object.values(s);if(e.length){const n="http://www.w3.org/1999/xhtml",i=document.createElementNS(n,"svg");i.setAttribute("xmlns",n),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(n,"defs");i.appendChild(s);for(let t=0;t<e.length;t++)s.appendChild(e[t]);t.appendChild(i)}return t}(t,n))):null}const C=/url\((['"]?)([^'"]+?)\1\)/g,E=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,F=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function M(t){return-1!==t.search(C)}async function j(t,n,i){if(!M(t))return t;const s=function(t,{preferredFontFormat:n}){return n?t.replace(F,(t=>{for(;;){const[i,,s]=E.exec(t)||[];if(!s)return"";if(s===n)return`src: ${i};`}})):t}(t,i),e=function(t){const n=[];return t.replace(C,((t,i,s)=>(n.push(s),t))),n.filter((t=>!b(t)))}(s);return e.reduce(((t,s)=>t.then((t=>async function(t,n,i,s,e){try{const o=i?function(t,n){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const i=document.implementation.createHTMLDocument(),s=i.createElement("base"),e=i.createElement("a");return i.head.appendChild(s),i.body.appendChild(e),n&&(s.href=n),e.href=t,e.href}(n,i):n,r=_(n);let a;return a=e?w(await e(o),r):await P(o,r,s),t.replace(function(t){const n=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`,"g")}(n),`$1${a}$3`)}catch(t){}return t}(t,s,n,i)))),Promise.resolve(s))}async function L(t,n,i){var s;const e=null===(s=n.style)||void 0===s?void 0:s.getPropertyValue(t);if(e){const s=await j(e,null,i);return n.style.setProperty(t,s,n.style.getPropertyPriority(t)),!0}return!1}async function T(t,n){f(t,Element)&&(await async function(t,n){await L("background",t,n)||await L("background-image",t,n),await L("mask",t,n)||await L("mask-image",t,n)}(t,n),await async function(t,n){const i=f(t,HTMLImageElement);if((!i||b(t.src))&&(!f(t,SVGImageElement)||b(t.href.baseVal)))return;const s=i?t.src:t.href.baseVal,e=await P(s,_(s),n);await new Promise(((n,s)=>{t.onload=n,t.onerror=s;const o=t;o.decode&&(o.decode=n),"lazy"===o.loading&&(o.loading="eager"),i?(t.srcset="",t.src=e):t.href.baseVal=e}))}(t,n),await async function(t,n){const i=c(t.childNodes).map((t=>T(t,n)));await Promise.all(i).then((()=>t))}(t,n))}const D={};async function I(t){let n=D[t];if(null!=n)return n;const i=await fetch(t);return n={url:t,cssText:await i.text()},D[t]=n,n}async function O(t,n){let i=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,e=(i.match(/url\([^)]+\)/g)||[]).map((async e=>{let o=e.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),y(o,n.fetchRequestInit,(({result:t})=>(i=i.replace(e,`url(${t})`),[e,t])))}));return Promise.all(e).then((()=>i))}function z(t){if(null==t)return[];const n=[];let i=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=s.exec(i);if(null===t)break;n.push(t[0])}i=i.replace(s,"");const e=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=e.exec(i);if(null===t){if(t=o.exec(i),null===t)break;e.lastIndex=o.lastIndex}else o.lastIndex=e.lastIndex;n.push(t[0])}return n}async function R(t,n){const i=null!=n.fontEmbedCSS?n.fontEmbedCSS:n.skipFonts?null:await async function(t,n){const i=await async function(t,n){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const i=c(t.ownerDocument.styleSheets),s=await async function(t,n){const i=[],s=[];return t.forEach((i=>{if("cssRules"in i)try{c(i.cssRules||[]).forEach(((t,e)=>{if(t.type===CSSRule.IMPORT_RULE){let o=e+1;const r=I(t.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{try{i.insertRule(t,t.startsWith("@import")?o+=1:i.cssRules.length)}catch(n){console.error("Error inserting rule from remote css",{rule:t,error:n})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));s.push(r)}}))}catch(e){const o=t.find((t=>null==t.href))||document.styleSheets[0];null!=i.href&&s.push(I(i.href).then((t=>O(t,n))).then((t=>z(t).forEach((t=>{o.insertRule(t,i.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",e)}})),Promise.all(s).then((()=>(t.forEach((t=>{if("cssRules"in t)try{c(t.cssRules||[]).forEach((t=>{i.push(t)}))}catch(n){console.error(`Error while reading CSS rules from ${t.href}`,n)}})),i)))}(i,n);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>M(t.style.getPropertyValue("src"))))}(s)}(t,n);return(await Promise.all(i.map((t=>j(t.cssText,t.parentStyleSheet?t.parentStyleSheet.href:null,n))))).join("\n")}(t,n);if(i){const n=document.createElement("style"),s=document.createTextNode(i);n.appendChild(s),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function H(t,n={}){const{width:i,height:s}=h(t,n),e=await S(t,n,!0);return await R(e,n),await T(e,n),function(t,n){const{style:i}=t;n.backgroundColor&&(i.backgroundColor=n.backgroundColor),n.width&&(i.width=`${n.width}px`),n.height&&(i.height=`${n.height}px`);const s=n.style;null!=s&&Object.keys(s).forEach((t=>{i[t]=s[t]}))}(e,n),await async function(t,n,i){const s="http://www.w3.org/2000/svg",e=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return e.setAttribute("width",`${n}`),e.setAttribute("height",`${i}`),e.setAttribute("viewBox",`0 0 ${n} ${i}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),e.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(e)}(e,i,s)}async function V(t,n={}){const{width:i,height:s}=h(t,n),e=await H(t,n),o=await d(e),r=document.createElement("canvas"),a=r.getContext("2d"),p=n.pixelRatio||function(){let t,n;try{n=process}catch(t){}const i=n&&n.env?n.env.devicePixelRatio:null;return i&&(t=parseInt(i,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=n.canvasWidth||i,l=n.canvasHeight||s;return r.width=c*p,r.height=l*p,n.skipAutoScale||function(t){(t.width>u||t.height>u)&&(t.width>u&&t.height>u?t.width>t.height?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u):t.width>u?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u))}(r),r.style.width=`${c}`,r.style.height=`${l}`,n.backgroundColor&&(a.fillStyle=n.backgroundColor,a.fillRect(0,0,r.width,r.height)),a.drawImage(o,0,0,r.width,r.height),r}const G="instant-apps-export calcite-mode-light",U="instant-apps-export-print instant-apps-export-print__pdf",W="instant-apps-export-print instant-apps-export-print__img",A="instant-apps-export-print__img--extra-content",B="instant-apps-export-print__content-container",N="instant-apps-export-print__extra-container",J="instant-apps-export-print__legend-container",q="instant-apps-export-print__compass-container",X="instant-apps-export-print__scale-bar-container",K="instant-apps-export-print__popup-container",Q="instant-apps-export-print__popup-content",Y="instant-apps-export-print__popup-title",Z="instant-apps-export-print__view",tt="instant-apps-export-print__view-container",nt="instant-apps-export-print__view-wrapper",it="instant-app-export-drag",st=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.fileTypes=["PDF","JPG","PNG"],this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.logoImage="",this.includeExtraContent=!0,this.showExtraContentInImg=!1,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.includeFileFormat=!0,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!1,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=G,this.exportIsLoading=void 0,this.messages=void 0,this.selectedFileType="PDF"}watchIncludeMap(t){t&&this.updateLegend()}watchView(){this.handleIncludePopup()}async componentWillLoad(){this.baseClass="dark"===a(this.el)?"instant-apps-export calcite-mode-dark":G,r(this),await this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl),this.handleIncludePopup()}async initializeModules(){const[t,n]=await o(["esri/core/Handles","esri/core/reactiveUtils"]);return this.handles=new t,this.reactiveUtils=n,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,{key:"9811c244faf2c794db3edaad498a9a902cb3faad"},i("div",{key:"cb880c04d46ec06a9588cedc0bd90ab62d25c0ac",class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{key:"fc7ccd1eeb4b6a82bd9804d1aa73c4f242085a56",class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n,s;const e=this.showHeaderTitle?this.renderTitle():null,o=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel,"PDF"!==this.selectedFileType&&!this.showExtraContentInImg):null,r=this.showIncludeMap?this.renderSwitch("includeMap",void 0,"PDF"!==this.selectedFileType):null,a=this.includeMap?this.renderMapOptions():null,p=this.includeFileFormat?this.renderSelectFileType():null,c="PDF"===this.selectedFileType?this.renderPrint():this.renderImg();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},e,o,r,a,p,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this,!0),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},"PDF"===this.selectedFileType?null===(n=this.messages)||void 0===n?void 0:n.export:null===(s=this.messages)||void 0===s?void 0:s.preview),c)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n,s){var e;const o=null!=n?n:null===(e=this.messages)||void 0===e?void 0:e[t];return i("calcite-label",{layout:"inline-space-between"},o,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this),disabled:s}))}renderSelectFileType(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.fileType,i("calcite-select",{onCalciteSelectChange:this.handleSelectFileType.bind(this)},this.fileTypes.map((t=>i("calcite-option",{value:t,selected:t===this.selectedFileType},t)))))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:U,ref:t=>this.printEl=t},t,s,i("div",{class:B},e,n)))}renderPrintMap(){return i("div",{class:tt,ref:t=>this.viewContainerEl=t},i("div",{class:nt,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{logoImage:this.logoImage,logoScale:"s",titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:Z,ref:t=>this.viewEl=t}),i("div",{class:X,ref:t=>this.scaleBarContainerEl=t})))}renderLegend(){return i("div",{class:J,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:q,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:K,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:Y}),i("div",{ref:t=>this.popupContentEl=t,class:Q}))}renderExtraContent(){return i("div",{class:N,id:"export-content",ref:t=>this.extraContainerEl=t})}renderImg(){const t=this.includeMap?this.renderPrintMap():null,n=this.includeMap&&this.showIncludeLegend?this.renderLegend():null;let s;return this.includeMap&&this.showIncludePopup?s=this.renderPopup():this.showExtraContentInImg&&null!=this.extraContent&&this.includeExtraContent&&(s=this.renderExtraContent()),i("div",{ref:t=>this.printContainerEl=t},i("div",{class:W,ref:t=>this.printEl=t},t,n,s))}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async exportPreviewOnClick(){"PDF"===this.selectedFileType?await this.exportPDF():this.exportImg()}async exportPDF(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}exportImg(){var t;if(this.resetPopupVisibility(),null==this.dataUrl)return;const n=document.createElement("a");n.id="download-link",n.href=this.dataUrl,n.download=null!==(t=this.headerTitle)&&void 0!==t?t:document.title,n.click(),this.dataUrl=null,this.exportIsLoading=!1,this.removeScreenshotElements(),this.resetPrintContent()}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updateScaleBar(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print__pdf {\n height: 100%;\n width: 100%;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n }\n\n .instant-apps-export-print__img {\n display: grid;\n width: auto;\n }\n\n .instant-apps-export-print__img--extra-content {\n grid-template-columns: 2fr minmax(0, 325px);\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-container {\n grid-row: 1;\n grid-column: 1;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__view-wrapper {\n border: 2pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__view-wrapper {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__extra-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 325px;\n display: none;\n color: #323232;\n background: #fff;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__pdf .instant-apps-export-print__popup-container {\n border: 1pt solid #323232;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__popup-container {\n grid-row: 1 / span 2;\n grid-column: 2;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .instant-apps-export-print__img .instant-apps-export-print__legend-container {\n margin: 14px;\n grid-row: 2;\n grid-column: 1;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content *, .instant-apps-export-print__img .esri-feature.esri-widget * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 2pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 4px;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n margin: 0 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n font-size: 10px;\n padding: 0 4px;\n }\n \n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label {\n height: 10px;\n padding: 0 2px;\n line-height: 11px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__bar-container.esri-scale-bar__bar-container--line {\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n border-top: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label-container--line {\n position: unset;\n margin: 0 2px;\n background-color: rgba(255, 255, 255, 0.66);\n height: 10px;\n display: flex;\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{"PDF"===this.selectedFileType&&(this.exportIsLoading=!1),this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");if(null!=t){t.innerHTML="";const n=null!=this.extraContent&&this.includeExtraContent;this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&this.showExtraContentInImg&&n),n?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none"}else this.showExtraContentInImg&&"PDF"!==this.selectedFileType&&!this.includeExtraContent&&this.printEl.classList.toggle(A,!1)}resetPrintContent(){var t,n,i;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),null===(i=this.tmpPopupTitleEl)||void 0===i||i.remove(),this.printStyleEl=void 0;const s=this.printEl.querySelector("#export-content");s&&(s.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null==this.view||null==this.popupContainerEl)return;this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen();const i=this.includePopup&&(this.view.popup.visible||this.popupHiddenByMapArea)&&null!=this.view.popup.selectedFeature;if(this.printEl.classList.toggle(A,"PDF"!==this.selectedFileType&&i),i){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null==this.popupTitleEl?(this.tmpPopupTitleEl=document.createElement("div"),this.tmpPopupTitleEl.prepend(i),this.tmpPopupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupContainerEl.prepend(this.tmpPopupTitleEl)):(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view)if(this.handleLegendSetup(),"PDF"===this.selectedFileType){const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}else this.convertToImage()}convertToImage(){const t={backgroundColor:"#FFF",skipFonts:!0};"JPG"===this.selectedFileType?async function(t,n={}){return(await V(t,n)).toDataURL("image/jpeg",n.quality||1)}(this.printEl,t).then(this.handleGetImage.bind(this)):async function(t,n={}){return(await V(t,n)).toDataURL()}(this.printEl,t).then(this.handleGetImage.bind(this))}handleGetImage(t){var n;this.resetPrintContent(),this.dataUrl=t,this.setMapAreaOnClick(!1),this.showPreview(t),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)}handleLegendSetup(){var t;if(this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl){const n=null!=this.legend&&(null===(t=this.legend.activeLayerInfos)||void 0===t?void 0:t.length)>0;this.legendContainerEl.style.display=this.includeLegend&&n?"block":"none"}}handleWidgetCreation(){this.includeMap&&(this.handleLegendCreation(),this.handleCompassCreation(),this.updatePopupToPrint())}handleIncludePopup(){var t,n;if(this.showIncludePopup){const i="includePopup";null===(t=this.handles)||void 0===t||t.remove(i),null===(n=this.reactiveUtils)||void 0===n||n.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready})).then((()=>{var t;null===(t=this.handles)||void 0===t||t.add(this.reactiveUtils.watch((()=>{var t,n;return null===(n=null===(t=this.view)||void 0===t?void 0:t.popup)||void 0===n?void 0:n.visible}),(t=>{this.settingMapArea||(this.includePopup=t)})),i)}))}}handleLegendCreation(){var t,n,i,s,e;if(null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const o=this.view.map,r=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;null!=(null===(i=null==o?void 0:o.portalItem)||void 0===i?void 0:i.id)&&(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)===(null===(e=null==r?void 0:r.portalItem)||void 0===e?void 0:e.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{if(null!=this.legend&&(this.legend.destroy(),this.legend=null),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const n=document.createElement("div");this.legendContainerEl.append(n);const[i]=await o(["esri/widgets/Legend"]);this.legend=new i({container:n,view:t,respectLayerDefinitionExpression:!0,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n,i,s;if(null!=this.view&&null!=this.compassContainerEl){const e=this.view.map,o=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null===(i=null==e?void 0:e.portalItem)||void 0===i?void 0:i.id)===(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await o(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){if(this.scaleBarContainerEl&&null!=this.view&&(this.scaleBarContainerEl.innerHTML="",this.showScaleBar)){const t=this.view.ui.getComponents(),n=null==t?void 0:t.find((({container:t})=>{var n;return null===(n=null==t?void 0:t.className)||void 0===n?void 0:n.includes("esri-scale-bar")}));null!=(null==n?void 0:n.container)&&"string"!=typeof n.container&&this.scaleBarContainerEl.append(n.container.cloneNode(!0))}}async viewScreenshot(){var t;if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3),this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){"PDF"===this.selectedFileType&&(this.printEl.style.gridTemplateRows="minmax(auto, 70%)"),this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const r=t.getAttribute("style");r&&o.setAttribute("style",r);const a=i[n];null!=a&&(a.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n,i;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const s=document.createElement("div"),e=document.createElement("calcite-button"),o=document.createElement("calcite-button");e.innerHTML="PDF"===this.selectedFileType?null===(t=this.messages)||void 0===t?void 0:t.export:null===(n=this.messages)||void 0===n?void 0:n.downloadImage,o.innerHTML=null===(i=this.messages)||void 0===i?void 0:i.returnToMap,o.appearance="outline-fill",e.onclick=this.exportPreviewOnClick.bind(this),o.onclick=this.screenshotReturn.bind(this),s.append(o,e),this.screenshotImgContainer.append(this.screenshotImg,s),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null,this.resetPopupVisibility()}setMapAreaOnClick(t){null!=this.view&&(this.settingMapArea=!0,t&&this.view.popup.visible&&(this.popupHiddenByMapArea=!0,this.view.popup.container.style.display="none"),this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),it))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){var t;if(null!=this.view&&null!=this.area){this.view.removeHandles(it);const n=this.area.height,i=this.area.width;this.showScaleBar&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3&&.75*this.view.width<i)),this.view.takeScreenshot({area:this.area,width:2*i,height:2*n,format:"jpg"}).then((t=>{var n;this.screenshot=t,null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null),"PDF"===this.selectedFileType?(this.showPreview(null==t?void 0:t.dataUrl),this.resetPopupVisibility()):(null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1))}))}}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(t){t&&(this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&(this.screenshotImg.src=t))}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){var i;if(null!=t&&null!=this.screenshot){const s=this.screenshot.data.width/2,e=Number(t.style.width.replace("px",""));null===(i=this.scaleBarContainerEl)||void 0===i||i.style.setProperty(`--instant-apps-scale-bar-${n}`,e/s*100+"%")}}removeScreenshotElements(){var t,n,i;null===(t=this.view)||void 0===t||t.removeHandles(it),null===(n=this.screenshotPreview)||void 0===n||n.remove(),null===(i=this.screenshotStyle)||void 0===i||i.remove()}resetPopupVisibility(){this.view&&this.settingMapArea&&this.popupHiddenByMapArea&&(this.view.popup.container.style.display=""),this.settingMapArea=!1,this.popupHiddenByMapArea=!1}handleSelectFileType(t){this.selectedFileType=t.target.value,"PDF"===this.selectedFileType?(this.includeMap=this.pdfIncludeMap,this.showExtraContentInImg||(this.includeExtraContent=this.pdfIncludeExtraContent)):(this.pdfIncludeMap=this.includeMap,this.includeMap=!0,this.showExtraContentInImg||(this.pdfIncludeExtraContent=this.includeExtraContent,this.includeMap=!0,this.includeExtraContent=!1))}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"],view:["watchView"]}}};st.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export .instant-apps-export-print_img{display:flex;flex-flow:row wrap}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{st as instant_apps_export}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{l as a}from"./p-4cd4cb85.js";async function t(a,t){var n,e,l;try{const r=null===(l=null===(e=null===(n=null==t?void 0:t.portalItem)||void 0===n?void 0:n.portal)||void 0===e?void 0:e.credential)||void 0===l?void 0:l.token,g={responseType:"json"};r&&(g.query={token:r});var s="cacheBuster="+Date.now();const u=`${t.url}?${s}`,o=await a(u,g);return Promise.resolve(o.data)}catch(a){console.error("Unable to get resource t9n data.")}}async function n(t){if(!t)return null;const[n]=await a(["esri/portal/PortalItemResource"]),e=await t.fetchResources({num:100}),l=`t9n/${null==t?void 0:t.id}.json`,s=new n({path:l,portalItem:t}),r=e.resources.filter((a=>a.resource.path===l));if(0!==r.length)return Promise.resolve(r[0].resource);{const a="application/json",n=new Blob([JSON.stringify({})],{type:a});try{await t.addResource(s,n);const a=await t.fetchResources(),e=`t9n/${null==t?void 0:t.id}.json`,l=a.resources.filter((a=>a.resource.path===e));return Promise.resolve(l[0].resource)}catch(a){return console.error("ERROR: ",a),Promise.reject(null)}}}const e={full:{ar:{language:"Arabic",translated:"عربي"},bg:{language:"Bulgarian",translated:"Български"},bs:{language:"Bosnian",translated:"Bosanski"},ca:{language:"Catalan",translated:"Català"},cs:{language:"Czech",translated:"čeština"},da:{language:"Danish",translated:"Dansk"},de:{language:"German",translated:"Deutsch"},el:{language:"Greek",translated:"Ελλάδα"},en:{language:"English",translated:"English"},es:{language:"Spanish",translated:"Español"},et:{language:"Estonian",translated:"Eesti"},fi:{language:"Finnish",translated:"Suomi"},fr:{language:"French",translated:"Français"},he:{language:"Hebrew",translated:"עברית"},hr:{language:"Croatian",translated:"Hrvatski"},hu:{language:"Hungarian",translated:"Magyar"},id:{language:"Indonesian",translated:"Bahasa Indonesia",supportsAutoTranslate:!0},it:{language:"Italian",translated:"Italiano"},ja:{language:"Japanese",translated:"日本語"},ko:{language:"Korean",translated:"한국어"},lt:{language:"Lithuanian",translated:"Lietuvių"},lv:{language:"Latvian",translated:"Latviešu"},nb:{language:"Norwegian",translated:"Norsk"},nl:{language:"Dutch",translated:"Nederlands"},pl:{language:"Polish",translated:"Polski"},"pt-BR":{language:"Portuguese (Brazil)",translated:"Português (Brasil)"},"pt-PT":{language:"Portuguese (Portugal)",translated:"Português (Portugal)"},ro:{language:"Romanian",translated:"Română"},ru:{language:"Russian",translated:"Русский"},sk:{language:"Slovak",translated:"Slovenčina"},sl:{language:"Slovenian",translated:"Slovenščina"},sr:{language:"Serbian",translated:"Srpski"},sv:{language:"Swedish",translated:"Svenska"},th:{language:"Thai",translated:"ไทย"},tr:{language:"Turkish",translated:"Türkiye"},uk:{language:"Ukrainian",translated:"Україна"},vi:{language:"Vietnamese",translated:"Tiếng Việt"},"zh-CN":{language:"Simplified Chinese",translated:"简体中文"},"zh-HK":{language:"Traditional Chinese (Hong Kong)",translated:"繁體中文(香港)"},"zh-TW":{language:"Traditional Chinese (Taiwan)",translated:"繁體中文(台灣)"}},partial:{ab:{language:"Abkhaz",translated:"Аҧсуа"},aa:{language:"Afar",translated:"Afar"},af:{language:"Afrikaans",translated:"Afrikaans",supportsAutoTranslate:!0},ak:{language:"Akan",translated:"Akan"},sq:{language:"Albanian",translated:"Shqip",supportsAutoTranslate:!0},am:{language:"Amharic",translated:"አማርኛ",supportsAutoTranslate:!0},an:{language:"Aragonese",translated:"Aragonés"},hy:{language:"Armenian",translated:"Հայերեն",supportsAutoTranslate:!0},as:{language:"Assamese",translated:"অসমীয়া",supportsAutoTranslate:!0},av:{language:"Avaric",translated:"авар мацӀ"},ae:{language:"Avestan",translated:"Avesta"},ay:{language:"Aymara",translated:"aymar aru"},az:{language:"Azerbaijani",translated:"azərbaycan dili"},bm:{language:"Bambara",translated:"bamanankan"},ba:{language:"Bashkir",translated:"Башҡорт теле",supportsAutoTranslate:!0},eu:{language:"Basque",translated:"euskara",supportsAutoTranslate:!0},be:{language:"Belarusian",translated:"Беларуская"},bn:{language:"Bengali",translated:"বাংলা"},bh:{language:"Bihari",translated:"भोजपुरी"},bi:{language:"Bislama",translated:"Bislama"},br:{language:"Breton",translated:"Brezhoneg"},my:{language:"Burmese",translated:"ဗမာစာ"},ch:{language:"Chamorro",translated:"Chamoru"},ce:{language:"Chechen",translated:"нохчийн мотт"},ny:{language:"Chichewa",translated:"chiCheŵa"},cu:{language:"Church Slavic",translated:"ѩзыкъ словѣньскъ"},cv:{language:"Chuvash",translated:"чӑваш чӗлхи"},kw:{language:"Cornish",translated:"Kernewek"},co:{language:"Corsican",translated:"corsu"},cr:{language:"Cree",translated:"ᓀᐦᐃᔭᐍᐏᐣ"},dv:{language:"Divehi",translated:"ދިވެހި",supportsAutoTranslate:!0},eo:{language:"Esperanto",translated:"Esperanto"},ee:{language:"Ewe",translated:"Ɛʋɛgbɛ"},fo:{language:"Faroese",translated:"føroyskt",supportsAutoTranslate:!0},fj:{language:"Fijian",translated:"Vosa Vakaviti"},ff:{language:"Fulah",translated:"Fulfulde"},gl:{language:"Galician",translated:"galego",supportsAutoTranslate:!0},ka:{language:"Georgian",translated:"ქართული",supportsAutoTranslate:!0},gn:{language:"Guarani",translated:"Avañe'ẽ"},gu:{language:"Gujarati",translated:"ગુજરાતી",supportsAutoTranslate:!0},ht:{language:"Haitian Creole",translated:"Kreyòl Ayisyen",supportsAutoTranslate:!0},ha:{language:"Hausa",translated:"هَوُسَ",supportsAutoTranslate:!0},hz:{language:"Herero",translated:"Otjiherero"},hi:{language:"Hindi",translated:"हिन्दी"},ho:{language:"Hiri Motu",translated:"Hiri Motu"},is:{language:"Icelandic",translated:"Íslenska",supportsAutoTranslate:!0},io:{language:"Ido",translated:"Ido"},ig:{language:"Igbo",translated:"Asụsụ Igbo",supportsAutoTranslate:!0},ia:{language:"Interlingua",translated:"Interlingua"},ie:{language:"Interlingue",translated:"Interlingue"},iu:{language:"Inuktitut",translated:"ᐃᓄᒃᑎᑐᑦ",supportsAutoTranslate:!0},ip:{language:"Inupiaq",translated:"Iñupiaq"},ga:{language:"Irish",translated:"Gaeilge",supportsAutoTranslate:!0},jv:{language:"Javanese",translated:"ꦧꦱꦗꦮ"},kl:{language:"Kalaallisut",translated:"kalaallisut"},kn:{language:"Kannada",translated:"ಕನ್ನಡ",supportsAutoTranslate:!0},kr:{language:"Kanuri",translated:"Kanuri"},ks:{language:"Kashmiri",translated:"कश्मीरी",supportsAutoTranslate:!0},kk:{language:"Kazakh",translated:"қазақ тілі",supportsAutoTranslate:!0},km:{language:"Khmer",translated:"ខ្មែរ",supportsAutoTranslate:!0},ki:{language:"Kikuyu",translated:"Gĩkũyũ"},rw:{language:"Kinyarwanda",translated:"Kinyarwanda",supportsAutoTranslate:!0},rn:{language:"Kirundi",translated:"Ikirundi"},kv:{language:"Komi",translated:"коми кыв"},kg:{language:"Kongo",translated:"Kikongo"},ku:{language:"Kurdish",translated:"Kurdî",supportsAutoTranslate:!0},kj:{language:"Kwanyama",translated:"Kuanyama"},ky:{language:"Kyrgyz",translated:"Кыргызча"},lo:{language:"Lao",translated:"ພາສາລາວ",supportsAutoTranslate:!0},la:{language:"Latin",translated:"latine"},li:{language:"Limburgish",translated:"Limburgs"},ln:{language:"Lingala",translated:"Lingála"},lu:{language:"Luba-Katanga",translated:"Kiluba"},lg:{language:"Luganda",translated:"Luganda"},lb:{language:"Luxembourgish",translated:"Lëtzebuergesch"},mk:{language:"Macedonian",translated:"македонски јазик",supportsAutoTranslate:!0},mg:{language:"Malagasy",translated:"fiteny malagasy",supportsAutoTranslate:!0},ms:{language:"Malay",translated:"Bahasa Melayu",supportsAutoTranslate:!0},ml:{language:"Malayalam",translated:"മലയാളം",supportsAutoTranslate:!0},mt:{language:"Maltese",translated:"Malti",supportsAutoTranslate:!0},gv:{language:"Manx",translated:"Gailck"},mi:{language:"Maori",translated:"te reo Māori",supportsAutoTranslate:!0},mr:{language:"Marathi",translated:"मराठी",supportsAutoTranslate:!0},mh:{language:"Marshallese",translated:"Kajin M̧ajeļ"},mn:{language:"Mongolian",translated:"Монгол хэл"},na:{language:"Nauru",translated:"Ekakairũ Naoero"},nv:{language:"Navajo",translated:"Diné bizaad"},ng:{language:"Ndonga",translated:"Owambo"},ne:{language:"Nepali",translated:"नेपाली",supportsAutoTranslate:!0},nd:{language:"North Ndebele",translated:"isiNdebele"},se:{language:"Northern Sami",translated:"Davvisámegiella"},no:{language:"Norwegian",translated:"Norsk"},nn:{language:"Norwegian Nynorsk",translated:"Norsk nynorsk"},ii:{language:"Nuosu",translated:"ꆈꌠ꒿ Nuosuhxop"},oc:{language:"Occitan",translated:"occitan"},oj:{language:"Ojibwe",translated:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},or:{language:"Oriya",translated:"ଓଡ଼ିଆ",supportsAutoTranslate:!0},om:{language:"Oromo",translated:"Afaan Oromoo"},os:{language:"Ossetian",translated:"ирон æвзаг"},pi:{language:"Pali",translated:"पाऴि"},pa:{language:"Panjabi",translated:"ਪੰਜਾਬੀ"},ps:{language:"Pashto",translated:"پښتو",supportsAutoTranslate:!0},fa:{language:"Persian",translated:"فارسی",supportsAutoTranslate:!0},qu:{language:"Quechua",translated:"Runa Simi"},rm:{language:"Romansh",translated:"rumantsch grischun"},sm:{language:"Samoan",translated:"gagana fa'a Samoa",supportsAutoTranslate:!0},sg:{language:"Sango",translated:"yângâ tî sängö"},sa:{language:"Sanskrit",translated:"संस्कृतम्"},sc:{language:"Sardinian",translated:"sardu"},gd:{language:"Scottish Gaelic",translated:"Gàidhlig"},sn:{language:"Shona",translated:"chiShona"},sd:{language:"Sindhi",translated:"सिन्धी",supportsAutoTranslate:!0},si:{language:"Sinhala",translated:"සිංහල",supportsAutoTranslate:!0},so:{language:"Somali",translated:"Soomaaliga",supportsAutoTranslate:!0},nr:{language:"South Ndebele",translated:"isiNdebele"},st:{language:"Southern Sotho",translated:"Sesotho"},su:{language:"Sundanese",translated:"Basa Sunda"},sw:{language:"Swahili",translated:"Kiswahili",supportsAutoTranslate:!0},ss:{language:"Swati",translated:"SiSwati"},tl:{language:"Tagalog",translated:"Wikang Tagalog"},ty:{language:"Tahitian",translated:"Reo Tahiti",supportsAutoTranslate:!0},tg:{language:"Tajik",translated:"тоҷикӣ"},ta:{language:"Tamil",translated:"தமிழ்",supportsAutoTranslate:!0},tt:{language:"Tatar",translated:"татар теле",supportsAutoTranslate:!0},te:{language:"Telugu",translated:"తెలుగు",supportsAutoTranslate:!0},bo:{language:"Tibetan",translated:"བོད་ཡིག",supportsAutoTranslate:!0},ti:{language:"Tigrinya",translated:"ትግርኛ",supportsAutoTranslate:!0},to:{language:"Tonga",translated:"faka Tonga",supportsAutoTranslate:!0},ts:{language:"Tsonga",translated:"Xitsonga"},tn:{language:"Tswana",translated:"Setswana"},tk:{language:"Turkmen",translated:"Türkmen",supportsAutoTranslate:!0},tw:{language:"Twi",translated:"Twi"},ug:{language:"Uighur",translated:"Uyƣurqə"},ur:{language:"Urdu",translated:"اردو",supportsAutoTranslate:!0},uz:{language:"Uzbek",translated:"O'zbek",supportsAutoTranslate:!0},ve:{language:"Venda",translated:"Tshivenḓa"},vo:{language:"Volapük",translated:"Volapük"},wa:{language:"Walloon",translated:"walon"},cy:{language:"Welsh",translated:"Cymraeg",supportsAutoTranslate:!0},fy:{language:"Western Frisian",translated:"Frysk"},wo:{language:"Wolof",translated:"Wollof"},xh:{language:"Xhosa",translated:"isiXhosa",supportsAutoTranslate:!0},yi:{language:"Yiddish",translated:"ייִדיש"},yo:{language:"Yoruba",translated:"Yorùbá",supportsAutoTranslate:!0},za:{language:"Zhuang",translated:"Saɯ cueŋƅ"},zu:{language:"Zulu",translated:"isiZulu",supportsAutoTranslate:!0}}};export{e as L,t as f,n as g}
|