-
Notifications
You must be signed in to change notification settings - Fork 0
/
strict.min.cjs
1 lines (1 loc) · 10.5 KB
/
strict.min.cjs
1
"use strict";var j=Object.defineProperty;var s=(r,e)=>j(r,"name",{value:e,configurable:!0});var m=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var g=m(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});function A(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}s(A,"_export");A(f,{ARRAY_IN_PLACE_MUTATION:s(function(){return v},"ARRAY_IN_PLACE_MUTATION"),SL:s(function(){return c},"SL")});function E(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}s(E,"_define_property");var a=s((r,e)=>{if(r&&e&&Object.isFrozen(r)){/* c8 ignore next 3 @preserve */return Object.freeze(e)}return e},"freezeIfImmutable"),l=s(()=>typeof console=="object"&&console&&typeof console.warn=="function"&&(typeof window>"u"&&typeof process=="object"&&process&&typeof process.env=="object"&&process.env&&!0&&"production"&&!1||typeof window=="object"&&window&&"__NEXT_DATA__"in window&&typeof window.__NEXT_DATA__=="object"&&window.__NEXT_DATA__&&"runtimeConfig"in window.__NEXT_DATA__&&typeof window.__NEXT_DATA__.runtimeConfig=="object"&&window.__NEXT_DATA__.runtimeConfig&&"environment"in window.__NEXT_DATA__.runtimeConfig&&typeof window.__NEXT_DATA__.runtimeConfig.environment=="string"&&window.__NEXT_DATA__.runtimeConfig.environment!=="prod"),"shouldWarn"),u=class u extends Array{includes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this.length===0?!1:t!==0&&typeof t=="number"&&(t>0||t>=this.length*-1)?super.includes(e,t):typeof this.enum[e]=="string"}concat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(this,new u(...super.concat.apply(this,t.flat())))}concatList(e){return this.concat(...e)}toSorted(){return a(this,new u(...super.toSorted.apply(this,arguments)))}toReversed(){return a(this,new u(...super.toReversed.apply(this,arguments)))}toSpliced(){return a(this,new u(...super.toSpliced.apply(this,arguments)))}slice(){return a(this,new u(...super.slice.apply(this,arguments)))}without(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let o=t.flat().map(i=>typeof i=="string"?i:typeof i=="number"?String(i):void 0);return a(this,new u(...this.filter(i=>!o.includes(i))))}withTrim(){return a(this,new u(...super.map(e=>e.trim())))}withPrefix(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return a(this,new u(...super.map(t=>`${e}${t}`)))}withSuffix(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return a(this,new u(...super.map(t=>`${t}${e}`)))}withReplace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;return a(this,new u(...super.map(n=>n.replace(e,t))))}withReplaceAll(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;return a(this,new u(...super.map(n=>n.replaceAll(e,t))))}toLowerCase(){return a(this,new u(...super.map(e=>e.toLowerCase())))}toUpperCase(){return a(this,new u(...super.map(e=>e.toUpperCase())))}toCapitalize(){return this.withReplace(/\b\w/g,e=>e.toUpperCase())}toUnCapitalize(){return this.withReplace(/\b\w/g,e=>e.toLowerCase())}value(e){if(typeof e!="string")throw new Error(`Invalid value ${e}`);if(this.enum[e]===e)return this.enum[e];throw new Error(`Invalid value ${e}`)}mutable(){return Array.from(this)}toRecordValue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return Object.assign({},...n,Object.fromEntries(super.map(i=>{try{return[i,typeof e=="object"&&e!==null?Array.isArray(e)?[...e]:typeof structuredClone=="function"?structuredClone(e):{...e}:e]}catch(p){return[i,e]}})))}mapAsObject(e){return Object.fromEntries(super.map(t=>[t,e(t)]))}toRecordType(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"any",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return Object.assign({},...o,Object.fromEntries(super.map(p=>{try{return[p,typeof t=="object"&&t!==null?Array.isArray(t)?[...t]:typeof structuredClone=="function"?structuredClone(t):{...t}:t]}catch(x){return[p,t]}})))}asMap(){return new Map(super.map(e=>[e,e]))}asSet(){return new Set(this)}asObject(){return Object.assign({},...super.map(e=>({[e]:e})))}map(){let e=this.mutable();return e.map.apply(e,arguments)}filter(){let e=this.mutable();return e.filter.apply(e,arguments)}reduce(){let e=this.mutable();return e.reduce.apply(e,arguments)}reduceRight(){let e=this.mutable();return e.reduceRight.apply(e,arguments)}flat(){let e=this.mutable();return e.flat.apply(e,arguments)}flatMap(){let e=this.mutable();return e.flatMap.apply(e,arguments)}with(){let e=this.mutable();return e.with.apply(e,arguments)}push(){if(l()&&console.warn("Using push() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable();e.push.apply(e,arguments),super.push.apply(this,arguments),this.enum=Object.fromEntries(this.map(t=>[t,t])),Object.freeze(this.enum)}return this.length}shift(){if(l()&&console.warn("Using shift() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable(),t=e.shift.apply(e,arguments);return super.shift.apply(this,arguments),this.enum=Object.fromEntries(this.map(n=>[n,n])),Object.freeze(this.enum),t}}unshift(){if(l()&&console.warn("Using unshift() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable();e.unshift.apply(e,arguments),super.unshift.apply(this,arguments),this.enum=Object.fromEntries(this.map(t=>[t,t])),Object.freeze(this.enum)}return this.length}copyWithin(){if(l()&&console.warn("Using copyWithin() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable();e.copyWithin.apply(e,arguments),super.copyWithin.apply(this,arguments),this.enum=Object.fromEntries(this.map(t=>[t,t])),Object.freeze(this.enum)}return this}pop(){if(l()&&console.warn("Using pop() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable(),t=e.pop.apply(e,arguments);return super.pop.apply(this,arguments),this.enum=Object.fromEntries(this.map(n=>[n,n])),Object.freeze(this.enum),t}}fill(){if(l()&&console.warn("Using fill() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable();e.fill.apply(e,arguments),super.fill.apply(this,arguments),this.enum=Object.fromEntries(this.map(t=>[t,t])),Object.freeze(this.enum)}return this}splice(){if(l()&&console.warn("Using splice() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable(),t=e.splice.apply(e,arguments);return super.splice.apply(this,arguments),this.enum=Object.fromEntries(this.map(n=>[n,n])),Object.freeze(this.enum),t}}reverse(){if(l()&&console.warn("Using reverse() method on a string list will mutate the original list in place. The code relying on this list will behave unexpectedly and may lead to unsafe execution."),Object.isFrozen(this))throw new Error("Cannot set properties on a frozen object");{let e=this.mutable();e.reverse.apply(e,arguments),super.reverse.apply(this,arguments),this.enum=Object.fromEntries(this.map(t=>[t,t])),Object.freeze(this.enum)}return this}constructor(...e){let t=[],n=[];for(let o of e.flat())typeof o=="string"&&(t.push([o,o]),n.push(o));super(...n),E(this,"enum",void 0),this.enum=Object.fromEntries(t),Object.freeze(this.enum),Object.defineProperty(this,"enum",{writable:!0,configurable:!1,enumerable:!1})}};s(u,"SL");var c=u,v=Object.freeze({push:"push",unshift:"unshift",shift:"shift",copyWithin:"copyWithin",pop:"pop",fill:"fill",splice:"splice",reverse:"reverse"})});var w=m(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});function O(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}s(O,"_export");O(h,{stringListMutable:s(function(){return d},"stringListMutable"),stringListReadonly:s(function(){return N},"stringListReadonly")});var T=g();function d(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];let n=e,o=e.some(i=>typeof i!="string");return e.length&&o&&(typeof console=="object"&&console&&typeof console.warn=="function"&&(typeof window>"u"&&typeof process=="object"&&process&&typeof process.env=="object"&&process.env&&!1||typeof window=="object"&&window&&"__NEXT_DATA__"in window&&typeof window.__NEXT_DATA__=="object"&&window.__NEXT_DATA__&&"runtimeConfig"in window.__NEXT_DATA__&&typeof window.__NEXT_DATA__.runtimeConfig=="object"&&window.__NEXT_DATA__.runtimeConfig&&"environment"in window.__NEXT_DATA__.runtimeConfig&&typeof window.__NEXT_DATA__.runtimeConfig.environment=="string"&&window.__NEXT_DATA__.runtimeConfig.environment!=="prod")&&console.warn(`Unexpected type in stringList(${typeof o}). Casting all arguments to string type.`),n=e.flatMap(i=>Array.isArray(i)?i.filter(p=>typeof p=="string"||typeof p=="number").map(p=>String(p)):typeof i=="string"?[i]:typeof i=="number"?[String(i)]:[])),new T.SL(...n)}s(d,"stringListMutable");function N(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return Object.freeze(d(...e))}s(N,"stringListReadonly")});Object.defineProperty(exports,"__esModule",{value:!0});function C(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}s(C,"_export");C(exports,{default:s(function(){return z},"default"),sl:s(function(){return _},"sl"),stringList:s(function(){return b},"stringList")});var y=w(),b=y.stringListReadonly,_=y.stringListReadonly,z={stringList:b,sl:_};