{"version":3,"sources":["node_modules/@arcgis/core/support/popupUtils.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport e from \"../PopupTemplate.js\";\nimport { isFieldEditable as t, isRasterPixelValueField as n, getDisplayFieldName as i, isFieldVisibleByDefault as o } from \"../layers/support/fieldUtils.js\";\nimport s from \"../popup/content/AttachmentsContent.js\";\nimport \"../popup/content/Content.js\";\nimport \"../popup/content/CustomContent.js\";\nimport \"../popup/content/ExpressionContent.js\";\nimport r from \"../popup/content/FieldsContent.js\";\nimport \"../popup/content/MediaContent.js\";\nimport \"../popup/content/RelationshipContent.js\";\nimport \"../popup/content/TextContent.js\";\nimport \"../popup/content/UtilityNetworkAssociationsContent.js\";\nimport l from \"../popup/FieldInfo.js\";\nimport a from \"../popup/support/FieldInfoFormat.js\";\nfunction p({\n displayField: t,\n editFieldsInfo: n,\n fields: i,\n objectIdField: o,\n title: s\n}, r) {\n if (!i) return null;\n const l = F({\n editFieldsInfo: n,\n fields: i,\n objectIdField: o\n }, r);\n if (!l.length) return null;\n const a = I({\n titleBase: s,\n fields: i,\n displayField: t\n }),\n p = j();\n return new e({\n title: a,\n content: p,\n fieldInfos: l\n });\n}\nfunction u(t) {\n const {\n fields: n,\n featureReduction: i,\n title: o\n } = t,\n s = i.fields;\n if (!s) return null;\n const r = g(s, n ?? []);\n if (!r.length) return null;\n const l = C();\n return new e({\n title: o,\n content: l,\n fieldInfos: r\n });\n}\nfunction c(e) {\n const {\n title: t,\n graphic: n\n } = e ?? {},\n {\n attributes: i,\n sourceLayer: o\n } = n ?? {},\n s = o && \"displayField\" in o ? o.displayField : null,\n r = s ? i?.[s] : null,\n l = n?.getObjectId()?.toString();\n return t || r || l || \"\";\n}\nconst d = (e, t) => t.visibleFieldNames ? t.visibleFieldNames.has(e.name) : o(e, t);\nfunction f({\n fields: e,\n ignoreFieldTypes: t,\n sortDisabled: n\n}) {\n const i = e;\n return t && (e = e.filter(e => !t.includes(e.type))), e === i && (e = e.slice()), !0 !== n && e.sort(m), e;\n}\nfunction m(e, t) {\n return \"oid\" === e.type ? -1 : \"oid\" === t.type ? 1 : v(e) ? -1 : v(t) ? 1 : (e.alias || e.name).toLocaleLowerCase().localeCompare((t.alias || t.name).toLocaleLowerCase());\n}\nfunction b(e, t) {\n return new r({\n fieldInfos: F(e, t).filter(e => e.visible)\n });\n}\nfunction F(e, n) {\n const i = n?.visibleFieldNames;\n return f({\n fields: e.fields ?? [],\n ignoreFieldTypes: n?.ignoreFieldTypes || S,\n sortDisabled: n?.sortDisabled\n }).map(n => new l({\n fieldName: n.name,\n isEditable: t(n, e),\n label: n.alias,\n format: y(n),\n visible: d(n, {\n ...e,\n visibleFieldNames: i\n })\n }));\n}\nfunction g(e, t) {\n return e.map(e => new l({\n fieldName: e.name,\n isEditable: !1,\n label: e.alias,\n format: w(e, t),\n visible: !0\n }));\n}\nfunction w(e, t) {\n const {\n onStatisticField: n,\n onStatisticExpression: i,\n statisticType: o\n } = e;\n if (n) {\n const e = t.find(e => n === e.name);\n if (e) return y(e);\n }\n return \"number\" === i?.returnType ? new a({\n digitSeparator: !0,\n places: 2\n }) : \"count\" === o ? new a({\n digitSeparator: !0,\n places: 0\n }) : void 0;\n}\nfunction y(e) {\n switch (e.type) {\n case \"small-integer\":\n case \"integer\":\n case \"single\":\n return new a({\n digitSeparator: !0,\n places: 0\n });\n case \"double\":\n return new a({\n digitSeparator: !0,\n places: 2\n });\n case \"string\":\n return n(e.name) ? new a({\n digitSeparator: !0,\n places: 0\n }) : void 0;\n default:\n return;\n }\n}\nfunction j() {\n return [new r(), new s()];\n}\nfunction C() {\n return [new r()];\n}\nfunction I(e) {\n const t = i(e),\n {\n titleBase: n\n } = e;\n return t ? `${n}: {${t.trim()}}` : n ?? \"\";\n}\nfunction v(e) {\n if (\"name\" === (e.name && e.name.toLowerCase())) return !0;\n const t = e.alias?.toLowerCase();\n return \"name\" === t;\n}\nconst S = [\"geometry\", \"blob\", \"raster\", \"guid\", \"xml\"];\nexport { F as createFieldInfos, b as createFieldsContent, p as createPopupTemplate, u as createPopupTemplateForFeatureReduction, c as getFeaturePopupTitle };"],"mappings":"gLAiBA,SAASA,EAAE,CACT,aAAcC,EACd,eAAgBC,EAChB,OAAQC,EACR,cAAeC,EACf,MAAOC,CACT,EAAGC,EAAG,CACJ,GAAI,CAACH,EAAG,OAAO,KACf,IAAMI,EAAIC,EAAE,CACV,eAAgBN,EAChB,OAAQC,EACR,cAAeC,CACjB,EAAGE,CAAC,EACJ,GAAI,CAACC,EAAE,OAAQ,OAAO,KACtB,IAAME,EAAIC,EAAE,CACR,UAAWL,EACX,OAAQF,EACR,aAAcF,CAChB,CAAC,EACDD,EAAIW,EAAE,EACR,OAAO,IAAIC,EAAE,CACX,MAAOH,EACP,QAAST,EACT,WAAYO,CACd,CAAC,CACH,CAkBA,SAASM,EAAE,EAAG,CACZ,GAAM,CACF,MAAOC,EACP,QAASC,CACX,EAAI,GAAK,CAAC,EACV,CACE,WAAYC,EACZ,YAAaC,CACf,EAAIF,GAAK,CAAC,EACVG,EAAID,GAAK,iBAAkBA,EAAIA,EAAE,aAAe,KAChDE,EAAID,EAAIF,IAAIE,CAAC,EAAI,KACjBE,EAAIL,GAAG,YAAY,GAAG,SAAS,EACjC,OAAOD,GAAKK,GAAKC,GAAK,EACxB,CACA,IAAMC,EAAI,CAAC,EAAGP,IAAMA,EAAE,kBAAoBA,EAAE,kBAAkB,IAAI,EAAE,IAAI,EAAIQ,EAAE,EAAGR,CAAC,EAClF,SAASS,EAAE,CACT,OAAQ,EACR,iBAAkBT,EAClB,aAAcC,CAChB,EAAG,CACD,IAAMC,EAAI,EACV,OAAOF,IAAM,EAAI,EAAE,OAAOU,GAAK,CAACV,EAAE,SAASU,EAAE,IAAI,CAAC,GAAI,IAAMR,IAAM,EAAI,EAAE,MAAM,GAAWD,IAAP,IAAY,EAAE,KAAKU,CAAC,EAAG,CAC3G,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AAE,MAAQ,EAAE,KAAK,YAAY,KAAzC,OAAoD,GAC9C,EAAE,OAAO,YAAY,IACxB,MACT,CACA,IAAMC,EAAI,CAAC,WAAY,OAAQ,SAAU,OAAQ,KAAK","names":["p","t","n","i","o","s","r","l","F","a","I","j","q","c","t","n","i","o","s","r","l","d","B","f","e","m","v","F","n","i","f","S","q","y","d","__spreadProps","__spreadValues","y","m","Ge","j","c","i","I","t","_","n","v","S"],"x_google_ignoreList":[0]}