@stacksjs/slug 0.70.86 → 0.70.88
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.
- package/package.json +6 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -8
- package/dist/unique.d.ts +0 -20
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/slug",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.88",
|
|
5
5
|
"description": "The Stacks slug functionality.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"prepublishOnly": "bun run build"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@stacksjs/cli": "0.70.
|
|
55
|
-
"@stacksjs/database": "0.70.
|
|
54
|
+
"@stacksjs/cli": "0.70.88",
|
|
55
|
+
"@stacksjs/database": "0.70.88",
|
|
56
56
|
"better-dx": "^0.2.16",
|
|
57
|
-
"@stacksjs/path": "0.70.
|
|
58
|
-
"@stacksjs/strings": "0.70.
|
|
59
|
-
"@stacksjs/utils": "0.70.
|
|
57
|
+
"@stacksjs/path": "0.70.88",
|
|
58
|
+
"@stacksjs/strings": "0.70.88",
|
|
59
|
+
"@stacksjs/utils": "0.70.88"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false
|
|
62
62
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './unique';
|
package/dist/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{randomBytes as R1}from"crypto";import{db as a0}from"@stacksjs/database";var{defineProperty:G0,getOwnPropertyNames:W1,getOwnPropertyDescriptor:X1}=Object,Y1=Object.prototype.hasOwnProperty,L0=new WeakMap,$1=(Y)=>{var X=L0.get(Y),W;if(X)return X;if(X=G0({},"__esModule",{value:!0}),Y&&typeof Y==="object"||typeof Y==="function")W1(Y).map((V)=>!Y1.call(X,V)&&G0(X,V,{get:()=>Y[V],enumerable:!(W=X1(Y,V))||W.enumerable}));return L0.set(Y,X),X},D1=(Y,X)=>{for(var W in X)G0(Y,W,{get:X[W],enumerable:!0,configurable:!0,set:(V)=>X[W]=()=>V})},K1=(Y,X)=>()=>(Y&&(X=Y(Y=0)),X),S0={};D1(S0,{transcode:()=>A0,resolveObjectURL:()=>I0,kStringMaxLength:()=>p,kMaxLength:()=>k0,isUtf8:()=>y0,isAscii:()=>_0,default:()=>d0,createObjectURL:()=>$0,constants:()=>D0,btoa:()=>Y0,atob:()=>X0,File:()=>W0,Buffer:()=>m0,Blob:()=>J0});function I0(Y){throw Error("Not implemented")}function A0(Y,X,W){throw Error("Not implemented")}var B0,n,C0,M0,b0,x0,r=(Y,X)=>()=>(X||Y((X={exports:{}}).exports,X),X.exports),N1=(Y,X)=>{for(var W in X)n(Y,W,{get:X[W],enumerable:!0})},H0=(Y,X,W,V)=>{if(X&&typeof X=="object"||typeof X=="function")for(let D of M0(X))!x0.call(Y,D)&&D!==W&&n(Y,D,{get:()=>X[D],enumerable:!(V=C0(X,D))||V.enumerable});return Y},U1=(Y,X,W)=>(H0(Y,X,"default"),W&&H0(W,X,"default")),Q0=(Y,X,W)=>(W=Y!=null?B0(b0(Y)):{},H0(X||!Y||!Y.__esModule?n(W,"default",{value:Y,enumerable:!0}):W,Y)),P0,E0,h,Z0,q0,z0,p,k0=9007199254740991,J0,W0,X0,Y0,$0,_0=(Y)=>ArrayBuffer.isView(Y)?Y.every((X)=>X<128):Y.split("").every((X)=>X.charCodeAt(0)<128),y0=(Y)=>{throw Error("Not implemented")},D0,m0,d0,V1=K1(()=>{B0=Object.create,n=Object.defineProperty,C0=Object.getOwnPropertyDescriptor,M0=Object.getOwnPropertyNames,b0=Object.getPrototypeOf,x0=Object.prototype.hasOwnProperty,P0=r((Y)=>{Y.byteLength=R,Y.toByteArray=j,Y.fromByteArray=b;var X=[],W=[],V=typeof Uint8Array<"u"?Uint8Array:Array,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(v=0,N=D.length;v<N;++v)X[v]=D[v],W[D.charCodeAt(v)]=v;var v,N;W[45]=62,W[95]=63;function G(K){var O=K.length;if(O%4>0)throw Error("Invalid string. Length must be a multiple of 4");var L=K.indexOf("=");L===-1&&(L=O);var B=L===O?0:4-L%4;return[L,B]}function R(K){var O=G(K),L=O[0],B=O[1];return(L+B)*3/4-B}function U(K,O,L){return(O+L)*3/4-L}function j(K){var O,L=G(K),B=L[0],k=L[1],I=new V(U(K,B,k)),_=0,m=k>0?B-4:B,x;for(x=0;x<m;x+=4)O=W[K.charCodeAt(x)]<<18|W[K.charCodeAt(x+1)]<<12|W[K.charCodeAt(x+2)]<<6|W[K.charCodeAt(x+3)],I[_++]=O>>16&255,I[_++]=O>>8&255,I[_++]=O&255;return k===2&&(O=W[K.charCodeAt(x)]<<2|W[K.charCodeAt(x+1)]>>4,I[_++]=O&255),k===1&&(O=W[K.charCodeAt(x)]<<10|W[K.charCodeAt(x+1)]<<4|W[K.charCodeAt(x+2)]>>2,I[_++]=O>>8&255,I[_++]=O&255),I}function F(K){return X[K>>18&63]+X[K>>12&63]+X[K>>6&63]+X[K&63]}function S(K,O,L){for(var B,k=[],I=O;I<L;I+=3)B=(K[I]<<16&16711680)+(K[I+1]<<8&65280)+(K[I+2]&255),k.push(F(B));return k.join("")}function b(K){for(var O,L=K.length,B=L%3,k=[],I=16383,_=0,m=L-B;_<m;_+=I)k.push(S(K,_,_+I>m?m:_+I));return B===1?(O=K[L-1],k.push(X[O>>2]+X[O<<4&63]+"==")):B===2&&(O=(K[L-2]<<8)+K[L-1],k.push(X[O>>10]+X[O>>4&63]+X[O<<2&63]+"=")),k.join("")}}),E0=r((Y)=>{Y.read=function(X,W,V,D,v){var N,G,R=v*8-D-1,U=(1<<R)-1,j=U>>1,F=-7,S=V?v-1:0,b=V?-1:1,K=X[W+S];for(S+=b,N=K&(1<<-F)-1,K>>=-F,F+=R;F>0;N=N*256+X[W+S],S+=b,F-=8);for(G=N&(1<<-F)-1,N>>=-F,F+=D;F>0;G=G*256+X[W+S],S+=b,F-=8);if(N===0)N=1-j;else{if(N===U)return G?NaN:(K?-1:1)*(1/0);G=G+Math.pow(2,D),N=N-j}return(K?-1:1)*G*Math.pow(2,N-D)},Y.write=function(X,W,V,D,v,N){var G,R,U,j=N*8-v-1,F=(1<<j)-1,S=F>>1,b=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,K=D?0:N-1,O=D?1:-1,L=W<0||W===0&&1/W<0?1:0;for(W=Math.abs(W),isNaN(W)||W===1/0?(R=isNaN(W)?1:0,G=F):(G=Math.floor(Math.log(W)/Math.LN2),W*(U=Math.pow(2,-G))<1&&(G--,U*=2),G+S>=1?W+=b/U:W+=b*Math.pow(2,1-S),W*U>=2&&(G++,U/=2),G+S>=F?(R=0,G=F):G+S>=1?(R=(W*U-1)*Math.pow(2,v),G=G+S):(R=W*Math.pow(2,S-1)*Math.pow(2,v),G=0));v>=8;X[V+K]=R&255,K+=O,R/=256,v-=8);for(G=G<<v|R,j+=v;j>0;X[V+K]=G&255,K+=O,G/=256,j-=8);X[V+K-O]|=L*128}}),h=r((Y)=>{var X=P0(),W=E0(),V=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Y.Buffer=G,Y.SlowBuffer=k,Y.INSPECT_MAX_BYTES=50;var D=2147483647;Y.kMaxLength=D,G.TYPED_ARRAY_SUPPORT=v(),!G.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{let Q=new Uint8Array(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,Uint8Array.prototype),Object.setPrototypeOf(Q,Z),Q.foo()===42}catch{return!1}}Object.defineProperty(G.prototype,"parent",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.buffer}}),Object.defineProperty(G.prototype,"offset",{enumerable:!0,get:function(){if(G.isBuffer(this))return this.byteOffset}});function N(Q){if(Q>D)throw RangeError('The value "'+Q+'" is invalid for option "size"');let Z=new Uint8Array(Q);return Object.setPrototypeOf(Z,G.prototype),Z}function G(Q,Z,q){if(typeof Q=="number"){if(typeof Z=="string")throw TypeError('The "string" argument must be of type string. Received type number');return F(Q)}return R(Q,Z,q)}G.poolSize=8192;function R(Q,Z,q){if(typeof Q=="string")return S(Q,Z);if(ArrayBuffer.isView(Q))return K(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(d(Q,ArrayBuffer)||Q&&d(Q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(d(Q,SharedArrayBuffer)||Q&&d(Q.buffer,SharedArrayBuffer)))return O(Q,Z,q);if(typeof Q=="number")throw TypeError('The "value" argument must not be of type number. Received type number');let z=Q.valueOf&&Q.valueOf();if(z!=null&&z!==Q)return G.from(z,Z,q);let H=L(Q);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]=="function")return G.from(Q[Symbol.toPrimitive]("string"),Z,q);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}G.from=function(Q,Z,q){return R(Q,Z,q)},Object.setPrototypeOf(G.prototype,Uint8Array.prototype),Object.setPrototypeOf(G,Uint8Array);function U(Q){if(typeof Q!="number")throw TypeError('"size" argument must be of type number');if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function j(Q,Z,q){return U(Q),Q<=0?N(Q):Z!==void 0?typeof q=="string"?N(Q).fill(Z,q):N(Q).fill(Z):N(Q)}G.alloc=function(Q,Z,q){return j(Q,Z,q)};function F(Q){return U(Q),N(Q<0?0:B(Q)|0)}G.allocUnsafe=function(Q){return F(Q)},G.allocUnsafeSlow=function(Q){return F(Q)};function S(Q,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!G.isEncoding(Z))throw TypeError("Unknown encoding: "+Z);let q=I(Q,Z)|0,z=N(q),H=z.write(Q,Z);return H!==q&&(z=z.slice(0,H)),z}function b(Q){let Z=Q.length<0?0:B(Q.length)|0,q=N(Z);for(let z=0;z<Z;z+=1)q[z]=Q[z]&255;return q}function K(Q){if(d(Q,Uint8Array)){let Z=new Uint8Array(Q);return O(Z.buffer,Z.byteOffset,Z.byteLength)}return b(Q)}function O(Q,Z,q){if(Z<0||Q.byteLength<Z)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<Z+(q||0))throw RangeError('"length" is outside of buffer bounds');let z;return Z===void 0&&q===void 0?z=new Uint8Array(Q):q===void 0?z=new Uint8Array(Q,Z):z=new Uint8Array(Q,Z,q),Object.setPrototypeOf(z,G.prototype),z}function L(Q){if(G.isBuffer(Q)){let Z=B(Q.length)|0,q=N(Z);return q.length===0||Q.copy(q,0,0,Z),q}if(Q.length!==void 0)return typeof Q.length!="number"||t(Q.length)?N(0):b(Q);if(Q.type==="Buffer"&&Array.isArray(Q.data))return b(Q.data)}function B(Q){if(Q>=D)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return Q|0}function k(Q){return+Q!=Q&&(Q=0),G.alloc(+Q)}G.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==G.prototype},G.compare=function(Q,Z){if(d(Q,Uint8Array)&&(Q=G.from(Q,Q.offset,Q.byteLength)),d(Z,Uint8Array)&&(Z=G.from(Z,Z.offset,Z.byteLength)),!G.isBuffer(Q)||!G.isBuffer(Z))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===Z)return 0;let q=Q.length,z=Z.length;for(let H=0,J=Math.min(q,z);H<J;++H)if(Q[H]!==Z[H]){q=Q[H],z=Z[H];break}return q<z?-1:z<q?1:0},G.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},G.concat=function(Q,Z){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return G.alloc(0);let q;if(Z===void 0)for(Z=0,q=0;q<Q.length;++q)Z+=Q[q].length;let z=G.allocUnsafe(Z),H=0;for(q=0;q<Q.length;++q){let J=Q[q];if(d(J,Uint8Array))H+J.length>z.length?(G.isBuffer(J)||(J=G.from(J)),J.copy(z,H)):Uint8Array.prototype.set.call(z,J,H);else if(G.isBuffer(J))J.copy(z,H);else throw TypeError('"list" argument must be an Array of Buffers');H+=J.length}return z};function I(Q,Z){if(G.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||d(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let q=Q.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&q===0)return 0;let H=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":return i(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q*2;case"hex":return q>>>1;case"base64":return F0(Q).length;default:if(H)return z?-1:i(Q).length;Z=(""+Z).toLowerCase(),H=!0}}G.byteLength=I;function _(Q,Z,q){let z=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((q===void 0||q>this.length)&&(q=this.length),q<=0)||(q>>>=0,Z>>>=0,q<=Z))return"";for(Q||(Q="utf8");;)switch(Q){case"hex":return t0(this,Z,q);case"utf8":case"utf-8":return N0(this,Z,q);case"ascii":return e0(this,Z,q);case"latin1":case"binary":return i0(this,Z,q);case"base64":return o0(this,Z,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r0(this,Z,q);default:if(z)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),z=!0}}G.prototype._isBuffer=!0;function m(Q,Z,q){let z=Q[Z];Q[Z]=Q[q],Q[q]=z}G.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let Z=0;Z<Q;Z+=2)m(this,Z,Z+1);return this},G.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let Z=0;Z<Q;Z+=4)m(this,Z,Z+3),m(this,Z+1,Z+2);return this},G.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let Z=0;Z<Q;Z+=8)m(this,Z,Z+7),m(this,Z+1,Z+6),m(this,Z+2,Z+5),m(this,Z+3,Z+4);return this},G.prototype.toString=function(){let Q=this.length;return Q===0?"":arguments.length===0?N0(this,0,Q):_.apply(this,arguments)},G.prototype.toLocaleString=G.prototype.toString,G.prototype.equals=function(Q){if(!G.isBuffer(Q))throw TypeError("Argument must be a Buffer");return this===Q?!0:G.compare(this,Q)===0},G.prototype.inspect=function(){let Q="",Z=Y.INSPECT_MAX_BYTES;return Q=this.toString("hex",0,Z).replace(/(.{2})/g,"$1 ").trim(),this.length>Z&&(Q+=" ... "),"<Buffer "+Q+">"},V&&(G.prototype[V]=G.prototype.inspect),G.prototype.compare=function(Q,Z,q,z,H){if(d(Q,Uint8Array)&&(Q=G.from(Q,Q.offset,Q.byteLength)),!G.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(Z===void 0&&(Z=0),q===void 0&&(q=Q?Q.length:0),z===void 0&&(z=0),H===void 0&&(H=this.length),Z<0||q>Q.length||z<0||H>this.length)throw RangeError("out of range index");if(z>=H&&Z>=q)return 0;if(z>=H)return-1;if(Z>=q)return 1;if(Z>>>=0,q>>>=0,z>>>=0,H>>>=0,this===Q)return 0;let J=H-z,$=q-Z,T=Math.min(J,$),M=this.slice(z,H),E=Q.slice(Z,q);for(let w=0;w<T;++w)if(M[w]!==E[w]){J=M[w],$=E[w];break}return J<$?-1:$<J?1:0};function x(Q,Z,q,z,H){if(Q.length===0)return-1;if(typeof q=="string"?(z=q,q=0):q>2147483647?q=2147483647:q<-2147483648&&(q=-2147483648),q=+q,t(q)&&(q=H?0:Q.length-1),q<0&&(q=Q.length+q),q>=Q.length){if(H)return-1;q=Q.length-1}else if(q<0)if(H)q=0;else return-1;if(typeof Z=="string"&&(Z=G.from(Z,z)),G.isBuffer(Z))return Z.length===0?-1:K0(Q,Z,q,z,H);if(typeof Z=="number")return Z=Z&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(Q,Z,q):Uint8Array.prototype.lastIndexOf.call(Q,Z,q):K0(Q,[Z],q,z,H);throw TypeError("val must be string, number or Buffer")}function K0(Q,Z,q,z,H){let J=1,$=Q.length,T=Z.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(Q.length<2||Z.length<2)return-1;J=2,$/=2,T/=2,q/=2}function M(w,A){return J===1?w[A]:w.readUInt16BE(A*J)}let E;if(H){let w=-1;for(E=q;E<$;E++)if(M(Q,E)===M(Z,w===-1?0:E-w)){if(w===-1&&(w=E),E-w+1===T)return w*J}else w!==-1&&(E-=E-w),w=-1}else for(q+T>$&&(q=$-T),E=q;E>=0;E--){let w=!0;for(let A=0;A<T;A++)if(M(Q,E+A)!==M(Z,A)){w=!1;break}if(w)return E}return-1}G.prototype.includes=function(Q,Z,q){return this.indexOf(Q,Z,q)!==-1},G.prototype.indexOf=function(Q,Z,q){return x(this,Q,Z,q,!0)},G.prototype.lastIndexOf=function(Q,Z,q){return x(this,Q,Z,q,!1)};function p0(Q,Z,q,z){q=Number(q)||0;let H=Q.length-q;z?(z=Number(z),z>H&&(z=H)):z=H;let J=Z.length;z>J/2&&(z=J/2);let $;for($=0;$<z;++$){let T=parseInt(Z.substr($*2,2),16);if(t(T))return $;Q[q+$]=T}return $}function l0(Q,Z,q,z){return l(i(Z,Q.length-q),Q,q,z)}function h0(Q,Z,q,z){return l(z1(Z),Q,q,z)}function u0(Q,Z,q,z){return l(F0(Z),Q,q,z)}function s0(Q,Z,q,z){return l(G1(Z,Q.length-q),Q,q,z)}G.prototype.write=function(Q,Z,q,z){if(Z===void 0)z="utf8",q=this.length,Z=0;else if(q===void 0&&typeof Z=="string")z=Z,q=this.length,Z=0;else if(isFinite(Z))Z=Z>>>0,isFinite(q)?(q=q>>>0,z===void 0&&(z="utf8")):(z=q,q=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-Z;if((q===void 0||q>H)&&(q=H),Q.length>0&&(q<0||Z<0)||Z>this.length)throw RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let J=!1;for(;;)switch(z){case"hex":return p0(this,Q,Z,q);case"utf8":case"utf-8":return l0(this,Q,Z,q);case"ascii":case"latin1":case"binary":return h0(this,Q,Z,q);case"base64":return u0(this,Q,Z,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s0(this,Q,Z,q);default:if(J)throw TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),J=!0}},G.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function o0(Q,Z,q){return Z===0&&q===Q.length?X.fromByteArray(Q):X.fromByteArray(Q.slice(Z,q))}function N0(Q,Z,q){q=Math.min(Q.length,q);let z=[],H=Z;for(;H<q;){let J=Q[H],$=null,T=J>239?4:J>223?3:J>191?2:1;if(H+T<=q){let M,E,w,A;switch(T){case 1:J<128&&($=J);break;case 2:M=Q[H+1],(M&192)===128&&(A=(J&31)<<6|M&63,A>127&&($=A));break;case 3:M=Q[H+1],E=Q[H+2],(M&192)===128&&(E&192)===128&&(A=(J&15)<<12|(M&63)<<6|E&63,A>2047&&(A<55296||A>57343)&&($=A));break;case 4:M=Q[H+1],E=Q[H+2],w=Q[H+3],(M&192)===128&&(E&192)===128&&(w&192)===128&&(A=(J&15)<<18|(M&63)<<12|(E&63)<<6|w&63,A>65535&&A<1114112&&($=A))}}$===null?($=65533,T=1):$>65535&&($-=65536,z.push($>>>10&1023|55296),$=56320|$&1023),z.push($),H+=T}return n0(z)}var U0=4096;function n0(Q){let Z=Q.length;if(Z<=U0)return String.fromCharCode.apply(String,Q);let q="",z=0;for(;z<Z;)q+=String.fromCharCode.apply(String,Q.slice(z,z+=U0));return q}function e0(Q,Z,q){let z="";q=Math.min(Q.length,q);for(let H=Z;H<q;++H)z+=String.fromCharCode(Q[H]&127);return z}function i0(Q,Z,q){let z="";q=Math.min(Q.length,q);for(let H=Z;H<q;++H)z+=String.fromCharCode(Q[H]);return z}function t0(Q,Z,q){let z=Q.length;(!Z||Z<0)&&(Z=0),(!q||q<0||q>z)&&(q=z);let H="";for(let J=Z;J<q;++J)H+=H1[Q[J]];return H}function r0(Q,Z,q){let z=Q.slice(Z,q),H="";for(let J=0;J<z.length-1;J+=2)H+=String.fromCharCode(z[J]+z[J+1]*256);return H}G.prototype.slice=function(Q,Z){let q=this.length;Q=~~Q,Z=Z===void 0?q:~~Z,Q<0?(Q+=q,Q<0&&(Q=0)):Q>q&&(Q=q),Z<0?(Z+=q,Z<0&&(Z=0)):Z>q&&(Z=q),Z<Q&&(Z=Q);let z=this.subarray(Q,Z);return Object.setPrototypeOf(z,G.prototype),z};function C(Q,Z,q){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+Z>q)throw RangeError("Trying to access beyond buffer length")}G.prototype.readUintLE=G.prototype.readUIntLE=function(Q,Z,q){Q=Q>>>0,Z=Z>>>0,q||C(Q,Z,this.length);let z=this[Q],H=1,J=0;for(;++J<Z&&(H*=256);)z+=this[Q+J]*H;return z},G.prototype.readUintBE=G.prototype.readUIntBE=function(Q,Z,q){Q=Q>>>0,Z=Z>>>0,q||C(Q,Z,this.length);let z=this[Q+--Z],H=1;for(;Z>0&&(H*=256);)z+=this[Q+--Z]*H;return z},G.prototype.readUint8=G.prototype.readUInt8=function(Q,Z){return Q=Q>>>0,Z||C(Q,1,this.length),this[Q]},G.prototype.readUint16LE=G.prototype.readUInt16LE=function(Q,Z){return Q=Q>>>0,Z||C(Q,2,this.length),this[Q]|this[Q+1]<<8},G.prototype.readUint16BE=G.prototype.readUInt16BE=function(Q,Z){return Q=Q>>>0,Z||C(Q,2,this.length),this[Q]<<8|this[Q+1]},G.prototype.readUint32LE=G.prototype.readUInt32LE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},G.prototype.readUint32BE=G.prototype.readUInt32BE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},G.prototype.readBigUInt64LE=g(function(Q){Q=Q>>>0,c(Q,"offset");let Z=this[Q],q=this[Q+7];(Z===void 0||q===void 0)&&a(Q,this.length-8);let z=Z+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,H=this[++Q]+this[++Q]*256+this[++Q]*65536+q*16777216;return BigInt(z)+(BigInt(H)<<BigInt(32))}),G.prototype.readBigUInt64BE=g(function(Q){Q=Q>>>0,c(Q,"offset");let Z=this[Q],q=this[Q+7];(Z===void 0||q===void 0)&&a(Q,this.length-8);let z=Z*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],H=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+q;return(BigInt(z)<<BigInt(32))+BigInt(H)}),G.prototype.readIntLE=function(Q,Z,q){Q=Q>>>0,Z=Z>>>0,q||C(Q,Z,this.length);let z=this[Q],H=1,J=0;for(;++J<Z&&(H*=256);)z+=this[Q+J]*H;return H*=128,z>=H&&(z-=Math.pow(2,8*Z)),z},G.prototype.readIntBE=function(Q,Z,q){Q=Q>>>0,Z=Z>>>0,q||C(Q,Z,this.length);let z=Z,H=1,J=this[Q+--z];for(;z>0&&(H*=256);)J+=this[Q+--z]*H;return H*=128,J>=H&&(J-=Math.pow(2,8*Z)),J},G.prototype.readInt8=function(Q,Z){return Q=Q>>>0,Z||C(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},G.prototype.readInt16LE=function(Q,Z){Q=Q>>>0,Z||C(Q,2,this.length);let q=this[Q]|this[Q+1]<<8;return q&32768?q|4294901760:q},G.prototype.readInt16BE=function(Q,Z){Q=Q>>>0,Z||C(Q,2,this.length);let q=this[Q+1]|this[Q]<<8;return q&32768?q|4294901760:q},G.prototype.readInt32LE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},G.prototype.readInt32BE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},G.prototype.readBigInt64LE=g(function(Q){Q=Q>>>0,c(Q,"offset");let Z=this[Q],q=this[Q+7];(Z===void 0||q===void 0)&&a(Q,this.length-8);let z=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(q<<24);return(BigInt(z)<<BigInt(32))+BigInt(Z+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)}),G.prototype.readBigInt64BE=g(function(Q){Q=Q>>>0,c(Q,"offset");let Z=this[Q],q=this[Q+7];(Z===void 0||q===void 0)&&a(Q,this.length-8);let z=(Z<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(z)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+q)}),G.prototype.readFloatLE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),W.read(this,Q,!0,23,4)},G.prototype.readFloatBE=function(Q,Z){return Q=Q>>>0,Z||C(Q,4,this.length),W.read(this,Q,!1,23,4)},G.prototype.readDoubleLE=function(Q,Z){return Q=Q>>>0,Z||C(Q,8,this.length),W.read(this,Q,!0,52,8)},G.prototype.readDoubleBE=function(Q,Z){return Q=Q>>>0,Z||C(Q,8,this.length),W.read(this,Q,!1,52,8)};function y(Q,Z,q,z,H,J){if(!G.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if(Z>H||Z<J)throw RangeError('"value" argument is out of bounds');if(q+z>Q.length)throw RangeError("Index out of range")}G.prototype.writeUintLE=G.prototype.writeUIntLE=function(Q,Z,q,z){if(Q=+Q,Z=Z>>>0,q=q>>>0,!z){let $=Math.pow(2,8*q)-1;y(this,Q,Z,q,$,0)}let H=1,J=0;for(this[Z]=Q&255;++J<q&&(H*=256);)this[Z+J]=Q/H&255;return Z+q},G.prototype.writeUintBE=G.prototype.writeUIntBE=function(Q,Z,q,z){if(Q=+Q,Z=Z>>>0,q=q>>>0,!z){let $=Math.pow(2,8*q)-1;y(this,Q,Z,q,$,0)}let H=q-1,J=1;for(this[Z+H]=Q&255;--H>=0&&(J*=256);)this[Z+H]=Q/J&255;return Z+q},G.prototype.writeUint8=G.prototype.writeUInt8=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,1,255,0),this[Z]=Q&255,Z+1},G.prototype.writeUint16LE=G.prototype.writeUInt16LE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,2,65535,0),this[Z]=Q&255,this[Z+1]=Q>>>8,Z+2},G.prototype.writeUint16BE=G.prototype.writeUInt16BE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,2,65535,0),this[Z]=Q>>>8,this[Z+1]=Q&255,Z+2},G.prototype.writeUint32LE=G.prototype.writeUInt32LE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,4,4294967295,0),this[Z+3]=Q>>>24,this[Z+2]=Q>>>16,this[Z+1]=Q>>>8,this[Z]=Q&255,Z+4},G.prototype.writeUint32BE=G.prototype.writeUInt32BE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,4,4294967295,0),this[Z]=Q>>>24,this[Z+1]=Q>>>16,this[Z+2]=Q>>>8,this[Z+3]=Q&255,Z+4};function V0(Q,Z,q,z,H){w0(Z,z,H,Q,q,7);let J=Number(Z&BigInt(4294967295));Q[q++]=J,J=J>>8,Q[q++]=J,J=J>>8,Q[q++]=J,J=J>>8,Q[q++]=J;let $=Number(Z>>BigInt(32)&BigInt(4294967295));return Q[q++]=$,$=$>>8,Q[q++]=$,$=$>>8,Q[q++]=$,$=$>>8,Q[q++]=$,q}function O0(Q,Z,q,z,H){w0(Z,z,H,Q,q,7);let J=Number(Z&BigInt(4294967295));Q[q+7]=J,J=J>>8,Q[q+6]=J,J=J>>8,Q[q+5]=J,J=J>>8,Q[q+4]=J;let $=Number(Z>>BigInt(32)&BigInt(4294967295));return Q[q+3]=$,$=$>>8,Q[q+2]=$,$=$>>8,Q[q+1]=$,$=$>>8,Q[q]=$,q+8}G.prototype.writeBigUInt64LE=g(function(Q,Z=0){return V0(this,Q,Z,BigInt(0),BigInt("0xffffffffffffffff"))}),G.prototype.writeBigUInt64BE=g(function(Q,Z=0){return O0(this,Q,Z,BigInt(0),BigInt("0xffffffffffffffff"))}),G.prototype.writeIntLE=function(Q,Z,q,z){if(Q=+Q,Z=Z>>>0,!z){let T=Math.pow(2,8*q-1);y(this,Q,Z,q,T-1,-T)}let H=0,J=1,$=0;for(this[Z]=Q&255;++H<q&&(J*=256);)Q<0&&$===0&&this[Z+H-1]!==0&&($=1),this[Z+H]=(Q/J>>0)-$&255;return Z+q},G.prototype.writeIntBE=function(Q,Z,q,z){if(Q=+Q,Z=Z>>>0,!z){let T=Math.pow(2,8*q-1);y(this,Q,Z,q,T-1,-T)}let H=q-1,J=1,$=0;for(this[Z+H]=Q&255;--H>=0&&(J*=256);)Q<0&&$===0&&this[Z+H+1]!==0&&($=1),this[Z+H]=(Q/J>>0)-$&255;return Z+q},G.prototype.writeInt8=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,1,127,-128),Q<0&&(Q=255+Q+1),this[Z]=Q&255,Z+1},G.prototype.writeInt16LE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,2,32767,-32768),this[Z]=Q&255,this[Z+1]=Q>>>8,Z+2},G.prototype.writeInt16BE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,2,32767,-32768),this[Z]=Q>>>8,this[Z+1]=Q&255,Z+2},G.prototype.writeInt32LE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,4,2147483647,-2147483648),this[Z]=Q&255,this[Z+1]=Q>>>8,this[Z+2]=Q>>>16,this[Z+3]=Q>>>24,Z+4},G.prototype.writeInt32BE=function(Q,Z,q){return Q=+Q,Z=Z>>>0,q||y(this,Q,Z,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),this[Z]=Q>>>24,this[Z+1]=Q>>>16,this[Z+2]=Q>>>8,this[Z+3]=Q&255,Z+4},G.prototype.writeBigInt64LE=g(function(Q,Z=0){return V0(this,Q,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),G.prototype.writeBigInt64BE=g(function(Q,Z=0){return O0(this,Q,Z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function v0(Q,Z,q,z,H,J){if(q+z>Q.length)throw RangeError("Index out of range");if(q<0)throw RangeError("Index out of range")}function R0(Q,Z,q,z,H){return Z=+Z,q=q>>>0,H||v0(Q,Z,q,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000),W.write(Q,Z,q,z,23,4),q+4}G.prototype.writeFloatLE=function(Q,Z,q){return R0(this,Q,Z,!0,q)},G.prototype.writeFloatBE=function(Q,Z,q){return R0(this,Q,Z,!1,q)};function j0(Q,Z,q,z,H){return Z=+Z,q=q>>>0,H||v0(Q,Z,q,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000),W.write(Q,Z,q,z,52,8),q+8}G.prototype.writeDoubleLE=function(Q,Z,q){return j0(this,Q,Z,!0,q)},G.prototype.writeDoubleBE=function(Q,Z,q){return j0(this,Q,Z,!1,q)},G.prototype.copy=function(Q,Z,q,z){if(!G.isBuffer(Q))throw TypeError("argument should be a Buffer");if(q||(q=0),!z&&z!==0&&(z=this.length),Z>=Q.length&&(Z=Q.length),Z||(Z=0),z>0&&z<q&&(z=q),z===q||Q.length===0||this.length===0)return 0;if(Z<0)throw RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw RangeError("Index out of range");if(z<0)throw RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),Q.length-Z<z-q&&(z=Q.length-Z+q);let H=z-q;return this===Q&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Z,q,z):Uint8Array.prototype.set.call(Q,this.subarray(q,z),Z),H},G.prototype.fill=function(Q,Z,q,z){if(typeof Q=="string"){if(typeof Z=="string"?(z=Z,Z=0,q=this.length):typeof q=="string"&&(z=q,q=this.length),z!==void 0&&typeof z!="string")throw TypeError("encoding must be a string");if(typeof z=="string"&&!G.isEncoding(z))throw TypeError("Unknown encoding: "+z);if(Q.length===1){let J=Q.charCodeAt(0);(z==="utf8"&&J<128||z==="latin1")&&(Q=J)}}else typeof Q=="number"?Q=Q&255:typeof Q=="boolean"&&(Q=Number(Q));if(Z<0||this.length<Z||this.length<q)throw RangeError("Out of range index");if(q<=Z)return this;Z=Z>>>0,q=q===void 0?this.length:q>>>0,Q||(Q=0);let H;if(typeof Q=="number")for(H=Z;H<q;++H)this[H]=Q;else{let J=G.isBuffer(Q)?Q:G.from(Q,z),$=J.length;if($===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(H=0;H<q-Z;++H)this[H+Z]=J[H%$]}return this};var f={};function e(Q,Z,q){f[Q]=class extends q{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}e("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){return Q?`${Q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),e("ERR_INVALID_ARG_TYPE",function(Q,Z){return`The "${Q}" argument must be of type number. Received type ${typeof Z}`},TypeError),e("ERR_OUT_OF_RANGE",function(Q,Z,q){let z=`The value of "${Q}" is out of range.`,H=q;return Number.isInteger(q)&&Math.abs(q)>4294967296?H=T0(String(q)):typeof q=="bigint"&&(H=String(q),(q>BigInt(2)**BigInt(32)||q<-(BigInt(2)**BigInt(32)))&&(H=T0(H)),H+="n"),z+=` It must be ${Z}. Received ${H}`,z},RangeError);function T0(Q){let Z="",q=Q.length,z=Q[0]==="-"?1:0;for(;q>=z+4;q-=3)Z=`_${Q.slice(q-3,q)}${Z}`;return`${Q.slice(0,q)}${Z}`}function Q1(Q,Z,q){c(Z,"offset"),(Q[Z]===void 0||Q[Z+q]===void 0)&&a(Z,Q.length-(q+1))}function w0(Q,Z,q,z,H,J){if(Q>q||Q<Z){let $=typeof Z=="bigint"?"n":"",T;throw J>3?Z===0||Z===BigInt(0)?T=`>= 0${$} and < 2${$} ** ${(J+1)*8}${$}`:T=`>= -(2${$} ** ${(J+1)*8-1}${$}) and < 2 ** ${(J+1)*8-1}${$}`:T=`>= ${Z}${$} and <= ${q}${$}`,new f.ERR_OUT_OF_RANGE("value",T,Q)}Q1(z,H,J)}function c(Q,Z){if(typeof Q!="number")throw new f.ERR_INVALID_ARG_TYPE(Z,"number",Q)}function a(Q,Z,q){throw Math.floor(Q)!==Q?(c(Q,q),new f.ERR_OUT_OF_RANGE(q||"offset","an integer",Q)):Z<0?new f.ERR_BUFFER_OUT_OF_BOUNDS:new f.ERR_OUT_OF_RANGE(q||"offset",`>= ${q?1:0} and <= ${Z}`,Q)}var Z1=/[^+/0-9A-Za-z-_]/g;function q1(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(Z1,""),Q.length<2)return"";for(;Q.length%4!==0;)Q=Q+"=";return Q}function i(Q,Z){Z=Z||1/0;let q,z=Q.length,H=null,J=[];for(let $=0;$<z;++$){if(q=Q.charCodeAt($),q>55295&&q<57344){if(!H){if(q>56319){(Z-=3)>-1&&J.push(239,191,189);continue}else if($+1===z){(Z-=3)>-1&&J.push(239,191,189);continue}H=q;continue}if(q<56320){(Z-=3)>-1&&J.push(239,191,189),H=q;continue}q=(H-55296<<10|q-56320)+65536}else H&&(Z-=3)>-1&&J.push(239,191,189);if(H=null,q<128){if((Z-=1)<0)break;J.push(q)}else if(q<2048){if((Z-=2)<0)break;J.push(q>>6|192,q&63|128)}else if(q<65536){if((Z-=3)<0)break;J.push(q>>12|224,q>>6&63|128,q&63|128)}else if(q<1114112){if((Z-=4)<0)break;J.push(q>>18|240,q>>12&63|128,q>>6&63|128,q&63|128)}else throw Error("Invalid code point")}return J}function z1(Q){let Z=[];for(let q=0;q<Q.length;++q)Z.push(Q.charCodeAt(q)&255);return Z}function G1(Q,Z){let q,z,H,J=[];for(let $=0;$<Q.length&&!((Z-=2)<0);++$)q=Q.charCodeAt($),z=q>>8,H=q%256,J.push(H),J.push(z);return J}function F0(Q){return X.toByteArray(q1(Q))}function l(Q,Z,q,z){let H;for(H=0;H<z&&!(H+q>=Z.length||H>=Q.length);++H)Z[H+q]=Q[H];return H}function d(Q,Z){return Q instanceof Z||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===Z.name}function t(Q){return Q!==Q}var H1=function(){let Q="0123456789abcdef",Z=Array(256);for(let q=0;q<16;++q){let z=q*16;for(let H=0;H<16;++H)Z[z+H]=Q[q]+Q[H]}return Z}();function g(Q){return typeof BigInt>"u"?J1:Q}function J1(){throw Error("BigInt not supported")}}),Z0={},N1(Z0,{Blob:()=>J0,Buffer:()=>z0.Buffer,File:()=>W0,atob:()=>X0,btoa:()=>Y0,constants:()=>D0,createObjectURL:()=>$0,default:()=>q0.Buffer,isAscii:()=>_0,isUtf8:()=>y0,kMaxLength:()=>k0,kStringMaxLength:()=>p,resolveObjectURL:()=>I0,transcode:()=>A0}),U1(Z0,Q0(h())),q0=Q0(h()),z0=Q0(h()),p=4294967295,{Blob:J0,File:W0,atob:X0,btoa:Y0}=globalThis,{createObjectURL:$0}=URL,D0={__proto__:null,MAX_LENGTH:p,MAX_STRING_LENGTH:p,BYTES_PER_ELEMENT:1},m0=z0.Buffer,d0=q0.Buffer;/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */});function O1(Y,X){let W=Y.charCodeAt(X);if(Number.isNaN(W))throw RangeError(`Index ${X} out of range for string "${Y}"; please open an issue at https://github.com/Trott/slug/issues/new`);if(W<55296||W>57343)return[Y.charAt(X),X];if(W>=55296&&W<=56319){if(Y.length<=X+1)return[" ",X];let D=Y.charCodeAt(X+1);if(D<56320||D>57343)return[" ",X];return[Y.charAt(X)+Y.charAt(X+1),X+1]}if(X===0)return[" ",X];let V=Y.charCodeAt(X-1);if(V<55296||V>56319)return[" ",X];throw Error(`String "${Y}" reaches code believed to be unreachable; please open an issue at https://github.com/Trott/slug/issues/new`)}var u;if(typeof window<"u")if(window.btoa)u=function(Y){return btoa(unescape(encodeURIComponent(Y)))};else u=function(Y){let X=unescape(encodeURIComponent(`${Y}`)),W="",V=0,D,v=0,N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";while(!0){let G=N;if(!X.charAt(v|0)){if(G="=",!(v%1))break}if(W+=G.charAt(63&V>>8-v%1*8),G==="="&&!(v%1))break;if(D=X.charCodeAt(v+=0.75),D>255)throw Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");V=V<<8|D}return W};else u=function(Y){return(V1(),$1(S0)).Buffer.from(Y).toString("base64")};var P=v1;function v1(Y,X){if(X&&typeof X==="object"&&X.debug===!0){let v=Y.split(" ").map((N)=>{return Array.from(N).map((G)=>G.codePointAt(0))});return`STRING: ${Y}
|
|
8
|
-
CODEPOINTS: ${JSON.stringify(v)}`}let W=o(Y,X);if((X&&typeof X==="object"&&X.fallback!==void 0?X.fallback:P.defaults.fallback)===!0&&W===""){let D="";for(let N=0;N<Y.length;N++){let G=O1(Y,N);N=G[1],D+=G[0]}let v=u(D);if(typeof v==="string")W=o(v,X)}return W}var g0={bg:{\u{419}:"Y",\u{439}:"y",X:"H",x:"h",\u{426}:"Ts",\u{446}:"ts",\u{429}:"Sht",\u{449}:"sht",\u{42a}:"A",\u{44a}:"a",\u{42c}:"Y",\u{44c}:"y"},de:{\u{c4}:"AE",\u{e4}:"ae",\u{d6}:"OE",\u{f6}:"oe",\u{dc}:"UE",\u{fc}:"ue"},sr:{\u{111}:"dj",\u{110}:"DJ"},uk:{\u{418}:"Y",\u{438}:"y",\u{419}:"Y",\u{439}:"y",\u{426}:"Ts",\u{446}:"ts",\u{425}:"Kh",\u{445}:"kh",\u{429}:"Shch",\u{449}:"shch",\u{413}:"H",\u{433}:"h"}},s={};function o(Y,X){if(typeof Y!=="string")throw TypeError(`slug() requires a string argument, received ${typeof Y}`);let W;if(typeof X==="string")W={replacement:X};else W=X?Object.assign({},X):{};W.mode=W.mode||P.defaults.mode;let V=P.defaults.modes[W.mode],D=["replacement","multicharmap","charmap","remove","lower","trim"];for(let U,j=0,F=D.length;j<F;j++)U=D[j],W[U]=U in W?W[U]:V[U];let v=W.locale?g0[W.locale]||s:s,N=[];if(W.multicharmap)for(let U in W.multicharmap){if(!Object.prototype.hasOwnProperty.call(W.multicharmap,U))continue;let j=U.length;if(!N.includes(j))N.push(j)}N=N.sort((U,j)=>j-U);let G=W.mode==="rfc3986"?/[^\w\s\-.~]/:/[^A-Z0-9\s]/i,R="";for(let U,j=0,F=Y.length;j<F;j++){U=Y[j];let S=!1;for(let b=0;b<N.length;b++){let K=N[b],O=Y.substr(j,K);if(W.multicharmap&&W.multicharmap[O]){j+=K-1,U=W.multicharmap[O],S=!0;break}}if(!S)if(v[U])U=v[U];else if(W.charmap&&W.charmap[U])U=W.charmap[U].replace(W.replacement," ");else if(W.replacement&&U.includes(W.replacement))U=U.replace(W.replacement," ");else U=U.replace(G,"");R+=U}if(W.remove)R=R.replace(W.remove,"");if(W.trim)R=R.trim();if(R=R.replace(/\s+/g,W.replacement),W.lower)R=R.toLowerCase();return R}var f0={\u{92b}\u{93c}:"Fi",\u{917}\u{93c}:"Ghi",\u{916}\u{93c}:"Khi",\u{915}\u{93c}:"Qi",\u{921}\u{93c}:"ugDha",\u{922}\u{93c}:"ugDhha",\u{92f}\u{93c}:"Yi",\u{91c}\u{93c}:"Za",\u{5d1}\u{5b4}\u{5d9}:"i",\u{5d1}\u{5b5}:"e",\u{5d1}\u{5b5}\u{5d9}:"e",\u{5d1}\u{5b6}:"e",\u{5d1}\u{5b7}:"a",\u{5d1}\u{5b8}:"a",\u{5d1}\u{5b9}:"o",\u{5d5}\u{5b9}:"o",\u{5d1}\u{5bb}:"u",\u{5d5}\u{5bc}:"u",\u{5d1}\u{5bc}:"b",\u{5db}\u{5bc}:"k",\u{5da}\u{5bc}:"k",\u{5e4}\u{5bc}:"p",\u{5e9}\u{5c1}:"sh",\u{5e9}\u{5c2}:"s",\u{5d1}\u{5b0}:"e",\u{5d7}\u{5b1}:"e",\u{5d7}\u{5b2}:"a",\u{5d7}\u{5b3}:"o",\u{5d1}\u{5b4}:"i"},c0={\u{c0}:"A",\u{c1}:"A",\u{c2}:"A",\u{c3}:"A",\u{c4}:"A",\u{c5}:"A",\u{c6}:"AE",\u{c7}:"C",\u{c8}:"E",\u{c9}:"E",\u{ca}:"E",\u{cb}:"E",\u{cc}:"I",\u{cd}:"I",\u{ce}:"I",\u{cf}:"I",\u{d0}:"D",\u{d1}:"N",\u{d2}:"O",\u{d3}:"O",\u{d4}:"O",\u{d5}:"O",\u{d6}:"O",\u{150}:"O",\u{d8}:"O",\u{14c}:"O",\u{d9}:"U",\u{da}:"U",\u{db}:"U",\u{dc}:"U",\u{170}:"U",\u{dd}:"Y",\u{de}:"TH",\u{df}:"ss",\u{e0}:"a",\u{e1}:"a",\u{e2}:"a",\u{e3}:"a",\u{e4}:"a",\u{e5}:"a",\u{e6}:"ae",\u{e7}:"c",\u{e8}:"e",\u{e9}:"e",\u{ea}:"e",\u{eb}:"e",\u{ec}:"i",\u{ed}:"i",\u{ee}:"i",\u{ef}:"i",\u{f0}:"d",\u{f1}:"n",\u{f2}:"o",\u{f3}:"o",\u{f4}:"o",\u{f5}:"o",\u{f6}:"o",\u{151}:"o",\u{f8}:"o",\u{14d}:"o",\u{152}:"OE",\u{153}:"oe",\u{f9}:"u",\u{fa}:"u",\u{fb}:"u",\u{fc}:"u",\u{171}:"u",\u{fd}:"y",\u{fe}:"th",\u{ff}:"y",\u{1e9e}:"SS",\u{3b1}:"a",\u{3b2}:"b",\u{3b3}:"g",\u{3b4}:"d",\u{3b5}:"e",\u{3b6}:"z",\u{3b7}:"h",\u{3b8}:"th",\u{3b9}:"i",\u{3ba}:"k",\u{3bb}:"l",\u{3bc}:"m",\u{3bd}:"n",\u{3be}:"3",\u{3bf}:"o",\u{3c0}:"p",\u{3c1}:"r",\u{3c3}:"s",\u{3c4}:"t",\u{3c5}:"y",\u{3c6}:"f",\u{3c7}:"x",\u{3c8}:"ps",\u{3c9}:"w",\u{3ac}:"a",\u{3ad}:"e",\u{3af}:"i",\u{3cc}:"o",\u{3cd}:"y",\u{3ae}:"h",\u{3ce}:"w",\u{3c2}:"s",\u{3ca}:"i",\u{3b0}:"y",\u{3cb}:"y",\u{390}:"i",\u{391}:"A",\u{392}:"B",\u{393}:"G",\u{394}:"D",\u{395}:"E",\u{396}:"Z",\u{397}:"H",\u{398}:"Th",\u{399}:"I",\u{39a}:"K",\u{39b}:"L",\u{39c}:"M",\u{39d}:"N",\u{39e}:"3",\u{39f}:"O",\u{3a0}:"P",\u{3a1}:"R",\u{3a3}:"S",\u{3a4}:"T",\u{3a5}:"Y",\u{3a6}:"F",\u{3a7}:"X",\u{3a8}:"PS",\u{3a9}:"W",\u{386}:"A",\u{388}:"E",\u{38a}:"I",\u{38c}:"O",\u{38e}:"Y",\u{389}:"H",\u{38f}:"W",\u{3aa}:"I",\u{3ab}:"Y",\u{15f}:"s",\u{15e}:"S",\u{131}:"i",\u{130}:"I",\u{11f}:"g",\u{11e}:"G",\u{430}:"a",\u{431}:"b",\u{432}:"v",\u{433}:"g",\u{434}:"d",\u{435}:"e",\u{451}:"yo",\u{436}:"zh",\u{437}:"z",\u{438}:"i",\u{439}:"j",\u{43a}:"k",\u{43b}:"l",\u{43c}:"m",\u{43d}:"n",\u{43e}:"o",\u{43f}:"p",\u{440}:"r",\u{441}:"s",\u{442}:"t",\u{443}:"u",\u{444}:"f",\u{445}:"h",\u{446}:"c",\u{447}:"ch",\u{448}:"sh",\u{449}:"sh",\u{44a}:"u",\u{44b}:"y",\u{44c}:"",\u{44d}:"e",\u{44e}:"yu",\u{44f}:"ya",\u{410}:"A",\u{411}:"B",\u{412}:"V",\u{413}:"G",\u{414}:"D",\u{415}:"E",\u{401}:"Yo",\u{416}:"Zh",\u{417}:"Z",\u{418}:"I",\u{419}:"J",\u{41a}:"K",\u{41b}:"L",\u{41c}:"M",\u{41d}:"N",\u{41e}:"O",\u{41f}:"P",\u{420}:"R",\u{421}:"S",\u{422}:"T",\u{423}:"U",\u{424}:"F",\u{425}:"H",\u{426}:"C",\u{427}:"Ch",\u{428}:"Sh",\u{429}:"Sh",\u{42a}:"U",\u{42b}:"Y",\u{42c}:"",\u{42d}:"E",\u{42e}:"Yu",\u{42f}:"Ya",\u{404}:"Ye",\u{406}:"I",\u{407}:"Yi",\u{490}:"G",\u{454}:"ye",\u{456}:"i",\u{457}:"yi",\u{491}:"g",\u{10d}:"c",\u{10f}:"d",\u{11b}:"e",\u{148}:"n",\u{159}:"r",\u{161}:"s",\u{165}:"t",\u{16f}:"u",\u{17e}:"z",\u{10c}:"C",\u{10e}:"D",\u{11a}:"E",\u{147}:"N",\u{158}:"R",\u{160}:"S",\u{164}:"T",\u{16e}:"U",\u{17d}:"Z",\u{13e}:"l",\u{13a}:"l",\u{155}:"r",\u{13d}:"L",\u{139}:"L",\u{154}:"R",\u{105}:"a",\u{107}:"c",\u{119}:"e",\u{142}:"l",\u{144}:"n",\u{15b}:"s",\u{17a}:"z",\u{17c}:"z",\u{104}:"A",\u{106}:"C",\u{118}:"E",\u{141}:"L",\u{143}:"N",\u{15a}:"S",\u{179}:"Z",\u{17b}:"Z",\u{101}:"a",\u{113}:"e",\u{123}:"g",\u{12b}:"i",\u{137}:"k",\u{13c}:"l",\u{146}:"n",\u{16b}:"u",\u{100}:"A",\u{112}:"E",\u{122}:"G",\u{12a}:"I",\u{136}:"K",\u{13b}:"L",\u{145}:"N",\u{16a}:"U",\u{623}:"a",\u{625}:"i",\u{628}:"b",\u{62a}:"t",\u{62b}:"th",\u{62c}:"g",\u{62d}:"h",\u{62e}:"kh",\u{62f}:"d",\u{630}:"th",\u{631}:"r",\u{632}:"z",\u{633}:"s",\u{634}:"sh",\u{635}:"s",\u{636}:"d",\u{637}:"t",\u{638}:"th",\u{639}:"aa",\u{63a}:"gh",\u{641}:"f",\u{642}:"k",\u{643}:"k",\u{644}:"l",\u{645}:"m",\u{646}:"n",\u{647}:"h",\u{648}:"o",\u{64a}:"y",\u{621}:"aa",\u{629}:"a",\u{622}:"a",\u{627}:"a",\u{67e}:"p",\u{698}:"zh",\u{6af}:"g",\u{686}:"ch",\u{6a9}:"k",\u{6cc}:"i",\u{117}:"e",\u{12f}:"i",\u{173}:"u",\u{116}:"E",\u{12e}:"I",\u{172}:"U",\u{21b}:"t",\u{21a}:"T",\u{163}:"t",\u{162}:"T",\u{219}:"s",\u{218}:"S",\u{103}:"a",\u{102}:"A",\u{1ea0}:"A",\u{1ea2}:"A",\u{1ea6}:"A",\u{1ea4}:"A",\u{1eac}:"A",\u{1ea8}:"A",\u{1eaa}:"A",\u{1eb0}:"A",\u{1eae}:"A",\u{1eb6}:"A",\u{1eb2}:"A",\u{1eb4}:"A",\u{1eb8}:"E",\u{1eba}:"E",\u{1ebc}:"E",\u{1ec0}:"E",\u{1ebe}:"E",\u{1ec6}:"E",\u{1ec2}:"E",\u{1ec4}:"E",\u{1eca}:"I",\u{1ec8}:"I",\u{128}:"I",\u{1ecc}:"O",\u{1ece}:"O",\u{1ed2}:"O",\u{1ed0}:"O",\u{1ed8}:"O",\u{1ed4}:"O",\u{1ed6}:"O",\u{1a0}:"O",\u{1edc}:"O",\u{1eda}:"O",\u{1ee2}:"O",\u{1ede}:"O",\u{1ee0}:"O",\u{1ee4}:"U",\u{1ee6}:"U",\u{168}:"U",\u{1af}:"U",\u{1eea}:"U",\u{1ee8}:"U",\u{1ef0}:"U",\u{1eec}:"U",\u{1eee}:"U",\u{1ef2}:"Y",\u{1ef4}:"Y",\u{1ef6}:"Y",\u{1ef8}:"Y",\u{110}:"D",\u{1ea1}:"a",\u{1ea3}:"a",\u{1ea7}:"a",\u{1ea5}:"a",\u{1ead}:"a",\u{1ea9}:"a",\u{1eab}:"a",\u{1eb1}:"a",\u{1eaf}:"a",\u{1eb7}:"a",\u{1eb3}:"a",\u{1eb5}:"a",\u{1eb9}:"e",\u{1ebb}:"e",\u{1ebd}:"e",\u{1ec1}:"e",\u{1ebf}:"e",\u{1ec7}:"e",\u{1ec3}:"e",\u{1ec5}:"e",\u{1ecb}:"i",\u{1ec9}:"i",\u{129}:"i",\u{1ecd}:"o",\u{1ecf}:"o",\u{1ed3}:"o",\u{1ed1}:"o",\u{1ed9}:"o",\u{1ed5}:"o",\u{1ed7}:"o",\u{1a1}:"o",\u{1edd}:"o",\u{1edb}:"o",\u{1ee3}:"o",\u{1edf}:"o",\u{1ee1}:"o",\u{1ee5}:"u",\u{1ee7}:"u",\u{169}:"u",\u{1b0}:"u",\u{1eeb}:"u",\u{1ee9}:"u",\u{1ef1}:"u",\u{1eed}:"u",\u{1eef}:"u",\u{1ef3}:"y",\u{1ef5}:"y",\u{1ef7}:"y",\u{1ef9}:"y",\u{111}:"d",\u{4d8}:"AE",\u{4d9}:"ae",\u{492}:"GH",\u{493}:"gh",\u{49a}:"KH",\u{49b}:"kh",\u{4a2}:"NG",\u{4a3}:"ng",\u{4ae}:"UE",\u{4af}:"ue",\u{4b0}:"U",\u{4b1}:"u",\u{4ba}:"H",\u{4bb}:"h",\u{4e8}:"OE",\u{4e9}:"oe",\u{452}:"dj",\u{458}:"j",\u{459}:"lj",\u{45a}:"nj",\u{45b}:"c",\u{45f}:"dz",\u{402}:"Dj",\u{408}:"j",\u{409}:"Lj",\u{40a}:"Nj",\u{40b}:"C",\u{40f}:"Dz",\u{1cc}:"nj",\u{1c9}:"lj",\u{1cb}:"NJ",\u{1c8}:"LJ",\u{905}:"a",\u{906}:"aa",\u{90f}:"e",\u{908}:"ii",\u{90d}:"ei",\u{90e}:"ae",\u{910}:"ai",\u{907}:"i",\u{913}:"o",\u{911}:"oi",\u{912}:"oii",\u{90a}:"uu",\u{914}:"ou",\u{909}:"u",\u{92c}:"B",\u{92d}:"Bha",\u{91a}:"Ca",\u{91b}:"Chha",\u{921}:"Da",\u{922}:"Dha",\u{92b}:"Fa",\u{917}:"Ga",\u{918}:"Gha",\u{917}\u{93c}:"Ghi",\u{939}:"Ha",\u{91c}:"Ja",\u{91d}:"Jha",\u{915}:"Ka",\u{916}:"Kha",\u{916}\u{93c}:"Khi",\u{932}:"L",\u{933}:"Li",\u{90c}:"Li",\u{934}:"Lii",\u{961}:"Lii",\u{92e}:"Ma",\u{928}:"Na",\u{919}:"Na",\u{91e}:"Nia",\u{923}:"Nae",\u{929}:"Ni",\u{950}:"oms",\u{92a}:"Pa",\u{915}\u{93c}:"Qi",\u{930}:"Ra",\u{90b}:"Ri",\u{960}:"Ri",\u{931}:"Ri",\u{938}:"Sa",\u{936}:"Sha",\u{937}:"Shha",\u{91f}:"Ta",\u{924}:"Ta",\u{920}:"Tha",\u{926}:"Tha",\u{925}:"Tha",\u{927}:"Thha",\u{921}\u{93c}:"ugDha",\u{922}\u{93c}:"ugDhha",\u{935}:"Va",\u{92f}:"Ya",\u{92f}\u{93c}:"Yi",\u{91c}\u{93c}:"Za",\u{259}:"e",\u{18f}:"E",\u{10d0}:"a",\u{10d1}:"b",\u{10d2}:"g",\u{10d3}:"d",\u{10d4}:"e",\u{10d5}:"v",\u{10d6}:"z",\u{10d7}:"t",\u{10d8}:"i",\u{10d9}:"k",\u{10da}:"l",\u{10db}:"m",\u{10dc}:"n",\u{10dd}:"o",\u{10de}:"p",\u{10df}:"zh",\u{10e0}:"r",\u{10e1}:"s",\u{10e2}:"t",\u{10e3}:"u",\u{10e4}:"p",\u{10e5}:"k",\u{10e6}:"gh",\u{10e7}:"q",\u{10e8}:"sh",\u{10e9}:"ch",\u{10ea}:"ts",\u{10eb}:"dz",\u{10ec}:"ts",\u{10ed}:"ch",\u{10ee}:"kh",\u{10ef}:"j",\u{10f0}:"h",\u{5d1}:"v",\u{5d2}\u{5bc}:"g",\u{5d2}:"g",\u{5d3}:"d",\u{5d3}\u{5bc}:"d",\u{5d4}:"h",\u{5d5}:"v",\u{5d6}:"z",\u{5d7}:"h",\u{5d8}:"t",\u{5d9}:"y",\u{5db}:"kh",\u{5da}:"kh",\u{5dc}:"l",\u{5de}:"m",\u{5dd}:"m",\u{5e0}:"n",\u{5df}:"n",\u{5e1}:"s",\u{5e4}:"f",\u{5e3}:"f",\u{5e5}:"ts",\u{5e6}:"ts",\u{5e7}:"k",\u{5e8}:"r",\u{5ea}\u{5bc}:"t",\u{5ea}:"t"};P.charmap=Object.assign({},c0);P.multicharmap=Object.assign({},f0);P.defaults={charmap:P.charmap,mode:"pretty",modes:{rfc3986:{replacement:"-",remove:null,lower:!0,charmap:P.charmap,multicharmap:P.multicharmap,trim:!0},pretty:{replacement:"-",remove:null,lower:!0,charmap:P.charmap,multicharmap:P.multicharmap,trim:!0}},multicharmap:P.multicharmap,fallback:!0};P.reset=function(){P.defaults.modes.rfc3986.charmap=P.defaults.modes.pretty.charmap=P.charmap=P.defaults.charmap=Object.assign({},c0),P.defaults.modes.rfc3986.multicharmap=P.defaults.modes.pretty.multicharmap=P.multicharmap=P.defaults.multicharmap=Object.assign({},f0),s={}};P.extend=function(Y){let X=Object.keys(Y),W={},V={};for(let D=0;D<X.length;D++)if(X[D].length>1)W[X[D]]=Y[X[D]];else V[X[D]]=Y[X[D]];Object.assign(P.charmap,V),Object.assign(P.multicharmap,W)};P.setLocale=function(Y){s=g0[Y]||{}};async function P1(Y,X){let W=o(Y);if(!X?.table||!X?.column)return W;let V=W,D=1,v=1000;while(D<=v){if(!await a0.selectFrom(X.table).select(["id"]).where(X.column,"=",V).executeTakeFirst())return V;D++,V=`${W}-${D}`}let N=R1(6).toString("base64url").toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,8);return`${W}-${N}`}export{P1 as uniqueSlug,o as slugify};
|
package/dist/unique.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { slugify } from 'ts-slug';
|
|
2
|
-
import type { TableNames } from '@stacksjs/types';
|
|
3
|
-
/**
|
|
4
|
-
* Generate a URL-safe slug that is unique within `options.table.column`.
|
|
5
|
-
*
|
|
6
|
-
* IMPORTANT: this function performs a check-then-write, which means two
|
|
7
|
-
* concurrent callers can both observe "slug is free" and then both insert
|
|
8
|
-
* the same value. Add a UNIQUE constraint on `options.column` in your
|
|
9
|
-
* migration as the source of truth — this helper is for ergonomics, not
|
|
10
|
-
* race protection. A bounded retry budget keeps a runaway loop from
|
|
11
|
-
* hammering the DB if 1000+ records share the same base slug (e.g.
|
|
12
|
-
* "untitled" for unsaved drafts).
|
|
13
|
-
*/
|
|
14
|
-
export declare function uniqueSlug(value: string, options?: SlugifyOptions): Promise<string>;
|
|
15
|
-
declare interface SlugifyOptions {
|
|
16
|
-
table: TableNames
|
|
17
|
-
column: string
|
|
18
|
-
}
|
|
19
|
-
// Re-export the original slugify for convenience
|
|
20
|
-
export { slugify };
|