// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 var t,n;t=this,n=function(){"use strict";function t(t){return Object.keys(Object(t))}var n=void 0!==Object.keys,e="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function i(){return e&&"symbol"==typeof Symbol.toStringTag}var o=Object.prototype.toString,r=Object.prototype.hasOwnProperty;function l(t,n){return null!=t&&r.call(t,n)}var c,u="function"==typeof Symbol?Symbol:void 0,a="function"==typeof u?u.toStringTag:"",f=i()?function(t){var n,e,i;if(null==t)return o.call(t);e=t[a],n=l(t,a);try{t[a]=void 0}catch(n){return o.call(t)}return i=o.call(t),n?t[a]=e:delete t[a],i}:function(t){return o.call(t)};function p(t){return"[object Arguments]"===f(t)}c=function(){return p(arguments)}();var s=c,m="function"==typeof Object.defineProperty?Object.defineProperty:null,g=Object.defineProperty;function x(t){return"number"==typeof t}function b(t){var n,e="";for(n=0;n0&&(n-=1),e=i.toExponential(n)):e=i.toPrecision(t.precision),t.alternate||(e=O.call(e,V,"$1e"),e=O.call(e,P,"e"),e=O.call(e,I,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return e=O.call(e,S,"e+0$1"),e=O.call(e,E,"e-0$1"),t.alternate&&(e=O.call(e,T,"$1."),e=O.call(e,k,"$1.e")),i>=0&&t.sign&&(e=t.sign+e),e=t.specifier===j.call(t.specifier)?j.call(e):_.call(e)}function F(t){var n,e="";for(n=0;n127)throw new Error("invalid character code. Value: "+i.arg);i.arg=N(r)?String(i.arg):$(r)}break;case"e":case"E":case"f":case"F":case"g":case"G":n||(i.precision=6),i.arg=A(i);break;default:throw new Error("invalid specifier: "+i.specifier)}i.maxWidth>=0&&i.arg.length>i.maxWidth&&(i.arg=i.arg.substring(0,i.maxWidth)),i.padZeros?i.arg=y(i.arg,i.width||i.precision,i.padRight):i.width&&(i.arg=(f=i.arg,p=i.width,s=i.padRight,m=void 0,(m=p-f.length)<0?f:f=s?f+F(m):F(m)+f)),l+=i.arg||"",c+=1}return l}var R=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function G(t){var n={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(n.precision="1"),n}function W(t){var n,e,i,o;for(e=[],o=0,i=R.exec(t);i;)(n=t.slice(o,R.lastIndex-i[0].length)).length&&e.push(n),e.push(G(i)),o=R.lastIndex,i=R.exec(t);return(n=t.slice(o)).length&&e.push(n),e}function X(t){var n,e;if("string"!=typeof t)throw new TypeError(X("invalid argument. First argument must be a string. Value: `%s`.",t));for(n=[W(t)],e=1;egt&&bt(t)}function dt(t){return it(t)&&yt(t)}function ht(t){return ct(t)&&yt(t.valueOf())}function vt(t){return dt(t)||ht(t)}J(vt,"isPrimitive",dt),J(vt,"isObject",ht);var wt=Object.prototype.propertyIsEnumerable,_t=!wt.call("beep","0");function jt(t,n){var e;return null!=t&&(!(e=wt.call(t,n))&&_t&&et(t)?!ft(n=+n)&&dt(n)&&n>=0&&n=0&&t.length<=4294967295&&l(t,"callee")&&!jt(t,"callee")},Et=Array.prototype.slice;function Tt(t){return null!==t&&"object"==typeof t}J(Tt,"isObjectLikeArray",function(t){if("function"!=typeof t)throw new TypeError(X("invalid argument. Must provide a function. Value: `%s`.",t));return function(n){var e,i;if(!Ot(n))return!1;if(0===(e=n.length))return!1;for(i=0;i=0&&r.length<=Pt||K(t)))throw new TypeError(X("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(i=t.length))return-1;if(3===arguments.length){if(!dt(e))throw new TypeError(X("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=i)return-1;o=e}else(o=i+e)<0&&(o=0)}else o=0;if(st(n)){for(;o0&&!l(t,"0"))for(u=0;u1){if(!fn(n))throw new TypeError(X("invalid argument. Options argument must be an object. Value: `%s`.",n));if(l(n,"duplicates")&&!Ft(f=n.duplicates))throw new TypeError(X("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",f))}if(i=(e=en(t)).length,c={},f)for(a=0;a