{"version":3,"file":"createUniqueId.cjs","names":["uniqueIdLength","exports","createUniqueId","id","Math","random","toString","slice","test"],"sources":["../../src/createUniqueId.ts"],"sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// This is a random number chosen to shrink down the unique ID to an arbitrary length.\nexport const uniqueIdLength = 6;\n\nexport const createUniqueId = () => {\n  const id = Math.random()\n    .toString(36)\n    .slice(2, 2 + uniqueIdLength);\n  return /^[a-z]/i.test(id) ? id : `a${id.slice(1)}`;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,CAAC;AAExB,MAAME,cAAc,GAAGA,CAAA,KAAM;EAClC,MAAMC,EAAE,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CACrBC,QAAQ,CAAC,EAAE,CAAC,CACZC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAGP,cAAc,CAAC;EAC/B,OAAO,SAAS,CAACQ,IAAI,CAACL,EAAE,CAAC,GAAGA,EAAE,GAAG,IAAIA,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC,EAAE;AACpD,CAAC;AAACN,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}