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,OAAO,IAChB,IAAI,IAAI,KAAK,OAAO,GAClB,EAAI,KAAK,OAAO,GAAK,SAGzB,EAAM,YAAY,WAGpB,OAAO,CACT,EAGA,OAAO,OAAS,SAAS,EAAM,GAC7B,OAAO,SAAS,EAAK,KAAM,EAC7B,EAIA,OAAO,QAAU,WACf,IAAI,EAAO,GACX,IAAI,IAAI,KAAK,OACX,EAAK,KAAK,GACZ,OAAO,CACT,EAIA,OAAO,QAAU,OAEjB,IAAI,YAAc,QAAQ,oBAItB,SAAW,SAAU,EAAK,GAC5B,OAAO,EAAI,QAAQ,IAAQ,CAC7B","file":"/npm/joint@0.0.1/lib/stdlib.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/joint@0.0.1/lib/stdlib.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*jshint node: true*/\n\nvar stdlib = {};\nvar groups = {};\n\n//*****BEGIN MULTIPLE TAGS API*****\n\n//adds a tag to the connection\nstdlib.pushTag = function (conn, name) {\n  \n  //initialize tags if necessary\n  if(!Boolean(conn.tags))\n    conn.tags = [];\n\n  //no duplicates allowed\n  else if(contains(conn.tags, name))\n    return;\n\n  //add tag to connection's tags\n  conn.tags.push(name);\n\n  //initialize group for the tag if necessary\n  if(!Boolean(groups[name]))\n    groups[name] = [];\n\n  //add the connection to the group\n  groups[name].push(conn);\n};\n\n//removes a tag from the connection\nstdlib.popTag = function (conn, tag) {\n\n  //if no tag specified, return\n  if(!tag) return;\n\n  //if the connection does not have the tag, return\n  if(!Boolean(conn.tags) || !contains(conn.tags, tag)) return;\n  \n  //remove the tag from the connection's tags\n  conn.tags.splice(conn.tags.indexOf(tag), 1);\n\n  //remove the connection from the group for the tag\n  groups[tag].splice(groups[tag].indexOf(conn), 1);\n\n  //if the group is empty, remove it from open groups\n  if(groups[tag].length === 0) \n    delete groups[tag];\n};\n\n//returns the array of tags for a connection\nstdlib.getTags = function (conn) {\n  if(arguments.length === 0)\n    return this.allTags();\n  var r = [];\n  for(var t in conn.tags)\n    r[t] = conn.tags[t];\n  return r;\n};\n\n//*****END MULTIPLE TAGS API*****\n\n\n//*****BEGIN SINGLE TAG API*****\n\n//sets the sole tag of the connection to the name\n//specified, removing all other tags if necessary\nstdlib.setTag = function(conn, name) {\n  \n  //return if tag is already set to 'name'\n  if(this.getTag(conn) === name && this.getTags(conn).length === 1) return;\n\n  //remove all other tags\n  this.clearTags(conn);\n\n  //add the new tag\n  this.pushTag(conn, name);\n};\n\n//returns the first tag in the connection's tag array\nstdlib.getTag = function(conn) {\n  if(!conn.tags || conn.tags.length === 0)\n     return null;\n  return conn.tags[0];\n};\n\n//*****END SINGLE TAG API*****\n\n\n//*****BEGIN UNIVERSAL FUNCTIONS*****\n\n//clears all tags for the connection\nstdlib.clearTags = function(conn) {\n  var tags;\n  while((tags = this.getTags(conn)).length > 0)\n    this.popTag(conn, tags[0]);\n};\n\n//tests to see if any client has the specified tag\nvar tagIsLive = function(tag) {\n  return contains(this.allTags(), tag);\n};\n\n//returns array-like object containing all connections associated with the tag\nstdlib.conns = function (tag) {\n  var ret = [];\n  if(arguments.length > 0) {\n    if(Boolean(groups[tag])) {\n      for(var c in groups[tag])\n        ret.push(groups[tag][c]);\n    }\n  } else {\n    ret = connections.allConns();\n  }\n\n  return ret;\n};\n\n//tests to see if a connection has a tag\nstdlib.hasTag = function(conn, tag) {\n  return contains(conn.tags, tag);\n};\n\n//returns all tags presently associated\n//with at least one connection\nstdlib.allTags = function () {\n  var tags = [];\n  for(var t in groups)\n    tags.push(t);\n  return tags;\n};\n\n//*****END UNIVERSAL FUNCTIONS*****\n\nmodule.exports = stdlib;\n\nvar connections = require('./connections.js');\n\n//*****PRIVATE FUNCTIONS BELOW*****\n\nvar contains = function (arr, obj) {\n  return arr.indexOf(obj) >= 0;\n};\n"]}