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K,OAAS,EAAI,WAClB,EAAI,GAAG,QAAS,IACd,KAAK,cAAc,CAAC,IAEtB,EAAI,GAAG,OAAO,KACZ,KAAK,WAAa,EAClB,IACE,KAAK,aAAe,KAAK,MAAM,KAAK,aACtC,CAAE,MAAM,GACN,KAAK,aAAe,IACtB,CACA,KAAK,QAAQ,GACb,IAEJ,EAAI,GAAG,SAAU,IACf,KAAK,WAAa,EAClB,KAAK,SAAS,IAEhB,EAAI,IAAI,EACV,EAIF,MAAM,SAAW,CACf,cAAe,SAAS,GACtB,IAAI,EAAM,IAAI,OAYd,OAXA,OAAO,eAAe,EAAK,OAAQ,CACjC,IAAK,SAAS,GACZ,KAAK,MAAQ,EACb,IAAI,EAAS,IAAI,MAAM,KAAK,aACrB,EAAO,KACd,OAAO,KAAM,EACf,EACA,IAAK,WACH,OAAO,KAAK,KACd,IAEK,CACT,GAIF,KAAK,MAAM,KAAK,OAGhB,OAAO,QAAU,OAAO","file":"/npm/xapiwrapper-node@1.10.6/main.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/xapiwrapper-node@1.10.6/main.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const fs = require(\"fs\");\r\nconst path = require(\"path\");\r\nconst url = require(\"url\");\r\nconst { extend } = require(\"lodash\");\r\n\r\n// Import necessary files\r\nconst files = [\r\n  fs.readFileSync(path.join(__dirname, \"./lib/cryptojs_v3.1.2.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/xapi-util.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/xapi-launch.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/xapistatement.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/xapiwrapper.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/activitytypes.js\")).toString(),\r\n  fs.readFileSync(path.join(__dirname, \"./src/verbs.js\")).toString()\r\n];\r\n\r\n// shim browser apis\r\nconst window = {\r\n  location: {\r\n    search: \"\",\r\n    protocol: \"https:\"\r\n  }\r\n};\r\nconst location = window.location;\r\n\r\nclass XMLHttpRequest {\r\n\r\n  constructor() {\r\n    this.method = \"GET\";\r\n    this.url = null;\r\n    this.async = true;\r\n    this.headers = {};\r\n  }\r\n\r\n  open(method, url, async) {\r\n    if (async === false) {\r\n      console.log(\"ADL in node does not support synchronous http requests.\");\r\n    }\r\n    this.method = method;\r\n    this.url = url;\r\n    this.withCredentials = true;\r\n    this.crossDomain = true;\r\n    this.responseText = \"\";\r\n    this.responseJSON = null;\r\n    this.readyState = 0;\r\n    this.status = 0;\r\n    this.onerror = function(error) {};\r\n    this.onload = function() {};\r\n  }\r\n\r\n  setRequestHeader(name, value) {\r\n    this.headers[name] = value;\r\n  }\r\n\r\n  send(data) {\r\n    const http = this.url.includes(\"https:\") ? require('https') : require(\"http\");\r\n    const options = extend({\r\n      method: this.method,\r\n      headers: this.headers\r\n    }, url.parse(this.url));\r\n    const req = http.request(options, (res) => {\r\n      res.setEncoding('utf8');\r\n      this.status = res.statusCode;\r\n      res.on('data', (d) => {\r\n        this.responseText+=d;\r\n      });\r\n      res.on('end', ()=>{\r\n        this.readyState = 4;\r\n        try {\r\n          this.responseJSON = JSON.parse(this.responseText);\r\n        } catch(error) {\r\n          this.responseJSON = null;\r\n        }\r\n        this.onload();\r\n      });\r\n    });\r\n    req.on('error', (e) => {\r\n      this.readyState = 4;\r\n      this.onerror();\r\n    });\r\n    req.end(data);\r\n  }\r\n\r\n}\r\n\r\nconst document = {\r\n  createElement: function(type) {\r\n    var obj = new Object();\r\n    Object.defineProperty(obj, \"href\", {\r\n      set: function(value) {\r\n        this._href = value;\r\n        var parsed = url.parse(this.href);\r\n        delete parsed.href;\r\n        extend(this, parsed);\r\n      },\r\n      get: function() {\r\n        return this._href;\r\n      }\r\n    });\r\n    return obj;\r\n  }\r\n};\r\n\r\n// Compile code\r\neval(files.join(\"\\n\"));\r\n\r\n// Export ADL namespace\r\nmodule.exports = window.ADL;"]}