/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
function h(r,e,{signal:t,edges:o}={}){let n,f=null,m=o!=null&&o.includes("leading"),s=o==null||o.includes("trailing"),i=()=>{f!==null&&(r.apply(n,f),n=void 0,f=null)},a=()=>{s&&i(),u()},p=null,l=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,a()},e)},c=()=>{p!==null&&(clearTimeout(p),p=null)},u=()=>{c(),n=void 0,f=null},b=()=>{i()},y=function(...er){if(t?.aborted)return;n=this,f=er;let tr=p==null;l(),m&&tr&&i()};return y.schedule=l,y.cancel=u,y.flush=b,t?.addEventListener("abort",u,{once:!0}),y}function or(r,e,{signal:t,edges:o=["leading","trailing"]}={}){let n=null,f=h(function(...s){n=Date.now(),r.apply(this,s)},e,{signal:t,edges:o}),m=function(...s){if(n==null&&(n=Date.now()),Date.now()-n>=e){n=Date.now(),r.apply(this,s),f.cancel(),f.schedule();return}f.apply(this,s)};return m.cancel=f.cancel,m.flush=f.flush,m}var T=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function j(r){return typeof T.Buffer<"u"&&T.Buffer.isBuffer(r)}function A(r){if(!r||typeof r!="object")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(r)==="[object Object]":!1}function w(r){return Object.getOwnPropertySymbols(r).filter(e=>Object.prototype.propertyIsEnumerable.call(r,e))}function O(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}var S="[object RegExp]",E="[object String]",W="[object Number]",N="[object Boolean]",B="[object Arguments]",C="[object Symbol]",I="[object Date]",R="[object Map]",U="[object Set]",z="[object Array]",P="[object Function]",D="[object ArrayBuffer]",d="[object Object]",F="[object Error]",v="[object DataView]",M="[object Uint8Array]",K="[object Uint8ClampedArray]",q="[object Uint16Array]",L="[object Uint32Array]",k="[object BigUint64Array]",J="[object Int8Array]",V="[object Int16Array]",Z="[object Int32Array]",_="[object BigInt64Array]",$="[object Float32Array]",G="[object Float64Array]";function H(r,e){return r===e||Number.isNaN(r)&&Number.isNaN(e)}function Q(r,e,t){return x(r,e,void 0,void 0,void 0,void 0,t)}function x(r,e,t,o,n,f,m){let s=m(r,e,t,o,n,f);if(s!==void 0)return s;if(typeof r==typeof e)switch(typeof r){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return r===e;case"number":return r===e||Object.is(r,e);case"function":return r===e;case"object":return g(r,e,f,m)}return g(r,e,f,m)}function g(r,e,t,o){if(Object.is(r,e))return!0;let n=O(r),f=O(e);if(n===B&&(n=d),f===B&&(f=d),n!==f)return!1;switch(n){case E:return r.toString()===e.toString();case W:{let i=r.valueOf(),a=e.valueOf();return H(i,a)}case N:case I:case C:return Object.is(r.valueOf(),e.valueOf());case S:return r.source===e.source&&r.flags===e.flags;case P:return r===e}t=t??new Map;let m=t.get(r),s=t.get(e);if(m!=null&&s!=null)return m===e;t.set(r,e),t.set(e,r);try{switch(n){case R:{if(r.size!==e.size)return!1;for(let[i,a]of r.entries())if(!e.has(i)||!x(a,e.get(i),i,r,e,t,o))return!1;return!0}case U:{if(r.size!==e.size)return!1;let i=Array.from(r.values()),a=Array.from(e.values());for(let p=0;p<i.length;p++){let l=i[p],c=a.findIndex(u=>x(l,u,void 0,r,e,t,o));if(c===-1)return!1;a.splice(c,1)}return!0}case z:case M:case K:case q:case L:case k:case J:case V:case Z:case _:case $:case G:{if(j(r)!==j(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!x(r[i],e[i],i,r,e,t,o))return!1;return!0}case D:return r.byteLength!==e.byteLength?!1:g(new Uint8Array(r),new Uint8Array(e),t,o);case v:return r.byteLength!==e.byteLength||r.byteOffset!==e.byteOffset?!1:g(new Uint8Array(r),new Uint8Array(e),t,o);case F:return r.name===e.name&&r.message===e.message;case d:{if(!(g(r.constructor,e.constructor,t,o)||A(r)&&A(e)))return!1;let a=[...Object.keys(r),...w(r)],p=[...Object.keys(e),...w(e)];if(a.length!==p.length)return!1;for(let l=0;l<a.length;l++){let c=a[l],u=r[c];if(!Object.hasOwn(e,c))return!1;let b=e[c];if(!x(u,b,c,r,e,t,o))return!1}return!0}default:return!1}}finally{t.delete(r),t.delete(e)}}function X(){}function nr(r,e){return Q(r,e,X)}function Y(r,e){if(e===void 0)return r.trimEnd();let t=r.length;switch(typeof e){case"string":{if(e.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;t>0&&r[t-1]===e;)t--;break}case"object":for(;t>0&&e.includes(r[t-1]);)t--}return r.substring(0,t)}function rr(r,e){if(e===void 0)return r.trimStart();let t=0;switch(typeof e){case"string":{for(;t<r.length&&r[t]===e;)t++;break}case"object":for(;t<r.length&&e.includes(r[t]);)t++}return r.substring(t)}function fr(r,e){return e===void 0?r.trim():rr(Y(r,e),e)}function zr(r){return r}function ir(r,e){let t={...r};for(let o=0;o<e.length;o++){let n=e[o];delete t[n]}return t}function Fr(r){return r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}export{h as a,zr as b,or as c,ir as d,nr as e,Fr as f,fr as g};
