@esri/solutions-components 5.1.0-next.141 → 5.1.0-next.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cdn/{AYQT4HC4.js → 34JROLRM.js} +1 -1
  2. package/dist/cdn/4WJ2UJWQ.js +2 -0
  3. package/dist/cdn/{PV6MK2E6.js → FV4F6RW3.js} +1 -1
  4. package/dist/cdn/{QTZMCFZB.js → LLPT3R4B.js} +16 -16
  5. package/dist/cdn/{7J2F4TFI.js → PUQBEN7F.js} +1 -1
  6. package/dist/cdn/{TSYIZSCP.js → RYEEEMFO.js} +11 -1
  7. package/dist/cdn/S6U6SXMD.js +2 -0
  8. package/dist/cdn/{RMCQZMLA.js → TIRNZIMX.js} +1 -1
  9. package/dist/cdn/{OYBEDO63.js → UVOAWVML.js} +1 -1
  10. package/dist/cdn/{SAJPXZDW.js → WCOEPRRK.js} +1 -1
  11. package/dist/cdn/{NN52IXXG.js → YM3CRTWP.js} +1 -1
  12. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
  13. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
  14. package/dist/cdn/index.js +1 -1
  15. package/dist/chunks/converter.js +114 -105
  16. package/dist/chunks/designSolution.js +11 -1
  17. package/dist/chunks/solution-builder-assistant.js +56 -27
  18. package/dist/chunks/updateDesign.js +1 -1
  19. package/dist/components/arcgis-solutions-assistant/customElement.js +182 -174
  20. package/dist/components/solution-builder-assistant/customElement.d.ts +2 -0
  21. package/dist/components/solution-builder-assistant/customElement.js +3 -2
  22. package/dist/components/solution-builder-assistant/index.js +1 -0
  23. package/dist/docs/api.json +1 -1
  24. package/dist/docs/docs.json +1 -1
  25. package/dist/docs/web-types.json +1 -1
  26. package/dist/solutions-components_commit.txt +8 -5
  27. package/package.json +1 -1
  28. package/dist/cdn/LDNPRHOM.js +0 -2
  29. package/dist/cdn/WPGT2HLS.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as E3,b as k3}from"./BNRFT546.js";import{a as f3}from"./WPGT2HLS.js";import a from"./EXC566PM.js";import{b as b2}from"./2B4SGB3I.js";import{b as w2}from"./I2NTSKBD.js";import{$ as Y1,$a as k7,$b as Z9,A as F2,Aa as $2,Ab as h7,B as R2,Ba as q2,Bb as g7,C as k1,Ca as Y2,Cb as T7,D as Z,Da as F9,E as p2,Ea as R9,Eb as Z7,F as $1,Fa as X2,G as c1,Ga as Q2,Gb as U7,H as A,Ha as b1,Hb as W7,I as I9,Ia as p9,Ib as O7,J as h2,Ja as e7,Jb as K7,K as u,Ka as a7,Kb as n1,L as g2,La as x7,Lb as H7,Ma as t7,Mb as v7,N as C1,Na as n7,Nb as B7,O as D,Oa as m7,Ob as L7,P as G1,Pa as i7,Pb as j7,Q as T2,Qa as l7,Qb as _7,R as c9,Ra as d7,Rb as V7,S as C9,Sa as y7,Sb as z7,T as q1,Ta as o7,Tb as J7,U as J,Ua as u7,Ub as $7,V as Z2,Va as r7,Vb as q7,W as U2,Wa as S7,Wb as Y7,X as W2,Xa as h9,Xb as X7,Y as v,Ya as a9,Yb as Q7,Z as O2,Za as f7,Zb as e3,_ as j,_a as E7,_b as a3,a as K1,aa as K2,ab as t1,ac as t9,ba as G9,bb as w7,bc as U9,c as O,ca as x1,cb as b7,cc as F1,da as N,db as s7,dc as n9,e as e1,ea as c,eb as N7,ec as x3,f as D2,fa as X,fb as A7,fc as t3,g as d1,ga as X1,gb as P7,gc as n3,h as S,ha as H2,hb as D7,hc as m3,i as P9,ia as v2,ib as I7,ic as i3,j as r1,ja as M9,jb as c7,jc as l3,k as L1,ka as B2,kb as C7,kc as d3,l as f1,lb as M1,lc as R1,m as j1,ma as L2,mb as M,mc as m9,n as _1,na as j2,nb as x9,nc as i9,o as D9,oa as _2,oc as y3,p as c2,pa as V2,pc as l9,qa as z2,qb as G7,qc as o3,r as V1,ra as h,rb as M7,s as C2,sa as w1,sb as B,t as z1,ta as $,tb as F7,u as J1,ub as s1,v as a1,va as Q1,vb as q,w as G2,wa as e9,wb as R7,x as E1,xa as J2,xb as g9,y as M2,yb as p7,z as k,zb as T9}from"./3UKDJZ2D.js";import{a as k2}from"./MGEDATQ7.js";import{a as S1,g as I1}from"./IHG7KTNC.js";import{a as K}from"./ZCU2WWVN.js";import{a as z,b as H1,c as v1,d as B1}from"./KOIDWEP3.js";import{e as V,f as A2,j as U1,l as W1,o as P2,s as O1}from"./AYSQIO6L.js";import{b as s2,h as N2}from"./YQHYMLC7.js";import{a as I2}from"./5O53T3SW.js";import{a as H}from"./AJZDBHB6.js";import{b as E2}from"./2I5LGZNX.js";import{E as Z1,F as D1,G as S2,K as f2,h as r2,i as _,q as u1}from"./FFF5HUPM.js";import{c as W}from"./QPIMTXPL.js";export default $arcgis.t(([{g:u3,h:r3,i:S3}])=>{function N1(e,a="application/octet-stream"){if(typeof Blob<"u"){let x=[];for(let n=0;n<e.length;n++)x[n]=e.charCodeAt(n);let t=new Uint8Array(x);return new Blob([t],{type:a})}else throw new Error("stringToBlob is not currently supported on Node")}function w3(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var d9={};W(d9,{_mostRecentlyEditedLayer:()=>W9,convertItemToTemplate:()=>n0,createItemFromTemplate:()=>m0,postProcess:()=>i0});function n0(e,a,x,t){return new Promise((n,m)=>{let i=j(e);c7(e.groupDesignations)?x7(i,x).then(d=>n(d),d=>m(A(d))):(i.estimatedDeploymentCostFactor=10,$(i.item.id,x).then(d=>{i.data=d,P7(i,x).then(y=>{y.item.modified=Math.max(y.item.modified,W9(i.properties.layers),W9(i.properties.tables)),s7(y,x).then(o=>{y.dependencies=o.map(r=>r.id),n(X2(y,o,!1,t))},o=>m(A(o)))},y=>m(A(y)))}))})}function m0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),delete m.item.thumbnail,$1(m,"properties.service.size");let i=Q2(m.data);k7(m,x,a).then(l=>{l.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?(m=p9(m,a,l),m7(m,a,i,x).then(()=>{m=p9(m,a,l),s1({...m.item,url:void 0},m.data,x,e.item.thumbnail,void 0,a).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?h(m.itemId,x).then(d=>{m.item=d,u(m,"item.url")&&!m.item.url.endsWith("/")&&(m.item.url+="/"),n({item:m,id:l.serviceItemId,type:m.type,postProcess:x1({item:m.item,data:m.data})||h9(m)})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function i0(e,a,x,t,n,m,i){return new Promise((l,d)=>{q(e,m,i).then(y=>{h9(t)?(t=N(t,m),a9(t,i,t.item.url,m).then(l,d)):l(y)},d)})}function W9(e){let a=0;return e.forEach(x=>{a=x.editingInfo?.lastEditDate?Math.max(a,x.editingInfo.lastEditDate):a}),a}var f={};W(f,{convertItemToTemplate:()=>l0,createItemFromTemplate:()=>d0});function l0(e,a,x){return new Promise(t=>{let n=j(e);n.item.id=c(n.item.id,n.item.id,".itemId");let m=new Promise(l=>{w1(n.itemId,n.item.name,x).then(d=>{!d||d.size===0?l(null):l(d)})}),i=Promise.resolve({});Promise.all([m,i]).then(l=>{let[d]=l;if(d){let y=x3(d,n.item.name);n.properties[y.filename]=y.mimeType;let o=n9(n.itemId,y.blob.name,1,y.blob.name===y.filename?F1.data:F1.fakezip),r={itemId:n.itemId,file:y.blob,folder:o.folder,filename:o.filename};n.dataFile=r,n.resources.push(o.folder+"/"+o.filename),t(n)}else t(n)})})}function d0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),t1(m.item,m.data,x,a.folderId).then(i=>{t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,i.id)?(m.itemId=i.id,a[e.itemId]={itemId:i.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,i.id),n({item:m,id:i.id,type:m.type,postProcess:!1})):(t(e.itemId,S.Cancelled,0),M(i.id,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}var Q9={};W(Q9,{_getFormDataFilename:()=>a6,_replaceFeatureServiceURLs:()=>J3,_replaceItemIds:()=>$3,_replacePortalBaseUrls:()=>q3,_replaceWorkflowManagerBaseUrls:()=>Y3,_updateZipObjectTextContent:()=>X3,convertItemToTemplate:()=>j0,createItemFromTemplate:()=>_0,postProcess:()=>e6,postProcessFormItems:()=>z0,swizzleFormObject:()=>Y9,templatizeFormData:()=>X9});function N3(e,a){return y0(e,a)}function y0(e,a){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(t=>{let n=u(e,t);Array.isArray(n)&&n.forEach(m=>{m.type==="mapWidget"&&(e.dependencies.indexOf(m.itemId)<0&&e.dependencies.push(m.itemId),m.itemId=c(m.itemId,m.itemId,".itemId")),Array.isArray(m.datasets)&&o0(m,e,a)})}),e}function o0(e,a,x){e.datasets.forEach(t=>{if(u(t,"dataSource.type")!=="arcadeDataSource"){let m=u(t,"dataSource.itemId");if(m){a.dependencies.indexOf(m)<0&&a.dependencies.push(m);let i=u(t,"dataSource.layerId");b1(i?.toString(),m,"",x),t.dataSource.itemId=c(m,m,".itemId")}}})}function A3(e,a){let x=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return x.forEach(t=>{let n=u(e,t);u0(n,a)}),x.forEach(t=>{r0(e,t,a)}),e}function u0(e,a){e&&Array.isArray(e)&&e.forEach(x=>{Array.isArray(x.datasets)&&x.datasets.forEach(t=>{let n=c9(u(t,"dataSource.itemId"));if(n){let m=C9(u(t,"dataSource.layerId"));a.some(i=>i.itemId===n&&i.layerId===m?(s3(i,x.id),!0):!1)}else{let m=u(t,"dataSource.id");if(m){let i=m.split("#")[1];a.some(l=>l.ids.indexOf(i)>-1?(s3(l,x.id),!0):!1)}}})})}function r0(e,a,x){let t=u(e,a);t&&D(e,a,S0(t,x))}function S0(e,a){return Array.isArray(e)?e.map(x=>{let t=x;return Array.isArray(t.events)&&(t.events=t.events.map(n=>{let m=n;return Array.isArray(m.actions)&&(m.actions=m.actions.map(i=>{let l=i;if(l.fieldMap&&l.targetId&&l.targetId.indexOf("#")>-1){let d=b3(l,a);if(d){let y=u(d,"fields"),o=u(d,"basePath");Array.isArray(y)&&o&&(l.fieldMap=l.fieldMap.map(r=>{let E=r;return E.targetName=X(E.targetName,y,o),E}))}}return l})),m})),Array.isArray(t.datasets)&&(t.datasets=t.datasets.map(n=>{let m=n;if(m.type==="serviceDataset"){let i=b3(n,a);if(i){let l=u(i,"fields"),d=u(i,"basePath");Array.isArray(l)&&d&&(t=X(t,l,d),m=X(m,l,d))}}return m})),t}):e}function b3(e,a){let x,t=u(e,"dataSource.id")||u(e,"targetId");if(t){let n=t.split("#")[1];if(!a.some(m=>(x=m.ids.indexOf(n)>-1?m:x,m.ids.indexOf(n)>-1))){let m=t.split("#")[0];a.some(i=>{let d=(i.references||[]).indexOf(m)>-1;return x=d?i:x,d})}}else{let n=c9(u(e,"dataSource.itemId")),m=C9(u(e,"dataSource.layerId"));n&&a.some(i=>{let l=n===i.itemId&&m===i.layerId;return x=l?i:x,l})}return x}function s3(e,a){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(a)<0&&e.references.push(a)}var A1={};W(A1,{convertItemToTemplate:()=>D0,convertNotebookToTemplate:()=>z9,createItemFromTemplate:()=>I0,deleteProps:()=>h3,fineTuneCreatedItem:()=>V9,postProcess:()=>C0,postProcessNotebookTemplates:()=>c0});function I3(e,a,x,t){return new Promise((n,m)=>{let i="";if(e.item.url){let l=e.item.url,d=l.indexOf("//");e.item.url=v(J)+l.substring(l.indexOf("/",d+2),l.lastIndexOf("=")+1)+e.item.id,i=l.replace(l.substring(l.indexOf("/",d+2)),"")}e.dependencies=k0(e),D(e,"data.folderId","{{folderId}}"),s0(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),C3(e,"data.appItemId",e.itemId),j9(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],v(J)),D(e,"data.geometryService",v(Z2)),f0(e,x,i,t).then(()=>{D3(e,x,i,"data.widgetPool.widgets").then(l=>{D3(l,x,i,"data.widgetOnScreen.widgets",!0).then(d=>{E0(d,x,i,"data.values").then(y=>{n(y)},y=>m(A(y)))},d=>m(A(d)))},l=>m(A(l)))},l=>m(A(l)))})}function f0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,"data.dataSource.dataSources");if(i&&Object.keys(i).length>0){let l=new Array;Object.keys(i).forEach(d=>{let y=i[d];D(y,"portalUrl",v(J));let o=u(y,"itemId");if(u(y,"url")){if(o){let E=y.url.substr(y.url.lastIndexOf("/")+1);b1(E.toString(),o,y.url,t),y.itemId=c(o,o,".layer"+E+".itemId")}let r=L9(y.url,x,[],[],a);l.push(new Promise((E,w)=>{B9(r.serviceRequests,r.requestUrls,r.testString).then(s=>{y.url=s,E()},s=>w(A(s)))}))}else o&&(y.itemId=c(o,o,".itemId"))}),Promise.all(l).then(()=>n(e),d=>m(A(d)))}else n(e)})}function D3(e,a,x,t,n=!1){return new Promise((m,i)=>{let l=u(e,t)||[],d=[],y=[];if(l.forEach(o=>{!n&&u(o,"icon")&&j9(o,["icon"],v(J));let r=o.config;if(r){let E=JSON.stringify(r),w=L9(E,x,y,d,a);o.config=JSON.parse(w.testString),d=w.serviceRequests,y=w.requestUrls}}),d.length>0){let o=JSON.stringify(l);B9(d,y,o).then(r=>{D(e,t,JSON.parse(r)),m(e)},r=>i(A(r)))}else m(e)})}function E0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,t),l=[],d=[];if(i){u(i,"icon")&&j9(i,["icon"],v(J));let y=JSON.stringify(i),o=L9(y,x,d,l,a);i=JSON.parse(o.testString),l=o.serviceRequests,d=o.requestUrls}if(l.length>0){let y=JSON.stringify(i);B9(l,d,y).then(o=>{D(e,t,JSON.parse(o)),n(e)},o=>m(A(o)))}else n(e)})}function B9(e,a,x){return new Promise((t,n)=>{if(e&&e.length>0){let m=0;Promise.all(e).then(i=>{i.forEach(l=>{if(u(l,"serviceItemId")){let d="{{"+l.serviceItemId+(l.hasOwnProperty("id")?".layer"+l.id:"")+".url}}";x=y9(x,a[m],d,!0)}m++}),t(x)},i=>n(A(i)))}else t(x)})}function L9(e,a,x,t,n){let m={f:"json",authentication:n},i=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return i&&i.length&&i.forEach(l=>{l.indexOf("NAServer")>-1?e=y9(e,l,v(W2)):l.indexOf("GeocodeServer")>-1?e=y9(e,l,v(U2)):a&&l.indexOf(a)>-1?e=y9(e,a,v(J)):l.indexOf("FeatureServer")>-1&&x.indexOf(l)===-1&&(x.push(l),t.push(O(l,m)))}),{testString:e,requestUrls:x,serviceRequests:t}}function y9(e,a,x,t=!1){let n=t&&e.indexOf('"')>-1,m=new RegExp(n?'"'+a+'"':a,"gmi");return e.replace(m,n?'"'+x+'"':x)}function j9(e,a,x){a.forEach(t=>{let n=u(e,t);if(n){let m=n.substring(n.indexOf("/",n.indexOf("//")+2));D(e,t,m!==n?x+m:x)}})}function c3(e,a,x,t){return new Promise(n=>{if(G1(e,["WAB2D","WAB3D","Web AppBuilder"])){let m={id:a.itemId,url:a.item.url,data:a.data},i=B(m,t),l={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:a.itemId,url:J1(N(v(J),x))+"sharing/rest/content/items/"+a.itemId+"/package"},d=t1(l,{},t,x.folderId);Promise.all([i,d]).then(()=>n(null),()=>n(null))}else n(null)})}function k0(e){let a=w0;return G1(e,["WAB2D","WAB3D","Web AppBuilder"])&&(a=b0),a(e)}function w0(e){return g2(e,["data.values.webmap","data.values.group"])}function b0(e){let a=[],x=u(e,"data.map.itemId");x&&a.push(x);let t=u(e,"data.dataSource.dataSources");return t&&Object.keys(t).forEach(n=>{let m=t[n];m.itemId&&a.push(m.itemId)}),a}function s0(e,a){a.forEach(x=>{let t=u(e,x);C3(e,x,t)})}function C3(e,a,x){D(e,a,c(x,x,".itemId"))}function G3(e,a){let x=u(e,"data.dataSource.dataSources");x&&Object.keys(x).length>0&&(Object.keys(x).forEach(m=>{let i=x[m];x[m]=H9(i,a)}),D(e,"data.dataSource.dataSources",x)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(m=>{let i=u(e,m);i&&D(e,m,N0(i,a))});let n=u(e,"data.values");return n&&D(e,"data.values",H9(n,a)),e}function H9(e,a,x=!1){return e=P0(e,a,x),A0(e,a).forEach(n=>{e=X(e,n.fields,n.basePath,x)}),e}function N0(e,a){let x=["SmartEditor","Screening"];return e.map(t=>{if(t.config){let n=x.indexOf(t.name)>-1;t.config=H9(t.config,a,n)}return t})}function A0(e,a){let x=JSON.stringify(e);return a.filter(n=>K9(n,x)<4).sort((n,m)=>K9(n,x)-K9(m,x))}function K9(e,a){let x=e.url,t=e.itemId,n=e.layerId,m;return x&&!isNaN(n)&&(m=new RegExp(x.replace(/[.]/,".layer"+n+"."),"gm")),m&&m.test(a)||e.ids.length>0&&e.ids.some(i=>new RegExp(i,"gm").test(a))?1:x&&new RegExp(x,"gm").test(a)?2:t&&new RegExp(t,"gm").test(a)?3:4}function P0(e,a,x){let t=JSON.stringify(e),n=a.filter(m=>{let i;m.url&&!isNaN(m.layerId)&&(i=new RegExp(m.url.replace(/[.]/,".layer"+m.layerId+"."),"gm"));let l=!1;if(m.ids.length>0&&(l=m.ids.some(d=>new RegExp(d,"gm").test(t))),l||i&&i.test(t))return m});return n.length>0&&n.forEach(m=>{e=v9(e,m,x),m.ids.length>0&&m.ids.forEach(i=>{e=o9(e,m,i,x)})}),e}function v9(e,a,x){let t={},n=a.url,m=a.layerId,i;if(n&&!isNaN(m)&&(i=new RegExp(n.replace(/[.]/,".layer"+m+"."),"gm")),Array.isArray(e))t=e.map(l=>v9(l,a,x));else if(typeof e=="object")for(let l in e)e[l]!=null&&typeof e[l]=="object"?t[l]=v9(e[l],a,x):(i&&i.test(e[l])&&(e=X(e,a.fields,a.basePath,x)),t[l]=e[l]);else t=e;return t}function o9(e,a,x,t){let n={},m=new RegExp(x,"gm");if(Array.isArray(e))n=e.map(i=>o9(i,a,x,t));else if(typeof e=="object")for(let i in e)if(e[i]!==null){let l;try{l=JSON.parse(e[i])}catch{l=void 0}l&&typeof l=="object"?n[i]=JSON.stringify(o9(l,a,x,t)):typeof e[i]=="object"?(m.test(i)&&t&&(e[i]=X(e[i],a.fields,a.basePath,t)),n[i]=o9(e[i],a,x,t)):(m.test(e[i])&&(e=X(e,a.fields,a.basePath,t)),n[i]=e[i])}else n[i]=e[i];else n=e;return n}function M3(e,a,x,t){return S7(e,x,t)}function F3(e,a,x){return a9(e,a,"",x)}function Y(e,a,x,t,n){return new Promise((m,i)=>{function l(){n&&n.signal.aborted&&i(new Error("Operation was cancelled"))}if(l(),!t(e.itemId,S.Started,0))t(e.itemId,S.Ignored,0),m(k(e.type));else{let d=Z(e);d=N(d,a);let y;e.type==="Web Mapping Application"&&e.data?d=JSON.parse(N(JSON.stringify(d),a)):e.type==="QuickCapture Project"&&e.data&&(y=JSON.stringify(d.data.application),delete d.data),e.item.thumbnail&&(d.item.thumbnail=e.item.thumbnail),t1(d.item,d.data,x,a.folderId).then(o=>{if(l(),!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,o.id))t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type)));else{a[e.itemId]={itemId:o.id,itemUrl:a.portalBaseUrl+"/sharing/rest/content/items/"+o.id},d.itemId=o.id,d.type==="Web Mapping Application"&&e.data&&D(d,"data.appItemId",o.id);let r=x1(d.data),E=d.item.url;d=N(d,a),l();let w=Promise.resolve([]);if(d.relatedItems){let P=N(X1(d.relatedItems),a);w=f7(d.itemId,P,x)}l();let s;if(e.type==="Web Mapping Application"&&e.data&&G1(e,["WAB2D","WAB3D","Web AppBuilder"]))s=c3(e,d,a,x);else if(e.type==="Workforce Project")s=F3(d,x,a);else if(e.type==="QuickCapture Project"){if(y){let P=k1(N(JSON.parse(y),a),"qc.project.json");s=d3(P,d.itemId,"",P.name,x)}}else e.type==="Notebook"?s=V9(e,d,a,x):E!==d.item.url?(l(),s=new Promise((P,b)=>{R7(o.id,d.item.url,x).then(()=>P(),b)})):s=Promise.resolve(null);l(),Promise.all([w,s]).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,o.id)?m({item:d,id:o.id,type:d.type,postProcess:r}):(t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type))))},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}})}function D0(e,a,x,t){return Q(e,a,x,t)}function I0(e,a,x,t){return Y(e,a,x,t)}function z9(e){return new Promise(a=>{h3(e.data),a(e)})}function c0(e,a){if(e.some(t=>t.type==="Notebook")){let t=Object.keys(a).filter(m=>m.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((m,i)=>(m=[...new Set([...m,...i.dependencies,i.itemId])],m),[]);e=e.map(m=>{if(m.type==="Notebook"){let i=m.data&&JSON.stringify(m.data);return n.forEach(l=>{new RegExp(l,"gim").test(i)&&(i=i.replace(l,"{{"+l+".itemId}}"),m.dependencies.indexOf(l)<0&&m.dependencies.push(l))}),t.forEach(l=>{let d=new RegExp(l,"gim");if(d.test(i)){let y=a[l];i=i.replace(d,y);let o=/[0-9A-F]{32}/gim,r=y.match(o)[0];m.dependencies.indexOf(r)<0&&m.dependencies.push(r)}}),m.data=JSON.parse(i),m}})}return e}function h3(e){if(e){let a=["metadata.interpreter","metadata.papermill"];c1(e,a),(e.cells||[]).forEach(x=>{c1(x,a)})}}function V9(e,a,x,t){return new Promise((n,m)=>{let i={id:a.itemId,url:a.item.url,data:k1(a.data,a.itemId+".ipynb")};B(i,t).then(()=>n(null),m)})}function C0(e,a,x,t,n,m,i){return q(e,m,i)}function T3(e,a,x){return new Promise((t,n)=>{G0(e,x).then(m=>{e.dependencies=m.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=g3(e.data.properties.ServiceURL,m.urlHash),e.data.properties.OverviewURL=g3(e.data.properties.OverviewURL,m.urlHash)),t(e)},m=>n(A(m)))})}function G0(e,a){return new Promise((x,t)=>{let n=[];if(e.data?.properties){let m=[];e.data.properties.ServiceURL&&m.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&m.push(e.data.properties.OverviewURL),M0(m,n,a).then(i=>{x(i)},i=>t(A(i)))}else x({dependencies:n,urlHash:{}})})}function M0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o){let r=/.+FeatureServer/g.exec(o),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E]]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function g3(e,a){let x=e;if(e){let t=a[e];if(t){let n=e.substr(e.lastIndexOf("/")+1);x=c(t,t,".layer"+n+".url")}x=X1(x.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return x}var p1={};W(p1,{_templatizeAdminEmail:()=>W3,_templatizeApplication:()=>U3,_templatizeId:()=>J9,_templatizeUrl:()=>K3,_updateDependencies:()=>O3,convertItemToTemplate:()=>R0,convertQuickCaptureToTemplate:()=>$9,createItemFromTemplate:()=>p0});function R0(e,a,x,t){return Q(e,a,x,t)}function $9(e){return D(e,"data.application",U3(e.data.application,e)),e}function U3(e,a){J9(e,"itemId"),W3(e);let x=e?.dataSources;return x&&Array.isArray(x)&&x.forEach(t=>{let n=t.featureServiceItemId;n&&(O3(n,a),K3(t,"featureServiceItemId","url"),J9(t,"featureServiceItemId"))}),e}function W3(e){u(e,"preferences.adminEmail")&&D(e,"preferences.adminEmail","{{user.email}}")}function O3(e,a){a.dependencies.indexOf(e)===-1&&a.dependencies.push(e)}function K3(e,a,x){let t=u(e,a),n=u(e,x);if(n){let m=n.substr(n.lastIndexOf("/")+1);D(e,x,c(t,t,".layer"+m+".url"))}}function J9(e,a){let x=u(e,a);x&&D(e,a,c(x,x,".itemId"))}function p0(e,a,x,t){return Y(e,a,x,t)}var h0="home/webmap/viewer.html?webmap=";function H3(e,a,x,t){return new Promise((n,m)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?J1(v(J))+h0+e.item.id:e.item.url),g0(e,x).then(i=>{e.dependencies=i.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&q9(e.data.baseMap.baseMapLayers,i.urlHash,t),e.data.operationalLayers&&q9(e.data.operationalLayers,i.urlHash,t),q9(e.data.tables,i.urlHash,t),T0(e.data)),n(e)},i=>m(A(i)))})}function g0(e,a){return new Promise((x,t)=>{let n=[];if(e.data){let m=e.data.baseMap?.baseMapLayers||[],i=e.data.operationalLayers||[],l=e.data.tables||[],d=m.concat(i).concat(l);Z0(d,n,a).then(y=>{x(y)},y=>t(A(y)))}else x({dependencies:n,urlHash:{}})})}function T0(e){$1(e,"initialState")}function Z0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o.itemId&&o.layerType==="VectorTileLayer")return l.push(h(o.itemId,x)),!0;if(o.url&&o.url.indexOf("{{velocityUrl}}")<0){let r=/.+FeatureServer/g.exec(o.url),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o.url,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(y[E].layerType==="VectorTileLayer"){let w=u(r,"typeKeywords");if(w&&w.includes("Vector Tile Style Editor")){a.indexOf(r.id)<0&&a.push(r.id),y[E].templatizeId=!0;let s=y[E].styleUrl.indexOf(r.id)+r.id.length;y[E].styleUrl=c(y[E].styleUrl.replace(y[E].styleUrl.substring(0,s),r.id),r.id,".itemUrl")}}else if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E].url]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function q9(e=[],a,x){e.forEach(t=>{if(t.itemId&&t.layerType==="VectorTileLayer")t.templatizeId&&(t.itemId=c(t.itemId,t.itemId,".itemId"),delete t.templatizeId);else if(t.url){let n=t.url.substr(t.url.lastIndexOf("/")+1),m=Object.keys(a).indexOf(t.url)>-1?a[t.url]:void 0;m&&(b1(n,m,t.url,x),t.url=c(m,m,".layer"+n+".url"),t.itemId=c(m,m,".layer"+n+".itemId"))}})}function v3(e,a){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(t=>U0(e,a,t)),e}function U0(e,a,x){let t=u(e,x);t&&D(e,x,W0(t,a))}function W0(e,a){return e.forEach(x=>{let t=O0(x,a);if(t){let n=t.fields.map(i=>i.name);d7(x,t,t.basePath,t.itemId,n),o7(x,t.basePath,n),x.layerDefinition&&(r7(x.layerDefinition,t.basePath,n),u7(x.layerDefinition,t.basePath,n));let m=u(x,"field.name");m&&D(x,"field.name",y7(m,x,t.itemId,t.basePath))}}),e}function O0(e,a){let x;return a.some(t=>t.ids.indexOf(e.id)>-1?(x=t,!0):!1),x}function Q(e,a,x,t){return new Promise((n,m)=>{let i=j(e);i.item.id=c(i.item.id,i.item.id,".itemId");let l=Q1(i.itemId,"forward",x),d=Promise.resolve({}),y=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":d=new Promise(o=>{$(i.itemId,x).then(r=>o(r))});break;case"Form":d=w1(i.itemId,i.item.name,x);break;case"QuickCapture Project":y=e9(i.itemId,x);break}Promise.all([d,l,y]).then(o=>{let[r,E,w]=o;o3(i,t),i.data=l9(r,e.type,t);let s=E;i.dependencies=[],i.relatedItems=[],s.forEach(b=>{b.relationshipType!=="WMA2Code"&&(i.relatedItems.push(b),b.relatedItemIds.forEach(C=>{i.dependencies.indexOf(C)<0&&i.dependencies.push(C)}))}),e.type==="Data Pipeline"&&(i.dependencies=i.dependencies.concat(K0(r)));let P=Promise.resolve(i);switch(e.type){case"Dashboard":N3(i,t);break;case"Notebook":P=z9(i);break;case"Oriented Imagery Catalog":P=T3(i,a,x);break;case"QuickCapture Project":i.resources=w,P=new Promise(async b=>{let C=null,I=-1;w&&(w.some((y1,m1)=>{let i1=y1.name==="qc.project.json";return i1&&(C=y1,I=m1),i1}),I>=0&&w.splice(I,1)),C&&(i.data={application:{...await z1(C)},name:"qc.project.json"}),i.data.application?.basemap?.type==="Web Map"&&i.dependencies.push(i.data.application.basemap.itemId);let L=$9(i);b(L)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":P=H3(i,a,x,t);break;case"Web Mapping Application":r&&(P=I3(i,a,x,t));break;case"Workforce Project":P=M3(i,a,x,t);break}P.then(n,b=>m(A(b)))})})}function K0(e){let a=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(t=>{if(t.type==="FeatureServiceSource"||t.type==="FeatureServiceSink"){let n=u(t,"parameters.layer.value.itemId");n&&a.push(n)}}),a}var R={};W(R,{convertItemToTemplate:()=>H0,createItemFromTemplate:()=>v0,postProcess:()=>L0,postProcessFieldReferences:()=>B0});function H0(e,a,x,t){return Q(e,a,x,t)}function v0(e,a,x,t,n){return n?Y(e,a,x,t,n):Y(e,a,x,t)}function B0(e,a,x){switch(x){case"Web Mapping Application":G3(e,a);break;case"Dashboard":A3(e,a);break;case"Web Map":v3(e,a);break}return e}async function L0(e,a,x,t,n,m,i){if(a==="Web Map"&&t.resources.some(l=>l.indexOf(d1)>-1)){let l=n3(`${m.portalBaseUrl}/sharing/rest`,t.itemId,d1),d={httpMethod:"GET",authentication:i,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${i.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${i.token}`}};await O(l,d).then(async y=>{let o=JSON.stringify(y),r=N(o,m);if(o!==r){let E=JSON.parse(r),w={id:e,resource:k1(E,d1),name:d1,authentication:i,params:{}};await D2(w)}})}return q(e,m,i)}function j0(e,a,x,t){return R.convertItemToTemplate(e,a,x,t)}function u9(e){return!!u(e,"properties.services")}function j3(e,a="https://survey123.arcgis.com"){let x=`${a}/api/survey/create`,t={credentials:"same-origin",method:"POST",body:s2({f:"json",...e},!0)};return fetch(x,t).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var _3=function(a){let x=Z(a),t=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(i,l)=>(i&&i[l]&&(i[l]=encodeURIComponent(i[l])),i);t.forEach(([i,l])=>n(x[i],l));let m=i=>n(i,"description");return x.questions=(x.questions||[]).map(i=>i.questions?{...i,questions:i.questions.map(m)}:m(i)),x};function V3(e,a,x){let{item:{title:t,description:n,tags:m,typeKeywords:i},properties:{form:l}}=e,{user:{username:d},portalBaseUrl:y,organization:{basemapGalleryGroupQuery:o,defaultBasemap:{title:r}}}=a,{token:E}=x.toCredential();return $2(o,r,x).then(w=>{let s="Survey-",P=T2(`${s}${t}`,a,"user.folders").replace(s,"");if(l.questions){let C=I=>(I.maps&&(I.maps=I.maps.map(L=>({...L,itemId:w.id}))),I);l.questions=l.questions.map(I=>I.questions?{...I,questions:I.questions.map(C)}:C(I))}let b=_3(l);return{description:n,form:b,portalUrl:y,tags:m,title:P,token:E,typeKeywords:i,username:d}})}function z3(e,a,x,t){let n=N(e,a),{survey123Url:m}=a;return V3(n,a,x).then(i=>j3(i,m)).then(i=>{let{formId:l,featureServiceId:d}=i,y=Promise.resolve(null);return e.item.thumbnail&&(y=s1({id:l},null,x,e.item.thumbnail)),y.then(()=>h(l,x)).then(o=>(a[n.itemId]={itemId:l},a[n.properties.info.serviceInfo.itemId]={itemId:d},t(n.itemId,S.Finished,n.estimatedDeploymentCostFactor,l),{item:{...e,item:o,itemId:l},id:l,type:"Form",postProcess:!0}))}).catch(i=>{throw t(n.itemId,S.Failed,0),i})}function _0(e,a,x,t){return u9(e)?z3(e,a,x,t):R.createItemFromTemplate(e,a,x,t)}async function Y9(e,a){let x=await T9(e),t=new Date;return t=new Date(t.valueOf()-864e5-t.getTimezoneOffset()*1e3*60),x.forEach(n=>{if(typeof n.content=="string"){let m=X3(n,a);e.file(n.file,m,{date:t})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:t})}),Promise.resolve(e)}async function X9(e,a){return(await T9(e)).forEach(t=>{if(t.file.endsWith(".info")||t.file.endsWith(".itemInfo")||t.file.endsWith(".json")||t.file.endsWith(".webform")||t.file.endsWith(".xml")){let n=t.content,m=/\b([0-9A-Fa-f]){32}_type/g;n=$3(n,a,m),n=J3(n,a,m),n=q3(n,a),n=Y3(n,a),e.file(t.file,n)}}),Promise.resolve(e)}function J3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type==="Feature Service").forEach(m=>{let i=a[m].url,l=a[i];l&&(t=t.replace(new RegExp(i,"g"),l))}),t}function $3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type!=="Feature Service").map(m=>m.replace("_type","")).forEach(m=>{t=t.replace(new RegExp(m,"g"),`{{${m}.itemId}}`)}),t}function q3(e,a){let x=e;return a.portalBaseUrl&&(x=x.replace(new RegExp(a.portalBaseUrl,"g"),"{{portalBaseUrl}}")),x}function Y3(e,a){let x=e;return a.workflowBaseUrl&&(x=x.replace(new RegExp(a.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),x}function X3(e,a){let x=F2(),t=e.content;return t=N(e.content,a),E1(t.match(x)??[]).forEach(m=>{let i=a[m];typeof i?.itemId=="string"&&(t=t.replace(new RegExp(m,"g"),`${i.itemId}`))}),t}function Q3(e,a,x,t,n,m,i){let l=t.properties.info.serviceInfo.itemId,{itemId:d}=m[l],y=N(t,m);return h(d,i).then(o=>{let r=[{id:e,title:y.item.title,snippet:y.item.snippet,extent:y.item.extent,culture:y.item.culture},{id:d,extent:y.item.extent,typeKeywords:[`source-${l}`].concat(o.typeKeywords)}],E=s=>B(s,i),w=r.map(E);return Promise.all(w).then(()=>{let s=[e,d],P=C=>V({itemId:C,folderId:m.folderId,authentication:i}),b=s.map(P);return Promise.all(b)}).then(()=>C7(o.ownerFolder,i)).then(()=>{let s=j(o);return n.push(s),t.dependencies.push(o.id),!0})})}async function e6(e,a,x,t,n,m,i){let l=await w1(e,"Form",i);if(l){let d=await g9(l),y=await Y9(d,m);t9(y,e,i)}else return await M2(5e3),e6(e,a,x,t,n,m,i);return u9(t)?Q3(e,a,x,t,n,m,i):q(e,m,i)}async function z0(e,a){for(let x of e)if(x.type==="Form"){let t=x.data;if(x.data=null,t){let n=await g9(t);n=await X9(n,a),x.item.name=a6(x.item.name,t.name,`${x.itemId}.zip`);let m=await h7(n,x.item.name),i=n9(x.itemId,x.item.name,1,F1.data),l={itemId:x.itemId,file:m,folder:i.folder,filename:x.item.name};x.dataFile=l,x.resources.push(i.folder+"/"+i.filename)}}return Promise.resolve(e)}function a6(e,a,x){let t=e||a;return t&&t!=="undefined"?t:x}var e2={};W(e2,{_initializeNewGroup:()=>x6,convertItemToTemplate:()=>J0,createItemFromTemplate:()=>$0,postProcess:()=>q0});function J0(e,a,x){return new Promise(t=>{let n=O2(e);n.item.id=c(n.item.id,n.item.id,".itemId"),z2(e.id,x).then(m=>{n.type="Group",V2(e.id,x).then(i=>{i.id=n.item.id,n.item={...i,type:"Group"},n.dependencies=m.concat(h2(i.tags)),t(n)},()=>t(n))},()=>t(n))})}function $0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),m.item.thumbnail=e.item.thumbnail;let i=x6(m.item);b7(i.title,i,a,x,R9(m)?a.locationTracking.owner:void 0).then(l=>{if(l.success)if(!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(m.itemId=l.group.id,a[e.itemId]={itemId:l.group.id},m=N(m,a),a[e.itemId].itemId=l.group.id,!t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(R9(m)){let d=a.locationTracking.owner;G7(l.group.id,d,x).then(y=>{y.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?M7(l.group.id,[x.username],x).then(o=>{Array.isArray(o.notRemoved)&&o.notRemoved.length===0?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)}):(t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))})}else n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)});else t(e.itemId,S.Failed,0),n(k(e.type))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function q0(e,a,x,t,n,m,i){let l=Promise.resolve({success:!0});return x.some(d=>{if(d.id===e){let y=d.item.item;return x1(y)&&(y=N(y,m),l=F7(y,i)),!0}}),l}function x6(e){let a={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(t=>{e.hasOwnProperty(t)&&(a[t]=e[t])}),a}var h1={};W(h1,{convertItemToTemplate:()=>Y0,createItemFromTemplate:()=>X0,isAPage:()=>e5,postProcess:()=>Q0});function t6(e,a,x,t){return e=f1(e,x,{}),L7(e,{...t,allowList:[]}).then(()=>!0)}function r9(e){let a=z(e);return(e.dependencies||[]).forEach(t=>{let n=new RegExp(t,"g"),m=`{{${t}.itemId}}`;a.item=r1(a.item,n,m),a.data=r1(a.data,n,m),e.properties&&(a.properties=r1(a.properties,n,m))}),a}function S9(e,a,x){let t=K(V,{success:!0}),n=[t({itemId:e.item.id,folderId:a,authentication:x})];return H(e,"item.properties.parentInitiativeId")&&n.push(t({itemId:e.item.properties.parentInitiativeId,folderId:a,authentication:x})),Promise.all(n)}function Y0(e,a,x=null){let t=0,n=0;return Promise.all([I1(e.id,{authentication:a}),n1(a)]).then(([m,i])=>(t=m.item.created,n=m.item.modified,_7(m,i))).then(m=>(m.item.created=t,m.item.modified=n,m.item.typeKeywords=H1(m.item.typeKeywords,"doNotDelete"),m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],H(m,"properties")||(m.properties={}),m=r9(m),m))}function X0(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));if(e.assets&&e.resources&&delete e.assets,a.solutionItemExtent){let y=a.solutionItemExtent.split(",");a.organization.defaultExtentBBox=[[y[0],y[1]],[y[2],y[3]]]}let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,V7(e,a,m,l))).then(y=>{let o=y,r={assets:o.assets||[]};return j7(o,r,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(B7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function Q0(e,a,x,t,n,m,i){let l;return n1(i).then(d=>(l=d,I1(e,{authentication:i}))).then(d=>t6(d,x,m,l))}function e5(e){let a=!1;return(e==="Hub Page"||e==="Site Page")&&(a=!0),a}var g1={};W(g1,{convertItemToTemplate:()=>a5,createItemFromTemplate:()=>x5,isASite:()=>n5,postProcess:()=>t5});function n6(e,a,x){let t=a.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(t.map(n=>I1(n,x))).then(n=>e3(e,n,x))}function m6(e,a,x,t){let n=a.filter(d=>d.id!==e.item.id),m=n.map(d=>({item:{id:d.id,type:d.type}})),i=[];i=i.concat(Q7(e,m,t)),i=i.concat(n6(e,n,t));let l=n.map(d=>d.id);return e.item.properties.children=l,e=q7(e,x,{}),i.push(z7(e,{...t,allowList:void 0})),Promise.all(i).then(()=>!0)}function a5(e,a,x=null){let t=0,n=0,m,i,l;return n1(a).then(d=>(l=d,D9(e.id,l))).then(d=>(t=d.item.created,n=d.item.modified,m=d.item.title,i=d.data.values.title,X7(d,l))).then(d=>(d.item.created=t,d.item.modified=n,d.item.title=m,d.item.typeKeywords=H1(d.item.typeKeywords,"doNotDelete"),d.data.values.title=i,d.groups=[],d.estimatedDeploymentCostFactor=2,d.resources=[],u(d,"properties")||(d.properties={}),d.dependencies=E1(d.dependencies),d=r9(d),d))}function x5(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));e.assets&&e.resources&&delete e.assets,a.solution||(a.solution={}),a.solution.title=a.title;let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,Y7(e,a,m,l))).then(y=>{let o={assets:y.assets||[]};return $7(y,o,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(J7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function t5(e,a,x,t,n,m,i){let l;return n1(i,m).then(d=>(l=d,D9(e,l))).then(d=>m6(d,x,m,l)).then(()=>Promise.resolve(!0))}function n5(e){let a=!1;return(e==="Hub Site Application"||e==="Site Application")&&(a=!0),a}var E9={};W(E9,{convertItemToTemplate:()=>l5,createItemFromTemplate:()=>d5,isAStoryMap:()=>y5});function i6(e={}){let a=0;return Object.keys(e).reduce((x,t)=>(H(e,`${t}.type`)==="webmap"&&t!==`webmap${a}`&&(x.push({original:t,updated:`webmap${a}`}),a++),x),[])}function l6(e){let a=H(e,"data.resources")||{};return Object.keys(a).reduce((x,t)=>(H(a,`${t}.type`)==="webmap"&&x.push(H(a,`${t}.data.itemId`)),x),[])}function y6(e){let a=Y1(e.item.id,e.item.type);a.key=`${L1(e.item.title)}_${v1("i")}`;let x=z(e);a.data=x.data;let t=x.item.created,n=x.item.modified;return a.item=_1(x.item),a.item.created=t,a.item.modified=n,a.item.url="{{storyMapTemplateUrl}}",i6(a.data.resources).forEach(l=>{a.data.resources[l.updated]=z(a.data.resources[l.original]),delete a.data.resources[l.original],a.data.nodes=r1(a.data.nodes,l.original,l.updated)}),a.item.typeKeywords.indexOf(d6)!==-1&&(a.item.typeKeywords=[m5].concat(a.item.typeKeywords.filter(l=>l!==d6))),a.properties={},a.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(a.properties,i5),a.dependencies=l6(e),Promise.resolve(a)}var d6="smstatusunpublishedchanges",m5="smstatuspublished",i5={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2
+ import{a as E3,b as k3}from"./BNRFT546.js";import{a as f3}from"./S6U6SXMD.js";import a from"./EXC566PM.js";import{b as b2}from"./2B4SGB3I.js";import{b as w2}from"./I2NTSKBD.js";import{$ as Y1,$a as k7,$b as Z9,A as F2,Aa as $2,Ab as h7,B as R2,Ba as q2,Bb as g7,C as k1,Ca as Y2,Cb as T7,D as Z,Da as F9,E as p2,Ea as R9,Eb as Z7,F as $1,Fa as X2,G as c1,Ga as Q2,Gb as U7,H as A,Ha as b1,Hb as W7,I as I9,Ia as p9,Ib as O7,J as h2,Ja as e7,Jb as K7,K as u,Ka as a7,Kb as n1,L as g2,La as x7,Lb as H7,Ma as t7,Mb as v7,N as C1,Na as n7,Nb as B7,O as D,Oa as m7,Ob as L7,P as G1,Pa as i7,Pb as j7,Q as T2,Qa as l7,Qb as _7,R as c9,Ra as d7,Rb as V7,S as C9,Sa as y7,Sb as z7,T as q1,Ta as o7,Tb as J7,U as J,Ua as u7,Ub as $7,V as Z2,Va as r7,Vb as q7,W as U2,Wa as S7,Wb as Y7,X as W2,Xa as h9,Xb as X7,Y as v,Ya as a9,Yb as Q7,Z as O2,Za as f7,Zb as e3,_ as j,_a as E7,_b as a3,a as K1,aa as K2,ab as t1,ac as t9,ba as G9,bb as w7,bc as U9,c as O,ca as x1,cb as b7,cc as F1,da as N,db as s7,dc as n9,e as e1,ea as c,eb as N7,ec as x3,f as D2,fa as X,fb as A7,fc as t3,g as d1,ga as X1,gb as P7,gc as n3,h as S,ha as H2,hb as D7,hc as m3,i as P9,ia as v2,ib as I7,ic as i3,j as r1,ja as M9,jb as c7,jc as l3,k as L1,ka as B2,kb as C7,kc as d3,l as f1,lb as M1,lc as R1,m as j1,ma as L2,mb as M,mc as m9,n as _1,na as j2,nb as x9,nc as i9,o as D9,oa as _2,oc as y3,p as c2,pa as V2,pc as l9,qa as z2,qb as G7,qc as o3,r as V1,ra as h,rb as M7,s as C2,sa as w1,sb as B,t as z1,ta as $,tb as F7,u as J1,ub as s1,v as a1,va as Q1,vb as q,w as G2,wa as e9,wb as R7,x as E1,xa as J2,xb as g9,y as M2,yb as p7,z as k,zb as T9}from"./3UKDJZ2D.js";import{a as k2}from"./MGEDATQ7.js";import{a as S1,g as I1}from"./IHG7KTNC.js";import{a as K}from"./ZCU2WWVN.js";import{a as z,b as H1,c as v1,d as B1}from"./KOIDWEP3.js";import{e as V,f as A2,j as U1,l as W1,o as P2,s as O1}from"./AYSQIO6L.js";import{b as s2,h as N2}from"./YQHYMLC7.js";import{a as I2}from"./5O53T3SW.js";import{a as H}from"./AJZDBHB6.js";import{b as E2}from"./2I5LGZNX.js";import{E as Z1,F as D1,G as S2,K as f2,h as r2,i as _,q as u1}from"./FFF5HUPM.js";import{c as W}from"./QPIMTXPL.js";export default $arcgis.t(([{g:u3,h:r3,i:S3}])=>{function N1(e,a="application/octet-stream"){if(typeof Blob<"u"){let x=[];for(let n=0;n<e.length;n++)x[n]=e.charCodeAt(n);let t=new Uint8Array(x);return new Blob([t],{type:a})}else throw new Error("stringToBlob is not currently supported on Node")}function w3(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var d9={};W(d9,{_mostRecentlyEditedLayer:()=>W9,convertItemToTemplate:()=>n0,createItemFromTemplate:()=>m0,postProcess:()=>i0});function n0(e,a,x,t){return new Promise((n,m)=>{let i=j(e);c7(e.groupDesignations)?x7(i,x).then(d=>n(d),d=>m(A(d))):(i.estimatedDeploymentCostFactor=10,$(i.item.id,x).then(d=>{i.data=d,P7(i,x).then(y=>{y.item.modified=Math.max(y.item.modified,W9(i.properties.layers),W9(i.properties.tables)),s7(y,x).then(o=>{y.dependencies=o.map(r=>r.id),n(X2(y,o,!1,t))},o=>m(A(o)))},y=>m(A(y)))}))})}function m0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),delete m.item.thumbnail,$1(m,"properties.service.size");let i=Q2(m.data);k7(m,x,a).then(l=>{l.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?(m=p9(m,a,l),m7(m,a,i,x).then(()=>{m=p9(m,a,l),s1({...m.item,url:void 0},m.data,x,e.item.thumbnail,void 0,a).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.serviceItemId)?h(m.itemId,x).then(d=>{m.item=d,u(m,"item.url")&&!m.item.url.endsWith("/")&&(m.item.url+="/"),n({item:m,id:l.serviceItemId,type:m.type,postProcess:x1({item:m.item,data:m.data})||h9(m)})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})},()=>{t(e.itemId,S.Failed,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))})):(t(e.itemId,S.Cancelled,0),M(l.serviceItemId,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function i0(e,a,x,t,n,m,i){return new Promise((l,d)=>{q(e,m,i).then(y=>{h9(t)?(t=N(t,m),a9(t,i,t.item.url,m).then(l,d)):l(y)},d)})}function W9(e){let a=0;return e.forEach(x=>{a=x.editingInfo?.lastEditDate?Math.max(a,x.editingInfo.lastEditDate):a}),a}var f={};W(f,{convertItemToTemplate:()=>l0,createItemFromTemplate:()=>d0});function l0(e,a,x){return new Promise(t=>{let n=j(e);n.item.id=c(n.item.id,n.item.id,".itemId");let m=new Promise(l=>{w1(n.itemId,n.item.name,x).then(d=>{!d||d.size===0?l(null):l(d)})}),i=Promise.resolve({});Promise.all([m,i]).then(l=>{let[d]=l;if(d){let y=x3(d,n.item.name);n.properties[y.filename]=y.mimeType;let o=n9(n.itemId,y.blob.name,1,y.blob.name===y.filename?F1.data:F1.fakezip),r={itemId:n.itemId,file:y.blob,folder:o.folder,filename:o.filename};n.dataFile=r,n.resources.push(o.folder+"/"+o.filename),t(n)}else t(n)})})}function d0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),t1(m.item,m.data,x,a.folderId).then(i=>{t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,i.id)?(m.itemId=i.id,a[e.itemId]={itemId:i.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,i.id),n({item:m,id:i.id,type:m.type,postProcess:!1})):(t(e.itemId,S.Cancelled,0),M(i.id,x).then(()=>n(k(e.type)),()=>n(k(e.type))))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}var Q9={};W(Q9,{_getFormDataFilename:()=>a6,_replaceFeatureServiceURLs:()=>J3,_replaceItemIds:()=>$3,_replacePortalBaseUrls:()=>q3,_replaceWorkflowManagerBaseUrls:()=>Y3,_updateZipObjectTextContent:()=>X3,convertItemToTemplate:()=>j0,createItemFromTemplate:()=>_0,postProcess:()=>e6,postProcessFormItems:()=>z0,swizzleFormObject:()=>Y9,templatizeFormData:()=>X9});function N3(e,a){return y0(e,a)}function y0(e,a){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(t=>{let n=u(e,t);Array.isArray(n)&&n.forEach(m=>{m.type==="mapWidget"&&(e.dependencies.indexOf(m.itemId)<0&&e.dependencies.push(m.itemId),m.itemId=c(m.itemId,m.itemId,".itemId")),Array.isArray(m.datasets)&&o0(m,e,a)})}),e}function o0(e,a,x){e.datasets.forEach(t=>{if(u(t,"dataSource.type")!=="arcadeDataSource"){let m=u(t,"dataSource.itemId");if(m){a.dependencies.indexOf(m)<0&&a.dependencies.push(m);let i=u(t,"dataSource.layerId");b1(i?.toString(),m,"",x),t.dataSource.itemId=c(m,m,".itemId")}}})}function A3(e,a){let x=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return x.forEach(t=>{let n=u(e,t);u0(n,a)}),x.forEach(t=>{r0(e,t,a)}),e}function u0(e,a){e&&Array.isArray(e)&&e.forEach(x=>{Array.isArray(x.datasets)&&x.datasets.forEach(t=>{let n=c9(u(t,"dataSource.itemId"));if(n){let m=C9(u(t,"dataSource.layerId"));a.some(i=>i.itemId===n&&i.layerId===m?(s3(i,x.id),!0):!1)}else{let m=u(t,"dataSource.id");if(m){let i=m.split("#")[1];a.some(l=>l.ids.indexOf(i)>-1?(s3(l,x.id),!0):!1)}}})})}function r0(e,a,x){let t=u(e,a);t&&D(e,a,S0(t,x))}function S0(e,a){return Array.isArray(e)?e.map(x=>{let t=x;return Array.isArray(t.events)&&(t.events=t.events.map(n=>{let m=n;return Array.isArray(m.actions)&&(m.actions=m.actions.map(i=>{let l=i;if(l.fieldMap&&l.targetId&&l.targetId.indexOf("#")>-1){let d=b3(l,a);if(d){let y=u(d,"fields"),o=u(d,"basePath");Array.isArray(y)&&o&&(l.fieldMap=l.fieldMap.map(r=>{let E=r;return E.targetName=X(E.targetName,y,o),E}))}}return l})),m})),Array.isArray(t.datasets)&&(t.datasets=t.datasets.map(n=>{let m=n;if(m.type==="serviceDataset"){let i=b3(n,a);if(i){let l=u(i,"fields"),d=u(i,"basePath");Array.isArray(l)&&d&&(t=X(t,l,d),m=X(m,l,d))}}return m})),t}):e}function b3(e,a){let x,t=u(e,"dataSource.id")||u(e,"targetId");if(t){let n=t.split("#")[1];if(!a.some(m=>(x=m.ids.indexOf(n)>-1?m:x,m.ids.indexOf(n)>-1))){let m=t.split("#")[0];a.some(i=>{let d=(i.references||[]).indexOf(m)>-1;return x=d?i:x,d})}}else{let n=c9(u(e,"dataSource.itemId")),m=C9(u(e,"dataSource.layerId"));n&&a.some(i=>{let l=n===i.itemId&&m===i.layerId;return x=l?i:x,l})}return x}function s3(e,a){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(a)<0&&e.references.push(a)}var A1={};W(A1,{convertItemToTemplate:()=>D0,convertNotebookToTemplate:()=>z9,createItemFromTemplate:()=>I0,deleteProps:()=>h3,fineTuneCreatedItem:()=>V9,postProcess:()=>C0,postProcessNotebookTemplates:()=>c0});function I3(e,a,x,t){return new Promise((n,m)=>{let i="";if(e.item.url){let l=e.item.url,d=l.indexOf("//");e.item.url=v(J)+l.substring(l.indexOf("/",d+2),l.lastIndexOf("=")+1)+e.item.id,i=l.replace(l.substring(l.indexOf("/",d+2)),"")}e.dependencies=k0(e),D(e,"data.folderId","{{folderId}}"),s0(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),C3(e,"data.appItemId",e.itemId),j9(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],v(J)),D(e,"data.geometryService",v(Z2)),f0(e,x,i,t).then(()=>{D3(e,x,i,"data.widgetPool.widgets").then(l=>{D3(l,x,i,"data.widgetOnScreen.widgets",!0).then(d=>{E0(d,x,i,"data.values").then(y=>{n(y)},y=>m(A(y)))},d=>m(A(d)))},l=>m(A(l)))},l=>m(A(l)))})}function f0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,"data.dataSource.dataSources");if(i&&Object.keys(i).length>0){let l=new Array;Object.keys(i).forEach(d=>{let y=i[d];D(y,"portalUrl",v(J));let o=u(y,"itemId");if(u(y,"url")){if(o){let E=y.url.substr(y.url.lastIndexOf("/")+1);b1(E.toString(),o,y.url,t),y.itemId=c(o,o,".layer"+E+".itemId")}let r=L9(y.url,x,[],[],a);l.push(new Promise((E,w)=>{B9(r.serviceRequests,r.requestUrls,r.testString).then(s=>{y.url=s,E()},s=>w(A(s)))}))}else o&&(y.itemId=c(o,o,".itemId"))}),Promise.all(l).then(()=>n(e),d=>m(A(d)))}else n(e)})}function D3(e,a,x,t,n=!1){return new Promise((m,i)=>{let l=u(e,t)||[],d=[],y=[];if(l.forEach(o=>{!n&&u(o,"icon")&&j9(o,["icon"],v(J));let r=o.config;if(r){let E=JSON.stringify(r),w=L9(E,x,y,d,a);o.config=JSON.parse(w.testString),d=w.serviceRequests,y=w.requestUrls}}),d.length>0){let o=JSON.stringify(l);B9(d,y,o).then(r=>{D(e,t,JSON.parse(r)),m(e)},r=>i(A(r)))}else m(e)})}function E0(e,a,x,t){return new Promise((n,m)=>{let i=u(e,t),l=[],d=[];if(i){u(i,"icon")&&j9(i,["icon"],v(J));let y=JSON.stringify(i),o=L9(y,x,d,l,a);i=JSON.parse(o.testString),l=o.serviceRequests,d=o.requestUrls}if(l.length>0){let y=JSON.stringify(i);B9(l,d,y).then(o=>{D(e,t,JSON.parse(o)),n(e)},o=>m(A(o)))}else n(e)})}function B9(e,a,x){return new Promise((t,n)=>{if(e&&e.length>0){let m=0;Promise.all(e).then(i=>{i.forEach(l=>{if(u(l,"serviceItemId")){let d="{{"+l.serviceItemId+(l.hasOwnProperty("id")?".layer"+l.id:"")+".url}}";x=y9(x,a[m],d,!0)}m++}),t(x)},i=>n(A(i)))}else t(x)})}function L9(e,a,x,t,n){let m={f:"json",authentication:n},i=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return i&&i.length&&i.forEach(l=>{l.indexOf("NAServer")>-1?e=y9(e,l,v(W2)):l.indexOf("GeocodeServer")>-1?e=y9(e,l,v(U2)):a&&l.indexOf(a)>-1?e=y9(e,a,v(J)):l.indexOf("FeatureServer")>-1&&x.indexOf(l)===-1&&(x.push(l),t.push(O(l,m)))}),{testString:e,requestUrls:x,serviceRequests:t}}function y9(e,a,x,t=!1){let n=t&&e.indexOf('"')>-1,m=new RegExp(n?'"'+a+'"':a,"gmi");return e.replace(m,n?'"'+x+'"':x)}function j9(e,a,x){a.forEach(t=>{let n=u(e,t);if(n){let m=n.substring(n.indexOf("/",n.indexOf("//")+2));D(e,t,m!==n?x+m:x)}})}function c3(e,a,x,t){return new Promise(n=>{if(G1(e,["WAB2D","WAB3D","Web AppBuilder"])){let m={id:a.itemId,url:a.item.url,data:a.data},i=B(m,t),l={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:a.itemId,url:J1(N(v(J),x))+"sharing/rest/content/items/"+a.itemId+"/package"},d=t1(l,{},t,x.folderId);Promise.all([i,d]).then(()=>n(null),()=>n(null))}else n(null)})}function k0(e){let a=w0;return G1(e,["WAB2D","WAB3D","Web AppBuilder"])&&(a=b0),a(e)}function w0(e){return g2(e,["data.values.webmap","data.values.group"])}function b0(e){let a=[],x=u(e,"data.map.itemId");x&&a.push(x);let t=u(e,"data.dataSource.dataSources");return t&&Object.keys(t).forEach(n=>{let m=t[n];m.itemId&&a.push(m.itemId)}),a}function s0(e,a){a.forEach(x=>{let t=u(e,x);C3(e,x,t)})}function C3(e,a,x){D(e,a,c(x,x,".itemId"))}function G3(e,a){let x=u(e,"data.dataSource.dataSources");x&&Object.keys(x).length>0&&(Object.keys(x).forEach(m=>{let i=x[m];x[m]=H9(i,a)}),D(e,"data.dataSource.dataSources",x)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(m=>{let i=u(e,m);i&&D(e,m,N0(i,a))});let n=u(e,"data.values");return n&&D(e,"data.values",H9(n,a)),e}function H9(e,a,x=!1){return e=P0(e,a,x),A0(e,a).forEach(n=>{e=X(e,n.fields,n.basePath,x)}),e}function N0(e,a){let x=["SmartEditor","Screening"];return e.map(t=>{if(t.config){let n=x.indexOf(t.name)>-1;t.config=H9(t.config,a,n)}return t})}function A0(e,a){let x=JSON.stringify(e);return a.filter(n=>K9(n,x)<4).sort((n,m)=>K9(n,x)-K9(m,x))}function K9(e,a){let x=e.url,t=e.itemId,n=e.layerId,m;return x&&!isNaN(n)&&(m=new RegExp(x.replace(/[.]/,".layer"+n+"."),"gm")),m&&m.test(a)||e.ids.length>0&&e.ids.some(i=>new RegExp(i,"gm").test(a))?1:x&&new RegExp(x,"gm").test(a)?2:t&&new RegExp(t,"gm").test(a)?3:4}function P0(e,a,x){let t=JSON.stringify(e),n=a.filter(m=>{let i;m.url&&!isNaN(m.layerId)&&(i=new RegExp(m.url.replace(/[.]/,".layer"+m.layerId+"."),"gm"));let l=!1;if(m.ids.length>0&&(l=m.ids.some(d=>new RegExp(d,"gm").test(t))),l||i&&i.test(t))return m});return n.length>0&&n.forEach(m=>{e=v9(e,m,x),m.ids.length>0&&m.ids.forEach(i=>{e=o9(e,m,i,x)})}),e}function v9(e,a,x){let t={},n=a.url,m=a.layerId,i;if(n&&!isNaN(m)&&(i=new RegExp(n.replace(/[.]/,".layer"+m+"."),"gm")),Array.isArray(e))t=e.map(l=>v9(l,a,x));else if(typeof e=="object")for(let l in e)e[l]!=null&&typeof e[l]=="object"?t[l]=v9(e[l],a,x):(i&&i.test(e[l])&&(e=X(e,a.fields,a.basePath,x)),t[l]=e[l]);else t=e;return t}function o9(e,a,x,t){let n={},m=new RegExp(x,"gm");if(Array.isArray(e))n=e.map(i=>o9(i,a,x,t));else if(typeof e=="object")for(let i in e)if(e[i]!==null){let l;try{l=JSON.parse(e[i])}catch{l=void 0}l&&typeof l=="object"?n[i]=JSON.stringify(o9(l,a,x,t)):typeof e[i]=="object"?(m.test(i)&&t&&(e[i]=X(e[i],a.fields,a.basePath,t)),n[i]=o9(e[i],a,x,t)):(m.test(e[i])&&(e=X(e,a.fields,a.basePath,t)),n[i]=e[i])}else n[i]=e[i];else n=e;return n}function M3(e,a,x,t){return S7(e,x,t)}function F3(e,a,x){return a9(e,a,"",x)}function Y(e,a,x,t,n){return new Promise((m,i)=>{function l(){n&&n.signal.aborted&&i(new Error("Operation was cancelled"))}if(l(),!t(e.itemId,S.Started,0))t(e.itemId,S.Ignored,0),m(k(e.type));else{let d=Z(e);d=N(d,a);let y;e.type==="Web Mapping Application"&&e.data?d=JSON.parse(N(JSON.stringify(d),a)):e.type==="QuickCapture Project"&&e.data&&(y=JSON.stringify(d.data.application),delete d.data),e.item.thumbnail&&(d.item.thumbnail=e.item.thumbnail),t1(d.item,d.data,x,a.folderId).then(o=>{if(l(),!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,o.id))t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type)));else{a[e.itemId]={itemId:o.id,itemUrl:a.portalBaseUrl+"/sharing/rest/content/items/"+o.id},d.itemId=o.id,d.type==="Web Mapping Application"&&e.data&&D(d,"data.appItemId",o.id);let r=x1(d.data),E=d.item.url;d=N(d,a),l();let w=Promise.resolve([]);if(d.relatedItems){let P=N(X1(d.relatedItems),a);w=f7(d.itemId,P,x)}l();let s;if(e.type==="Web Mapping Application"&&e.data&&G1(e,["WAB2D","WAB3D","Web AppBuilder"]))s=c3(e,d,a,x);else if(e.type==="Workforce Project")s=F3(d,x,a);else if(e.type==="QuickCapture Project"){if(y){let P=k1(N(JSON.parse(y),a),"qc.project.json");s=d3(P,d.itemId,"",P.name,x)}}else e.type==="Notebook"?s=V9(e,d,a,x):E!==d.item.url?(l(),s=new Promise((P,b)=>{R7(o.id,d.item.url,x).then(()=>P(),b)})):s=Promise.resolve(null);l(),Promise.all([w,s]).then(()=>{t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,o.id)?m({item:d,id:o.id,type:d.type,postProcess:r}):(t(e.itemId,S.Cancelled,0),M(o.id,x).then(()=>m(k(e.type)),()=>m(k(e.type))))},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}},()=>{t(e.itemId,S.Failed,0),m(k(e.type))})}})}function D0(e,a,x,t){return Q(e,a,x,t)}function I0(e,a,x,t){return Y(e,a,x,t)}function z9(e){return new Promise(a=>{h3(e.data),a(e)})}function c0(e,a){if(e.some(t=>t.type==="Notebook")){let t=Object.keys(a).filter(m=>m.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((m,i)=>(m=[...new Set([...m,...i.dependencies,i.itemId])],m),[]);e=e.map(m=>{if(m.type==="Notebook"){let i=m.data&&JSON.stringify(m.data);return n.forEach(l=>{new RegExp(l,"gim").test(i)&&(i=i.replace(l,"{{"+l+".itemId}}"),m.dependencies.indexOf(l)<0&&m.dependencies.push(l))}),t.forEach(l=>{let d=new RegExp(l,"gim");if(d.test(i)){let y=a[l];i=i.replace(d,y);let o=/[0-9A-F]{32}/gim,r=y.match(o)[0];m.dependencies.indexOf(r)<0&&m.dependencies.push(r)}}),m.data=JSON.parse(i),m}})}return e}function h3(e){if(e){let a=["metadata.interpreter","metadata.papermill"];c1(e,a),(e.cells||[]).forEach(x=>{c1(x,a)})}}function V9(e,a,x,t){return new Promise((n,m)=>{let i={id:a.itemId,url:a.item.url,data:k1(a.data,a.itemId+".ipynb")};B(i,t).then(()=>n(null),m)})}function C0(e,a,x,t,n,m,i){return q(e,m,i)}function T3(e,a,x){return new Promise((t,n)=>{G0(e,x).then(m=>{e.dependencies=m.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=g3(e.data.properties.ServiceURL,m.urlHash),e.data.properties.OverviewURL=g3(e.data.properties.OverviewURL,m.urlHash)),t(e)},m=>n(A(m)))})}function G0(e,a){return new Promise((x,t)=>{let n=[];if(e.data?.properties){let m=[];e.data.properties.ServiceURL&&m.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&m.push(e.data.properties.OverviewURL),M0(m,n,a).then(i=>{x(i)},i=>t(A(i)))}else x({dependencies:n,urlHash:{}})})}function M0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o){let r=/.+FeatureServer/g.exec(o),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E]]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function g3(e,a){let x=e;if(e){let t=a[e];if(t){let n=e.substr(e.lastIndexOf("/")+1);x=c(t,t,".layer"+n+".url")}x=X1(x.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return x}var p1={};W(p1,{_templatizeAdminEmail:()=>W3,_templatizeApplication:()=>U3,_templatizeId:()=>J9,_templatizeUrl:()=>K3,_updateDependencies:()=>O3,convertItemToTemplate:()=>R0,convertQuickCaptureToTemplate:()=>$9,createItemFromTemplate:()=>p0});function R0(e,a,x,t){return Q(e,a,x,t)}function $9(e){return D(e,"data.application",U3(e.data.application,e)),e}function U3(e,a){J9(e,"itemId"),W3(e);let x=e?.dataSources;return x&&Array.isArray(x)&&x.forEach(t=>{let n=t.featureServiceItemId;n&&(O3(n,a),K3(t,"featureServiceItemId","url"),J9(t,"featureServiceItemId"))}),e}function W3(e){u(e,"preferences.adminEmail")&&D(e,"preferences.adminEmail","{{user.email}}")}function O3(e,a){a.dependencies.indexOf(e)===-1&&a.dependencies.push(e)}function K3(e,a,x){let t=u(e,a),n=u(e,x);if(n){let m=n.substr(n.lastIndexOf("/")+1);D(e,x,c(t,t,".layer"+m+".url"))}}function J9(e,a){let x=u(e,a);x&&D(e,a,c(x,x,".itemId"))}function p0(e,a,x,t){return Y(e,a,x,t)}var h0="home/webmap/viewer.html?webmap=";function H3(e,a,x,t){return new Promise((n,m)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?J1(v(J))+h0+e.item.id:e.item.url),g0(e,x).then(i=>{e.dependencies=i.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&q9(e.data.baseMap.baseMapLayers,i.urlHash,t),e.data.operationalLayers&&q9(e.data.operationalLayers,i.urlHash,t),q9(e.data.tables,i.urlHash,t),T0(e.data)),n(e)},i=>m(A(i)))})}function g0(e,a){return new Promise((x,t)=>{let n=[];if(e.data){let m=e.data.baseMap?.baseMapLayers||[],i=e.data.operationalLayers||[],l=e.data.tables||[],d=m.concat(i).concat(l);Z0(d,n,a).then(y=>{x(y)},y=>t(A(y)))}else x({dependencies:n,urlHash:{}})})}function T0(e){$1(e,"initialState")}function Z0(e,a,x){return new Promise((t,n)=>{let m={},i={f:"json",authentication:x},l=[],d={},y=e.filter(o=>{if(o.itemId&&o.layerType==="VectorTileLayer")return l.push(h(o.itemId,x)),!0;if(o.url&&o.url.indexOf("{{velocityUrl}}")<0){let r=/.+FeatureServer/g.exec(o.url),E=Array.isArray(r)&&r.length>0?r[0]:void 0;return E?(Object.keys(d).indexOf(E)<0&&(d[E]=O(o.url,i)),l.push(d[E]),!0):!1}else return!1});l.length>0?Promise.all(l).then(o=>{o.forEach((r,E)=>{if(y[E].layerType==="VectorTileLayer"){let w=u(r,"typeKeywords");if(w&&w.includes("Vector Tile Style Editor")){a.indexOf(r.id)<0&&a.push(r.id),y[E].templatizeId=!0;let s=y[E].styleUrl.indexOf(r.id)+r.id.length;y[E].styleUrl=c(y[E].styleUrl.replace(y[E].styleUrl.substring(0,s),r.id),r.id,".itemUrl")}}else if(u(r,"serviceItemId")){let w=r.serviceItemId;a.indexOf(w)<0&&a.push(w),m[y[E].url]=w}}),t({dependencies:a,urlHash:m})},o=>n(A(o))):t({dependencies:a,urlHash:m})})}function q9(e=[],a,x){e.forEach(t=>{if(t.itemId&&t.layerType==="VectorTileLayer")t.templatizeId&&(t.itemId=c(t.itemId,t.itemId,".itemId"),delete t.templatizeId);else if(t.url){let n=t.url.substr(t.url.lastIndexOf("/")+1),m=Object.keys(a).indexOf(t.url)>-1?a[t.url]:void 0;m&&(b1(n,m,t.url,x),t.url=c(m,m,".layer"+n+".url"),t.itemId=c(m,m,".layer"+n+".itemId"))}})}function v3(e,a){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(t=>U0(e,a,t)),e}function U0(e,a,x){let t=u(e,x);t&&D(e,x,W0(t,a))}function W0(e,a){return e.forEach(x=>{let t=O0(x,a);if(t){let n=t.fields.map(i=>i.name);d7(x,t,t.basePath,t.itemId,n),o7(x,t.basePath,n),x.layerDefinition&&(r7(x.layerDefinition,t.basePath,n),u7(x.layerDefinition,t.basePath,n));let m=u(x,"field.name");m&&D(x,"field.name",y7(m,x,t.itemId,t.basePath))}}),e}function O0(e,a){let x;return a.some(t=>t.ids.indexOf(e.id)>-1?(x=t,!0):!1),x}function Q(e,a,x,t){return new Promise((n,m)=>{let i=j(e);i.item.id=c(i.item.id,i.item.id,".itemId");let l=Q1(i.itemId,"forward",x),d=Promise.resolve({}),y=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":d=new Promise(o=>{$(i.itemId,x).then(r=>o(r))});break;case"Form":d=w1(i.itemId,i.item.name,x);break;case"QuickCapture Project":y=e9(i.itemId,x);break}Promise.all([d,l,y]).then(o=>{let[r,E,w]=o;o3(i,t),i.data=l9(r,e.type,t);let s=E;i.dependencies=[],i.relatedItems=[],s.forEach(b=>{b.relationshipType!=="WMA2Code"&&(i.relatedItems.push(b),b.relatedItemIds.forEach(C=>{i.dependencies.indexOf(C)<0&&i.dependencies.push(C)}))}),e.type==="Data Pipeline"&&(i.dependencies=i.dependencies.concat(K0(r)));let P=Promise.resolve(i);switch(e.type){case"Dashboard":N3(i,t);break;case"Notebook":P=z9(i);break;case"Oriented Imagery Catalog":P=T3(i,a,x);break;case"QuickCapture Project":i.resources=w,P=new Promise(async b=>{let C=null,I=-1;w&&(w.some((y1,m1)=>{let i1=y1.name==="qc.project.json";return i1&&(C=y1,I=m1),i1}),I>=0&&w.splice(I,1)),C&&(i.data={application:{...await z1(C)},name:"qc.project.json"}),i.data.application?.basemap?.type==="Web Map"&&i.dependencies.push(i.data.application.basemap.itemId);let L=$9(i);b(L)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":P=H3(i,a,x,t);break;case"Web Mapping Application":r&&(P=I3(i,a,x,t));break;case"Workforce Project":P=M3(i,a,x,t);break}P.then(n,b=>m(A(b)))})})}function K0(e){let a=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(t=>{if(t.type==="FeatureServiceSource"||t.type==="FeatureServiceSink"){let n=u(t,"parameters.layer.value.itemId");n&&a.push(n)}}),a}var R={};W(R,{convertItemToTemplate:()=>H0,createItemFromTemplate:()=>v0,postProcess:()=>L0,postProcessFieldReferences:()=>B0});function H0(e,a,x,t){return Q(e,a,x,t)}function v0(e,a,x,t,n){return n?Y(e,a,x,t,n):Y(e,a,x,t)}function B0(e,a,x){switch(x){case"Web Mapping Application":G3(e,a);break;case"Dashboard":A3(e,a);break;case"Web Map":v3(e,a);break}return e}async function L0(e,a,x,t,n,m,i){if(a==="Web Map"&&t.resources.some(l=>l.indexOf(d1)>-1)){let l=n3(`${m.portalBaseUrl}/sharing/rest`,t.itemId,d1),d={httpMethod:"GET",authentication:i,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${i.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${i.token}`}};await O(l,d).then(async y=>{let o=JSON.stringify(y),r=N(o,m);if(o!==r){let E=JSON.parse(r),w={id:e,resource:k1(E,d1),name:d1,authentication:i,params:{}};await D2(w)}})}return q(e,m,i)}function j0(e,a,x,t){return R.convertItemToTemplate(e,a,x,t)}function u9(e){return!!u(e,"properties.services")}function j3(e,a="https://survey123.arcgis.com"){let x=`${a}/api/survey/create`,t={credentials:"same-origin",method:"POST",body:s2({f:"json",...e},!0)};return fetch(x,t).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var _3=function(a){let x=Z(a),t=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(i,l)=>(i&&i[l]&&(i[l]=encodeURIComponent(i[l])),i);t.forEach(([i,l])=>n(x[i],l));let m=i=>n(i,"description");return x.questions=(x.questions||[]).map(i=>i.questions?{...i,questions:i.questions.map(m)}:m(i)),x};function V3(e,a,x){let{item:{title:t,description:n,tags:m,typeKeywords:i},properties:{form:l}}=e,{user:{username:d},portalBaseUrl:y,organization:{basemapGalleryGroupQuery:o,defaultBasemap:{title:r}}}=a,{token:E}=x.toCredential();return $2(o,r,x).then(w=>{let s="Survey-",P=T2(`${s}${t}`,a,"user.folders").replace(s,"");if(l.questions){let C=I=>(I.maps&&(I.maps=I.maps.map(L=>({...L,itemId:w.id}))),I);l.questions=l.questions.map(I=>I.questions?{...I,questions:I.questions.map(C)}:C(I))}let b=_3(l);return{description:n,form:b,portalUrl:y,tags:m,title:P,token:E,typeKeywords:i,username:d}})}function z3(e,a,x,t){let n=N(e,a),{survey123Url:m}=a;return V3(n,a,x).then(i=>j3(i,m)).then(i=>{let{formId:l,featureServiceId:d}=i,y=Promise.resolve(null);return e.item.thumbnail&&(y=s1({id:l},null,x,e.item.thumbnail)),y.then(()=>h(l,x)).then(o=>(a[n.itemId]={itemId:l},a[n.properties.info.serviceInfo.itemId]={itemId:d},t(n.itemId,S.Finished,n.estimatedDeploymentCostFactor,l),{item:{...e,item:o,itemId:l},id:l,type:"Form",postProcess:!0}))}).catch(i=>{throw t(n.itemId,S.Failed,0),i})}function _0(e,a,x,t){return u9(e)?z3(e,a,x,t):R.createItemFromTemplate(e,a,x,t)}async function Y9(e,a){let x=await T9(e),t=new Date;return t=new Date(t.valueOf()-864e5-t.getTimezoneOffset()*1e3*60),x.forEach(n=>{if(typeof n.content=="string"){let m=X3(n,a);e.file(n.file,m,{date:t})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:t})}),Promise.resolve(e)}async function X9(e,a){return(await T9(e)).forEach(t=>{if(t.file.endsWith(".info")||t.file.endsWith(".itemInfo")||t.file.endsWith(".json")||t.file.endsWith(".webform")||t.file.endsWith(".xml")){let n=t.content,m=/\b([0-9A-Fa-f]){32}_type/g;n=$3(n,a,m),n=J3(n,a,m),n=q3(n,a),n=Y3(n,a),e.file(t.file,n)}}),Promise.resolve(e)}function J3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type==="Feature Service").forEach(m=>{let i=a[m].url,l=a[i];l&&(t=t.replace(new RegExp(i,"g"),l))}),t}function $3(e,a,x){let t=e;return Object.keys(a).filter(m=>m.match(x)&&a[m].type!=="Feature Service").map(m=>m.replace("_type","")).forEach(m=>{t=t.replace(new RegExp(m,"g"),`{{${m}.itemId}}`)}),t}function q3(e,a){let x=e;return a.portalBaseUrl&&(x=x.replace(new RegExp(a.portalBaseUrl,"g"),"{{portalBaseUrl}}")),x}function Y3(e,a){let x=e;return a.workflowBaseUrl&&(x=x.replace(new RegExp(a.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),x}function X3(e,a){let x=F2(),t=e.content;return t=N(e.content,a),E1(t.match(x)??[]).forEach(m=>{let i=a[m];typeof i?.itemId=="string"&&(t=t.replace(new RegExp(m,"g"),`${i.itemId}`))}),t}function Q3(e,a,x,t,n,m,i){let l=t.properties.info.serviceInfo.itemId,{itemId:d}=m[l],y=N(t,m);return h(d,i).then(o=>{let r=[{id:e,title:y.item.title,snippet:y.item.snippet,extent:y.item.extent,culture:y.item.culture},{id:d,extent:y.item.extent,typeKeywords:[`source-${l}`].concat(o.typeKeywords)}],E=s=>B(s,i),w=r.map(E);return Promise.all(w).then(()=>{let s=[e,d],P=C=>V({itemId:C,folderId:m.folderId,authentication:i}),b=s.map(P);return Promise.all(b)}).then(()=>C7(o.ownerFolder,i)).then(()=>{let s=j(o);return n.push(s),t.dependencies.push(o.id),!0})})}async function e6(e,a,x,t,n,m,i){let l=await w1(e,"Form",i);if(l){let d=await g9(l),y=await Y9(d,m);t9(y,e,i)}else return await M2(5e3),e6(e,a,x,t,n,m,i);return u9(t)?Q3(e,a,x,t,n,m,i):q(e,m,i)}async function z0(e,a){for(let x of e)if(x.type==="Form"){let t=x.data;if(x.data=null,t){let n=await g9(t);n=await X9(n,a),x.item.name=a6(x.item.name,t.name,`${x.itemId}.zip`);let m=await h7(n,x.item.name),i=n9(x.itemId,x.item.name,1,F1.data),l={itemId:x.itemId,file:m,folder:i.folder,filename:x.item.name};x.dataFile=l,x.resources.push(i.folder+"/"+i.filename)}}return Promise.resolve(e)}function a6(e,a,x){let t=e||a;return t&&t!=="undefined"?t:x}var e2={};W(e2,{_initializeNewGroup:()=>x6,convertItemToTemplate:()=>J0,createItemFromTemplate:()=>$0,postProcess:()=>q0});function J0(e,a,x){return new Promise(t=>{let n=O2(e);n.item.id=c(n.item.id,n.item.id,".itemId"),z2(e.id,x).then(m=>{n.type="Group",V2(e.id,x).then(i=>{i.id=n.item.id,n.item={...i,type:"Group"},n.dependencies=m.concat(h2(i.tags)),t(n)},()=>t(n))},()=>t(n))})}function $0(e,a,x,t){return new Promise(n=>{if(!t(e.itemId,S.Started,0)){t(e.itemId,S.Ignored,0),n(k(e.type));return}let m=Z(e);m=N(m,a),m.item.thumbnail=e.item.thumbnail;let i=x6(m.item);b7(i.title,i,a,x,R9(m)?a.locationTracking.owner:void 0).then(l=>{if(l.success)if(!t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(m.itemId=l.group.id,a[e.itemId]={itemId:l.group.id},m=N(m,a),a[e.itemId].itemId=l.group.id,!t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor/2,l.group.id))t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)));else if(R9(m)){let d=a.locationTracking.owner;G7(l.group.id,d,x).then(y=>{y.success?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?M7(l.group.id,[x.username],x).then(o=>{Array.isArray(o.notRemoved)&&o.notRemoved.length===0?t(e.itemId,S.Created,e.estimatedDeploymentCostFactor/2,l.group.id)?n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)}):(t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))}):(t(e.itemId,S.Cancelled,0),M1(l.group.id,x).then(()=>n(k(e.type)),()=>n(k(e.type)))):(t(e.itemId,S.Failed,0),n(k(e.type)))})}else n({item:m,id:l.group.id,type:m.type,postProcess:x1(m)});else t(e.itemId,S.Failed,0),n(k(e.type))},()=>{t(e.itemId,S.Failed,0),n(k(e.type))})})}function q0(e,a,x,t,n,m,i){let l=Promise.resolve({success:!0});return x.some(d=>{if(d.id===e){let y=d.item.item;return x1(y)&&(y=N(y,m),l=F7(y,i)),!0}}),l}function x6(e){let a={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(t=>{e.hasOwnProperty(t)&&(a[t]=e[t])}),a}var h1={};W(h1,{convertItemToTemplate:()=>Y0,createItemFromTemplate:()=>X0,isAPage:()=>e5,postProcess:()=>Q0});function t6(e,a,x,t){return e=f1(e,x,{}),L7(e,{...t,allowList:[]}).then(()=>!0)}function r9(e){let a=z(e);return(e.dependencies||[]).forEach(t=>{let n=new RegExp(t,"g"),m=`{{${t}.itemId}}`;a.item=r1(a.item,n,m),a.data=r1(a.data,n,m),e.properties&&(a.properties=r1(a.properties,n,m))}),a}function S9(e,a,x){let t=K(V,{success:!0}),n=[t({itemId:e.item.id,folderId:a,authentication:x})];return H(e,"item.properties.parentInitiativeId")&&n.push(t({itemId:e.item.properties.parentInitiativeId,folderId:a,authentication:x})),Promise.all(n)}function Y0(e,a,x=null){let t=0,n=0;return Promise.all([I1(e.id,{authentication:a}),n1(a)]).then(([m,i])=>(t=m.item.created,n=m.item.modified,_7(m,i))).then(m=>(m.item.created=t,m.item.modified=n,m.item.typeKeywords=H1(m.item.typeKeywords,"doNotDelete"),m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],H(m,"properties")||(m.properties={}),m=r9(m),m))}function X0(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));if(e.assets&&e.resources&&delete e.assets,a.solutionItemExtent){let y=a.solutionItemExtent.split(",");a.organization.defaultExtentBBox=[[y[0],y[1]],[y[2],y[3]]]}let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,V7(e,a,m,l))).then(y=>{let o=y,r={assets:o.assets||[]};return j7(o,r,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(B7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function Q0(e,a,x,t,n,m,i){let l;return n1(i).then(d=>(l=d,I1(e,{authentication:i}))).then(d=>t6(d,x,m,l))}function e5(e){let a=!1;return(e==="Hub Page"||e==="Site Page")&&(a=!0),a}var g1={};W(g1,{convertItemToTemplate:()=>a5,createItemFromTemplate:()=>x5,isASite:()=>n5,postProcess:()=>t5});function n6(e,a,x){let t=a.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(t.map(n=>I1(n,x))).then(n=>e3(e,n,x))}function m6(e,a,x,t){let n=a.filter(d=>d.id!==e.item.id),m=n.map(d=>({item:{id:d.id,type:d.type}})),i=[];i=i.concat(Q7(e,m,t)),i=i.concat(n6(e,n,t));let l=n.map(d=>d.id);return e.item.properties.children=l,e=q7(e,x,{}),i.push(z7(e,{...t,allowList:void 0})),Promise.all(i).then(()=>!0)}function a5(e,a,x=null){let t=0,n=0,m,i,l;return n1(a).then(d=>(l=d,D9(e.id,l))).then(d=>(t=d.item.created,n=d.item.modified,m=d.item.title,i=d.data.values.title,X7(d,l))).then(d=>(d.item.created=t,d.item.modified=n,d.item.title=m,d.item.typeKeywords=H1(d.item.typeKeywords,"doNotDelete"),d.data.values.title=i,d.groups=[],d.estimatedDeploymentCostFactor=2,d.resources=[],u(d,"properties")||(d.properties={}),d.dependencies=E1(d.dependencies),d=r9(d),d))}function x5(e,a,x,t){if(!t(e.itemId,S.Started,0))return Promise.resolve(k(e.type));e.assets&&e.resources&&delete e.assets,a.solution||(a.solution={}),a.solution.title=a.title;let m={},i,l,d=e.item.thumbnail;return n1(x,a).then(y=>(l=y,Y7(e,a,m,l))).then(y=>{let o={assets:y.assets||[]};return $7(y,o,l)}).then(y=>(i=y,S9(y,a.folderId,x))).then(()=>{let y={item:{id:i.item.id},params:{thumbnail:d},authentication:x};return e1(y)}).then(()=>{if(a[e.itemId]={itemId:i.item.id},t(e.itemId,S.Finished,e.estimatedDeploymentCostFactor||2,i.item.id)){let o={item:{...e,...a1(i)},id:i.item.id,type:e.type,postProcess:!0};return o.item.itemId=i.item.id,o}else return K(J7,{success:!0})(i,l).then(()=>Promise.resolve(k(e.type)))}).catch(y=>{throw t(e.itemId,S.Failed,0),y})}function t5(e,a,x,t,n,m,i){let l;return n1(i,m).then(d=>(l=d,D9(e,l))).then(d=>m6(d,x,m,l)).then(()=>Promise.resolve(!0))}function n5(e){let a=!1;return(e==="Hub Site Application"||e==="Site Application")&&(a=!0),a}var E9={};W(E9,{convertItemToTemplate:()=>l5,createItemFromTemplate:()=>d5,isAStoryMap:()=>y5});function i6(e={}){let a=0;return Object.keys(e).reduce((x,t)=>(H(e,`${t}.type`)==="webmap"&&t!==`webmap${a}`&&(x.push({original:t,updated:`webmap${a}`}),a++),x),[])}function l6(e){let a=H(e,"data.resources")||{};return Object.keys(a).reduce((x,t)=>(H(a,`${t}.type`)==="webmap"&&x.push(H(a,`${t}.data.itemId`)),x),[])}function y6(e){let a=Y1(e.item.id,e.item.type);a.key=`${L1(e.item.title)}_${v1("i")}`;let x=z(e);a.data=x.data;let t=x.item.created,n=x.item.modified;return a.item=_1(x.item),a.item.created=t,a.item.modified=n,a.item.url="{{storyMapTemplateUrl}}",i6(a.data.resources).forEach(l=>{a.data.resources[l.updated]=z(a.data.resources[l.original]),delete a.data.resources[l.original],a.data.nodes=r1(a.data.nodes,l.original,l.updated)}),a.item.typeKeywords.indexOf(d6)!==-1&&(a.item.typeKeywords=[m5].concat(a.item.typeKeywords.filter(l=>l!==d6))),a.properties={},a.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(a.properties,i5),a.dependencies=l6(e),Promise.resolve(a)}var d6="smstatusunpublishedchanges",m5="smstatuspublished",i5={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
3
3
  <oembed>
4
4
  <version>1.0</version>
5
5
  <type>rich</type>
@@ -48,7 +48,7 @@ Please review the draft design and let me know if you\u2019d like to make any ch
48
48
  \r
49
49
  ## Feature Layers\r
50
50
  - Generate a detailed, normalized database schema for each Feature Layer\r
51
- - Supported layer types: \`Point\`, \`Line\`, \`Polygon\`, \`Table\`\r
51
+ - Supported layer types: \`Point\`, \`Polyine\`, \`Polygon\`, \`Table\`\r
52
52
  \r
53
53
  ### Layer Naming Rules\r
54
54
  - Layer \`name\` values are user-facing and must be written in Title Case\r
@@ -59,9 +59,19 @@ Please review the draft design and let me know if you\u2019d like to make any ch
59
59
  - If \`addLayers: false\`:\r
60
60
  - Layers cannot be added or removed\r
61
61
  - Layer \`id\` values are immutable\r
62
+ - Do not edit the \`typeMutable\` property of layers\r
62
63
  - If \`addLayers: true\`:\r
63
64
  - Layers may be added or removed\r
64
65
  - Each new layer must receive a unique \`id\` starting at 0\r
66
+ - Each new layer must have \`typeMutable\` property set to true\r
67
+ \r
68
+ ### Layer Type Mutability Rule\r
69
+ - If \`typeMutable: true\`:\r
70
+ - The layer type must be chosen: \`Point\`, \`Polyline\`, \`Polygon\`, \`Table\`\r
71
+ - The layer type may be changed without restriction\r
72
+ - If \`typeMutable: false\`:\r
73
+ - The layer type may never be changed\r
74
+ - Requests to change the layer type should be ignored\r
65
75
  \r
66
76
  ### Required Fields\r
67
77
  - Fields in \`requiredFields\` are protected:\r
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ function h(){return{renderer:{type:"simple",symbol:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-12.600000000000001},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:7.2,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[242,242,242,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:360},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-9},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:18,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[39,17,17,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:360}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:360}}}}}function b(){return{renderer:{type:"simple",symbol:{type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],size:10,angle:0,xoffset:0,yoffset:0,outline:{color:[0,0,0,255],width:0}}}}}var u=class n{constructor(e){this.llmFsLookup={},this.structure=e,this.buildSolution=this.structure?.buildSolution}static{this.typeLookup={point:"esriGeometryPoint",polyline:"esriGeometryPolyline",polygon:"esriGeometryPolygon"}}static{this.simpleTypeLookup={esriGeometryPoint:"Point",esriGeometryPolyline:"Polyline",esriGeometryPolygon:"Polygon"}}static{this.drawingToolLookup={esriGeometryPoint:"esriFeatureEditToolPoint",esriGeometryPolyline:"esriFeatureEditToolLine",esriGeometryPolygon:"esriFeatureEditToolPolygon",Table:"esriFeatureEditToolNone"}}static{this.fieldTypeToEsri={string:"esriFieldTypeString",integer:"esriFieldTypeInteger",double:"esriFieldTypeDouble",date:"esriFieldTypeDate",guid:"esriFieldTypeGUID",globalid:"esriFieldTypeGlobalID",oid:"esriFieldTypeOID"}}static{this.fieldTypeToSimple=Object.fromEntries(Object.entries(n.fieldTypeToEsri).map(([e,i])=>[i,e]))}dumpToLlmTemplate(){let e=this.structure?.buildSolution?.solution,i=Object.entries(e?.strings||{}).map(([s,o])=>({key:s,value:o.value,description:o.description})),t={title:e?.title,description:e?.description,tags:e?.tags,strings:i},r=this.structure?.buildSolution?.items,l=Object.entries(r||{}).map(([s,o])=>({id:s,title:o.title,description:o.description,type:o.type})),a=null;for(let[s,o]of Object.entries(r||{})){if(o.type!=="Feature Layer (hosted)")continue;let p=[];for(let d of o.service?.layers||[]){let y=this.getFields(d),c={id:d.id,type:"",typeMutable:!0,name:d.name,customFields:[],requiredFields:y,systemFields:[]};d.geometryType&&(c.type=n.simpleTypeLookup[d.geometryType]||"",c.typeMutable=!1),p.push(c)}for(let d of o.service?.tables||[]){let y=this.getFields(d);p.push({id:d.id,type:"Table",typeMutable:!1,name:d.name,customFields:[],requiredFields:y,systemFields:[]})}a={itemId:s,addLayers:o.addLayers,layers:p};break}return{solution:t,items:l,featureLayer:a??{itemId:"",addLayers:!1,layers:[]}}}getFields(e){let i=[];for(let t of e.fields||[])i.push({name:t.name,type:n.fieldTypeToSimple[t.type]||t.type,alias:t.alias,description:n.getFieldDescription(t.description),choiceList:n.getFieldDomain(t.domain),length:t.length});return i}static getFieldDescription(e){if(e)try{return JSON.parse(e).value||e}catch{return e}}static getFieldDomain(e){if(e)return e.codedValues?.map(i=>i.code)}applyLlmTemplate(e){let i=this.buildSolution.solution;if(this.llmFsLookup={},e.featureLayer?.itemId){this.llmFsLookup[e.featureLayer.itemId]={};for(let s of e.featureLayer.layers)this.llmFsLookup[e.featureLayer.itemId][s.id]=s}for(let[s,o]of Object.entries(this.buildSolution.items))o.type==="Feature Layer (hosted, view)"&&(this.llmFsLookup[s]={...this.llmFsLookup[o.source]});i.title=e.solution.title,i.description=e.solution.description,i.tags=e.solution.tags;let t=i.strings;for(let s of e.solution.strings)t[s.key]&&(t[s.key].value=s.value);let r={},l=new Set,a=this.buildSolution.items;for(let s of e.items){let o=a[s.id];if(o)if(o.title=s.title,o.description=s.description,o.type==="Web Map")this.applyWebMap(o);else if(o.type==="Feature Layer (hosted)"){this.applyFeatureService(o,s.id,!1);let p=g(o);o.data=p,r[s.id]=p}else o.type==="Feature Layer (hosted, view)"&&(this.applyFeatureService(o,s.id,!0),l.add(s.id))}for(let s of l){let o=a[s];o.data=r[o.source]}return this.structure}applyWebMap(e){if(!e.layerSources)return;for(let t of[...e.layers||[],...e.tables||[]]){let[r,l]=this.extractIdAndLayerId(t.url),a=this.llmFsLookup[r]?.[l];a&&(t.title=a.name)}if(!(e.layers?.length===0&&e.tables?.length===0))return;let i=crypto.randomUUID().replace(/-/gu,"").substring(0,10);for(let t of e.layerSources){let r=this.llmFsLookup[t];if(r)for(let[l,a]of Object.entries(r)){let s=Number(l),o=a.type.toLowerCase()==="table",p={id:`${i}-layer-${s}`,title:a.name,url:`{{${t}.layer${s}.url}}`,itemId:`{{${t}.layer${s}.itemId}}`};o?e.tables.push(p):(p.layerType="ArcGISFeatureLayer",e.layers.push(p))}}}extractIdAndLayerId(e){let i=e.replace(/[{}]/gu,"").split("."),t=i[0],r=Number.parseInt(i[1].replace("layer",""));return[t,r]}applyFeatureService(e,i,t=!1){let r=e.source||i,l=this.llmFsLookup[r];for(let s of[...e.service.layers,...e.service.tables])this.applyLayer(s,l,t);e.addLayers&&!t&&this.addNewLayers(e,l);let a=e.service.layers?.length===0&&e.service.tables?.length===0;t&&a&&this.addNewViewLayers(e,i,l)}addNewLayers(e,i){for(let[t,r]of Object.entries(i)){let l={id:Number(t)};this.applyLayer(l,i),r.type.toLowerCase()==="table"?e.service.tables.push(l):e.service.layers.push(l)}}addNewViewLayers(e,i,t){let r=e.source;for(let[l,a]of Object.entries(t)){let s=Number(l),o=a.type.toLowerCase()==="table",p={adminLayerInfo:{geometryField:o?null:{name:"Shape"},viewLayerDefinition:{sourceServiceName:`{{${r}.name}}`,sourceLayerId:s,sourceLayerFields:"*"}},id:s,name:a.name,extent:`{{${i}.solutionExtent}}`,maxRecordCount:2e3};o?e.service.tables.push(p):e.service.layers.push(p)}}applyLayer(e,i,t=!1){let r=i[e.id];if(!r||(e.name=r.name,t))return;let l=n.typeLookup[r.type.toLowerCase()]||r.type;l.toLowerCase()==="table"?e.type=l:e.geometryType=l,e.editFieldsInfo=this.editFieldsInfo(),e.globalIdField="globalid",e.objectIdField="objectid",e.uniqueIdField={name:"objectid",isSystemMaintained:!0},e.hasAttachments=!0,this.updateRelationships(e,i),this.updateFields(e,r),this.updateTemplates(e),this.updateDrawingInfo(e)}updateRelationships(e,i){let t=e.relationships||[];for(let r of t){let l=i[r.relatedTableId];l&&(r.name=l.name)}}updateFields(e,i){let t=[],r=[[!1,i.customFields],[!0,i.requiredFields],[!0,i.systemFields]];for(let[l,a]of r)if(Array.isArray(a))for(let s of a){let o={name:s.name,alias:s.alias,type:n.fieldTypeToEsri[s.type]||s.type,description:JSON.stringify({value:s.description,fieldValueType:""},null,0),domain:this.createDomain(s.choiceList,s.name),required:l};s.type?.toLowerCase()==="string"&&(o.length=s.length??256),(s.type==="oid"||s.type==="globalid")&&(o.editable=!1,o.nullable=!1),t.push(o)}e.fields=t}updateTemplates(e){let i=n.drawingToolLookup[e.geometryType||e.type];e.templates??=[{name:e.name,description:"",prototype:{attributes:{}}}];for(let t of e.templates)t.drawingTool=i}updateDrawingInfo(e){if(e.drawingTool==="esriGeometryPoint")e.drawingInfo=b();else return}createDomain(e,i){return e?{type:"codedValue",name:`${i}_${crypto.randomUUID().replace(/-/gu,"")}`,codedValues:e.map(t=>({name:t,code:t}))}:null}editFieldsInfo(){return{creationDateField:"created_date",creatorField:"created_user",editDateField:"last_edited_date",editorField:"last_edited_user"}}};function g(n){let e=n.service,i={layers:[],tables:[]};for(let t of e.layers||[])i.layers.push({id:t.id,formInfo:m(t),popupInfo:f(t),layerDefinition:F(t)});for(let t of e.tables||[])i.tables.push({id:t.id,formInfo:m(t),popupInfo:f(t)});return i}function m(n){let e=[];for(let t of n.fields)t.required||e.push({label:t.alias,type:"field",editableExpression:"expr/system/true",fieldName:t.name,inputType:L(t.type,t.domain,t.length)});let i=n.relationships||[];for(let t of i)e.push({description:"",label:t.name,type:"relationship",displayCount:3,displayType:"list",editableExpression:"expr/system/true",orderByFields:[{field:"created_date",order:"asc"}],relationshipId:t.id});return{formElements:e,expressionInfos:[{expression:"false",name:"expr/system/false",returnType:"boolean",title:"False"},{expression:"true",name:"expr/system/true",returnType:"boolean",title:"True"}],title:n.name}}function f(n){let e=[],i=[];for(let r of n.fields)r.required||i.push({fieldName:r.name,isEditable:!0,label:r.alias,visible:!0});e.push({type:"fields",description:"",fieldInfos:i});let t=n.relationships||[];if(t.length&&n.type!=="Table")for(let r of t)e.push({type:"relationship",description:"",displayCount:3,displayType:"list",orderByFields:[{field:"created_date",order:"asc"}],relationshipId:r.id});return e.push({type:"attachments",description:"",displayType:"auto",title:""}),{popupElements:e,showLastEditInfo:!1,title:n.name}}function F(n){return n.geometryType==="esriGeometryPoint"?{drawingInfo:h()}:{drawingInfo:{}}}function L(n,e,i){return n==="esriFieldTypeString"&&!e?{type:"text-box",maxLength:i||255,minLength:0}:n==="esriFieldTypeString"&&e?{type:"combo-box",noValueOptionLabel:"No value",showNoValueOption:!0}:["esriFieldTypeInteger","esriFieldTypeDouble"].includes(n)?{type:"text-box",minLength:0}:n==="esriFieldTypeDate"?{type:"datetime-picker",includeTime:!1}:{type:"text-box",maxLength:i||255,minLength:0}}export{u as a};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"./QPIMTXPL.js";var e='# Your Role\r\nYou are a specialized AI assistant for ArcGIS Solutions. Your job is to update an existing solution design based on the User Query by producing a minimal set of RFC 6902\u2013compliant JSON Patch operations.\r\n\r\nYou must follow all rules below at all times. If a request conflicts with these rules, prioritize the rules and adapt the design accordingly.\r\n\r\n# Your Task\r\n- Analyze the Current Solution Design and the User Query\r\n- Produce the fewest possible JSON Patch operations required to satisfy the request\r\n- Never modify, remove, or replace sections unrelated to the request\r\n\r\n# Response Guidelines\r\n- Populate `response` with a concise explanation of exactly what you changed\r\n- Refer to yourself as \u201CI\u201D or \u201Cwe\u201D.\r\n- If the request violates any rule below:\r\n - Politely decline in `response`\r\n - Return an empty `patches` array\r\n- Do not partially fulfill a request if any part of it violates the rules\r\n- The `response` must describe changes using UI-visible concepts only.\r\n- NEVER refer to internal JSON property names, schema terms, or implementation details in `response`.\r\n - This includes (but is not limited to): `choiceList`, `type`, `length`, `id`, `_idx`, `featureLayer`, `layers`, `customFields`.\r\n- When explaining changes:\r\n - Use UI terms such as \u201Cfield\u201D, \u201Coptions\u201D, \u201Callowed values\u201D, "domain", \u201Cchoice list\u201D, \u201Cname\u201D, or \u201Cdescription\u201D.\r\n- Always refer to custom fields as just fields. Do NOT include the word custom\r\n\r\n## Non-Change Requests\r\n- If the User Query does NOT request a specific change to the solution design:\r\n - Return an empty `patches` array.\r\n - Use the `response` to:\r\n - Briefly acknowledge the user\u2019s message, and\r\n - Let them know you\u2019re available to help make changes if they want to adjust anything\r\n - The `response` MUST:\r\n - Be no more than 2 sentences\r\n - Use UI-visible concepts only\r\n - Avoid internal schema terms or implementation details\r\n\r\n# Language and Localization Rules\r\n- Detect the primary language of the User Query\r\n- Use that language consistently for all user-facing strings unless explicitly prohibited\r\n\r\n# JSON Patch Rules\r\n\r\n## Array Indexing with `_idx`\r\n- Every array element includes a read-only `_idx`\r\n- Always use `_idx` values in patch paths\r\n- Never calculate array positions manually\r\n- Never include `_idx` itself in any patch path or value\r\n- When removing multiple elements from the same array, order those `remove` operations from highest `_idx` to lowest. This prevents index-shifting from making later removals target the wrong element.\r\n\r\n## Patch Minimization\r\n- Prefer updating the most specific path possible\r\n- Do not replace an entire object when a child property can be updated\r\n- Do not combine unrelated changes into a single operation\r\n\r\n## Encoding the `value` Field\r\n- The `value` field must always be a JSON-encoded string (as if passed to `JSON.stringify`).\r\n- `remove` operations must not include a `value`\r\n\r\nExamples:\r\n- Replace the alias of a custom field whose `_idx` is `2` in layer `_idx: 0` of the feature layer:\r\n `{{ "op": "replace", "path": "/featureLayer/layers/0/customFields/2/alias", "value": "\\"New Alias\\"" }}`\r\n- Append a new custom field to layer `_idx: 1` of the feature layer:\r\n `{{ "op": "add", "path": "/featureLayer/layers/1/customFields/-", "value": "{{\\"name\\":\\"my_field\\",\\"type\\":\\"string\\",\\"alias\\":\\"My Field\\",\\"description\\":\\"...\\",\\"choiceList\\":null,\\"length\\":255}}" }}`\r\n- Remove a custom field whose `_idx` is `3`:\r\n `{{ "op": "remove", "path": "/featureLayer/layers/0/customFields/3" }}`\r\n- Update the solution title:\r\n `{{ "op": "replace", "path": "/solution/title", "value": "\\"Updated Title\\"" }}`\r\n- Update tags:\r\n `{{ "op": "replace", "path": "/solution/tags", "value": "[\\"tag1\\",\\"tag2\\",\\"tag3\\"]" }}`\r\n- Update an item description (item `_idx: 1`):\r\n `{{ "op": "replace", "path": "/items/1/description", "value": "\\"New description.\\"" }}`\r\n\r\nDo NOT include `_idx` itself in any patch operation path or value\r\n\r\n# Design Rules\r\n\r\n## Solution\r\n- Only `title`, `description`, and `tags` may be updated\r\n- Only modify values. Do not add or remove properties\r\n\r\n## Strings\r\n- Only `value` may be updated\r\n- `key` and `description` are immutable\r\n- Always return the same number of strings\r\n\r\n## Items\r\n- Only `title` and `description` may be updated\r\n- `id` and `type` are immutable\r\n- Items cannot be added or removed\r\n\r\n## Feature Layers\r\n- Supported layer types: `Point`, `Line`, `Polygon`, `Table`\r\n\r\n### Layer Naming Rules\r\n- Layer `name` values should be written in Title Case unless specifically requested otherwise\r\n- Layer names should be localized to the detected User Query language unless specifically requested otherwise\r\n\r\n### Add Layers Rule\r\n- If `addLayers: false`:\r\n - Layers can NOT be added or removed\r\n - Layer `id` values are immutable\r\n - A layer\u2019s geometry classification may be changed **except**:\r\n - If a layer\u2019s current classification is Table, it must remain a Table.\r\n - Any request to convert a Table into Point, Line, or Polygon is a rule violation.\r\n - In this case, you must decline and return an empty `patches` array.\r\n- If `addLayers: true`:\r\n - Layers may be added or removed\r\n - Layer geometry classification may be changed without restriction\r\n - Each new layer must receive a unique `id` starting at 0\r\n- Regardless of `addLayers`:\r\n - Fields within a layer or table may be modified according to the Required Fields and Custom Fields rules.\r\n - Custom fields may be added or removed when explicitly requested.\r\n\r\n### Required Fields\r\n- Required fields are protected:\r\n - Cannot be removed\r\n - Cannot be moved\r\n - `name`, `type`, and `choiceList` are immutable\r\n- Only `alias` and `description` may be updated if explicitly requested\r\n\r\n### Custom Fields\r\n- Custom fields may be added, modified, or removed\r\n- Field names:\r\n - lowercase\r\n - start with a letter\r\n - only letters, numbers, and underscores\r\n- Localize the field `name` to the detected User Query language\r\n- Valid types: `string`, `integer`, `double`, `date`\r\n- String fields:\r\n - Set `choiceList` to an array of allowed values if applicable, else `null`\r\n - All`choiceList` values should be written in the detected User Query language unless specifically requested otherwise\r\n - Set an appropriate `length`\r\n- Non-string fields:\r\n - `choiceList: null`\r\n - `length: null`\r\n- Boolean values must be implemented as:\r\n - `string` with a two-value `choiceList`\r\n - The two values should be localized to the detected User Query language unless specifically requested otherwise\r\n - Preserve meaning equivalent to \u201CYes\u201D and \u201CNo\u201D (affirmative/negative)\r\n- No duplicate field names within the same layer\r\n\r\n# Current Solution Design\r\n{currentDesign}\r\n\r\n# User Query\r\n{query}';export{e as default};
2
+ import"./QPIMTXPL.js";var e='# Your Role\r\nYou are a specialized AI assistant for ArcGIS Solutions. Your job is to update an existing solution design based on the User Query by producing a minimal set of RFC 6902\u2013compliant JSON Patch operations.\r\n\r\nYou must follow all rules below at all times. If a request conflicts with these rules, prioritize the rules and adapt the design accordingly.\r\n\r\n# Your Task\r\n- Analyze the Current Solution Design and the User Query\r\n- Produce the fewest possible JSON Patch operations required to satisfy the request\r\n- Never modify, remove, or replace sections unrelated to the request\r\n\r\n# Response Guidelines\r\n- Populate `response` with a concise explanation of exactly what you changed\r\n- Refer to yourself as \u201CI\u201D or \u201Cwe\u201D.\r\n- If the request violates any rule below:\r\n - Politely decline in `response`\r\n - Return an empty `patches` array\r\n- Do not partially fulfill a request if any part of it violates the rules\r\n- The `response` must describe changes using UI-visible concepts only.\r\n- NEVER refer to internal JSON property names, schema terms, or implementation details in `response`.\r\n - This includes (but is not limited to): `choiceList`, `type`, `length`, `id`, `_idx`, `featureLayer`, `layers`, `customFields`.\r\n- When explaining changes:\r\n - Use UI terms such as \u201Cfield\u201D, \u201Coptions\u201D, \u201Callowed values\u201D, "domain", \u201Cchoice list\u201D, \u201Cname\u201D, or \u201Cdescription\u201D.\r\n- Always refer to custom fields as just fields. Do NOT include the word custom\r\n\r\n## Non-Change Requests\r\n- If the User Query does NOT request a specific change to the solution design:\r\n - Return an empty `patches` array.\r\n - Use the `response` to:\r\n - Briefly acknowledge the user\u2019s message, and\r\n - Let them know you\u2019re available to help make changes if they want to adjust anything\r\n - The `response` MUST:\r\n - Be no more than 2 sentences\r\n - Use UI-visible concepts only\r\n - Avoid internal schema terms or implementation details\r\n\r\n# Language and Localization Rules\r\n- Detect the primary language of the User Query\r\n- Use that language consistently for all user-facing strings unless explicitly prohibited\r\n\r\n# JSON Patch Rules\r\n\r\n## Array Indexing with `_idx`\r\n- Every array element includes a read-only `_idx`\r\n- Always use `_idx` values in patch paths\r\n- Never calculate array positions manually\r\n- Never include `_idx` itself in any patch path or value\r\n- When removing multiple elements from the same array, order those `remove` operations from highest `_idx` to lowest. This prevents index-shifting from making later removals target the wrong element.\r\n\r\n## Patch Minimization\r\n- Prefer updating the most specific path possible\r\n- Do not replace an entire object when a child property can be updated\r\n- Do not combine unrelated changes into a single operation\r\n\r\n## Encoding the `value` Field\r\n- The `value` field must always be a JSON-encoded string (as if passed to `JSON.stringify`).\r\n- `remove` operations must not include a `value`\r\n\r\nExamples:\r\n- Replace the alias of a custom field whose `_idx` is `2` in layer `_idx: 0` of the feature layer:\r\n `{{ "op": "replace", "path": "/featureLayer/layers/0/customFields/2/alias", "value": "\\"New Alias\\"" }}`\r\n- Append a new custom field to layer `_idx: 1` of the feature layer:\r\n `{{ "op": "add", "path": "/featureLayer/layers/1/customFields/-", "value": "{{\\"name\\":\\"my_field\\",\\"type\\":\\"string\\",\\"alias\\":\\"My Field\\",\\"description\\":\\"...\\",\\"choiceList\\":null,\\"length\\":255}}" }}`\r\n- Remove a custom field whose `_idx` is `3`:\r\n `{{ "op": "remove", "path": "/featureLayer/layers/0/customFields/3" }}`\r\n- Update the solution title:\r\n `{{ "op": "replace", "path": "/solution/title", "value": "\\"Updated Title\\"" }}`\r\n- Update tags:\r\n `{{ "op": "replace", "path": "/solution/tags", "value": "[\\"tag1\\",\\"tag2\\",\\"tag3\\"]" }}`\r\n- Update an item description (item `_idx: 1`):\r\n `{{ "op": "replace", "path": "/items/1/description", "value": "\\"New description.\\"" }}`\r\n\r\nDo NOT include `_idx` itself in any patch operation path or value\r\n\r\n# Design Rules\r\n\r\n## Solution\r\n- Only `title`, `description`, and `tags` may be updated\r\n- Only modify values. Do not add or remove properties\r\n\r\n## Strings\r\n- Only `value` may be updated\r\n- `key` and `description` are immutable\r\n- Always return the same number of strings\r\n\r\n## Items\r\n- Only `title` and `description` may be updated\r\n- `id` and `type` are immutable\r\n- Items cannot be added or removed\r\n\r\n## Feature Layers\r\n- Supported layer types: `Point`, `Polyine`, `Polygon`, `Table`\r\n\r\n### Layer Naming Rules\r\n- Layer `name` values should be written in Title Case unless specifically requested otherwise\r\n- Layer names should be localized to the detected User Query language unless specifically requested otherwise\r\n\r\n### Add Layers Rule\r\n- If `addLayers: false`:\r\n - Layers can NOT be added or removed\r\n - Layer `id` values are immutable\r\n- If `addLayers: true`:\r\n - Layers may be added or removed\r\n - Each new layer must receive a unique `id` starting at 0\r\n- Regardless of `addLayers`:\r\n - Fields within a layer or table may be modified according to the Required Fields and Custom Fields rules.\r\n - Custom fields may be added or removed when explicitly requested.\r\n\r\n### Layer Type Mutability Rule\r\n- Never edit the `typeMutable` property\r\n- If `typeMutable: true`:\r\n - The layer type must be chosen: `Point`, `Polyine`, `Polygon`, `Table`\r\n - The layer type may be changed without restriction\r\n- If `typeMutable: false`:\r\n - The layer type may never be changed\r\n - Requests to change the layer type should be rejected\r\n\r\n### Required Fields\r\n- Required fields are protected:\r\n - Cannot be removed\r\n - Cannot be moved\r\n - `name`, `type`, and `choiceList` are immutable\r\n- Only `alias` and `description` may be updated if explicitly requested\r\n\r\n### Custom Fields\r\n- Custom fields may be added, modified, or removed\r\n- Field names:\r\n - lowercase\r\n - start with a letter\r\n - only letters, numbers, and underscores\r\n- Localize the field `name` to the detected User Query language\r\n- Valid types: `string`, `integer`, `double`, `date`\r\n- String fields:\r\n - Set `choiceList` to an array of allowed values if applicable, else `null`\r\n - All`choiceList` values should be written in the detected User Query language unless specifically requested otherwise\r\n - Set an appropriate `length`\r\n- Non-string fields:\r\n - `choiceList: null`\r\n - `length: null`\r\n- Boolean values must be implemented as:\r\n - `string` with a two-value `choiceList`\r\n - The two values should be localized to the detected User Query language unless specifically requested otherwise\r\n - Preserve meaning equivalent to \u201CYes\u201D and \u201CNo\u201D (affirmative/negative)\r\n- No duplicate field names within the same layer\r\n\r\n# Current Solution Design\r\n{currentDesign}\r\n\r\n# User Query\r\n{query}';export{e as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"./7J2F4TFI.js";import c from"./XC3IZAIH.js";import b from"./EXC566PM.js";import{a as M,b as L}from"./2B4SGB3I.js";import{b as f}from"./I2NTSKBD.js";import{K as _,M as x,N as T,nb as P,q as u,ta as E}from"./3UKDJZ2D.js";import{a as I}from"./MGEDATQ7.js";import{k as R}from"./AYSQIO6L.js";import{b as D}from"./2I5LGZNX.js";import{E as d,F as h,G as k,I as p,J as S,K as m,h as C,i as a,q as v}from"./FFF5HUPM.js";export default $arcgis.t(([{h:y,p:A,q:b,r:O},{b:F,d:U,e:V,f:w,r:g},{a:H}])=>{var z=C`.display-flex{display:flex}.flex-direction-row{flex-direction:row}.flex-direction-column{flex-direction:column}.flex-1{flex:1}.cursor-default{cursor:default}solution-details-card[id*=you-may-also-like]{width:240px}.border-bottom{border-bottom-color:var(--calcite-color-border-1);border-bottom-width:var(--calcite-spacing-px);border-bottom-style:solid}ul{list-style-type:disc;margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}ul ul{list-style-type:circle}li{margin:var(--calcite-spacing-sm) var(--calcite-spacing-none)}calcite-label{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.padding-1{padding:var(--calcite-spacing-lg)}.padding-1-5{padding:var(--calcite-spacing-xl)}.padding-2px{padding:var(--calcite-spacing-base)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-bottom-1{padding-bottom:var(--calcite-spacing-lg)}.padding-bottom-sm{padding-bottom:var(--calcite-spacing-sm)}.padding-top-md{padding-top:var(--calcite-spacing-md)}.padding-top-sm{padding-top:var(--calcite-spacing-sm)}.padding-top-xs{padding-top:.25rem}.padding-bottom-1-5{padding-bottom:var(--calcite-spacing-xxl)}.padding-top-1{padding-top:var(--calcite-spacing-lg)}.padding-top-1-5{padding-top:var(--calcite-spacing-xxl)}.padding-top-1-2{padding-top:var(--calcite-spacing-sm)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-1-75{padding-inline-end:1.75rem}.padding-end-2{padding-inline-end:var(--calcite-spacing-xxxl)}.padding-start-1{padding-inline-start:var(--calcite-spacing-lg)}.margin-bottom-1{margin-bottom:var(--calcite-spacing-lg)}.margin-bottom-1-5{margin-bottom:var(--calcite-spacing-xxl)}.margin-end-1{margin-inline-end:var(--calcite-spacing-lg)}.margin-top-0{margin-top:var(--calcite-spacing-none)}.margin-top-1{margin-top:var(--calcite-spacing-lg)}.margin-top-875{margin-top:.875rem}.margin-top-1-5{margin-top:var(--calcite-spacing-xxl)}.margin-sides-0-5{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm)}.margin-sides-1{margin-left:var(--calcite-spacing-lg);margin-right:var(--calcite-spacing-lg)}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.align-self-center{align-self:center;padding:5px;--calcite-fab-shadow: #FFFFFF00}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.button-width{width:260px;flex-grow:0;flex-shrink:0}@container (max-width: 1050px){.button-width{width:auto}}.image-width{width:300px;flex-grow:0;flex-shrink:0}@container (max-width: 1050px){.image-width{flex-grow:0;flex-shrink:1}}.width-full{width:100%}@container (max-width: 800px){.width-full{flex-direction:column}.width-full>.display-flex{flex-direction:column}.image-width{width:100%;max-width:100%;margin:0;padding-bottom:0}.image-width img{width:100%;max-width:100%}.title-font{padding-inline-end:var(--calcite-spacing-lg);padding-top:var(--calcite-spacing-lg)}.button-width{width:100%;margin-top:var(--calcite-spacing-lg)}}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-sm) var(--calcite-spacing-md)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}calcite-card{width:450px;--calcite-card-border-color: transparent}@container (max-width: 1496px){calcite-card{width:calc(100% / 3 - .5rem)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}}@container (max-width: 1100px){calcite-card{width:calc(50% - .5rem)}#screenshots-subsection calcite-card{width:calc(50% - .5rem)}}@container (max-width: 550px){calcite-card{width:100%}#screenshots-subsection calcite-card{width:100%}}.max-height-300{max-height:300px}.display-none{display:none}.cursor-pointer{cursor:pointer}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{border:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:border-box;cursor:pointer;padding:var(--calcite-spacing-base)}calcite-card.is-mobile:hover img{cursor:default;-webkit-filter:brightness(100%);filter:brightness(100%);transition:all .1s ease}calcite-card{border:var(--calcite-spacing-base) solid transparent;box-sizing:border-box;padding:var(--calcite-spacing-base)}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}#screenshots-subsection .card-image{background-color:var(--calcite-color-surface-2)}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip;display:block}.margin-inline-unset{margin-inline:unset}.collapsible-div{overflow:hidden;transition:max-height .3s ease-in-out}.collapsible-div.expanded{max-height:100%}.back-color-override{--calcite-panel-background-color: var(--calcite-color-surface-3)}.back-color-override-1{background-color:var(--calcite-color-surface-2)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.line-height-xxl{line-height:var(--calcite-spacing-xxl)}.line-height-1{line-height:1.1}.font-1{font-size:var(--calcite-spacing-lg)}.font-color-1{color:var(--calcite-color-text-1)}.font-color-2{color:var(--calcite-color-text-2)}h1{font-weight:unset;margin:var(--calcite-spacing-none);padding:var(--calcite-spacing-none)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.accordion-bg{--calcite-accordion-background-color: var(--calcite-color-surface-2)}.table-cell{font-size:var(--calcite-spacing-lg);color:var(--calcite-color-text-2);margin:0}.table-cell p{margin:0}calcite-table-header{font-weight:var(--calcite-font-weight-medium);--calcite-internal-table-cell-font-size: var(--calcite-font-size-md)}.position-relative{position:relative}.background-color-2{background-color:var(--calcite-color-surface-3)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-3)}.border-none{border:none}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}calcite-shell{block-size:unset}.solution-detail-action{--calcite-color-focus: initial}a{color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:hover{background-size:100% 1px,100% 1px}a:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:active{color:var(--calcite-color-brand-press)}*[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.chip-status{--calcite-chip-icon-color: var(--calcite-color-brand);cursor:pointer}.chip-deployed{--calcite-chip-icon-color: var(--calcite-color-status-success)}.chip-deployed-warn{--calcite-chip-icon-color: var(--calcite-color-status-warning)}`,$=class extends k{constructor(){super(),this.readOnlyNotice="",this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showScreenshotsShowMore=!1,this._showYouMayAlsoLikeShowMore=!1,this.isMobile=!1,this._isScreenshotsRowExpanded=!1,this._isYouMayAlsoLikeRowExpanded=!1,this._screenshotsRowBaseHeight=340,this._showLoader=!1,this._templates=[],this._translations=I({name:"solution-details-panel",blocking:!0}),this._youMayAlsoLikeBaseHeight=340,this._allCards=[],this._configContextConsumer=f({context:L,subscribe:!0}),this._configureLearnMore="",this._customDeploymentMappings={},this._deployDialogRef=d(),this._deployingDialogRef=d(),this._isMobileContextConsumer=f({context:M,subscribe:!0,callback:e=>this.isMobile=e}),this._overviewAccordionItemElement=d(),this._privilegePopoverRef=d(),this._privileges=[],this._regexFsUrl="https?:\\/\\/.+FeatureServer\\b",this._regexID="\\b[0-9A-F]{32}\\b",this._releaseNotesAccordionItemElement=d(),this._relatedResourcesAccordionItemElement=d(),this._screenshotsAccordionItemElement=d(),this._screenshotsDialogRef=d(),this._screenshotsElement=d(),this._termsOfUseAccordionItemElement=d(),this._userOptions=[],this._youMayAlsoLikeAccordionItemElement=d(),this._youMayAlsoLikeElement=d(),this._signInParamValue=null,this._deploymentStartTime=null,this._pendingDeployedSolutionId=null,this._cancellationStartTime=null,this._deployToCancelDuration=0,this.templatesFetched=v(),this.itemPropertiesFetched=v(),this.sortTypeChanged=v(),this.tokenRefreshed=v(),this._handleDeployCancelled=()=>{this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]})},this._handleDeploySuccess=e=>{let i=b(this._deploymentStartTime);this._deploymentStartTime=null,this._pendingDeployedSolutionId=e?.detail||null,this._deployingDialogRef.value&&(this._deployingDialogRef.value.isWaitingForCard=!0),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Success",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""],metrics:[i]})},this._handleDeployedCardReady=async e=>{!this._pendingDeployedSolutionId||e.detail?.card?.id!==this._pendingDeployedSolutionId||(this._pendingDeployedSolutionId=null,this._closeDialogs(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),window.dispatchEvent(new CustomEvent("displayDeployedCard",{detail:e.detail})))},this._handleDeploymentFallback=e=>{!this._pendingDeployedSolutionId||e.detail?.solutionId!==this._pendingDeployedSolutionId||(this._pendingDeployedSolutionId=null,console.warn("Deployment completed but unable to navigate to deployed card - closing dialogs"),this._closeDialogs(),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:"deployments"})))},this._handleDeploymentProcessCancelled=()=>{this._cancellationStartTime=Date.now(),this._deployToCancelDuration=b(this._deploymentStartTime),this._deploymentStartTime=null},this._handleDeployFailed=e=>{if(this._pendingDeployedSolutionId=null,this._cancellationStartTime!==null){this._closeDialogs();return}let i=b(this._deploymentStartTime);this._deploymentStartTime=null;let t=A(e.detail?.error),l=t.length>200?t.slice(-200):t;console.error("Deployment failed:",e.detail?.error),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Failure",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",l],metrics:[i]}),this._closeDialogs(!0)},this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"allCardsFetched",this._allCardsFetched),this.listenOn(window,"deployAppTabSelected",this._handleDeployAppTabSelected),this.listenOn(window,"deployedCardReady",this._handleDeployedCardReady),this.listenOn(window,"deploymentCompletedWithoutNav",this._handleDeploymentFallback)}static{this.properties={card:0,readOnlyNotice:1,_deployedTooltipContent:16,_isDeployDisabled:16,_isLoaded:16,_itemFetched:16,_showScreenshotsShowMore:16,_showYouMayAlsoLikeShowMore:16,isMobile:16,_isScreenshotsRowExpanded:16,_isYouMayAlsoLikeRowExpanded:16,_itemProperties:16,_missingPrivilegeMessages:16,_screenshotsRowBaseHeight:16,_showLoader:16,_templates:16,_translations:16,_youMayAlsoLikeBaseHeight:16}}static{this.styles=z}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async connectedCallback(){super.connectedCallback(),this.listenOn(window,"calciteTabChange",this._cleanupPanel)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}willUpdate(e){e.has("card")&&(this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._showLoader=!1,this._signInParamValue==="deploy"&&(this._showLoader=!0,this._signInParamValue=null))}loaded(){this._signInParamValue===null&&this._configContextConsumer.value?.authentication?.SignInParam&&(this._signInParamValue=this._configContextConsumer.value.authentication.SignInParam),this._resizeObserver=new ResizeObserver(async()=>{this._onResize()}),this._screenshotsElement.value&&this._resizeObserver.observe(this._screenshotsElement.value)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}render(){let e="padding-bottom-1-5",i=this._getRelatedResources(),t=this._getYouMayAlsoLikeCards();return a`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="margin-top-875 padding-1-5 back-color-override-1 margin-bottom-1-5" id=solution-details-row>${this._getSolutionRow()}</div><div class=${p(e)}>${this._getScreenshotsRow()}</div><div class=${p(e)}>${this._getOverviewRow()}</div><div class=${p(e)}>${this._getReleaseNotesRow()}</div>${i.length>0?a`<div class=${p(e)}>${this._getRelatedResourcesRow(i)}</div>`:""}${t.length>0?a`<div class=${p(e)}>${this._getYouMayAlsoLikeRow(t)}</div>`:""}<div class=${p(e)}>${this._getTermsOfUseRow()}</div>${this.isMobile?"":a`<solution-deploy-dialog .card=${this.card} @deployCancelled=${this._handleDeployCancelled} @deployFailed=${this._handleDeployFailed} @deployProgressEnd=${this._handleDeploySuccess} @deployProgressStart=${this._deployProgressStart} @deployProgressUpdated=${this._deployProgessUpdated} id=solutionDeployDialog .userOptions=${this._userOptions} ${h(this._deployDialogRef)}></solution-deploy-dialog>`}<solution-snapshot-gallery .card=${this.card} id=solutionSnapshotGallery .itemProperties=${this._itemProperties} ${h(this._screenshotsDialogRef)}></solution-snapshot-gallery><solution-deploying-dialog .card=${this.card} @deploymentProcessCancelled=${this._handleDeploymentProcessCancelled} ${h(this._deployingDialogRef)}></solution-deploying-dialog></calcite-panel></calcite-shell>`}updated(){setTimeout(()=>{let e=this._getYouMayAlsoLikeCards(),i=340;for(let t=0;t<e.length;t++){let l=this.el.shadowRoot?.getElementById(`you-may-also-like-${t}`),s=l?.offsetHeight?l.offsetHeight+40:0;s>i&&(i=s)}this._youMayAlsoLikeBaseHeight=i,this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2},100)}_checkUrlParametersForAutoDeployment(){if(this._signInParamValue==="deploy"){let e=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);this._configContextConsumer.value?.authentication?.IsSignedIn&&this.card&&this._deployDialogRef.value&&!e&&!y(this._configContextConsumer.value)&&(this._signInParamValue=null,this._openDeploy())}}_getSolutionRow(){let e=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400"),i=this._missingPrivilegeMessages?.leadingMessages||[],t=i.length>0,l=this._missingPrivilegeMessages?.bulletedMessages||[],s=l.length>0,o=this._missingPrivilegeMessages?.trailingMessages||[],r=o.length>0;return a`<div class="display-flex flex-direction-row width-full"><div class="padding-end-1-75 image-width"><img alt=${this.card?.title??m} src=${e??m}></div><div class="display-flex flex-direction-row flex-1">${this._getTextSection(t,s,r,i,l,o)}${this._getButtons()}</div></div>`}_getTextSection(e,i,t,l,s,o){return a`<div class="display-flex flex-direction-column padding-end-1 flex-1"><div class="display-flex flex-direction-row align-items-baseline"><h1 class="padding-top-xs title-font margin-top-0 margin-bottom-1-5 line-height-1" tabindex=0>${this.card?.title}</h1>${this.card?.categories?.some(r=>r.includes("New Release"))&&a`<calcite-chip class="margin-bottom-1-5 margin-sides-1" kind=brand .label=${this._translations.newChip} scale=m icon=star>${this._translations.newChip}</calcite-chip>`||""}${this._renderChips(this.card?.chips||[])}</div><div class="font-1 padding-end-1 line-height-xxl" tabindex=0>${this.card?.snippet}</div>${this.isMobile?"":y(this._configContextConsumer.value)?a`<div class="display-flex flex-direction-row padding-top-1">${this._getReadOnlyNotice()}</div>`:e||i||t?a`<div class="display-flex flex-direction-row padding-top-1">${this._getMissingPrivilegesNotice(l,s,o)}</div>`:""}</div>`}_renderChips(e){let i=e.filter(s=>s==="deployed"||s==="deployedOlderVersion"),t=e.filter(s=>s!=="deployed"&&s!=="deployedOlderVersion"),l=[];if(t.forEach(s=>{let o="margin-bottom-1-5 margin-sides-1 chip-status",r=`solution-details-card-chip-${s}`,c=s==="new"?"star":"mega-phone",n=s==="new"?this._translations.newChip:this._translations.updatedChip;l.push(a`<calcite-chip class=${p(o)} .icon=${c} id=${r??m} .label=${n} .value=${n} scale=s></calcite-chip><calcite-tooltip .referenceElement=${r}><span>${n}</span></calcite-tooltip>`)}),i.length>0){let s="margin-bottom-1-5 margin-sides-1 chip-status";t.length>0?s=i[0]==="deployedOlderVersion"?"chip-deployed-warn":"chip-deployed":s+=i[0]==="deployedOlderVersion"?" chip-deployed-warn":" chip-deployed",l.push(a`<calcite-chip class=${p(s)} .icon=${i[0]==="deployedOlderVersion"?"recent":"check-circle"} id=solution-details-card-chip-deployed .label=${this._translations.deployedChip} .value=${this._translations.deployedChip} scale=s></calcite-chip><calcite-tooltip placement=bottom reference-element=solution-details-card-chip-deployed @calciteTooltipBeforeOpen=${async()=>{let o={q:`${this.card?.deployCommonId} and owner:${this._configContextConsumer.value?.userSession?.username}`,authentication:this._configContextConsumer.value?.userSession,pagingParam:{start:1,num:100}},r=await P(o);this._deployedTooltipContent=a`<solutions-deployed-list .results=${r} has-links .listTitle=${i[0]==="deployedOlderVersion"?this._translations.deployedPreviousTitle:this._translations.deployedTitle}></solutions-deployed-list>`}} @calciteTooltipBeforeClose=${()=>{}}>${this._deployedTooltipContent}</calcite-tooltip>`)}return l}_getButtons(){let e=this._itemProperties?.demoURL||"",i=y(this._configContextConsumer.value);return a`<div class="display-flex flex-direction-column button-width">${!this.isMobile&&a`<calcite-button class="padding-bottom-1 solution-detail-action" .disabled=${this._isDeployDisabled||i} icon-flip-rtl=end @click=${()=>this._checkPermissionsBeforeDeploy()} scale=m width=full>${this._showLoader?a`<calcite-loader inline label></calcite-loader>`:this._translations.deployButton}</calcite-button>`||""}${!this._configContextConsumer.value?.isEnterprise&&e&&a`<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleWatchDemoClick(e)} scale=m width=full>${this._translations.watchDemo}</calcite-button>`||""}<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleLearnMoreClick()} scale=m width=full>${this._translations.openHelp}</calcite-button>${!this._configContextConsumer.value?.isEnterprise&&a`<solution-social-share button-appearance=outline-fill class="padding-bottom-1" share-button-kind=neutral .shareButtonText=${this._translations.share} share-button-scale=m .solutionId=${this.card?.deployCommonId||""} .solutionTitle=${this.card?.title||""} .solutionVersion=${this.card?.deployVersion||""}></solution-social-share>`||""}</div>`}_getReadOnlyNotice(){return a`<calcite-notice class="margin-inline-unset" icon=exclamation-mark-triangle kind=warning open scale=s><div slot=message .innerHTML=${this.readOnlyNotice??""}></div></calcite-notice>`}_getMissingPrivilegesNotice(e,i,t){let l="solutions-missing-privileges-notice",s=this._translations.missingPrivilegesPopup.missingLicensingOrPrivileges,o=i.length>0?"":"display-none",r=i.length>0?"padding-top-sm":"";return a`<div><calcite-notice class="margin-inline-unset" kind=info open><div slot=message>${`${s}`}</div><calcite-action icon=information id=${l} slot=actions-end .text=${s}></calcite-action></calcite-notice><calcite-popover closable label overlay-positioning=fixed placement=bottom reference-element=solutions-missing-privileges-notice ${h(this._privilegePopoverRef)}><div class="padding-1 display-flex flex-direction-column">${this._getSpanMessages(e,"padding-bottom-1")}<span class=${`padding-bottom-1-2 ${o}`}>${this._translations.missingPrivilegesPopup.missingPrivilegesListHeading}</span>${this._getBulletedMessages(i)}${this._getSpanMessages(t,r)}</div></calcite-popover></div>`}_getSpanMessages(e,i){return e.length>0?e.map(t=>a`<span class=${p(i)}>${t}</span>`):""}_getBulletedMessages(e){return e.length>0?a`<ul>${e.map(i=>a`<li>${i}</li>`)}</ul>`:""}_getScreenshotsRow(){let e=this._isScreenshotsRowExpanded?this._translations.showLess:this._translations.showMore,i=this._isScreenshotsRowExpanded?"arrow-up":"arrow-down",t=this._showScreenshotsShowMore?"":"display-none";return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._screenshotsAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionOverview}</div><calcite-panel><div class="display-flex flex-direction-column back-color-override-1"><div class="collapsible-div max-height-300" id=screenshots-subsection ${h(this._screenshotsElement)}>${this._getScreenshots()}</div><calcite-fab appearance=outline-fill class=${`align-self-center ${t}`} .icon=${i} kind=neutral @click=${()=>{this._screenshotsElement.value?.classList.toggle("expanded"),this._isScreenshotsRowExpanded=this._screenshotsElement.value.classList.contains("expanded")}} .text=${e} text-enabled></calcite-fab></div></calcite-panel></calcite-accordion-item></calcite-accordion>`}_getScreenshots(){let e=this._itemProperties?.preview.filter(s=>s.format==="image")||[],i=this._configContextConsumer.value,t=this._itemFetched?"":"display-none",l=this._itemFetched?"display-none":"";return a`<calcite-loader class=${p(l)} label></calcite-loader><calcite-card-group class=${`card-group ${t}`} .label=${this._translations.solutionOverview}>${e.reduce((s,o)=>{let r=w(this.card?.id||"",o.name,i.authentication),c;return i.agoBasedEnterpriseSolutionsGroupId&&i.isEnterprise&&(c=w(this.card?.id||"",o.name,void 0,i.agolPortalUrl)),this.card?.id?s.push(a`<calcite-card class=${`${this.isMobile?"is-mobile":"cursor-pointer not-mobile"}`} .label=${o.alt} @click=${()=>this._openScreenshotGallery(o)} @keydown=${n=>O(n,()=>this._openScreenshotGallery(o))}><div class="card-image-wrap" slot=thumbnail><img alt=${o.alt??m} class="thumbnail card-image" slot=thumbnail src=${(c||r)??m}>${!this.isMobile&&a`<div class="hover-text">${this._translations.openInGallery}</div>`||""}</div></calcite-card>`):s.push(""),s},[])}</calcite-card-group>`}_openScreenshotGallery(e){if(!this.isMobile){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Screenshot Gallery",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]});let i=this._screenshotsDialogRef.value;i&&(i.screenshot=e,i.open=!0)}}_getOverviewRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._overviewAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionDetails}</div>${this._getDescriptionRow()}${this._getInformationProductsRow()}</calcite-accordion-item></calcite-accordion>`}_getDescriptionRow(){return a`<div class="display-flex flex-direction-column"><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" tabindex=0>${this.card?.snippet}</div><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" .innerHTML=${this.card?.description??""} tabindex=0></div></div>`}_getInformationProductsRow(){return a`<div class="display-flex flex-direction-column font-1 line-height-xxl font-color-2"><span tabindex=0>${this.card?.title?this._translations.informationProductsSubText.replace("{{solutionTitle}}",this.card.title):""}</span><calcite-table bordered caption class="padding-top-1">${this._getInformationTableHeaderRow()}${this._getInformationTableRows()}</calcite-table><p tabindex=0>${this._translations.informationProductsFooterText}</p></div>`}_getInformationTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.solutionItem}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header><calcite-table-header .heading=${this._translations.minimumUserType}></calcite-table-header></calcite-table-row>`}_getInformationTableRows(){return(this._itemProperties?.infoProducts||[]).map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.item)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.description)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.userType)??""}></p></calcite-table-cell></calcite-table-row>`)}_getReleaseNotesRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._releaseNotesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.releaseNotes}</div><div class="display-flex flex-direction-column"><calcite-table bordered caption>${this._getReleaseNotesTableHeaderRow()}${this._getReleaseNotesTableRows()}</calcite-table></div></calcite-accordion-item></calcite-accordion>`}_getReleaseNotesTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.version}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header></calcite-table-row>`}_getReleaseNotesTableRows(){return(this._itemProperties?.releaseNotes||[])?.map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.version)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.description)??""}></p></calcite-table-cell></calcite-table-row>`)}_getRelatedResourcesRow(e){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._relatedResourcesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.relatedResources}</div><div class="display-flex flex-direction-row">${e.map(()=>{a`<solution-resource-card></solution-resource-card>`})}</div></calcite-accordion-item></calcite-accordion>`}_getRelatedResources(){return[]}_getYouMayAlsoLikeRow(e){let i=this._showYouMayAlsoLikeShowMore?"":"display-none",t=this._isYouMayAlsoLikeRowExpanded?this._translations.showLess:this._translations.showMore,l=this._isYouMayAlsoLikeRowExpanded?"arrow-up":"arrow-down",s=this._isYouMayAlsoLikeRowExpanded?"":{height:`${this._youMayAlsoLikeBaseHeight}px`};return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._youMayAlsoLikeAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.youMayAlsoLike}</div><div class="display-flex flex-direction-column"><div class="collapsible-div" id=you-may-also-like-subsection style=${S(s)} ${h(this._youMayAlsoLikeElement)}><div class="display-flex flex-direction-row"><calcite-card-group class="card-group" .label=${this._translations.youMayAlsoLike}>${e.map((o,r)=>a`<solution-details-card .id=${`you-may-also-like-${r}`} .card=${o} class="padding-2px" source=you-may-also-like .referrerSolutionId=${this.card?.deployCommonId||""} .referrerSolutionTitle=${this.card?.title||""} .referrerSolutionVersion=${this.card?.deployVersion||""}></solution-details-card>`)}</calcite-card-group></div></div><calcite-fab appearance=outline-fill class=${`align-self-center ${i}`} .icon=${l} kind=inverse @click=${()=>{this._youMayAlsoLikeElement.value?.classList.toggle("expanded"),this._isYouMayAlsoLikeRowExpanded=this._youMayAlsoLikeElement.value.classList.contains("expanded")}} .text=${t} text-enabled></calcite-fab></div></calcite-accordion-item></calcite-accordion>`}_getYouMayAlsoLikeCards(){let e=this._itemProperties?.relatedSolutions||[];return this._allCards.filter(i=>e.indexOf(i.deployCommonId)>-1)}_getTermsOfUseRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._termsOfUseAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.termsOfUse}</div><div class="font-color-2" .innerHTML=${(this.card?.licenseInfo||"")??""} tabindex=0></div></calcite-accordion-item></calcite-accordion>`}_openDeploy(){if(this._configContextConsumer.value.authentication.IsSignedIn){let e=this._deployDialogRef.value;e&&(this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Opened",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),e.userOptions=this._userOptions,e.open=!0)}else this._configContextConsumer.value.authentication.signIn("deploy")}_openUrl(e){window.open(e,"_blank")}_handleWatchDemoClick(e){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Watch Demo",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(e)}_handleLearnMoreClick(){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(this.card?.learnMoreUrl||"")}async _detailsCardSelected(e){this.card=e.detail,this.el.scrollIntoView(!0),this._onResize(),this._missingPrivilegeMessages=void 0,await this._getItemData(),this._expandAccordions()}_expandAccordions(){this._overviewAccordionItemElement.value&&(this._overviewAccordionItemElement.value.expanded=!0),this._releaseNotesAccordionItemElement.value&&(this._releaseNotesAccordionItemElement.value.expanded=!0),this._relatedResourcesAccordionItemElement.value&&(this._relatedResourcesAccordionItemElement.value.expanded=!0),this._screenshotsAccordionItemElement.value&&(this._screenshotsAccordionItemElement.value.expanded=!0),this._termsOfUseAccordionItemElement.value&&(this._termsOfUseAccordionItemElement.value.expanded=!0),this._youMayAlsoLikeAccordionItemElement.value&&(this._youMayAlsoLikeAccordionItemElement.value.expanded=!0)}async _getItemData(){this._itemFetched=!1;let e=this._configContextConsumer.value,i=e?.agoBasedEnterpriseSolutionsGroupId&&e?.isEnterprise?e.anonAgolSession:e?.userSession,t=await E(this.card.id,i),l=await R(this.card.id,i);this._itemFetched=!0,this._itemProperties=l.properties,this.itemPropertiesFetched.emit(this._itemProperties);let s=F(t,this.card.typeKeywords,e?.authentication);this._privileges=i.username?s:[],this._userPrivileges=e?.authentication?e.authentication.PortalUserEnrichedPrivileges:[];let o=this._privileges.filter(c=>!this._userPrivileges.includes(c));this._missingPrivilegeMessages=U(this._translations,o),this._isDeployDisabled=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);let r=t.params?await this.formatParams(t.params):[];this._userOptions=r,this._templates=t.templates,this.templatesFetched.emit(t.templates),this._checkUrlParametersForAutoDeployment(),this._isLoaded=!0,this._showLoader&&(this._showLoader=!1,this._isDeployDisabled||this._openDeploy())}formatParams(e){let i=this._configContextConsumer.value.userSession,t=[],l=e?Object.keys(e):[],s={id:"",props:[],accordionDisplay:!1};if(l.length>0){let o=[];return l.forEach(r=>{let c=e[r];c.valueType&&c.valueType.toLowerCase()==="itemid"&&o.push(this._findExistingItem(r,"Feature Service",i.username||""))}),Promise.all(o).then(r=>{let c={};return r.forEach(n=>{if(n.query&&n.results&&n.results.length>0){let N=n.query.split(" ")[0].replace("typekeywords:source-","");c[N]={resultId:n.results[0].id,response:n.results[0]}}}),l.forEach(n=>{if(n==="serviceLearnMore"){this._configureLearnMore=e[n],alert(this._configureLearnMore),delete e[n];return}e[n].enterpriseIDMapping&&(this._customDeploymentMappings[n]=e[n].enterpriseIDMapping),s.id=n,c[n]&&(e[n].existingItemId=c[n].resultId,this.updateUserProp(e[n],c[n].response)),this.updateOption(e[n],s,n)}),t.push(s),Promise.resolve(t)}).catch(()=>Promise.resolve([]))}else return Promise.resolve([])}_findExistingItem(e,i,t){let l=this._configContextConsumer.value.userSession;return H(`typekeywords:source-${e} type:${i} owner:${t}`,l)}updateUserProp(e,i){let t=e.itemType?.toLowerCase()==="feature service",l=new RegExp(t?this._regexFsUrl:e.itemType,"iu"),s=x(i,t?"url":"type","")||"",o=s!==""&&l.test(s);return e.responseValue=o?s:"",e.name=o&&_(i,"name")||"",e.title=o&&_(i,"title")||"",e.itemType=o?_(i,"type"):e.itemType,e.validId=o,e.itemUrl=V(i.id,this._configContextConsumer.value.authentication),o}updateOption(e,i,t){let l=e.default||"",s=typeof l,o=l.toString();this._setFeatureServiceProps(e);let r=this.getValidation(e,o);i.props.push({id:t,outType:s,prop:t,itemType:e.itemType||"",responseValue:e.responseValue||"",label:e.label||"",choices:e.choices||[],valueType:e.valueType.toLowerCase(),attributes:e.attributes||{},value:e.existingItemId&&e.valueType.toLowerCase()==="itemid"?e.existingItemId:o,default:o,srSearchText:o,autoSelect:o!=="",...r,loading:!1,validId:!0,tooltip:e.tooltip||"",name:e.name||"",title:e.title||"",itemUrl:e.itemUrl||""})}_setFeatureServiceProps(e){e.valueType&&e.valueType.toLowerCase()==="itemid"&&T(e,"attributes.required","true")}getValidation(e,i){let t="",l=_(e,"validation.message")||"",s=!0;return _(e,"attributes.required")==="true"&&(t=x(e,"validation.expression","\\S{1,}"),s=new RegExp(t).test(i)),e.valueType&&e.valueType.toLowerCase()==="itemid"&&(t=this._regexID,l=this._translations.configure.invalidID),{valid:s,validation:{expression:t,message:l}}}_allCardsFetched(e){this._allCards=e.detail}_onResize(){this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2}_cleanupPanel(){this.el.scrollIntoView(!0),this._isScreenshotsRowExpanded=!1,this._showScreenshotsShowMore=!1,this._screenshotsElement.value?.classList.remove("expanded"),this._isYouMayAlsoLikeRowExpanded=!1,this._showYouMayAlsoLikeShowMore=!1,this._youMayAlsoLikeElement.value?.classList.remove("expanded"),this._privilegePopoverRef.value?.open&&(this._privilegePopoverRef.value.open=!1),this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showLoader=!1,this._expandAccordions()}_deployProgressStart(e){this._deploymentStartTime=Date.now(),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Started",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._deployingDialogRef.value&&(this._deployingDialogRef.value.open=!0,this._deployingDialogRef.value.abortController=e.detail),this._deployDialogRef.value&&this._deployDialogRef.value.classList.add("display-none")}_deployProgessUpdated(e){let i=e.detail;this._deployingDialogRef.value.deploymentProgress=i.progress}_closeDialogs(e=!1){if(this._cancellationStartTime!==null){let i=b(this._cancellationStartTime);this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""],metrics:[this._deployToCancelDuration,i]}),this._cancellationStartTime=null,this._deployToCancelDuration=0}this._deployingDialogRef.value.close(),e?this._deployDialogRef.value.open=!0:this._deployDialogRef.value.close(),this._deployDialogRef.value.classList.remove("display-none")}_handleDeployAppTabSelected(e){e.detail==="details"&&this.sortTypeChanged.emit("")}_checkPermissionsBeforeDeploy(){y(this._configContextConsumer.value)||(this._isLoaded?this._openDeploy():this._configContextConsumer.value.authentication?.IsSignedIn?this._showLoader=!0:this._openDeploy())}};D("solution-details-panel",$);return $},b,c,e)
2
+ import e from"./PUQBEN7F.js";import c from"./XC3IZAIH.js";import b from"./EXC566PM.js";import{a as M,b as L}from"./2B4SGB3I.js";import{b as f}from"./I2NTSKBD.js";import{K as _,M as x,N as T,nb as P,q as u,ta as E}from"./3UKDJZ2D.js";import{a as I}from"./MGEDATQ7.js";import{k as R}from"./AYSQIO6L.js";import{b as D}from"./2I5LGZNX.js";import{E as d,F as h,G as k,I as p,J as S,K as m,h as C,i as a,q as v}from"./FFF5HUPM.js";export default $arcgis.t(([{h:y,p:A,q:b,r:O},{b:F,d:U,e:V,f:w,r:g},{a:H}])=>{var z=C`.display-flex{display:flex}.flex-direction-row{flex-direction:row}.flex-direction-column{flex-direction:column}.flex-1{flex:1}.cursor-default{cursor:default}solution-details-card[id*=you-may-also-like]{width:240px}.border-bottom{border-bottom-color:var(--calcite-color-border-1);border-bottom-width:var(--calcite-spacing-px);border-bottom-style:solid}ul{list-style-type:disc;margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}ul ul{list-style-type:circle}li{margin:var(--calcite-spacing-sm) var(--calcite-spacing-none)}calcite-label{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.padding-1{padding:var(--calcite-spacing-lg)}.padding-1-5{padding:var(--calcite-spacing-xl)}.padding-2px{padding:var(--calcite-spacing-base)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-bottom-1{padding-bottom:var(--calcite-spacing-lg)}.padding-bottom-sm{padding-bottom:var(--calcite-spacing-sm)}.padding-top-md{padding-top:var(--calcite-spacing-md)}.padding-top-sm{padding-top:var(--calcite-spacing-sm)}.padding-top-xs{padding-top:.25rem}.padding-bottom-1-5{padding-bottom:var(--calcite-spacing-xxl)}.padding-top-1{padding-top:var(--calcite-spacing-lg)}.padding-top-1-5{padding-top:var(--calcite-spacing-xxl)}.padding-top-1-2{padding-top:var(--calcite-spacing-sm)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-1-75{padding-inline-end:1.75rem}.padding-end-2{padding-inline-end:var(--calcite-spacing-xxxl)}.padding-start-1{padding-inline-start:var(--calcite-spacing-lg)}.margin-bottom-1{margin-bottom:var(--calcite-spacing-lg)}.margin-bottom-1-5{margin-bottom:var(--calcite-spacing-xxl)}.margin-end-1{margin-inline-end:var(--calcite-spacing-lg)}.margin-top-0{margin-top:var(--calcite-spacing-none)}.margin-top-1{margin-top:var(--calcite-spacing-lg)}.margin-top-875{margin-top:.875rem}.margin-top-1-5{margin-top:var(--calcite-spacing-xxl)}.margin-sides-0-5{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm)}.margin-sides-1{margin-left:var(--calcite-spacing-lg);margin-right:var(--calcite-spacing-lg)}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.align-self-center{align-self:center;padding:5px;--calcite-fab-shadow: #FFFFFF00}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.button-width{width:260px;flex-grow:0;flex-shrink:0}@container (max-width: 1050px){.button-width{width:auto}}.image-width{width:300px;flex-grow:0;flex-shrink:0}@container (max-width: 1050px){.image-width{flex-grow:0;flex-shrink:1}}.width-full{width:100%}@container (max-width: 800px){.width-full{flex-direction:column}.width-full>.display-flex{flex-direction:column}.image-width{width:100%;max-width:100%;margin:0;padding-bottom:0}.image-width img{width:100%;max-width:100%}.title-font{padding-inline-end:var(--calcite-spacing-lg);padding-top:var(--calcite-spacing-lg)}.button-width{width:100%;margin-top:var(--calcite-spacing-lg)}}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-sm) var(--calcite-spacing-md)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}calcite-card{width:450px;--calcite-card-border-color: transparent}@container (max-width: 1496px){calcite-card{width:calc(100% / 3 - .5rem)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}}@container (max-width: 1100px){calcite-card{width:calc(50% - .5rem)}#screenshots-subsection calcite-card{width:calc(50% - .5rem)}}@container (max-width: 550px){calcite-card{width:100%}#screenshots-subsection calcite-card{width:100%}}.max-height-300{max-height:300px}.display-none{display:none}.cursor-pointer{cursor:pointer}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{border:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:border-box;cursor:pointer;padding:var(--calcite-spacing-base)}calcite-card.is-mobile:hover img{cursor:default;-webkit-filter:brightness(100%);filter:brightness(100%);transition:all .1s ease}calcite-card{border:var(--calcite-spacing-base) solid transparent;box-sizing:border-box;padding:var(--calcite-spacing-base)}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}#screenshots-subsection .card-image{background-color:var(--calcite-color-surface-2)}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip;display:block}.margin-inline-unset{margin-inline:unset}.collapsible-div{overflow:hidden;transition:max-height .3s ease-in-out}.collapsible-div.expanded{max-height:100%}.back-color-override{--calcite-panel-background-color: var(--calcite-color-surface-3)}.back-color-override-1{background-color:var(--calcite-color-surface-2)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.line-height-xxl{line-height:var(--calcite-spacing-xxl)}.line-height-1{line-height:1.1}.font-1{font-size:var(--calcite-spacing-lg)}.font-color-1{color:var(--calcite-color-text-1)}.font-color-2{color:var(--calcite-color-text-2)}h1{font-weight:unset;margin:var(--calcite-spacing-none);padding:var(--calcite-spacing-none)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.accordion-bg{--calcite-accordion-background-color: var(--calcite-color-surface-2)}.table-cell{font-size:var(--calcite-spacing-lg);color:var(--calcite-color-text-2);margin:0}.table-cell p{margin:0}calcite-table-header{font-weight:var(--calcite-font-weight-medium);--calcite-internal-table-cell-font-size: var(--calcite-font-size-md)}.position-relative{position:relative}.background-color-2{background-color:var(--calcite-color-surface-3)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-3)}.border-none{border:none}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}calcite-shell{block-size:unset}.solution-detail-action{--calcite-color-focus: initial}a{color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:hover{background-size:100% 1px,100% 1px}a:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:active{color:var(--calcite-color-brand-press)}*[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.chip-status{--calcite-chip-icon-color: var(--calcite-color-brand);cursor:pointer}.chip-deployed{--calcite-chip-icon-color: var(--calcite-color-status-success)}.chip-deployed-warn{--calcite-chip-icon-color: var(--calcite-color-status-warning)}`,$=class extends k{constructor(){super(),this.readOnlyNotice="",this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showScreenshotsShowMore=!1,this._showYouMayAlsoLikeShowMore=!1,this.isMobile=!1,this._isScreenshotsRowExpanded=!1,this._isYouMayAlsoLikeRowExpanded=!1,this._screenshotsRowBaseHeight=340,this._showLoader=!1,this._templates=[],this._translations=I({name:"solution-details-panel",blocking:!0}),this._youMayAlsoLikeBaseHeight=340,this._allCards=[],this._configContextConsumer=f({context:L,subscribe:!0}),this._configureLearnMore="",this._customDeploymentMappings={},this._deployDialogRef=d(),this._deployingDialogRef=d(),this._isMobileContextConsumer=f({context:M,subscribe:!0,callback:e=>this.isMobile=e}),this._overviewAccordionItemElement=d(),this._privilegePopoverRef=d(),this._privileges=[],this._regexFsUrl="https?:\\/\\/.+FeatureServer\\b",this._regexID="\\b[0-9A-F]{32}\\b",this._releaseNotesAccordionItemElement=d(),this._relatedResourcesAccordionItemElement=d(),this._screenshotsAccordionItemElement=d(),this._screenshotsDialogRef=d(),this._screenshotsElement=d(),this._termsOfUseAccordionItemElement=d(),this._userOptions=[],this._youMayAlsoLikeAccordionItemElement=d(),this._youMayAlsoLikeElement=d(),this._signInParamValue=null,this._deploymentStartTime=null,this._pendingDeployedSolutionId=null,this._cancellationStartTime=null,this._deployToCancelDuration=0,this.templatesFetched=v(),this.itemPropertiesFetched=v(),this.sortTypeChanged=v(),this.tokenRefreshed=v(),this._handleDeployCancelled=()=>{this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]})},this._handleDeploySuccess=e=>{let i=b(this._deploymentStartTime);this._deploymentStartTime=null,this._pendingDeployedSolutionId=e?.detail||null,this._deployingDialogRef.value&&(this._deployingDialogRef.value.isWaitingForCard=!0),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Success",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""],metrics:[i]})},this._handleDeployedCardReady=async e=>{!this._pendingDeployedSolutionId||e.detail?.card?.id!==this._pendingDeployedSolutionId||(this._pendingDeployedSolutionId=null,this._closeDialogs(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),window.dispatchEvent(new CustomEvent("displayDeployedCard",{detail:e.detail})))},this._handleDeploymentFallback=e=>{!this._pendingDeployedSolutionId||e.detail?.solutionId!==this._pendingDeployedSolutionId||(this._pendingDeployedSolutionId=null,console.warn("Deployment completed but unable to navigate to deployed card - closing dialogs"),this._closeDialogs(),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:"deployments"})))},this._handleDeploymentProcessCancelled=()=>{this._cancellationStartTime=Date.now(),this._deployToCancelDuration=b(this._deploymentStartTime),this._deploymentStartTime=null},this._handleDeployFailed=e=>{if(this._pendingDeployedSolutionId=null,this._cancellationStartTime!==null){this._closeDialogs();return}let i=b(this._deploymentStartTime);this._deploymentStartTime=null;let t=A(e.detail?.error),l=t.length>200?t.slice(-200):t;console.error("Deployment failed:",e.detail?.error),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Failure",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",l],metrics:[i]}),this._closeDialogs(!0)},this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"allCardsFetched",this._allCardsFetched),this.listenOn(window,"deployAppTabSelected",this._handleDeployAppTabSelected),this.listenOn(window,"deployedCardReady",this._handleDeployedCardReady),this.listenOn(window,"deploymentCompletedWithoutNav",this._handleDeploymentFallback)}static{this.properties={card:0,readOnlyNotice:1,_deployedTooltipContent:16,_isDeployDisabled:16,_isLoaded:16,_itemFetched:16,_showScreenshotsShowMore:16,_showYouMayAlsoLikeShowMore:16,isMobile:16,_isScreenshotsRowExpanded:16,_isYouMayAlsoLikeRowExpanded:16,_itemProperties:16,_missingPrivilegeMessages:16,_screenshotsRowBaseHeight:16,_showLoader:16,_templates:16,_translations:16,_youMayAlsoLikeBaseHeight:16}}static{this.styles=z}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async connectedCallback(){super.connectedCallback(),this.listenOn(window,"calciteTabChange",this._cleanupPanel)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}willUpdate(e){e.has("card")&&(this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._showLoader=!1,this._signInParamValue==="deploy"&&(this._showLoader=!0,this._signInParamValue=null))}loaded(){this._signInParamValue===null&&this._configContextConsumer.value?.authentication?.SignInParam&&(this._signInParamValue=this._configContextConsumer.value.authentication.SignInParam),this._resizeObserver=new ResizeObserver(async()=>{this._onResize()}),this._screenshotsElement.value&&this._resizeObserver.observe(this._screenshotsElement.value)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}render(){let e="padding-bottom-1-5",i=this._getRelatedResources(),t=this._getYouMayAlsoLikeCards();return a`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="margin-top-875 padding-1-5 back-color-override-1 margin-bottom-1-5" id=solution-details-row>${this._getSolutionRow()}</div><div class=${p(e)}>${this._getScreenshotsRow()}</div><div class=${p(e)}>${this._getOverviewRow()}</div><div class=${p(e)}>${this._getReleaseNotesRow()}</div>${i.length>0?a`<div class=${p(e)}>${this._getRelatedResourcesRow(i)}</div>`:""}${t.length>0?a`<div class=${p(e)}>${this._getYouMayAlsoLikeRow(t)}</div>`:""}<div class=${p(e)}>${this._getTermsOfUseRow()}</div>${this.isMobile?"":a`<solution-deploy-dialog .card=${this.card} @deployCancelled=${this._handleDeployCancelled} @deployFailed=${this._handleDeployFailed} @deployProgressEnd=${this._handleDeploySuccess} @deployProgressStart=${this._deployProgressStart} @deployProgressUpdated=${this._deployProgessUpdated} id=solutionDeployDialog .userOptions=${this._userOptions} ${h(this._deployDialogRef)}></solution-deploy-dialog>`}<solution-snapshot-gallery .card=${this.card} id=solutionSnapshotGallery .itemProperties=${this._itemProperties} ${h(this._screenshotsDialogRef)}></solution-snapshot-gallery><solution-deploying-dialog .card=${this.card} @deploymentProcessCancelled=${this._handleDeploymentProcessCancelled} ${h(this._deployingDialogRef)}></solution-deploying-dialog></calcite-panel></calcite-shell>`}updated(){setTimeout(()=>{let e=this._getYouMayAlsoLikeCards(),i=340;for(let t=0;t<e.length;t++){let l=this.el.shadowRoot?.getElementById(`you-may-also-like-${t}`),s=l?.offsetHeight?l.offsetHeight+40:0;s>i&&(i=s)}this._youMayAlsoLikeBaseHeight=i,this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2},100)}_checkUrlParametersForAutoDeployment(){if(this._signInParamValue==="deploy"){let e=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);this._configContextConsumer.value?.authentication?.IsSignedIn&&this.card&&this._deployDialogRef.value&&!e&&!y(this._configContextConsumer.value)&&(this._signInParamValue=null,this._openDeploy())}}_getSolutionRow(){let e=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400"),i=this._missingPrivilegeMessages?.leadingMessages||[],t=i.length>0,l=this._missingPrivilegeMessages?.bulletedMessages||[],s=l.length>0,o=this._missingPrivilegeMessages?.trailingMessages||[],r=o.length>0;return a`<div class="display-flex flex-direction-row width-full"><div class="padding-end-1-75 image-width"><img alt=${this.card?.title??m} src=${e??m}></div><div class="display-flex flex-direction-row flex-1">${this._getTextSection(t,s,r,i,l,o)}${this._getButtons()}</div></div>`}_getTextSection(e,i,t,l,s,o){return a`<div class="display-flex flex-direction-column padding-end-1 flex-1"><div class="display-flex flex-direction-row align-items-baseline"><h1 class="padding-top-xs title-font margin-top-0 margin-bottom-1-5 line-height-1" tabindex=0>${this.card?.title}</h1>${this.card?.categories?.some(r=>r.includes("New Release"))&&a`<calcite-chip class="margin-bottom-1-5 margin-sides-1" kind=brand .label=${this._translations.newChip} scale=m icon=star>${this._translations.newChip}</calcite-chip>`||""}${this._renderChips(this.card?.chips||[])}</div><div class="font-1 padding-end-1 line-height-xxl" tabindex=0>${this.card?.snippet}</div>${this.isMobile?"":y(this._configContextConsumer.value)?a`<div class="display-flex flex-direction-row padding-top-1">${this._getReadOnlyNotice()}</div>`:e||i||t?a`<div class="display-flex flex-direction-row padding-top-1">${this._getMissingPrivilegesNotice(l,s,o)}</div>`:""}</div>`}_renderChips(e){let i=e.filter(s=>s==="deployed"||s==="deployedOlderVersion"),t=e.filter(s=>s!=="deployed"&&s!=="deployedOlderVersion"),l=[];if(t.forEach(s=>{let o="margin-bottom-1-5 margin-sides-1 chip-status",r=`solution-details-card-chip-${s}`,c=s==="new"?"star":"mega-phone",n=s==="new"?this._translations.newChip:this._translations.updatedChip;l.push(a`<calcite-chip class=${p(o)} .icon=${c} id=${r??m} .label=${n} .value=${n} scale=s></calcite-chip><calcite-tooltip .referenceElement=${r}><span>${n}</span></calcite-tooltip>`)}),i.length>0){let s="margin-bottom-1-5 margin-sides-1 chip-status";t.length>0?s=i[0]==="deployedOlderVersion"?"chip-deployed-warn":"chip-deployed":s+=i[0]==="deployedOlderVersion"?" chip-deployed-warn":" chip-deployed",l.push(a`<calcite-chip class=${p(s)} .icon=${i[0]==="deployedOlderVersion"?"recent":"check-circle"} id=solution-details-card-chip-deployed .label=${this._translations.deployedChip} .value=${this._translations.deployedChip} scale=s></calcite-chip><calcite-tooltip placement=bottom reference-element=solution-details-card-chip-deployed @calciteTooltipBeforeOpen=${async()=>{let o={q:`${this.card?.deployCommonId} and owner:${this._configContextConsumer.value?.userSession?.username}`,authentication:this._configContextConsumer.value?.userSession,pagingParam:{start:1,num:100}},r=await P(o);this._deployedTooltipContent=a`<solutions-deployed-list .results=${r} has-links .listTitle=${i[0]==="deployedOlderVersion"?this._translations.deployedPreviousTitle:this._translations.deployedTitle}></solutions-deployed-list>`}} @calciteTooltipBeforeClose=${()=>{}}>${this._deployedTooltipContent}</calcite-tooltip>`)}return l}_getButtons(){let e=this._itemProperties?.demoURL||"",i=y(this._configContextConsumer.value);return a`<div class="display-flex flex-direction-column button-width">${!this.isMobile&&a`<calcite-button class="padding-bottom-1 solution-detail-action" .disabled=${this._isDeployDisabled||i} icon-flip-rtl=end @click=${()=>this._checkPermissionsBeforeDeploy()} scale=m width=full>${this._showLoader?a`<calcite-loader inline label></calcite-loader>`:this._translations.deployButton}</calcite-button>`||""}${!this._configContextConsumer.value?.isEnterprise&&e&&a`<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleWatchDemoClick(e)} scale=m width=full>${this._translations.watchDemo}</calcite-button>`||""}<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleLearnMoreClick()} scale=m width=full>${this._translations.openHelp}</calcite-button>${!this._configContextConsumer.value?.isEnterprise&&a`<solution-social-share button-appearance=outline-fill class="padding-bottom-1" share-button-kind=neutral .shareButtonText=${this._translations.share} share-button-scale=m .solutionId=${this.card?.deployCommonId||""} .solutionTitle=${this.card?.title||""} .solutionVersion=${this.card?.deployVersion||""}></solution-social-share>`||""}</div>`}_getReadOnlyNotice(){return a`<calcite-notice class="margin-inline-unset" icon=exclamation-mark-triangle kind=warning open scale=s><div slot=message .innerHTML=${this.readOnlyNotice??""}></div></calcite-notice>`}_getMissingPrivilegesNotice(e,i,t){let l="solutions-missing-privileges-notice",s=this._translations.missingPrivilegesPopup.missingLicensingOrPrivileges,o=i.length>0?"":"display-none",r=i.length>0?"padding-top-sm":"";return a`<div><calcite-notice class="margin-inline-unset" kind=info open><div slot=message>${`${s}`}</div><calcite-action icon=information id=${l} slot=actions-end .text=${s}></calcite-action></calcite-notice><calcite-popover closable label overlay-positioning=fixed placement=bottom reference-element=solutions-missing-privileges-notice ${h(this._privilegePopoverRef)}><div class="padding-1 display-flex flex-direction-column">${this._getSpanMessages(e,"padding-bottom-1")}<span class=${`padding-bottom-1-2 ${o}`}>${this._translations.missingPrivilegesPopup.missingPrivilegesListHeading}</span>${this._getBulletedMessages(i)}${this._getSpanMessages(t,r)}</div></calcite-popover></div>`}_getSpanMessages(e,i){return e.length>0?e.map(t=>a`<span class=${p(i)}>${t}</span>`):""}_getBulletedMessages(e){return e.length>0?a`<ul>${e.map(i=>a`<li>${i}</li>`)}</ul>`:""}_getScreenshotsRow(){let e=this._isScreenshotsRowExpanded?this._translations.showLess:this._translations.showMore,i=this._isScreenshotsRowExpanded?"arrow-up":"arrow-down",t=this._showScreenshotsShowMore?"":"display-none";return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._screenshotsAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionOverview}</div><calcite-panel><div class="display-flex flex-direction-column back-color-override-1"><div class="collapsible-div max-height-300" id=screenshots-subsection ${h(this._screenshotsElement)}>${this._getScreenshots()}</div><calcite-fab appearance=outline-fill class=${`align-self-center ${t}`} .icon=${i} kind=neutral @click=${()=>{this._screenshotsElement.value?.classList.toggle("expanded"),this._isScreenshotsRowExpanded=this._screenshotsElement.value.classList.contains("expanded")}} .text=${e} text-enabled></calcite-fab></div></calcite-panel></calcite-accordion-item></calcite-accordion>`}_getScreenshots(){let e=this._itemProperties?.preview.filter(s=>s.format==="image")||[],i=this._configContextConsumer.value,t=this._itemFetched?"":"display-none",l=this._itemFetched?"display-none":"";return a`<calcite-loader class=${p(l)} label></calcite-loader><calcite-card-group class=${`card-group ${t}`} .label=${this._translations.solutionOverview}>${e.reduce((s,o)=>{let r=w(this.card?.id||"",o.name,i.authentication),c;return i.agoBasedEnterpriseSolutionsGroupId&&i.isEnterprise&&(c=w(this.card?.id||"",o.name,void 0,i.agolPortalUrl)),this.card?.id?s.push(a`<calcite-card class=${`${this.isMobile?"is-mobile":"cursor-pointer not-mobile"}`} .label=${o.alt} @click=${()=>this._openScreenshotGallery(o)} @keydown=${n=>O(n,()=>this._openScreenshotGallery(o))}><div class="card-image-wrap" slot=thumbnail><img alt=${o.alt??m} class="thumbnail card-image" slot=thumbnail src=${(c||r)??m}>${!this.isMobile&&a`<div class="hover-text">${this._translations.openInGallery}</div>`||""}</div></calcite-card>`):s.push(""),s},[])}</calcite-card-group>`}_openScreenshotGallery(e){if(!this.isMobile){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Screenshot Gallery",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]});let i=this._screenshotsDialogRef.value;i&&(i.screenshot=e,i.open=!0)}}_getOverviewRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._overviewAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionDetails}</div>${this._getDescriptionRow()}${this._getInformationProductsRow()}</calcite-accordion-item></calcite-accordion>`}_getDescriptionRow(){return a`<div class="display-flex flex-direction-column"><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" tabindex=0>${this.card?.snippet}</div><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" .innerHTML=${this.card?.description??""} tabindex=0></div></div>`}_getInformationProductsRow(){return a`<div class="display-flex flex-direction-column font-1 line-height-xxl font-color-2"><span tabindex=0>${this.card?.title?this._translations.informationProductsSubText.replace("{{solutionTitle}}",this.card.title):""}</span><calcite-table bordered caption class="padding-top-1">${this._getInformationTableHeaderRow()}${this._getInformationTableRows()}</calcite-table><p tabindex=0>${this._translations.informationProductsFooterText}</p></div>`}_getInformationTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.solutionItem}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header><calcite-table-header .heading=${this._translations.minimumUserType}></calcite-table-header></calcite-table-row>`}_getInformationTableRows(){return(this._itemProperties?.infoProducts||[]).map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.item)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.description)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.userType)??""}></p></calcite-table-cell></calcite-table-row>`)}_getReleaseNotesRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._releaseNotesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.releaseNotes}</div><div class="display-flex flex-direction-column"><calcite-table bordered caption>${this._getReleaseNotesTableHeaderRow()}${this._getReleaseNotesTableRows()}</calcite-table></div></calcite-accordion-item></calcite-accordion>`}_getReleaseNotesTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.version}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header></calcite-table-row>`}_getReleaseNotesTableRows(){return(this._itemProperties?.releaseNotes||[])?.map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.version)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${u(e.description)??""}></p></calcite-table-cell></calcite-table-row>`)}_getRelatedResourcesRow(e){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._relatedResourcesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.relatedResources}</div><div class="display-flex flex-direction-row">${e.map(()=>{a`<solution-resource-card></solution-resource-card>`})}</div></calcite-accordion-item></calcite-accordion>`}_getRelatedResources(){return[]}_getYouMayAlsoLikeRow(e){let i=this._showYouMayAlsoLikeShowMore?"":"display-none",t=this._isYouMayAlsoLikeRowExpanded?this._translations.showLess:this._translations.showMore,l=this._isYouMayAlsoLikeRowExpanded?"arrow-up":"arrow-down",s=this._isYouMayAlsoLikeRowExpanded?"":{height:`${this._youMayAlsoLikeBaseHeight}px`};return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._youMayAlsoLikeAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.youMayAlsoLike}</div><div class="display-flex flex-direction-column"><div class="collapsible-div" id=you-may-also-like-subsection style=${S(s)} ${h(this._youMayAlsoLikeElement)}><div class="display-flex flex-direction-row"><calcite-card-group class="card-group" .label=${this._translations.youMayAlsoLike}>${e.map((o,r)=>a`<solution-details-card .id=${`you-may-also-like-${r}`} .card=${o} class="padding-2px" source=you-may-also-like .referrerSolutionId=${this.card?.deployCommonId||""} .referrerSolutionTitle=${this.card?.title||""} .referrerSolutionVersion=${this.card?.deployVersion||""}></solution-details-card>`)}</calcite-card-group></div></div><calcite-fab appearance=outline-fill class=${`align-self-center ${i}`} .icon=${l} kind=inverse @click=${()=>{this._youMayAlsoLikeElement.value?.classList.toggle("expanded"),this._isYouMayAlsoLikeRowExpanded=this._youMayAlsoLikeElement.value.classList.contains("expanded")}} .text=${t} text-enabled></calcite-fab></div></calcite-accordion-item></calcite-accordion>`}_getYouMayAlsoLikeCards(){let e=this._itemProperties?.relatedSolutions||[];return this._allCards.filter(i=>e.indexOf(i.deployCommonId)>-1)}_getTermsOfUseRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._termsOfUseAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.termsOfUse}</div><div class="font-color-2" .innerHTML=${(this.card?.licenseInfo||"")??""} tabindex=0></div></calcite-accordion-item></calcite-accordion>`}_openDeploy(){if(this._configContextConsumer.value.authentication.IsSignedIn){let e=this._deployDialogRef.value;e&&(this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Opened",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),e.userOptions=this._userOptions,e.open=!0)}else this._configContextConsumer.value.authentication.signIn("deploy")}_openUrl(e){window.open(e,"_blank")}_handleWatchDemoClick(e){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Watch Demo",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(e)}_handleLearnMoreClick(){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(this.card?.learnMoreUrl||"")}async _detailsCardSelected(e){this.card=e.detail,this.el.scrollIntoView(!0),this._onResize(),this._missingPrivilegeMessages=void 0,await this._getItemData(),this._expandAccordions()}_expandAccordions(){this._overviewAccordionItemElement.value&&(this._overviewAccordionItemElement.value.expanded=!0),this._releaseNotesAccordionItemElement.value&&(this._releaseNotesAccordionItemElement.value.expanded=!0),this._relatedResourcesAccordionItemElement.value&&(this._relatedResourcesAccordionItemElement.value.expanded=!0),this._screenshotsAccordionItemElement.value&&(this._screenshotsAccordionItemElement.value.expanded=!0),this._termsOfUseAccordionItemElement.value&&(this._termsOfUseAccordionItemElement.value.expanded=!0),this._youMayAlsoLikeAccordionItemElement.value&&(this._youMayAlsoLikeAccordionItemElement.value.expanded=!0)}async _getItemData(){this._itemFetched=!1;let e=this._configContextConsumer.value,i=e?.agoBasedEnterpriseSolutionsGroupId&&e?.isEnterprise?e.anonAgolSession:e?.userSession,t=await E(this.card.id,i),l=await R(this.card.id,i);this._itemFetched=!0,this._itemProperties=l.properties,this.itemPropertiesFetched.emit(this._itemProperties);let s=F(t,this.card.typeKeywords,e?.authentication);this._privileges=i.username?s:[],this._userPrivileges=e?.authentication?e.authentication.PortalUserEnrichedPrivileges:[];let o=this._privileges.filter(c=>!this._userPrivileges.includes(c));this._missingPrivilegeMessages=U(this._translations,o),this._isDeployDisabled=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);let r=t.params?await this.formatParams(t.params):[];this._userOptions=r,this._templates=t.templates,this.templatesFetched.emit(t.templates),this._checkUrlParametersForAutoDeployment(),this._isLoaded=!0,this._showLoader&&(this._showLoader=!1,this._isDeployDisabled||this._openDeploy())}formatParams(e){let i=this._configContextConsumer.value.userSession,t=[],l=e?Object.keys(e):[],s={id:"",props:[],accordionDisplay:!1};if(l.length>0){let o=[];return l.forEach(r=>{let c=e[r];c.valueType&&c.valueType.toLowerCase()==="itemid"&&o.push(this._findExistingItem(r,"Feature Service",i.username||""))}),Promise.all(o).then(r=>{let c={};return r.forEach(n=>{if(n.query&&n.results&&n.results.length>0){let N=n.query.split(" ")[0].replace("typekeywords:source-","");c[N]={resultId:n.results[0].id,response:n.results[0]}}}),l.forEach(n=>{if(n==="serviceLearnMore"){this._configureLearnMore=e[n],alert(this._configureLearnMore),delete e[n];return}e[n].enterpriseIDMapping&&(this._customDeploymentMappings[n]=e[n].enterpriseIDMapping),s.id=n,c[n]&&(e[n].existingItemId=c[n].resultId,this.updateUserProp(e[n],c[n].response)),this.updateOption(e[n],s,n)}),t.push(s),Promise.resolve(t)}).catch(()=>Promise.resolve([]))}else return Promise.resolve([])}_findExistingItem(e,i,t){let l=this._configContextConsumer.value.userSession;return H(`typekeywords:source-${e} type:${i} owner:${t}`,l)}updateUserProp(e,i){let t=e.itemType?.toLowerCase()==="feature service",l=new RegExp(t?this._regexFsUrl:e.itemType,"iu"),s=x(i,t?"url":"type","")||"",o=s!==""&&l.test(s);return e.responseValue=o?s:"",e.name=o&&_(i,"name")||"",e.title=o&&_(i,"title")||"",e.itemType=o?_(i,"type"):e.itemType,e.validId=o,e.itemUrl=V(i.id,this._configContextConsumer.value.authentication),o}updateOption(e,i,t){let l=e.default||"",s=typeof l,o=l.toString();this._setFeatureServiceProps(e);let r=this.getValidation(e,o);i.props.push({id:t,outType:s,prop:t,itemType:e.itemType||"",responseValue:e.responseValue||"",label:e.label||"",choices:e.choices||[],valueType:e.valueType.toLowerCase(),attributes:e.attributes||{},value:e.existingItemId&&e.valueType.toLowerCase()==="itemid"?e.existingItemId:o,default:o,srSearchText:o,autoSelect:o!=="",...r,loading:!1,validId:!0,tooltip:e.tooltip||"",name:e.name||"",title:e.title||"",itemUrl:e.itemUrl||""})}_setFeatureServiceProps(e){e.valueType&&e.valueType.toLowerCase()==="itemid"&&T(e,"attributes.required","true")}getValidation(e,i){let t="",l=_(e,"validation.message")||"",s=!0;return _(e,"attributes.required")==="true"&&(t=x(e,"validation.expression","\\S{1,}"),s=new RegExp(t).test(i)),e.valueType&&e.valueType.toLowerCase()==="itemid"&&(t=this._regexID,l=this._translations.configure.invalidID),{valid:s,validation:{expression:t,message:l}}}_allCardsFetched(e){this._allCards=e.detail}_onResize(){this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2}_cleanupPanel(){this.el.scrollIntoView(!0),this._isScreenshotsRowExpanded=!1,this._showScreenshotsShowMore=!1,this._screenshotsElement.value?.classList.remove("expanded"),this._isYouMayAlsoLikeRowExpanded=!1,this._showYouMayAlsoLikeShowMore=!1,this._youMayAlsoLikeElement.value?.classList.remove("expanded"),this._privilegePopoverRef.value?.open&&(this._privilegePopoverRef.value.open=!1),this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showLoader=!1,this._expandAccordions()}_deployProgressStart(e){this._deploymentStartTime=Date.now(),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Started",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._deployingDialogRef.value&&(this._deployingDialogRef.value.open=!0,this._deployingDialogRef.value.abortController=e.detail),this._deployDialogRef.value&&this._deployDialogRef.value.classList.add("display-none")}_deployProgessUpdated(e){let i=e.detail;this._deployingDialogRef.value.deploymentProgress=i.progress}_closeDialogs(e=!1){if(this._cancellationStartTime!==null){let i=b(this._cancellationStartTime);this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""],metrics:[this._deployToCancelDuration,i]}),this._cancellationStartTime=null,this._deployToCancelDuration=0}this._deployingDialogRef.value.close(),e?this._deployDialogRef.value.open=!0:this._deployDialogRef.value.close(),this._deployDialogRef.value.classList.remove("display-none")}_handleDeployAppTabSelected(e){e.detail==="details"&&this.sortTypeChanged.emit("")}_checkPermissionsBeforeDeploy(){y(this._configContextConsumer.value)||(this._isLoaded?this._openDeploy():this._configContextConsumer.value.authentication?.IsSignedIn?this._showLoader=!0:this._openDeploy())}};D("solution-details-panel",$);return $},b,c,e)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import b from"./7J2F4TFI.js";import"./BNRFT546.js";import"./WPGT2HLS.js";import a from"./EXC566PM.js";import"./2B4SGB3I.js";import"./I2NTSKBD.js";import"./3UKDJZ2D.js";import"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import"./2I5LGZNX.js";import"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,{c:o}])=>{return o},a,b)
2
+ import b from"./PUQBEN7F.js";import"./BNRFT546.js";import"./S6U6SXMD.js";import a from"./EXC566PM.js";import"./2B4SGB3I.js";import"./I2NTSKBD.js";import"./3UKDJZ2D.js";import"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import"./2I5LGZNX.js";import"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,{c:o}])=>{return o},a,b)