/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{getDeepValue as t}from"./object.js";const e=/\{([^}]+)\}/g;function n(t){return t??""}function r(r,o){return o?r.replaceAll(e,"object"==typeof o?(e,r)=>n(t(r,o)):(t,e)=>n(o(e))):r}function o(e,n){return e.replaceAll(/\$\{([^\s:}]*)(?::([^\s:}]+))?\}/g,(e,r)=>{if(""===r)return"$";const o=t(r,n);return(o??"").toString()})}function u(t,e){return t.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,t=>e?.includes(t)?t:`\\${t}`)}function l(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}let c;function i(t){c??=new DOMParser;return c.parseFromString(t||"","text/html").body.innerText||""}function f(t,e){return new RegExp(`{${e}}`,"ig").test(t)}function g(t,...e){let n=t[0];for(let r=0;r<e.length;++r)n+=e[r]+t[r+1];return n}export{u as escapeRegExpString,l as numericHash,r as replace,g as safeToString,i as stripHTML,o as substitute,f as templateHasKey};
