@ezeep/ezeep-js 1.0.225 → 1.0.226
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/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_15.cjs.entry.js +46 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-input/ezp-input.js +22 -2
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +13 -4
- package/dist/collection/utils/utils.js +29 -0
- package/dist/custom-elements/index.js +48 -8
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +46 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-3139f35d.entry.js → p-0d6efa1d.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-a124be11.system.entry.js → p-f5a002c3.system.entry.js} +3 -3
- package/dist/types/components/ezp-input/ezp-input.d.ts +2 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-3139f35d.entry.js → p-0d6efa1d.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-a124be11.system.entry.js → p-f5a002c3.system.entry.js} +3 -3
- package/www/data/locales/de.json +2 -1
- package/www/data/locales/en.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function a(){this.constructor=t}t.prototype=r===null?Object.create(r):(a.prototype=r.prototype,new a)}}();var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):n(e.value).then(o,s)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};import{g as getRenderingRef,f as forceUpdate,r as registerInstance,c as createEvent,h,H as Host,a as getElement,d as getAssetPath,F as Fragment}from"./index-3ac1b749.js";var appendToMap=function(e,t,r){var a=e.get(t);if(!a){e.set(t,[r])}else if(!a.includes(r)){a.push(r)}};var debounce=function(e,t){var r;return function(){var a=[];for(var n=0;n<arguments.length;n++){a[n]=arguments[n]}if(r){clearTimeout(r)}r=setTimeout((function(){r=0;e.apply(void 0,a)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,r=e.keys();t<r.length;t++){var a=r[t];e.set(a,e.get(a).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var r=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){r.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(r,e,t)}}));t("set",(function(e){var t=r.get(e);if(t){r.set(e,t.filter(forceUpdate))}cleanupElements(r)}));t("reset",(function(){r.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(r)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var a={dispose:[],get:[],set:[],reset:[]};var n=function(){r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));a.reset.forEach((function(e){return e()}))};var i=function(){a.dispose.forEach((function(e){return e()}));n()};var o=function(e){a.get.forEach((function(t){return t(e)}));return r.get(e)};var s=function(e,n){var i=r.get(e);if(t(n,i,e)){r.set(e,n);a.set.forEach((function(t){return t(e,n,i)}))}};var l=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return o(t)},ownKeys:function(e){return Array.from(r.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return r.has(t)},set:function(e,t,r){s(t,r);return true}});var c=function(e,t){a[e].push(t);return function(){removeFromArray(a[e],t)}};var p=function(t,r){var a=c("set",(function(e,a){if(e===t){r(a)}}));var n=c("reset",(function(){return r(e[t])}));return function(){a();n()}};var d=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){c("set",e.set)}if(e.get){c("get",e.get)}if(e.reset){c("reset",e.reset)}}))};var u=function(e){var t=r.get(e);a.set.forEach((function(r){return r(e,t,t)}))};return{state:l,get:o,set:s,on:c,onChange:p,use:d,dispose:i,reset:n,forceUpdate:u}};var removeFromArray=function(e,t){var r=e.indexOf(t);if(r>=0){e[r]=e[e.length-1];e.length--}};var createStore=function(e,t){var r=createObservableMap(e,t);stencilSubscription(r);return r};function _typeof$1(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof$1=function e(t){return typeof t}}else{_typeof$1=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof$1(e)}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{};var a=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){a=a.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}a.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;if("value"in a)a.writable=true;Object.defineProperty(e,a.key,a)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);return e}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _typeof_1=createCommonjsModule((function(e){function t(r){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){e.exports=t=function e(t){return typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}else{e.exports=t=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}return t(r)}e.exports=t;e.exports["default"]=e.exports,e.exports.__esModule=true}));var _typeof=getDefaultExportFromCjs(_typeof_1);function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return _setPrototypeOf(e,t)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}var consoleLogger={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,r){if(console&&console[t])console[t].apply(console,r)}};var Logger=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.init(t,r)}_createClass(e,[{key:"init",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=r.prefix||"i18next:";this.logger=t||consoleLogger;this.options=r;this.debug=r.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"log","",true)}},{key:"warn",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"warn","",true)}},{key:"error",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"error","")}},{key:"deprecate",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"warn","WARNING DEPRECATED: ",true)}},{key:"forward",value:function e(t,r,a,n){if(n&&!this.debug)return null;if(typeof t[0]==="string")t[0]="".concat(a).concat(this.prefix," ").concat(t[0]);return this.logger[r](t)}},{key:"create",value:function t(r){return new e(this.logger,_objectSpread({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]);return e}();var baseLogger=new Logger;var EventEmitter$1=function(){function e(){_classCallCheck(this,e);this.observers={}}_createClass(e,[{key:"on",value:function e(t,r){var a=this;t.split(" ").forEach((function(e){a.observers[e]=a.observers[e]||[];a.observers[e].push(r)}));return this}},{key:"off",value:function e(t,r){if(!this.observers[t])return;if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter((function(e){return e!==r}))}},{key:"emit",value:function e(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}if(this.observers[t]){var i=[].concat(this.observers[t]);i.forEach((function(e){e.apply(void 0,a)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(e){e.apply(e,[t].concat(a))}))}}}]);return e}();function defer(){var e;var t;var r=new Promise((function(r,a){e=r;t=a}));r.resolve=e;r.reject=t;return r}function makeString(e){if(e==null)return"";return""+e}function copy(e,t,r){e.forEach((function(e){if(t[e])r[e]=t[e]}))}function getLastOfPath(e,t,r){function a(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function n(){return!e||typeof e==="string"}var i=typeof t!=="string"?[].concat(t):t.split(".");while(i.length>1){if(n())return{};var o=a(i.shift());if(!e[o]&&r)e[o]=new r;if(Object.prototype.hasOwnProperty.call(e,o)){e=e[o]}else{e={}}}if(n())return{};return{obj:e,k:a(i.shift())}}function setPath(e,t,r){var a=getLastOfPath(e,t,Object),n=a.obj,i=a.k;n[i]=r}function pushPath(e,t,r,a){var n=getLastOfPath(e,t,Object),i=n.obj,o=n.k;i[o]=i[o]||[];if(a)i[o]=i[o].concat(r);if(!a)i[o].push(r)}function getPath(e,t){var r=getLastOfPath(e,t),a=r.obj,n=r.k;if(!a)return undefined;return a[n]}function getPathWithDefaults(e,t,r){var a=getPath(e,r);if(a!==undefined){return a}return getPath(t,r)}function deepExtend(e,t,r){for(var a in t){if(a!=="__proto__"&&a!=="constructor"){if(a in e){if(typeof e[a]==="string"||e[a]instanceof String||typeof t[a]==="string"||t[a]instanceof String){if(r)e[a]=t[a]}else{deepExtend(e[a],t[a],r)}}else{e[a]=t[a]}}}return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(e){if(typeof e==="string"){return e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]}))}return e}var isIE10=typeof window!=="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;var chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,r){t=t||"";r=r||"";var a=chars.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(a.length===0)return true;var n=new RegExp("(".concat(a.map((function(e){return e==="?"?"\\?":e})).join("|"),")"));var i=!n.test(e);if(!i){var o=e.indexOf(r);if(o>0&&!n.test(e.substring(0,o))){i=true}}return i}function deepFind(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:".";if(!e)return undefined;if(e[t])return e[t];var a=t.split(r);var n=e;for(var i=0;i<a.length;++i){if(!n)return undefined;if(typeof n[a[i]]==="string"&&i+1<a.length){return undefined}if(n[a[i]]===undefined){var o=2;var s=a.slice(i,i+o).join(r);var l=n[s];while(l===undefined&&a.length>i+o){o++;s=a.slice(i,i+o).join(r);l=n[s]}if(l===undefined)return undefined;if(typeof l==="string")return l;if(s&&typeof l[s]==="string")return l[s];var c=a.slice(i+o).join(r);if(c)return deepFind(l,c,r);return undefined}n=n[a[i]]}return n}var ResourceStore=function(e){_inherits(t,e);function t(e){var r;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(r))}r.data=e||{};r.options=a;if(r.options.keySeparator===undefined){r.options.keySeparator="."}if(r.options.ignoreJSONStructure===undefined){r.options.ignoreJSONStructure=true}return r}_createClass(t,[{key:"addNamespaces",value:function e(t){if(this.options.ns.indexOf(t)<0){this.options.ns.push(t)}}},{key:"removeNamespaces",value:function e(t){var r=this.options.ns.indexOf(t);if(r>-1){this.options.ns.splice(r,1)}}},{key:"getResource",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=n.keySeparator!==undefined?n.keySeparator:this.options.keySeparator;var o=n.ignoreJSONStructure!==undefined?n.ignoreJSONStructure:this.options.ignoreJSONStructure;var s=[t,r];if(a&&typeof a!=="string")s=s.concat(a);if(a&&typeof a==="string")s=s.concat(i?a.split(i):a);if(t.indexOf(".")>-1){s=t.split(".")}var l=getPath(this.data,s);if(l||!o||typeof a!=="string")return l;return deepFind(this.data&&this.data[t]&&this.data[t][r],a,i)}},{key:"addResource",value:function e(t,r,a,n){var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:false};var o=this.options.keySeparator;if(o===undefined)o=".";var s=[t,r];if(a)s=s.concat(o?a.split(o):a);if(t.indexOf(".")>-1){s=t.split(".");n=r;r=s[1]}this.addNamespaces(r);setPath(this.data,s,n);if(!i.silent)this.emit("added",t,r,a,n)}},{key:"addResources",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{silent:false};for(var i in a){if(typeof a[i]==="string"||Object.prototype.toString.apply(a[i])==="[object Array]")this.addResource(t,r,i,a[i],{silent:true})}if(!n.silent)this.emit("added",t,r,a)}},{key:"addResourceBundle",value:function e(t,r,a,n,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{silent:false};var s=[t,r];if(t.indexOf(".")>-1){s=t.split(".");n=a;a=r;r=s[1]}this.addNamespaces(r);var l=getPath(this.data,s)||{};if(n){deepExtend(l,a,i)}else{l=_objectSpread({},l,a)}setPath(this.data,s,l);if(!o.silent)this.emit("added",t,r,a)}},{key:"removeResourceBundle",value:function e(t,r){if(this.hasResourceBundle(t,r)){delete this.data[t][r]}this.removeNamespaces(r);this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function e(t,r){return this.getResource(t,r)!==undefined}},{key:"getResourceBundle",value:function e(t,r){if(!r)r=this.options.defaultNS;if(this.options.compatibilityAPI==="v1")return _objectSpread({},{},this.getResource(t,r));return this.getResource(t,r)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function e(t){var r=this.getDataByLanguage(t);var a=r&&Object.keys(r)||[];return!!a.find((function(e){return r[e]&&Object.keys(r[e]).length>0}))}},{key:"toJSON",value:function e(){return this.data}}]);return t}(EventEmitter$1);var postProcessor={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,r,a,n,i){var o=this;t.forEach((function(e){if(o.processors[e])r=o.processors[e].process(r,a,n,i)}));return r}};var checkedLoadedFor={};var Translator=function(e){_inherits(t,e);function t(e){var r;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(r))}copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(r));r.options=a;if(r.options.keySeparator===undefined){r.options.keySeparator="."}r.logger=baseLogger.create("translator");return r}_createClass(t,[{key:"changeLanguage",value:function e(t){if(t)this.language=t}},{key:"exists",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};if(t===undefined||t===null){return false}var a=this.resolve(t,r);return a&&a.res!==undefined}},{key:"extractFromKey",value:function e(t,r){var a=r.nsSeparator!==undefined?r.nsSeparator:this.options.nsSeparator;if(a===undefined)a=":";var n=r.keySeparator!==undefined?r.keySeparator:this.options.keySeparator;var i=r.ns||this.options.defaultNS;var o=a&&t.indexOf(a)>-1;var s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!looksLikeObjectPath(t,a,n);if(o&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0){return{key:t,namespaces:i}}var c=t.split(a);if(a!==n||a===n&&this.options.ns.indexOf(c[0])>-1)i=c.shift();t=c.join(n)}if(typeof i==="string")i=[i];return{key:t,namespaces:i}}},{key:"translate",value:function e(r,a,n){var i=this;if(_typeof$1(a)!=="object"&&this.options.overloadTranslationOptionHandler){a=this.options.overloadTranslationOptionHandler(arguments)}if(!a)a={};if(r===undefined||r===null)return"";if(!Array.isArray(r))r=[String(r)];var o=a.keySeparator!==undefined?a.keySeparator:this.options.keySeparator;var s=this.extractFromKey(r[r.length-1],a),l=s.key,c=s.namespaces;var p=c[c.length-1];var d=a.lng||this.language;var u=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(u){var m=a.nsSeparator||this.options.nsSeparator;return p+m+l}return l}var f=this.resolve(r,a);var h=f&&f.res;var g=f&&f.usedKey||l;var y=f&&f.exactUsedKey||l;var b=Object.prototype.toString.apply(h);var v=["[object Number]","[object Function]","[object RegExp]"];var x=a.joinArrays!==undefined?a.joinArrays:this.options.joinArrays;var S=!this.i18nFormat||this.i18nFormat.handleAsObject;var N=typeof h!=="string"&&typeof h!=="boolean"&&typeof h!=="number";if(S&&h&&N&&v.indexOf(b)<0&&!(typeof x==="string"&&b==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler){this.logger.warn("accessing an object - but returnObjects options is not enabled!")}return this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,_objectSpread({},a,{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.")}if(o){var z=b==="[object Array]";var C=z?[]:{};var P=z?y:g;for(var R in h){if(Object.prototype.hasOwnProperty.call(h,R)){var E="".concat(P).concat(o).concat(R);C[R]=this.translate(E,_objectSpread({},a,{joinArrays:false,ns:c}));if(C[R]===E)C[R]=h[R]}}h=C}}else if(S&&typeof x==="string"&&b==="[object Array]"){h=h.join(x);if(h)h=this.extendTranslation(h,r,a,n)}else{var B=false;var w=false;var _=a.count!==undefined&&typeof a.count!=="string";var T=t.hasDefaultValue(a);var O=_?this.pluralResolver.getSuffix(d,a.count,a):"";var k=a["defaultValue".concat(O)]||a.defaultValue;if(!this.isValidLookup(h)&&T){B=true;h=k}if(!this.isValidLookup(h)){w=true;h=l}var A=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;var I=A&&w?undefined:h;var L=T&&k!==h&&this.options.updateMissing;if(w||B||L){this.logger.log(L?"updateKey":"missingKey",d,p,l,L?k:h);if(o){var H=this.resolve(l,_objectSpread({},a,{keySeparator:false}));if(H&&H.res)this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var q=[];var M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0]){for(var D=0;D<M.length;D++){q.push(M[D])}}else if(this.options.saveMissingTo==="all"){q=this.languageUtils.toResolveHierarchy(a.lng||this.language)}else{q.push(a.lng||this.language)}var U=function e(t,r,n){if(i.options.missingKeyHandler){i.options.missingKeyHandler(t,p,r,L?n:I,L,a)}else if(i.backendConnector&&i.backendConnector.saveMissing){i.backendConnector.saveMissing(t,p,r,L?n:I,L,a)}i.emit("missingKey",t,p,r,h)};if(this.options.saveMissing){if(this.options.saveMissingPlurals&&_){q.forEach((function(e){i.pluralResolver.getSuffixes(e).forEach((function(t){U([e],l+t,a["defaultValue".concat(t)]||k)}))}))}else{U(q,l,k)}}}h=this.extendTranslation(h,r,a,f,n);if(w&&h===l&&this.options.appendNamespaceToMissingKey)h="".concat(p,":").concat(l);if((w||B)&&this.options.parseMissingKeyHandler)h=this.options.parseMissingKeyHandler(h)}return h}},{key:"extendTranslation",value:function e(t,r,a,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse){t=this.i18nFormat.parse(t,a,n.usedLng,n.usedNS,n.usedKey,{resolved:n})}else if(!a.skipInterpolation){if(a.interpolation)this.interpolator.init(_objectSpread({},a,{interpolation:_objectSpread({},this.options.interpolation,a.interpolation)}));var s=a.interpolation&&a.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var l;if(s){var c=t.match(this.interpolator.nestingRegexp);l=c&&c.length}var p=a.replace&&typeof a.replace!=="string"?a.replace:a;if(this.options.interpolation.defaultVariables)p=_objectSpread({},this.options.interpolation.defaultVariables,p);t=this.interpolator.interpolate(t,p,a.lng||this.language,a);if(s){var d=t.match(this.interpolator.nestingRegexp);var u=d&&d.length;if(l<u)a.nest=false}if(a.nest!==false)t=this.interpolator.nest(t,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}if(i&&i[0]===t[0]&&!a.context){o.logger.warn("It seems you are nesting recursively key: ".concat(t[0]," in key: ").concat(r[0]));return null}return o.translate.apply(o,t.concat([r]))}),a);if(a.interpolation)this.interpolator.reset()}var m=a.postProcess||this.options.postProcess;var f=typeof m==="string"?[m]:m;if(t!==undefined&&t!==null&&f&&f.length&&a.applyPostProcessor!==false){t=postProcessor.handle(f,t,r,this.options&&this.options.postProcessPassResolved?_objectSpread({i18nResolved:n},a):a,this)}return t}},{key:"resolve",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n;var i;var o;var s;var l;if(typeof t==="string")t=[t];t.forEach((function(e){if(r.isValidLookup(n))return;var t=r.extractFromKey(e,a);var c=t.key;i=c;var p=t.namespaces;if(r.options.fallbackNS)p=p.concat(r.options.fallbackNS);var d=a.count!==undefined&&typeof a.count!=="string";var u=a.context!==undefined&&(typeof a.context==="string"||typeof a.context==="number")&&a.context!=="";var m=a.lngs?a.lngs:r.languageUtils.toResolveHierarchy(a.lng||r.language,a.fallbackLng);p.forEach((function(e){if(r.isValidLookup(n))return;l=e;if(!checkedLoadedFor["".concat(m[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(l)){checkedLoadedFor["".concat(m[0],"-").concat(e)]=true;r.logger.warn('key "'.concat(i,'" for languages "').concat(m.join(", "),'" won\'t get resolved as namespace "').concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}m.forEach((function(t){if(r.isValidLookup(n))return;s=t;var i=c;var l=[i];if(r.i18nFormat&&r.i18nFormat.addLookupKeys){r.i18nFormat.addLookupKeys(l,c,t,e,a)}else{var p;if(d)p=r.pluralResolver.getSuffix(t,a.count,a);if(d&&u)l.push(i+p);if(u)l.push(i+="".concat(r.options.contextSeparator).concat(a.context));if(d)l.push(i+=p)}var m;while(m=l.pop()){if(!r.isValidLookup(n)){o=m;n=r.getResource(t,e,m,a)}}}))}))}));return{res:n,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}},{key:"isValidLookup",value:function e(t){return t!==undefined&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(this.i18nFormat&&this.i18nFormat.getResource)return this.i18nFormat.getResource(t,r,a,n);return this.resourceStore.getResource(t,r,a,n)}}],[{key:"hasDefaultValue",value:function e(t){var r="defaultValue";for(var a in t){if(Object.prototype.hasOwnProperty.call(t,a)&&r===a.substring(0,r.length)&&undefined!==t[a]){return true}}return false}}]);return t}(EventEmitter$1);function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e);this.options=t;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}_createClass(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");if(r.length===2)return null;r.pop();if(r[r.length-1].toLowerCase()==="x")return null;return this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function e(t){if(typeof t==="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"];var a=t.split("-");if(this.options.lowerCaseLng){a=a.map((function(e){return e.toLowerCase()}))}else if(a.length===2){a[0]=a[0].toLowerCase();a[1]=a[1].toUpperCase();if(r.indexOf(a[1].toLowerCase())>-1)a[1]=capitalize(a[1].toLowerCase())}else if(a.length===3){a[0]=a[0].toLowerCase();if(a[1].length===2)a[1]=a[1].toUpperCase();if(a[0]!=="sgn"&&a[2].length===2)a[2]=a[2].toUpperCase();if(r.indexOf(a[1].toLowerCase())>-1)a[1]=capitalize(a[1].toLowerCase());if(r.indexOf(a[2].toLowerCase())>-1)a[2]=capitalize(a[2].toLowerCase())}return a.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function e(t){if(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs){t=this.getLanguagePartFromCode(t)}return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var r=this;if(!t)return null;var a;t.forEach((function(e){if(a)return;var t=r.formatLanguageCode(e);if(!r.options.supportedLngs||r.isSupportedCode(t))a=t}));if(!a&&this.options.supportedLngs){t.forEach((function(e){if(a)return;var t=r.getLanguagePartFromCode(e);if(r.isSupportedCode(t))return a=t;a=r.options.supportedLngs.find((function(e){if(e.indexOf(t)===0)return e}))}))}if(!a)a=this.getFallbackCodes(this.options.fallbackLng)[0];return a}},{key:"getFallbackCodes",value:function e(t,r){if(!t)return[];if(typeof t==="function")t=t(r);if(typeof t==="string")t=[t];if(Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t["default"]||[];var a=t[r];if(!a)a=t[this.getScriptPartFromCode(r)];if(!a)a=t[this.formatLanguageCode(r)];if(!a)a=t[this.getLanguagePartFromCode(r)];if(!a)a=t["default"];return a||[]}},{key:"toResolveHierarchy",value:function e(t,r){var a=this;var n=this.getFallbackCodes(r||this.options.fallbackLng||[],t);var i=[];var o=function e(t){if(!t)return;if(a.isSupportedCode(t)){i.push(t)}else{a.logger.warn("rejecting language code not found in supportedLngs: ".concat(t))}};if(typeof t==="string"&&t.indexOf("-")>-1){if(this.options.load!=="languageOnly")o(this.formatLanguageCode(t));if(this.options.load!=="languageOnly"&&this.options.load!=="currentOnly")o(this.getScriptPartFromCode(t));if(this.options.load!=="currentOnly")o(this.getLanguagePartFromCode(t))}else if(typeof t==="string"){o(this.formatLanguageCode(t))}n.forEach((function(e){if(i.indexOf(e)<0)o(a.formatLanguageCode(e))}));return i}}]);return e}();var sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}];var _rulesPluralsTypes={1:function e(t){return Number(t>1)},2:function e(t){return Number(t!=1)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function e(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(t!==0)},14:function e(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function e(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(t==0?0:t==1?1:2)},19:function e(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};var deprecatedJsonVersions=["v1","v2","v3"];var suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};sets.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))}));return e}var PluralResolver=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.languageUtils=t;this.options=r;this.logger=baseLogger.create("pluralResolver");if((!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl==="undefined"||!Intl.PluralRules)){this.options.compatibilityJSON="v3";this.logger.error("Your environment seems not to be Inlt API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")}this.rules=createRules()}_createClass(e,[{key:"addRule",value:function e(t,r){this.rules[t]=r}},{key:"getRule",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.shouldUseIntlApi()){try{return new Intl.PluralRules(t,{type:r.ordinal?"ordinal":"cardinal"})}catch(e){return}}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=this.getRule(t,r);if(this.shouldUseIntlApi()){return a&&a.resolvedOptions().pluralCategories.length>1}return a&&a.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.getSuffixes(t,a).map((function(e){return"".concat(r).concat(e)}))}},{key:"getSuffixes",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=this.getRule(t,a);if(!n){return[]}if(this.shouldUseIntlApi()){return n.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(r.options.prepend).concat(e)}))}return n.numbers.map((function(e){return r.getSuffix(t,e,a)}))}},{key:"getSuffix",value:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=this.getRule(t,a);if(n){if(this.shouldUseIntlApi()){return"".concat(this.options.prepend).concat(n.select(r))}return this.getSuffixRetroCompatible(n,r)}this.logger.warn("no plural rule found for: ".concat(t));return""}},{key:"getSuffixRetroCompatible",value:function e(t,r){var a=this;var n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));var i=t.numbers[n];if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){if(i===2){i="plural"}else if(i===1){i=""}}var o=function e(){return a.options.prepend&&i.toString()?a.options.prepend+i.toString():i.toString()};if(this.options.compatibilityJSON==="v1"){if(i===1)return"";if(typeof i==="number")return"_plural_".concat(i.toString());return o()}else if(this.options.compatibilityJSON==="v2"){return o()}else if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){return o()}return this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function e(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]);return e}();var Interpolator=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,e);this.logger=baseLogger.create("interpolator");this.options=t;this.format=t.interpolation&&t.interpolation.format||function(e){return e};this.init(t)}_createClass(e,[{key:"init",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!t.interpolation)t.interpolation={escapeValue:true};var r=t.interpolation;this.escape=r.escape!==undefined?r.escape:escape$1;this.escapeValue=r.escapeValue!==undefined?r.escapeValue:true;this.useRawValueToEscape=r.useRawValueToEscape!==undefined?r.useRawValueToEscape:false;this.prefix=r.prefix?regexEscape(r.prefix):r.prefixEscaped||"{{";this.suffix=r.suffix?regexEscape(r.suffix):r.suffixEscaped||"}}";this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",";this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"";this.nestingPrefix=r.nestingPrefix?regexEscape(r.nestingPrefix):r.nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=r.nestingSuffix?regexEscape(r.nestingSuffix):r.nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",";this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3;this.alwaysFormat=r.alwaysFormat!==undefined?r.alwaysFormat:false;this.resetRegExp()}},{key:"reset",value:function e(){if(this.options)this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var a="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(a,"g")}},{key:"interpolate",value:function e(t,r,a,n){var i=this;var o;var s;var l;var c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(e){return e.replace(/\$/g,"$$$$")}var d=function e(t){if(t.indexOf(i.formatSeparator)<0){var o=getPathWithDefaults(r,c,t);return i.alwaysFormat?i.format(o,undefined,a,_objectSpread({},n,r,{interpolationkey:t})):o}var s=t.split(i.formatSeparator);var l=s.shift().trim();var p=s.join(i.formatSeparator).trim();return i.format(getPathWithDefaults(r,c,l),p,a,_objectSpread({},n,r,{interpolationkey:l}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;var m=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var f=[{regex:this.regexpUnescape,safeValue:function e(t){return p(t)}},{regex:this.regexp,safeValue:function e(t){return i.escapeValue?p(i.escape(t)):p(t)}}];f.forEach((function(e){l=0;while(o=e.regex.exec(t)){s=d(o[1].trim());if(s===undefined){if(typeof u==="function"){var r=u(t,o,n);s=typeof r==="string"?r:""}else if(m){s=o[0];continue}else{i.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(t));s=""}}else if(typeof s!=="string"&&!i.useRawValueToEscape){s=makeString(s)}var a=e.safeValue(s);t=t.replace(o[0],a);if(m){e.regex.lastIndex+=a.length;e.regex.lastIndex-=o[0].length}else{e.regex.lastIndex=0}l++;if(l>=i.maxReplaces){break}}}));return t}},{key:"nest",value:function e(t,r){var a=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i;var o;var s=_objectSpread({},n);s.applyPostProcessor=false;delete s.defaultValue;function l(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var a=e.split(new RegExp("".concat(r,"[ ]*{")));var n="{".concat(a[1]);e=a[0];n=this.interpolate(n,s);n=n.replace(/'/g,'"');try{s=JSON.parse(n);if(t)s=_objectSpread({},t,s)}catch(t){this.logger.warn("failed parsing options string in nesting for key ".concat(e),t);return"".concat(e).concat(r).concat(n)}delete s.defaultValue;return e}while(i=this.nestingRegexp.exec(t)){var c=[];var p=false;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){var d=i[1].split(this.formatSeparator).map((function(e){return e.trim()}));i[1]=d.shift();c=d;p=true}o=r(l.call(this,i[1].trim(),s),s);if(o&&i[0]===t&&typeof o!=="string")return o;if(typeof o!=="string")o=makeString(o);if(!o){this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t));o=""}if(p){o=c.reduce((function(e,t){return a.format(e,t,n.lng,_objectSpread({},n,{interpolationkey:i[1].trim()}))}),o.trim())}t=t.replace(i[0],o);this.regexp.lastIndex=0}return t}}]);return e}();function remove(e,t){var r=e.indexOf(t);while(r!==-1){e.splice(r,1);r=e.indexOf(t)}}var Connector=function(e){_inherits(t,e);function t(e,r,a){var n;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};_classCallCheck(this,t);n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(n))}n.backend=e;n.store=r;n.services=a;n.languageUtils=a.languageUtils;n.options=i;n.logger=baseLogger.create("backendConnector");n.state={};n.queue=[];if(n.backend&&n.backend.init){n.backend.init(a,i.backend,i)}return n}_createClass(t,[{key:"queueLoad",value:function e(t,r,a,n){var i=this;var o=[];var s=[];var l=[];var c=[];t.forEach((function(e){var t=true;r.forEach((function(r){var n="".concat(e,"|").concat(r);if(!a.reload&&i.store.hasResourceBundle(e,r)){i.state[n]=2}else if(i.state[n]<0);else if(i.state[n]===1){if(s.indexOf(n)<0)s.push(n)}else{i.state[n]=1;t=false;if(s.indexOf(n)<0)s.push(n);if(o.indexOf(n)<0)o.push(n);if(c.indexOf(r)<0)c.push(r)}}));if(!t)l.push(e)}));if(o.length||s.length){this.queue.push({pending:s,loaded:{},errors:[],callback:n})}return{toLoad:o,pending:s,toLoadLanguages:l,toLoadNamespaces:c}}},{key:"loaded",value:function e(t,r,a){var n=t.split("|");var i=n[0];var o=n[1];if(r)this.emit("failedLoading",i,o,r);if(a){this.store.addResourceBundle(i,o,a)}this.state[t]=r?-1:2;var e={};this.queue.forEach((function(a){pushPath(a.loaded,[i],o);remove(a.pending,t);if(r)a.errors.push(r);if(a.pending.length===0&&!a.done){Object.keys(a.loaded).forEach((function(t){if(!e[t])e[t]=[];if(a.loaded[t].length){a.loaded[t].forEach((function(r){if(e[t].indexOf(r)<0)e[t].push(r)}))}}));a.done=true;if(a.errors.length){a.callback(a.errors)}else{a.callback()}}}));this.emit("loaded",e);this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,r,a){var n=this;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:350;var s=arguments.length>5?arguments[5]:undefined;if(!t.length)return s(null,{});return this.backend[a](t,r,(function(e,l){if(e&&l&&i<5){setTimeout((function(){n.read.call(n,t,r,a,i+1,o*2,s)}),o);return}s(e,l)}))}},{key:"prepareLoading",value:function e(t,r){var a=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=arguments.length>3?arguments[3]:undefined;if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return i&&i()}if(typeof t==="string")t=this.languageUtils.toResolveHierarchy(t);if(typeof r==="string")r=[r];var o=this.queueLoad(t,r,n,i);if(!o.toLoad.length){if(!o.pending.length)i();return null}o.toLoad.forEach((function(e){a.loadOne(e)}))}},{key:"load",value:function e(t,r,a){this.prepareLoading(t,r,{},a)}},{key:"reload",value:function e(t,r,a){this.prepareLoading(t,r,{reload:true},a)}},{key:"loadOne",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var n=t.split("|");var i=n[0];var o=n[1];this.read(i,o,"read",undefined,undefined,(function(e,n){if(e)r.logger.warn("".concat(a,"loading namespace ").concat(o," for language ").concat(i," failed"),e);if(!e&&n)r.logger.log("".concat(a,"loaded namespace ").concat(o," for language ").concat(i),n);r.loaded(t,e,n)}))}},{key:"saveMissing",value:function e(t,r,a,n,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(a===undefined||a===null||a==="")return;if(this.backend&&this.backend.create){this.backend.create(t,r,a,n,null,_objectSpread({},o,{isUpdate:i}))}if(!t||!t[0])return;this.store.addResource(t[0],r,a,n)}}]);return t}(EventEmitter$1);function get(){return{debug:false,initImmediate:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:true,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:function e(t){var r={};if(_typeof$1(t[1])==="object")r=t[1];if(typeof t[1]==="string")r.defaultValue=t[1];if(typeof t[2]==="string")r.tDescription=t[2];if(_typeof$1(t[2])==="object"||_typeof$1(t[3])==="object"){var a=t[3]||t[2];Object.keys(a).forEach((function(e){r[e]=a[e]}))}return r},interpolation:{escapeValue:true,format:function e(t,r,a,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true}}}function transformOptions(e){if(typeof e.ns==="string")e.ns=[e.ns];if(typeof e.fallbackLng==="string")e.fallbackLng=[e.fallbackLng];if(typeof e.fallbackNS==="string")e.fallbackNS=[e.fallbackNS];if(e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0){e.supportedLngs=e.supportedLngs.concat(["cimode"])}return e}function noop(){}var I18n=function(e){_inherits(t,e);function t(){var e;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;_classCallCheck(this,t);e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(e))}e.options=transformOptions(r);e.services={};e.logger=baseLogger;e.modules={external:[]};if(a&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate){e.init(r,a);return _possibleConstructorReturn(e,_assertThisInitialized(e))}setTimeout((function(){e.init(r,a)}),0)}return e}_createClass(t,[{key:"init",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;if(typeof r==="function"){a=r;r={}}if(!r.defaultNS&&r.ns){if(typeof r.ns==="string"){r.defaultNS=r.ns}else if(r.ns.indexOf("translation")<0){r.defaultNS=r.ns[0]}}this.options=_objectSpread({},get(),this.options,transformOptions(r));if(r.keySeparator!==undefined){this.options.userDefinedKeySeparator=r.keySeparator}this.format=this.options.interpolation.format;if(!a)a=noop;function n(e){if(!e)return null;if(typeof e==="function")return new e;return e}if(!this.options.isClone){if(this.modules.logger){baseLogger.init(n(this.modules.logger),this.options)}else{baseLogger.init(null,this.options)}var i=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var o=this.services;o.logger=baseLogger;o.resourceStore=this.store;o.languageUtils=i;o.pluralResolver=new PluralResolver(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix});o.interpolator=new Interpolator(this.options);o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};o.backendConnector=new Connector(n(this.modules.backend),o.resourceStore,o,this.options);o.backendConnector.on("*",(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}t.emit.apply(t,[e].concat(a))}));if(this.modules.languageDetector){o.languageDetector=n(this.modules.languageDetector);o.languageDetector.init(o,this.options.detection,this.options)}if(this.modules.i18nFormat){o.i18nFormat=n(this.modules.i18nFormat);if(o.i18nFormat.init)o.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}t.emit.apply(t,[e].concat(a))}));this.modules.external.forEach((function(e){if(e.init)e.init(t)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(s.length>0&&s[0]!=="dev")this.options.lng=s[0]}if(!this.services.languageDetector&&!this.options.lng){this.logger.warn("init: no languageDetector is used and no lng is defined")}var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var r;(r=t.store)[e].apply(r,arguments);return t}}));var p=defer();var d=function e(){var r=function e(r,n){if(t.isInitialized&&!t.initializedStoreOnce)t.logger.warn("init: i18next is already initialized. You should call init just once!");t.isInitialized=true;if(!t.options.isClone)t.logger.log("initialized",t.options);t.emit("initialized",t.options);p.resolve(n);a(r,n)};if(t.languages&&t.options.compatibilityAPI!=="v1"&&!t.isInitialized)return r(null,t.t.bind(t));t.changeLanguage(t.options.lng,r)};if(this.options.resources||!this.options.initImmediate){d()}else{setTimeout(d,0)}return p}},{key:"loadResources",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var n=a;var i=typeof t==="string"?t:this.language;if(typeof t==="function")n=t;if(!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return n();var o=[];var s=function e(t){if(!t)return;var a=r.services.languageUtils.toResolveHierarchy(t);a.forEach((function(e){if(o.indexOf(e)<0)o.push(e)}))};if(!i){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach((function(e){return s(e)}))}else{s(i)}if(this.options.preload){this.options.preload.forEach((function(e){return s(e)}))}this.services.backendConnector.load(o,this.options.ns,n)}else{n(null)}}},{key:"reloadResources",value:function e(t,r,a){var n=defer();if(!t)t=this.languages;if(!r)r=this.options.ns;if(!a)a=noop;this.services.backendConnector.reload(t,r,(function(e){n.resolve();a(e)}));return n}},{key:"use",value:function e(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");if(t.type==="backend"){this.modules.backend=t}if(t.type==="logger"||t.log&&t.warn&&t.error){this.modules.logger=t}if(t.type==="languageDetector"){this.modules.languageDetector=t}if(t.type==="i18nFormat"){this.modules.i18nFormat=t}if(t.type==="postProcessor"){postProcessor.addPostProcessor(t)}if(t.type==="3rdParty"){this.modules.external.push(t)}return this}},{key:"changeLanguage",value:function e(t,r){var a=this;this.isLanguageChangingTo=t;var n=defer();this.emit("languageChanging",t);var i=function e(t){a.language=t;a.languages=a.services.languageUtils.toResolveHierarchy(t);a.resolvedLanguage=undefined;if(["cimode","dev"].indexOf(t)>-1)return;for(var r=0;r<a.languages.length;r++){var n=a.languages[r];if(["cimode","dev"].indexOf(n)>-1)continue;if(a.store.hasLanguageSomeTranslations(n)){a.resolvedLanguage=n;break}}};var o=function e(t,o){if(o){i(o);a.translator.changeLanguage(o);a.isLanguageChangingTo=undefined;a.emit("languageChanged",o);a.logger.log("languageChanged",o)}else{a.isLanguageChangingTo=undefined}n.resolve((function(){return a.t.apply(a,arguments)}));if(r)r(t,(function(){return a.t.apply(a,arguments)}))};var s=function e(r){if(!t&&!r&&a.services.languageDetector)r=[];var n=typeof r==="string"?r:a.services.languageUtils.getBestMatchFromCodes(r);if(n){if(!a.language){i(n)}if(!a.translator.language)a.translator.changeLanguage(n);if(a.services.languageDetector)a.services.languageDetector.cacheUserLanguage(n)}a.loadResources(n,(function(e){o(e,n)}))};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async){s(this.services.languageDetector.detect())}else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){this.services.languageDetector.detect(s)}else{s(t)}return n}},{key:"getFixedT",value:function e(t,r,a){var n=this;var i=function e(t,r){var i;if(_typeof$1(r)!=="object"){for(var o=arguments.length,s=new Array(o>2?o-2:0),l=2;l<o;l++){s[l-2]=arguments[l]}i=n.options.overloadTranslationOptionHandler([t,r].concat(s))}else{i=_objectSpread({},r)}i.lng=i.lng||e.lng;i.lngs=i.lngs||e.lngs;i.ns=i.ns||e.ns;var c=n.options.keySeparator||".";var p=a?"".concat(a).concat(c).concat(t):t;return n.t(p,i)};if(typeof t==="string"){i.lng=t}else{i.lngs=t}i.ns=r;i.keyPrefix=a;return i}},{key:"t",value:function e(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function e(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function e(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}var n=this.resolvedLanguage||this.languages[0];var i=this.options?this.options.fallbackLng:false;var o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return true;var s=function e(t,a){var n=r.services.backendConnector.state["".concat(t,"|").concat(a)];return n===-1||n===2};if(a.precheck){var l=a.precheck(this,s);if(l!==undefined)return l}if(this.hasResourceBundle(n,t))return true;if(!this.services.backendConnector.backend)return true;if(s(n,t)&&(!i||s(o,t)))return true;return false}},{key:"loadNamespaces",value:function e(t,r){var a=this;var n=defer();if(!this.options.ns){r&&r();return Promise.resolve()}if(typeof t==="string")t=[t];t.forEach((function(e){if(a.options.ns.indexOf(e)<0)a.options.ns.push(e)}));this.loadResources((function(e){n.resolve();if(r)r(e)}));return n}},{key:"loadLanguages",value:function e(t,r){var a=defer();if(typeof t==="string")t=[t];var n=this.options.preload||[];var i=t.filter((function(e){return n.indexOf(e)<0}));if(!i.length){if(r)r();return Promise.resolve()}this.options.preload=n.concat(i);this.loadResources((function(e){a.resolve();if(r)r(e)}));return a}},{key:"dir",value:function e(t){if(!t)t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language);if(!t)return"rtl";var r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;return new t(r,a)}},{key:"cloneInstance",value:function e(){var r=this;var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var i=_objectSpread({},this.options,a,{isClone:true});var o=new t(i);var s=["store","services","language"];s.forEach((function(e){o[e]=r[e]}));o.services=_objectSpread({},this.services);o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)};o.translator=new Translator(o.services,o.options);o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++){r[a-1]=arguments[a]}o.emit.apply(o,[e].concat(r))}));o.init(i,n);o.translator.options=o.options;o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)};return o}},{key:"toJSON",value:function e(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]);return t}(EventEmitter$1);var i18next=new I18n;var login_dialog$1={heading:"Drucke mit ezeep Blue",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken.",action:"Anmelden"};var no_document_dialog$1={heading:"Keine Datei ausgewählt",description:"Wähle zunächst eine Datei zum Drucken aus.",action:"OK"};var printer_selection$1={loading:"Lade meine Drucker…",print:"Drucken",printer:"Drucker",print_processing:"Drucken…",print_success:"Erfolgreich gedruckt.",print_failed:"Druck fehlgeschlagen",not_supported:"Der ausgewählte Dateityp wird nicht unterstützt.",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Beidseitig",quality:"Druckqualität",select_printer:"Wähle einen Drucker",select_color:"Wähle Farbe/Graustufen",select_size:"Wähle Papierformat",select_orientation:"Wähle Ausrichtung",select_quality:"Wähle Druckqualität",select_duplex:"Wähle Beidseitig",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort",no_printers:"Keine Drucker gefunden.",prepare_upload:"Vorbereiten…",uploading:"Hochladen…",duplex_none:"Keine",copies:"Kopien",duplex_long:"auf der langen Seite umdrehen",duplex_short:"auf der kurzen Seite umdrehen",pull_print_success:"Bereit zum Auslösen.",width:"Breite",length:"Länge"};var button_actions$1={login:"Anmelden",print:"Drucken",cancel:"Abbrechen",close:"Schließen",retry:"Wiederholen",select_printer:"Wähle Drucker"};var upload$1={description:"Ziehe eine Datei hier in den Browser ",meta_leading:"oder",meta_select:"wähle eine Datei aus",meta_trailing:"um mit ezeep Blue zu drucken.",selected_file:"Ausgewählte Datei:"};var user_menu$1={theme:"Farbschema",appearance:"Darstellung",system:"System",light:"Hell",dark:"Dunkel",account:"Konto verwalten",help:"Hilfe & Unterstützung",logout:"Ausloggen"};var translationsDE={login_dialog:login_dialog$1,no_document_dialog:no_document_dialog$1,printer_selection:printer_selection$1,button_actions:button_actions$1,upload:upload$1,user_menu:user_menu$1};var login_dialog={heading:"Print with ezeep Blue",description:"Sign in with your ezeep Blue account to print.",action:"Sign in"};var no_document_dialog={heading:"No file selected",description:"Select a file first to print.",action:"OK"};var printer_selection={loading:"Loading My Printers…",print_processing:"Printing…",print_success:"Successfully printed.",pull_print_success:"Ready to be released.",print_failed:"Print failed",not_supported:"The selected file type is not supported.",prepare_upload:"Preparing…",uploading:"Uploading…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper Size",duplex:"Double-sided",duplex_none:"None",duplex_long:"flip on long side",duplex_short:"flip on short side",quality:"Print Quality",select_printer:"Select a printer",select_color:"Select Color/Grayscale",select_orientation:"Select Orientation",select_size:"Select Paper Size",select_quality:"Select Print Quality",select_duplex:"Select Double-sided",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location",no_printers:"No printers found.",copies:"Copies",width:"Width",length:"Length"};var button_actions={login:"Sign In",print:"Print",cancel:"Cancel",close:"Close",retry:"Retry",select_printer:"Select Printer"};var upload={description:"Drop a file here into the browser ",meta_leading:"or",meta_select:"select a file",meta_trailing:"to print with ezeep Blue.",selected_file:"Selected File:"};var user_menu={theme:"Color theme",appearance:"Appearance",system:"System",light:"Light",dark:"Dark",account:"Manage Account",help:"Help & Support",logout:"Logout"};var translationsEN={login_dialog:login_dialog,no_document_dialog:no_document_dialog,printer_selection:printer_selection,button_actions:button_actions,upload:upload,user_menu:user_menu};function encodeFormData(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function initi18n(e){var t={en:{translation:translationsEN},de:{translation:translationsDE}};if(e!=""){i18next.init({resources:t,lng:e,nsSeparator:false,fallbackLng:"en"})}else{i18next.init({resources:t,lng:navigator.language,nsSeparator:false,fallbackLng:"en"})}}var poll=function(e){var t=e.fn,r=e.validate,a=e.interval,n=e.maxAttempts;return __awaiter(void 0,void 0,void 0,(function(){var e,i;return __generator(this,(function(o){e=0;i=function(o,s){return __awaiter(void 0,void 0,void 0,(function(){var l;return __generator(this,(function(c){switch(c.label){case 0:return[4,t()];case 1:l=c.sent();e++;if(r(l)){return[2,o(l)]}else if(n&&e===n){return[2,s(new Error("Exceeded max attempts."))]}else{setTimeout(i,a,o,s)}return[2]}}))}))};return[2,new Promise(i)]}))}))};var removeEmptyStrings=function(e){var t={};Object.keys(e).forEach((function(r){if(e[r]!==""){t[r]=e[r]}}));return t};var managePaperDimensions=function(e){if(e.paperid!=PAPER_ID){delete e.paperlength;delete e.paperwidth}if(e.paperlength&&e.paperwidth){e.paperlength=+e.paperlength*10;e.paperwidth=+e.paperwidth*10}return e};var PAPER_ID=256;var EzpAuthorizationService=function(){function e(e,t){this.urlParams=new URLSearchParams;this.isAuthorized=false;this.redirectURI=e;this.clientID=t;this.oauthUrl=authStore.state.authApiHostUrl;this.authURI=new URL("https://".concat(this.oauthUrl,"/oauth/authorize/"));this.accessTokenURL="https://".concat(this.oauthUrl,"/oauth/access_token/")}e.prototype.generateCodeVerifier=function(){if(authStore.state.codeVerifier!==""){this.codeVerifier=authStore.state.codeVerifier}else{var e=new Uint8Array(128);var t=crypto.getRandomValues(e);var r=btoa(t.toString()).substr(0,128);this.codeVerifier=r;authStore.state.codeVerifier=this.codeVerifier}};e.prototype.generateCodeChallenge=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=new TextEncoder;r=t.encode(e);return[4,crypto.subtle.digest("SHA-256",r)];case 1:a=i.sent();n=btoa(String.fromCharCode.apply(null,new Uint8Array(a)));this.codeChallenge=n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return[2]}}))}))};e.prototype.buildAuthURI=function(){this.urlParams.append("response_type","code");this.urlParams.append("client_id",this.clientID);this.urlParams.append("redirect_uri",this.redirectURI);this.urlParams.append("code_challenge",this.codeChallenge);this.urlParams.append("code_challenge_method","S256");this.authURI.search=this.urlParams.toString();authStore.state.authUri=this.authURI.toString()};e.prototype.getAccessToken=function(){var e=this;return fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"authorization_code",scope:"printing",code:authStore.state.code,redirect_uri:this.redirectURI,code_verifier:authStore.state.codeVerifier})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){authStore.state.isAuthorized=true;e.isAuthorized=authStore.state.isAuthorized;localStorage.setItem("isAuthorized",e.isAuthorized.toString());e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken}}))};e.prototype.refreshTokens=function(){var e=this;fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"refresh_token",scope:"printing",refresh_token:authStore.state.refreshToken})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken;authStore.state.isAuthorized=true}}))};e.prototype.revokeRefreshToken=function(){if(authStore.state.refreshToken)fetch("https://".concat(this.oauthUrl,"/oauth/revoke/"),{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({token:authStore.state.refreshToken})}).catch((function(e){console.log(e)}))};return e}();var authStore=createStore({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:false,devApi:false,authApiHostUrl:"",redirectUri:"",authUri:""});function sendCodeToParentWindow(){var e=new URLSearchParams(window.location.search);var t=e.get("code");if(window.opener){if(t){window.opener.postMessage(t,authStore.state.redirectUri);window.close()}}}var ezpAuthCss=":host{--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent);display:block}";var EzpAuth=function(){function e(e){registerInstance(this,e);this.authCancel=createEvent(this,"authCancel",7);this.authSuccess=createEvent(this,"authSuccess",7);this.oauthPopupWindow=null;this.previousUrl=null}e.prototype.listenDialogAction=function(){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")};e.prototype.listenDialogClose=function(){this.authCancel.emit()};e.prototype.listenStatusCancel=function(){this.authCancel.emit()};e.prototype.openSignInWindow=function(e,t){var r=this;if(authStore.state.isAuthorized){this.authCancel.emit();this.authSuccess.emit();return}window.removeEventListener("message",this.receiveMessage);var a="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";if(this.oauthPopupWindow===null||this.oauthPopupWindow.closed){this.oauthPopupWindow=window.open(e,t,a)}else if(this.previousUrl!==this.auth.authURI.toString()){this.oauthPopupWindow=window.open(e,t,a);if(!this.oauthPopupWindow||this.oauthPopupWindow.closed||typeof this.oauthPopupWindow.closed=="undefined"){alert("popup blocked")}this.oauthPopupWindow.focus()}else{this.oauthPopupWindow.focus()}window.addEventListener("message",(function(e){return r.receiveMessage(e)}),false);this.previousUrl=this.auth.authURI};e.prototype.receiveMessage=function(e){var t=this;authStore.state.code=e.data;this.auth.getAccessToken().then((function(){t.authCancel.emit();t.authSuccess.emit()}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.auth=new EzpAuthorizationService(this.redirectURI,this.clientID);if(!this.code)return[3,2];authStore.state.code=this.code;return[4,this.auth.getAccessToken()];case 1:e.sent();this.authCancel.emit();this.authSuccess.emit();e.label=2;case 2:if(!(authStore.state.isAuthorized===false))return[3,4];this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 3:e.sent();this.auth.buildAuthURI();e.label=4;case 4:if(this.hidelogin&&this.trigger==="button"){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,this.hidelogin&&this.trigger==="button"?h("ezp-status",{description:i18next.t("login_dialog.action"),processing:true,cancel:true}):this.hidelogin&&this.trigger==="file"?h("ezp-text-button",{type:"button",level:"primary",onClick:function(){return e.openSignInWindow(e.auth.authURI.toString(),"ezeep Login")},label:i18next.t("button_actions.select_printer")}):h("ezp-dialog",{heading:i18next.t("login_dialog.heading"),description:i18next.t("login_dialog.description"),action:i18next.t("login_dialog.action"),iconName:"logo",iconSize:"huge",iconFramed:false,instance:"login"}))};return e}();EzpAuth.style=ezpAuthCss;var ezpBackdropCss=":host{-webkit-animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);background:var(--ezp-core-backdrop);border-radius:var(--ezp-backdrop-border-radius, 6px);display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--ezp-backdrop-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}";var EzpBackdrop=function(){function e(e){registerInstance(this,e);this.backdropHideStart=createEvent(this,"backdropHideStart",7);this.backdropHideEnd=createEvent(this,"backdropHideEnd",7);this.visible=true}e.prototype.handleClick=function(){this.visible=false;this.backdropHideStart.emit()};e.prototype.listenAnimationEnd=function(){if(!this.visible){this.backdropHideEnd.emit()}};e.prototype.render=function(){var e=this;return h(Host,{class:{hide:!this.visible},onClick:function(){return e.handleClick()}})};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();EzpBackdrop.style=ezpBackdropCss;var ezpDialogCss=":host{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-line-pack:center;align-content:center;background:var(--ezp-core-backdrop);display:grid;grid-template:auto/minmax(auto, 280px);height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}#box{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10))}#header{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;padding:var(--ezp-spacing-2) var(--ezp-spacing-3)}#body{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);padding:0 var(--ezp-spacing-5);text-align:center}#text{color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4)}#footer{display:grid;grid-template:auto/minmax(144px, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-5)}";var EzpDialog=function(){function e(e){var t=this;registerInstance(this,e);this.dialogClose=createEvent(this,"dialogClose",7);this.dialogAction=createEvent(this,"dialogAction",7);this.action=i18next.t("button_actions.close");this.iconSize="large";this.iconFramed=true;this.handleClose=function(){t.dialogClose.emit(t.instance)};this.handleAction=function(){t.dialogAction.emit(t.instance)}}e.prototype.componentWillLoad=function(){};e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},h("div",{id:"header"},h("ezp-icon-button",{level:"tertiary",icon:"close",type:"button",onClick:this.handleClose})),h("div",{id:"body"},this.iconName&&h("ezp-icon",{name:this.iconName,size:this.iconSize,framed:this.iconFramed}),h("div",{id:"text"},h("ezp-label",{text:this.heading,weight:"heavy"}),h("ezp-label",{text:this.description}))),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"primary",onClick:this.handleAction,label:this.action}))))};return e}();EzpDialog.style=ezpDialogCss;var ezpIconCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}";var EzpIcon=function(){function e(e){registerInstance(this,e);this.size="normal";this.framed=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(getAssetPath("./assets/glyph-".concat(this.name,".svg"))).then((function(e){return e.text()})).then((function(t){e.glyph=t})).catch((function(e){return console.log(e)}))];case 1:t.sent();return[2]}}))}))};e.prototype.render=function(){return h(Host,{class:"".concat(this.size," ").concat(this.framed?"framed":"")},h("div",{id:"glyph",innerHTML:this.glyph}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();EzpIcon.style=ezpIconCss;var ezpIconButtonCss=":host{display:block}:host(.primary){--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:var(--ezp-theme-solid);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-white-100);--ezp-iconButton-opacity-active:0.74;--ezp-iconButton-opacity-hover:0.84}:host(.secondary){--ezp-iconButton-background-active:var(--ezp-core-shade-tertiary);--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-hover:var(--ezp-core-shade-secondary);--ezp-iconButton-background-init:var(--ezp-core-shade-primary);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-iconButton-background-active:var(--ezp-core-shade-secondary);--ezp-iconButton-background-hover:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.quaternary){--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid);--ezp-iconButton-opacity-active:0.58;--ezp-iconButton-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-iconButton-background, var(--ezp-iconButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-iconButton-color, var(--ezp-iconButton-color-init));cursor:var(--ezp-iconButton-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-iconButton-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--ezp-iconButton-background:var(\n --ezp-iconButton-background-hover,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-iconButton-background:var(\n --ezp-iconButton-background-active,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-active, 1)}}#button:disabled{--ezp-iconButton-background:var(\n --ezp-iconButton-background-disabled,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-color:var(--ezp-iconButton-color-disabled);--ezp-iconButton-cursor:default}";var EzpIconButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:"".concat(this.level)},h(e,Object.assign({id:"button"},t),h("ezp-icon",{name:this.icon})))};return e}();EzpIconButton.style=ezpIconButtonCss;var ezpInputCss=':host{display:grid;grid-template:var(--ezp-input-grid-template, auto/auto auto 1fr);height:30px;position:relative;gap:var(--ezp-spacing-3);background:var(--ezp-input-background, var(--ezp-core-surface-tertiary));padding:0 var(--ezp-spacing-3);z-index:var(--ezp-input-z-index, 3);border-radius:var(--ezp-input-border-radius, 0);-webkit-box-shadow:var(--ezp-input-box-shadow-position-top, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-right, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-bottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-left, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-input-box-shadow-position-top, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-right, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-bottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-left, -1px 0 0 0) var(--ezp-core-outline);-ms-flex-align:center;align-items:center;cursor:pointer}:host([suffix]){--ezp-input-grid-template:auto / auto auto 1fr auto;--ezp-input-input-padding-right:0}:host(.focused){--ezp-input-icon-color:var(--ezp-theme-solid);--ezp-input-label-color:var(--ezp-theme-solid)}:host(:first-child){--ezp-input-border-radius:3px 3px 0 0}:host(:last-child){--ezp-input-border-radius:0 0 3px 3px}:host(:first-child:last-child){--ezp-input-border-radius:3px}:host(:not(:last-child)){--ezp-input-box-shadow-position-bottom:0 0 0 0}:host(:hover){--ezp-input-background:linear-gradient(\n 0deg,\n var(--ezp-core-shade-primary) 0%,\n var(--ezp-core-shade-primary) 100%\n ),\n var(--ezp-core-surface-tertiary)}#label{color:var(--ezp-input-label-color, var(--ezp-core-foreground-secondary))}#icon{color:var(--ezp-input-icon-color, var(--ezp-core-foreground-secondary))}#input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0 var(--ezp-input-input-padding-right, var(--ezp-spacing-1)) 0 0;text-align:right;width:100%}#input[type=number]::-webkit-inner-spin-button,#input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}#suffix{color:var(--ezp-core-foreground-tertiary)}';var EzpInput=function(){function e(e){var t=this;registerInstance(this,e);this.inputValueChanged=createEvent(this,"inputValueChanged",7);this.timeout=null;this.label="Label";this.type="text";this.icon="color";this.focused=false;this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.handleChange=function(e){var t=this;if(this.timeout){clearTimeout(this.timeout)}this.value=e.target.value?e.target.value:0;this.timeout=setTimeout((function(){t.inputValueChanged.emit({type:t.eventType.toLowerCase(),value:t.value})}),500)};e.prototype.render=function(){var e=this;return h(Host,{class:{focused:this.focused},onClick:this.setFocus},h("ezp-icon",{id:"icon",name:this.icon}),h("ezp-label",{id:"label",noWrap:true,level:"secondary",text:this.label}),h("input",{id:"input",type:this.type,value:this.value,onInput:function(t){return e.handleChange(t)},ref:function(t){return e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur}),this.suffix?h("ezp-label",{id:"suffix",level:"secondary",text:this.suffix}):null)};return e}();EzpInput.style=ezpInputCss;var ezpLabelCss=':host{display:block;min-width:var(--ezp-label-minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--ezp-label-offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--ezp-label-offset) + 1px) * -1)}:host(.no-wrap){--ezp-label-whiteSpace:nowrap}:host(.ellipsis){--ezp-label-minWidth:0;--ezp-label-overflow:hidden;--ezp-label-textOverflow:ellipsis;--ezp-label-whiteSpace:nowrap;--ezp-label-width:100%}:host(.primary){--ezp-label-fontSize:17px;--ezp-label-lineHeight:24px;--ezp-label-letterSpacing:-0.0127756105em;--ezp-label-offset:6px}:host(.secondary){--ezp-label-fontSize:14px;--ezp-label-lineHeight:20px;--ezp-label-letterSpacing:-0.0062235443em;--ezp-label-offset:5px}:host(.tertiary){--ezp-label-fontSize:12px;--ezp-label-lineHeight:18px;--ezp-label-letterSpacing:0.0004907745em;--ezp-label-offset:5px}:host(.soft){--ezp-label-fontWeight:400}:host(.strong){--ezp-label-fontWeight:500}:host(.heavy){--ezp-label-fontWeight:600}#text{font-size:var(--ezp-label-fontSize);font-weight:var(--ezp-label-fontWeight);letter-spacing:var(--ezp-label-letterSpacing);line-height:var(--ezp-label-lineHeight);overflow:var(--ezp-label-overflow, visible);text-overflow:var(--ezp-label-textOverflow, clip);white-space:var(--ezp-label-whiteSpace, normal);width:var(--ezp-label-width, auto)}';var EzpLabel=function(){function e(e){registerInstance(this,e);this.ellipsis=false;this.level="secondary";this.noWrap=false;this.text="Label";this.weight="soft"}e.prototype.render=function(){return h(Host,{class:"".concat(this.level," ").concat(this.weight," ").concat(this.ellipsis?"ellipsis":""," ").concat(this.noWrap?"no-wrap":"")},h("div",{id:"text"},this.text))};return e}();EzpLabel.style=ezpLabelCss;var global$2=typeof globalThis!=="undefined"&&globalThis||typeof self!=="undefined"&&self||typeof global$2!=="undefined"&&global$2;var support={searchParams:"URLSearchParams"in global$2,iterable:"Symbol"in global$2&&"iterator"in Symbol,blob:"FileReader"in global$2&&"Blob"in global$2&&function(){try{new Blob;return true}catch(e){return false}}(),formData:"FormData"in global$2,arrayBuffer:"ArrayBuffer"in global$2};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}if(support.arrayBuffer){var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];var isArrayBufferView=ArrayBuffer.isView||function(e){return e&&viewClasses.indexOf(Object.prototype.toString.call(e))>-1}}function normalizeName(e){if(typeof e!=="string"){e=String(e)}if(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===""){throw new TypeError('Invalid character in header field name: "'+e+'"')}return e.toLowerCase()}function normalizeValue(e){if(typeof e!=="string"){e=String(e)}return e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:t===undefined,value:t}}};if(support.iterable){t[Symbol.iterator]=function(){return t}}return t}function Headers(e){this.map={};if(e instanceof Headers){e.forEach((function(e,t){this.append(t,e)}),this)}else if(Array.isArray(e)){e.forEach((function(e){this.append(e[0],e[1])}),this)}else if(e){Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}}Headers.prototype.append=function(e,t){e=normalizeName(e);t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};Headers.prototype["delete"]=function(e){delete this.map[normalizeName(e)]};Headers.prototype.get=function(e){e=normalizeName(e);return this.has(e)?this.map[e]:null};Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))};Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)};Headers.prototype.forEach=function(e,t){for(var r in this.map){if(this.map.hasOwnProperty(r)){e.call(t,this.map[r],r,this)}}};Headers.prototype.keys=function(){var e=[];this.forEach((function(t,r){e.push(r)}));return iteratorFor(e)};Headers.prototype.values=function(){var e=[];this.forEach((function(t){e.push(t)}));return iteratorFor(e)};Headers.prototype.entries=function(){var e=[];this.forEach((function(t,r){e.push([r,t])}));return iteratorFor(e)};if(support.iterable){Headers.prototype[Symbol.iterator]=Headers.prototype.entries}function consumed(e){if(e.bodyUsed){return Promise.reject(new TypeError("Already read"))}e.bodyUsed=true}function fileReaderReady(e){return new Promise((function(t,r){e.onload=function(){t(e.result)};e.onerror=function(){r(e.error)}}))}function readBlobAsArrayBuffer(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsArrayBuffer(e);return r}function readBlobAsText(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsText(e);return r}function readArrayBufferAsText(e){var t=new Uint8Array(e);var r=new Array(t.length);for(var a=0;a<t.length;a++){r[a]=String.fromCharCode(t[a])}return r.join("")}function bufferClone(e){if(e.slice){return e.slice(0)}else{var t=new Uint8Array(e.byteLength);t.set(new Uint8Array(e));return t.buffer}}function Body(){this.bodyUsed=false;this._initBody=function(e){this.bodyUsed=this.bodyUsed;this._bodyInit=e;if(!e){this._bodyText=""}else if(typeof e==="string"){this._bodyText=e}else if(support.blob&&Blob.prototype.isPrototypeOf(e)){this._bodyBlob=e}else if(support.formData&&FormData.prototype.isPrototypeOf(e)){this._bodyFormData=e}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this._bodyText=e.toString()}else if(support.arrayBuffer&&support.blob&&isDataView(e)){this._bodyArrayBuffer=bufferClone(e.buffer);this._bodyInit=new Blob([this._bodyArrayBuffer])}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))){this._bodyArrayBuffer=bufferClone(e)}else{this._bodyText=e=Object.prototype.toString.call(e)}if(!this.headers.get("content-type")){if(typeof e==="string"){this.headers.set("content-type","text/plain;charset=UTF-8")}else if(this._bodyBlob&&this._bodyBlob.type){this.headers.set("content-type",this._bodyBlob.type)}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")}}};if(support.blob){this.blob=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return Promise.resolve(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(new Blob([this._bodyArrayBuffer]))}else if(this._bodyFormData){throw new Error("could not read FormData body as blob")}else{return Promise.resolve(new Blob([this._bodyText]))}};this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=consumed(this);if(e){return e}if(ArrayBuffer.isView(this._bodyArrayBuffer)){return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength))}else{return Promise.resolve(this._bodyArrayBuffer)}}else{return this.blob().then(readBlobAsArrayBuffer)}}}this.text=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return readBlobAsText(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))}else if(this._bodyFormData){throw new Error("could not read FormData body as text")}else{return Promise.resolve(this._bodyText)}};if(support.formData){this.formData=function(){return this.text().then(decode)}}this.json=function(){return this.text().then(JSON.parse)};return this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return methods.indexOf(t)>-1?t:e}function Request$1(e,t){if(!(this instanceof Request$1)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}t=t||{};var r=t.body;if(e instanceof Request$1){if(e.bodyUsed){throw new TypeError("Already read")}this.url=e.url;this.credentials=e.credentials;if(!t.headers){this.headers=new Headers(e.headers)}this.method=e.method;this.mode=e.mode;this.signal=e.signal;if(!r&&e._bodyInit!=null){r=e._bodyInit;e.bodyUsed=true}}else{this.url=String(e)}this.credentials=t.credentials||this.credentials||"same-origin";if(t.headers||!this.headers){this.headers=new Headers(t.headers)}this.method=normalizeMethod(t.method||this.method||"GET");this.mode=t.mode||this.mode||null;this.signal=t.signal||this.signal;this.referrer=null;if((this.method==="GET"||this.method==="HEAD")&&r){throw new TypeError("Body not allowed for GET or HEAD requests")}this._initBody(r);if(this.method==="GET"||this.method==="HEAD"){if(t.cache==="no-store"||t.cache==="no-cache"){var a=/([?&])_=[^&]*/;if(a.test(this.url)){this.url=this.url.replace(a,"$1_="+(new Date).getTime())}else{var n=/\?/;this.url+=(n.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})};function decode(e){var t=new FormData;e.trim().split("&").forEach((function(e){if(e){var r=e.split("=");var a=r.shift().replace(/\+/g," ");var n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(a),decodeURIComponent(n))}}));return t}function parseHeaders$1(e){var t=new Headers;var r=e.replace(/\r?\n[\t ]+/g," ");r.split("\r").map((function(e){return e.indexOf("\n")===0?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":");var a=r.shift().trim();if(a){var n=r.join(":").trim();t.append(a,n)}}));return t}Body.call(Request$1.prototype);function Response(e,t){if(!(this instanceof Response)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}if(!t){t={}}this.type="default";this.status=t.status===undefined?200:t.status;this.ok=this.status>=200&&this.status<300;this.statusText=t.statusText===undefined?"":""+t.statusText;this.headers=new Headers(t.headers);this.url=t.url||"";this._initBody(e)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var e=new Response(null,{status:0,statusText:""});e.type="error";return e};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(e,t){if(redirectStatuses.indexOf(t)===-1){throw new RangeError("Invalid status code")}return new Response(null,{status:t,headers:{location:e}})};var DOMException=global$2.DOMException;try{new DOMException}catch(e){DOMException=function(e,t){this.message=e;this.name=t;var r=Error(e);this.stack=r.stack};DOMException.prototype=Object.create(Error.prototype);DOMException.prototype.constructor=DOMException}function fetch$1(e,t){return new Promise((function(r,a){var n=new Request$1(e,t);if(n.signal&&n.signal.aborted){return a(new DOMException("Aborted","AbortError"))}var i=new XMLHttpRequest;function o(){i.abort()}i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:parseHeaders$1(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;setTimeout((function(){r(new Response(t,e))}),0)};i.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)};i.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)};i.onabort=function(){setTimeout((function(){a(new DOMException("Aborted","AbortError"))}),0)};function s(e){try{return e===""&&global$2.location.href?global$2.location.href:e}catch(t){return e}}i.open(n.method,s(n.url),true);if(n.credentials==="include"){i.withCredentials=true}else if(n.credentials==="omit"){i.withCredentials=false}if("responseType"in i){if(support.blob){i.responseType="blob"}else if(support.arrayBuffer&&n.headers.get("Content-Type")&&n.headers.get("Content-Type").indexOf("application/octet-stream")!==-1){i.responseType="arraybuffer"}}if(t&&typeof t.headers==="object"&&!(t.headers instanceof Headers)){Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,normalizeValue(t.headers[e]))}))}else{n.headers.forEach((function(e,t){i.setRequestHeader(t,e)}))}if(n.signal){n.signal.addEventListener("abort",o);i.onreadystatechange=function(){if(i.readyState===4){n.signal.removeEventListener("abort",o)}}}i.send(typeof n._bodyInit==="undefined"?null:n._bodyInit)}))}fetch$1.polyfill=true;if(!global$2.fetch){global$2.fetch=fetch$1;global$2.Headers=Headers;global$2.Request=Request$1;global$2.Response=Response}var fetch$2=Object.freeze({__proto__:null,Headers:Headers,Request:Request$1,Response:Response,get DOMException(){return DOMException},fetch:fetch$1});var require$$0=getAugmentedNamespace(fetch$2);var browser=function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={exports:{},id:a,loaded:false};e[a].call(n.exports,n,n.exports,r);n.loaded=true;return n.exports}r.m=e;r.c=t;r.p="";return r(0)}([function(e,t,r){var a=r(1);var n=typeof importScripts==="function";e.exports=a(n?self:window)},function(e,t,r){function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return Array.from(e)}}var n=[];function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++){r[i-1]=arguments[i]}var o=n.reduce((function(e,t){return[t].concat(e)}),[]);var s=Promise.resolve(r);o.forEach((function(e){var t=e.request,r=e.requestError;if(t||r){s=s.then((function(e){return t.apply(undefined,a(e))}),r)}}));s=s.then((function(t){var r=new(Function.prototype.bind.apply(Request,[null].concat(a(t))));return e(r).then((function(e){e.request=r;return e})).catch((function(e){e.request=r;return Promise.reject(e)}))}));o.forEach((function(e){var t=e.response,r=e.responseError;if(t||r){s=s.then(t,r)}}));return s}e.exports=function e(t){if(!t.fetch){try{r(2)}catch(e){throw Error("No fetch available. Unable to register fetch-intercept")}}t.fetch=function(e){return function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++){r[a]=arguments[a]}return i.apply(undefined,[e].concat(r))}}(t.fetch);return{register:function e(t){n.push(t);return function(){var e=n.indexOf(t);if(e>=0){n.splice(e,1)}}},clear:function e(){n=[]}}}},function(e,t){e.exports=require$$0}]);function getHeaderKey(e){return e.toLowerCase()}function isHttpHeadersLike(e){if(e&&typeof e==="object"){var t=e;if(typeof t.rawHeaders==="function"&&typeof t.clone==="function"&&typeof t.get==="function"&&typeof t.set==="function"&&typeof t.contains==="function"&&typeof t.remove==="function"&&typeof t.headersArray==="function"&&typeof t.headerValues==="function"&&typeof t.headerNames==="function"&&typeof t.toJson==="function"){return true}}return false}var HttpHeaders=function(){function e(e){this._headersMap={};if(e){for(var t in e){this.set(t,e[t])}}}e.prototype.set=function(e,t){this._headersMap[getHeaderKey(e)]={name:e,value:t.toString()}};e.prototype.get=function(e){var t=this._headersMap[getHeaderKey(e)];return!t?undefined:t.value};e.prototype.contains=function(e){return!!this._headersMap[getHeaderKey(e)]};e.prototype.remove=function(e){var t=this.contains(e);delete this._headersMap[getHeaderKey(e)];return t};e.prototype.rawHeaders=function(){return this.toJson({preserveCase:true})};e.prototype.headersArray=function(){var e=[];for(var t in this._headersMap){e.push(this._headersMap[t])}return e};e.prototype.headerNames=function(){var e=[];var t=this.headersArray();for(var r=0;r<t.length;++r){e.push(t[r].name)}return e};e.prototype.headerValues=function(){var e=[];var t=this.headersArray();for(var r=0;r<t.length;++r){e.push(t[r].value)}return e};e.prototype.toJson=function(e){if(e===void 0){e={}}var t={};if(e.preserveCase){for(var r in this._headersMap){var a=this._headersMap[r];t[a.name]=a.value}}else{for(var r in this._headersMap){var a=this._headersMap[r];t[getHeaderKey(a.name)]=a.value}}return t};e.prototype.toString=function(){return JSON.stringify(this.toJson({preserveCase:true}))};e.prototype.clone=function(){var t={};for(var r in this._headersMap){var a=this._headersMap[r];t[a.name]=a.value}return new e(t)};return e}();function encodeByteArray(e){var t="";for(var r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return btoa(t)}function decodeString(e){var t=atob(e);var r=new Uint8Array(t.length);for(var a=0;a<t.length;a++){r[a]=t.charCodeAt(a)}return r}var process_1=commonjsGlobal.process;var Constants={coreHttpVersion:"2.2.3",HTTP:"http:",HTTPS:"https:",HTTP_PROXY:"HTTP_PROXY",HTTPS_PROXY:"HTTPS_PROXY",NO_PROXY:"NO_PROXY",ALL_PROXY:"ALL_PROXY",HttpConstants:{HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429,ServiceUnavailable:503}},HeaderConstants:{AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",RETRY_AFTER:"Retry-After",USER_AGENT:"User-Agent"}};var XML_ATTRKEY="$";var XML_CHARKEY="_";var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=="undefined"&&typeof msCrypto.getRandomValues==="function"&&msCrypto.getRandomValues.bind(msCrypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}var REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return typeof e==="string"&®EX.test(e)}var byteToHex=[];for(var i=0;i<256;++i){byteToHex.push((i+256).toString(16).substr(1))}function stringify(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase();if(!validate(r)){throw TypeError("Stringified UUID is invalid")}return r}function v4(e,t,r){e=e||{};var a=e.random||(e.rng||rng)();a[6]=a[6]&15|64;a[8]=a[8]&63|128;if(t){r=r||0;for(var n=0;n<16;++n){t[r+n]=a[n]}return t}return stringify(a)}var validUuidRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;var isNode=typeof process_1!=="undefined"&&!!process_1.version&&!!process_1.versions&&!!process_1.versions.node;function isValidUuid(e){return validUuidRegex.test(e)}function generateUuid(){return v4()}function prepareXMLRootList(e,t,r,a){var n,i,o;if(!Array.isArray(e)){e=[e]}if(!r||!a){return n={},n[t]=e,n}var s=(i={},i[t]=e,i);s[XML_ATTRKEY]=(o={},o[r]=a,o);return s}var validateISODuration=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(e){return validateISODuration.test(e)}function replaceAll(e,t,r){return!e||!t?e:e.split(t).join(r||"")}function isPrimitiveType(e){return typeof e!=="object"&&typeof e!=="function"||e===null}function isObject(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}var Serializer=function(){function e(e,t){if(e===void 0){e={}}this.modelMappers=e;this.isXML=t}e.prototype.validateConstraints=function(e,t,r){var a=function(e,a){throw new Error('"'.concat(r,'" with value "').concat(t,'" should satisfy the constraint "').concat(e,'": ').concat(a,"."))};if(e.constraints&&t!=undefined){var n=t;var i=e.constraints,o=i.ExclusiveMaximum,s=i.ExclusiveMinimum,l=i.InclusiveMaximum,c=i.InclusiveMinimum,p=i.MaxItems,d=i.MaxLength,u=i.MinItems,m=i.MinLength,f=i.MultipleOf,h=i.Pattern,g=i.UniqueItems;if(o!=undefined&&n>=o){a("ExclusiveMaximum",o)}if(s!=undefined&&n<=s){a("ExclusiveMinimum",s)}if(l!=undefined&&n>l){a("InclusiveMaximum",l)}if(c!=undefined&&n<c){a("InclusiveMinimum",c)}var y=t;if(p!=undefined&&y.length>p){a("MaxItems",p)}if(d!=undefined&&y.length>d){a("MaxLength",d)}if(u!=undefined&&y.length<u){a("MinItems",u)}if(m!=undefined&&y.length<m){a("MinLength",m)}if(f!=undefined&&n%f!==0){a("MultipleOf",f)}if(h){var b=typeof h==="string"?new RegExp(h):h;if(typeof t!=="string"||t.match(b)===null){a("Pattern",h)}}if(g&&y.some((function(e,t,r){return r.indexOf(e)!==t}))){a("UniqueItems",g)}}};e.prototype.serialize=function(e,t,r,a){if(a===void 0){a={}}var n,i,o;var s={rootName:(n=a.rootName)!==null&&n!==void 0?n:"",includeRoot:(i=a.includeRoot)!==null&&i!==void 0?i:false,xmlCharKey:(o=a.xmlCharKey)!==null&&o!==void 0?o:XML_CHARKEY};var l={};var c=e.type.name;if(!r){r=e.serializedName}if(c.match(/^Sequence$/i)!==null){l=[]}if(e.isConstant){t=e.defaultValue}var p=e.required,d=e.nullable;if(p&&d&&t===undefined){throw new Error("".concat(r," cannot be undefined."))}if(p&&!d&&t==undefined){throw new Error("".concat(r," cannot be null or undefined."))}if(!p&&d===false&&t===null){throw new Error("".concat(r," cannot be null."))}if(t==undefined){l=t}else{this.validateConstraints(e,t,r);if(c.match(/^any$/i)!==null){l=t}else if(c.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)!==null){l=serializeBasicTypes(c,r,t)}else if(c.match(/^Enum$/i)!==null){var u=e;l=serializeEnumType(r,u.type.allowedValues,t)}else if(c.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)!==null){l=serializeDateTypes(c,t,r)}else if(c.match(/^ByteArray$/i)!==null){l=serializeByteArrayType(r,t)}else if(c.match(/^Base64Url$/i)!==null){l=serializeBase64UrlType(r,t)}else if(c.match(/^Sequence$/i)!==null){l=serializeSequenceType(this,e,t,r,Boolean(this.isXML),s)}else if(c.match(/^Dictionary$/i)!==null){l=serializeDictionaryType(this,e,t,r,Boolean(this.isXML),s)}else if(c.match(/^Composite$/i)!==null){l=serializeCompositeType(this,e,t,r,Boolean(this.isXML),s)}}return l};e.prototype.deserialize=function(e,t,r,a){if(a===void 0){a={}}var n,i,o;var s={rootName:(n=a.rootName)!==null&&n!==void 0?n:"",includeRoot:(i=a.includeRoot)!==null&&i!==void 0?i:false,xmlCharKey:(o=a.xmlCharKey)!==null&&o!==void 0?o:XML_CHARKEY};if(t==undefined){if(this.isXML&&e.type.name==="Sequence"&&!e.xmlIsWrapped){t=[]}if(e.defaultValue!==undefined){t=e.defaultValue}return t}var l;var c=e.type.name;if(!r){r=e.serializedName}if(c.match(/^Composite$/i)!==null){l=deserializeCompositeType(this,e,t,r,s)}else{if(this.isXML){var p=s.xmlCharKey;var d=t;if(d[XML_ATTRKEY]!=undefined&&d[p]!=undefined){t=d[p]}}if(c.match(/^Number$/i)!==null){l=parseFloat(t);if(isNaN(l)){l=t}}else if(c.match(/^Boolean$/i)!==null){if(t==="true"){l=true}else if(t==="false"){l=false}else{l=t}}else if(c.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)!==null){l=t}else if(c.match(/^(Date|DateTime|DateTimeRfc1123)$/i)!==null){l=new Date(t)}else if(c.match(/^UnixTime$/i)!==null){l=unixTimeToDate(t)}else if(c.match(/^ByteArray$/i)!==null){l=decodeString(t)}else if(c.match(/^Base64Url$/i)!==null){l=base64UrlToByteArray(t)}else if(c.match(/^Sequence$/i)!==null){l=deserializeSequenceType(this,e,t,r,s)}else if(c.match(/^Dictionary$/i)!==null){l=deserializeDictionaryType(this,e,t,r,s)}}if(e.isConstant){l=e.defaultValue}return l};return e}();function trimEnd(e,t){var r=e.length;while(r-1>=0&&e[r-1]===t){--r}return e.substr(0,r)}function bufferToBase64Url(e){if(!e){return undefined}if(!(e instanceof Uint8Array)){throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.")}var t=encodeByteArray(e);return trimEnd(t,"=").replace(/\+/g,"-").replace(/\//g,"_")}function base64UrlToByteArray(e){if(!e){return undefined}if(e&&typeof e.valueOf()!=="string"){throw new Error("Please provide an input of type string for converting to Uint8Array")}e=e.replace(/-/g,"+").replace(/_/g,"/");return decodeString(e)}function splitSerializeName(e){var t=[];var r="";if(e){var a=e.split(".");for(var n=0,i=a;n<i.length;n++){var o=i[n];if(o.charAt(o.length-1)==="\\"){r+=o.substr(0,o.length-1)+"."}else{r+=o;t.push(r);r=""}}}return t}function dateToUnixTime(e){if(!e){return undefined}if(typeof e.valueOf()==="string"){e=new Date(e)}return Math.floor(e.getTime()/1e3)}function unixTimeToDate(e){if(!e){return undefined}return new Date(e*1e3)}function serializeBasicTypes(e,t,r){if(r!==null&&r!==undefined){if(e.match(/^Number$/i)!==null){if(typeof r!=="number"){throw new Error("".concat(t," with value ").concat(r," must be of type number."))}}else if(e.match(/^String$/i)!==null){if(typeof r.valueOf()!=="string"){throw new Error("".concat(t,' with value "').concat(r,'" must be of type string.'))}}else if(e.match(/^Uuid$/i)!==null){if(!(typeof r.valueOf()==="string"&&isValidUuid(r))){throw new Error("".concat(t,' with value "').concat(r,'" must be of type string and a valid uuid.'))}}else if(e.match(/^Boolean$/i)!==null){if(typeof r!=="boolean"){throw new Error("".concat(t," with value ").concat(r," must be of type boolean."))}}else if(e.match(/^Stream$/i)!==null){var a=typeof r;if(a!=="string"&&a!=="function"&&!(r instanceof ArrayBuffer)&&!ArrayBuffer.isView(r)&&!((typeof Blob==="function"||typeof Blob==="object")&&r instanceof Blob)){throw new Error("".concat(t," must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."))}}}return r}function serializeEnumType(e,t,r){if(!t){throw new Error("Please provide a set of allowedValues to validate ".concat(e," as an Enum Type."))}var a=t.some((function(e){if(typeof e.valueOf()==="string"){return e.toLowerCase()===r.toLowerCase()}return e===r}));if(!a){throw new Error("".concat(r," is not a valid value for ").concat(e,". The valid values are: ").concat(JSON.stringify(t),"."))}return r}function serializeByteArrayType(e,t){var r="";if(t!=undefined){if(!(t instanceof Uint8Array)){throw new Error("".concat(e," must be of type Uint8Array."))}r=encodeByteArray(t)}return r}function serializeBase64UrlType(e,t){var r="";if(t!=undefined){if(!(t instanceof Uint8Array)){throw new Error("".concat(e," must be of type Uint8Array."))}r=bufferToBase64Url(t)||""}return r}function serializeDateTypes(e,t,r){if(t!=undefined){if(e.match(/^Date$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in ISO8601 format."))}t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(e.match(/^DateTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in ISO8601 format."))}t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(e.match(/^DateTimeRfc1123$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in RFC-1123 format."))}t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(e.match(/^UnixTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in RFC-1123/ISO8601 format ")+"for it to be serialized in UnixTime/Epoch format.")}t=dateToUnixTime(t)}else if(e.match(/^TimeSpan$/i)!==null){if(!isDuration(t)){throw new Error("".concat(r,' must be a string in ISO 8601 format. Instead was "').concat(t,'".'))}}}return t}function serializeSequenceType(e,t,r,a,n,i){var o,s;if(!Array.isArray(r)){throw new Error("".concat(a," must be of type Array."))}var l=t.type.element;if(!l||typeof l!=="object"){throw new Error('element" metadata for an Array must be defined in the '+'mapper and it must of type "object" in '.concat(a,"."))}var c=[];for(var p=0;p<r.length;p++){var d=e.serialize(l,r[p],a,i);if(n&&l.xmlNamespace){var u=l.xmlNamespacePrefix?"xmlns:".concat(l.xmlNamespacePrefix):"xmlns";if(l.type.name==="Composite"){c[p]=Object.assign({},d);c[p][XML_ATTRKEY]=(o={},o[u]=l.xmlNamespace,o)}else{c[p]={};c[p][i.xmlCharKey]=d;c[p][XML_ATTRKEY]=(s={},s[u]=l.xmlNamespace,s)}}else{c[p]=d}}return c}function serializeDictionaryType(e,t,r,a,n,i){var o;if(typeof r!=="object"){throw new Error("".concat(a," must be of type object."))}var s=t.type.value;if(!s||typeof s!=="object"){throw new Error('"value" metadata for a Dictionary must be defined in the '+'mapper and it must of type "object" in '.concat(a,"."))}var l={};for(var c=0,p=Object.keys(r);c<p.length;c++){var d=p[c];var u=e.serialize(s,r[d],a,i);l[d]=getXmlObjectValue(s,u,n,i)}if(n&&t.xmlNamespace){var m=t.xmlNamespacePrefix?"xmlns:".concat(t.xmlNamespacePrefix):"xmlns";var f=l;f[XML_ATTRKEY]=(o={},o[m]=t.xmlNamespace,o);return f}return l}function resolveAdditionalProperties(e,t,r){var a=t.type.additionalProperties;if(!a&&t.type.className){var n=resolveReferencedMapper(e,t,r);return n===null||n===void 0?void 0:n.type.additionalProperties}return a}function resolveReferencedMapper(e,t,r){var a=t.type.className;if(!a){throw new Error('Class name for model "'.concat(r,'" is not provided in the mapper "').concat(JSON.stringify(t,undefined,2),'".'))}return e.modelMappers[a]}function resolveModelProperties(e,t,r){var a=t.type.modelProperties;if(!a){var n=resolveReferencedMapper(e,t,r);if(!n){throw new Error('mapper() cannot be null or undefined for model "'.concat(t.type.className,'".'))}a=n===null||n===void 0?void 0:n.type.modelProperties;if(!a){throw new Error("modelProperties cannot be null or undefined in the "+'mapper "'.concat(JSON.stringify(n),'" of type "').concat(t.type.className,'" for object "').concat(r,'".'))}}return a}function serializeCompositeType(e,t,r,a,n,i){var o,s;if(getPolymorphicDiscriminatorRecursively(e,t)){t=getPolymorphicMapper(e,t,r,"clientName")}if(r!=undefined){var l={};var c=resolveModelProperties(e,t,a);for(var p=0,d=Object.keys(c);p<d.length;p++){var u=d[p];var m=c[u];if(m.readOnly){continue}var f=void 0;var h=l;if(e.isXML){if(m.xmlIsWrapped){f=m.xmlName}else{f=m.xmlElementName||m.xmlName}}else{var g=splitSerializeName(m.serializedName);f=g.pop();for(var y=0,b=g;y<b.length;y++){var v=b[y];var x=h[v];if(x==undefined&&(r[u]!=undefined||m.defaultValue!==undefined)){h[v]={}}h=h[v]}}if(h!=undefined){if(n&&t.xmlNamespace){var S=t.xmlNamespacePrefix?"xmlns:".concat(t.xmlNamespacePrefix):"xmlns";h[XML_ATTRKEY]=Object.assign(Object.assign({},h[XML_ATTRKEY]),(o={},o[S]=t.xmlNamespace,o))}var N=m.serializedName!==""?a+"."+m.serializedName:a;var z=r[u];var C=getPolymorphicDiscriminatorRecursively(e,t);if(C&&C.clientName===u&&z==undefined){z=t.serializedName}var P=e.serialize(m,z,N,i);if(P!==undefined&&f!=undefined){var R=getXmlObjectValue(m,P,n,i);if(n&&m.xmlIsAttribute){h[XML_ATTRKEY]=h[XML_ATTRKEY]||{};h[XML_ATTRKEY][f]=P}else if(n&&m.xmlIsWrapped){h[f]=(s={},s[m.xmlElementName]=R,s)}else{h[f]=R}}}}var E=resolveAdditionalProperties(e,t,a);if(E){var B=Object.keys(c);var w=function(t){var n=B.every((function(e){return e!==t}));if(n){l[t]=e.serialize(E,r[t],a+'["'+t+'"]',i)}};for(var _ in r){w(_)}}return l}return r}function getXmlObjectValue(e,t,r,a){var n;if(!r||!e.xmlNamespace){return t}var i=e.xmlNamespacePrefix?"xmlns:".concat(e.xmlNamespacePrefix):"xmlns";var o=(n={},n[i]=e.xmlNamespace,n);if(["Composite"].includes(e.type.name)){if(t[XML_ATTRKEY]){return t}else{var s=Object.assign({},t);s[XML_ATTRKEY]=o;return s}}var l={};l[a.xmlCharKey]=t;l[XML_ATTRKEY]=o;return l}function isSpecialXmlProperty(e,t){return[XML_ATTRKEY,t.xmlCharKey].includes(e)}function deserializeCompositeType(e,t,r,a,n){var i;if(getPolymorphicDiscriminatorRecursively(e,t)){t=getPolymorphicMapper(e,t,r,"serializedName")}var o=resolveModelProperties(e,t,a);var s={};var l=[];for(var c=0,p=Object.keys(o);c<p.length;c++){var d=p[c];var u=o[d];var m=splitSerializeName(o[d].serializedName);l.push(m[0]);var f=u.serializedName,h=u.xmlName,g=u.xmlElementName;var y=a;if(f!==""&&f!==undefined){y=a+"."+f}var b=u.headerCollectionPrefix;if(b){var v={};for(var x=0,S=Object.keys(r);x<S.length;x++){var N=S[x];if(N.startsWith(b)){v[N.substring(b.length)]=e.deserialize(u.type.value,r[N],y,n)}l.push(N)}s[d]=v}else if(e.isXML){if(u.xmlIsAttribute&&r[XML_ATTRKEY]){s[d]=e.deserialize(u,r[XML_ATTRKEY][h],y,n)}else{var z=g||h||f;if(u.xmlIsWrapped){var C=r[h];var P=(i=C===null||C===void 0?void 0:C[g])!==null&&i!==void 0?i:[];s[d]=e.deserialize(u,P,y,n)}else{var R=r[z];s[d]=e.deserialize(u,R,y,n)}}}else{var E=void 0;var B=r;for(var w=0,_=m;w<_.length;w++){var T=_[w];if(!B)break;B=B[T]}E=B;var O=t.type.polymorphicDiscriminator;if(O&&d===O.clientName&&E==undefined){E=t.serializedName}var k=void 0;if(Array.isArray(r[d])&&o[d].serializedName===""){E=r[d];var A=e.deserialize(u,E,y,n);for(var I=0,L=Object.entries(s);I<L.length;I++){var H=L[I],q=H[0],M=H[1];if(!Object.prototype.hasOwnProperty.call(A,q)){A[q]=M}}s=A}else if(E!==undefined||u.defaultValue!==undefined){k=e.deserialize(u,E,y,n);s[d]=k}}}var D=t.type.additionalProperties;if(D){var U=function(e){for(var t in o){var r=splitSerializeName(o[t].serializedName);if(r[0]===e){return false}}return true};for(var j in r){if(U(j)){s[j]=e.deserialize(D,r[j],a+'["'+j+'"]',n)}}}else if(r){for(var F=0,V=Object.keys(r);F<V.length;F++){var d=V[F];if(s[d]===undefined&&!l.includes(d)&&!isSpecialXmlProperty(d,n)){s[d]=r[d]}}}return s}function deserializeDictionaryType(e,t,r,a,n){var i=t.type.value;if(!i||typeof i!=="object"){throw new Error('"value" metadata for a Dictionary must be defined in the '+'mapper and it must of type "object" in '.concat(a))}if(r){var o={};for(var s=0,l=Object.keys(r);s<l.length;s++){var c=l[s];o[c]=e.deserialize(i,r[c],a,n)}return o}return r}function deserializeSequenceType(e,t,r,a,n){var i=t.type.element;if(!i||typeof i!=="object"){throw new Error('element" metadata for an Array must be defined in the '+'mapper and it must of type "object" in '.concat(a))}if(r){if(!Array.isArray(r)){r=[r]}var o=[];for(var s=0;s<r.length;s++){o[s]=e.deserialize(i,r[s],"".concat(a,"[").concat(s,"]"),n)}return o}return r}function getPolymorphicMapper(e,t,r,a){var n=getPolymorphicDiscriminatorRecursively(e,t);if(n){var i=n[a];if(i!=undefined){var o=r[i];if(o!=undefined){var s=t.type.uberParent||t.type.className;var l=o===s?o:s+"."+o;var c=e.modelMappers.discriminators[l];if(c){t=c}}}}return t}function getPolymorphicDiscriminatorRecursively(e,t){return t.type.polymorphicDiscriminator||getPolymorphicDiscriminatorSafely(e,t.type.uberParent)||getPolymorphicDiscriminatorSafely(e,t.type.className)}function getPolymorphicDiscriminatorSafely(e,t){return t&&e.modelMappers[t]&&e.modelMappers[t].type.polymorphicDiscriminator}function strEnum(e){var t={};for(var r=0,a=e;r<a.length;r++){var n=a[r];t[n]=n}return t}var MapperType=strEnum(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"]);function isWebResourceLike(e){if(e&&typeof e==="object"){var t=e;if(typeof t.url==="string"&&typeof t.method==="string"&&typeof t.headers==="object"&&isHttpHeadersLike(t.headers)&&typeof t.validateRequestProperties==="function"&&typeof t.prepare==="function"&&typeof t.clone==="function"){return true}}return false}var WebResource=function(){function e(e,t,r,a,n,i,o,s,l,c,p,d,u,m,f){this.streamResponseBody=i;this.streamResponseStatusCodes=f;this.url=e||"";this.method=t||"GET";this.headers=isHttpHeadersLike(n)?n:new HttpHeaders(n);this.body=r;this.query=a;this.formData=undefined;this.withCredentials=o||false;this.abortSignal=s;this.timeout=l||0;this.onUploadProgress=c;this.onDownloadProgress=p;this.proxySettings=d;this.keepAlive=u;this.decompressResponse=m;this.requestId=this.headers.get("x-ms-client-request-id")||generateUuid()}e.prototype.validateRequestProperties=function(){if(!this.method){throw new Error("WebResource.method is required.")}if(!this.url){throw new Error("WebResource.url is required.")}};e.prototype.prepare=function(e){if(!e){throw new Error("options object is required")}if(e.method===undefined||e.method===null||typeof e.method.valueOf()!=="string"){throw new Error("options.method must be a string.")}if(e.url&&e.pathTemplate){throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them.")}if((e.pathTemplate===undefined||e.pathTemplate===null||typeof e.pathTemplate.valueOf()!=="string")&&(e.url===undefined||e.url===null||typeof e.url.valueOf()!=="string")){throw new Error("Please provide exactly one of options.pathTemplate or options.url.")}if(e.url){if(typeof e.url!=="string"){throw new Error('options.url must be of type "string".')}this.url=e.url}if(e.method){var t=["GET","PUT","HEAD","DELETE","OPTIONS","POST","PATCH","TRACE"];if(t.indexOf(e.method.toUpperCase())===-1){throw new Error('The provided method "'+e.method+'" is invalid. Supported HTTP methods are: '+JSON.stringify(t))}}this.method=e.method.toUpperCase();if(e.pathTemplate){var r=e.pathTemplate,a=e.pathParameters;if(typeof r!=="string"){throw new Error('options.pathTemplate must be of type "string".')}if(!e.baseUrl){e.baseUrl="https://management.azure.com"}var n=e.baseUrl;var i=n+(n.endsWith("/")?"":"/")+(r.startsWith("/")?r.slice(1):r);var o=i.match(/({[\w-]*\s*[\w-]*})/gi);if(o&&o.length){if(!a){throw new Error("pathTemplate: ".concat(r," has been provided. Hence, options.pathParameters must also be provided."))}o.forEach((function(e){var t=e.slice(1,-1);var n=a[t];if(n===null||n===undefined||!(typeof n==="string"||typeof n==="object")){var o=JSON.stringify(a,undefined,2);throw new Error("pathTemplate: ".concat(r," contains the path parameter ").concat(t)+" however, it is not present in parameters: ".concat(o,".")+'The value of the path parameter can either be a "string" of the form { '.concat(t,': "some sample value" } or ')+'it can be an "object" of the form { "'.concat(t,'": { value: "some sample value", skipUrlEncoding: true } }.'))}if(typeof n.valueOf()==="string"){i=i.replace(e,encodeURIComponent(n))}if(typeof n.valueOf()==="object"){if(!n.value){throw new Error("options.pathParameters[".concat(t,'] is of type "object" but it does not contain a "value" property.'))}if(n.skipUrlEncoding){i=i.replace(e,n.value)}else{i=i.replace(e,encodeURIComponent(n.value))}}}))}this.url=i}if(e.queryParameters){var s=e.queryParameters;if(typeof s!=="object"){throw new Error("options.queryParameters must be of type object. It should be a JSON object "+'of "query-parameter-name" as the key and the "query-parameter-value" as the value. '+'The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.')}if(this.url&&this.url.indexOf("?")===-1){this.url+="?"}var l=[];this.query={};for(var c in s){var p=s[c];if(p){if(typeof p==="string"){l.push(c+"="+encodeURIComponent(p));this.query[c]=encodeURIComponent(p)}else if(typeof p==="object"){if(!p.value){throw new Error("options.queryParameters[".concat(c,'] is of type "object" but it does not contain a "value" property.'))}if(p.skipUrlEncoding){l.push(c+"="+p.value);this.query[c]=p.value}else{l.push(c+"="+encodeURIComponent(p.value));this.query[c]=encodeURIComponent(p.value)}}}}this.url+=l.join("&")}if(e.headers){var d=e.headers;for(var u=0,m=Object.keys(e.headers);u<m.length;u++){var f=m[u];this.headers.set(f,d[f])}}if(!this.headers.get("accept-language")){this.headers.set("accept-language","en-US")}if(!this.headers.get("x-ms-client-request-id")&&!e.disableClientRequestId){this.headers.set("x-ms-client-request-id",this.requestId)}if(!this.headers.get("Content-Type")){this.headers.set("Content-Type","application/json; charset=utf-8")}this.body=e.body;if(e.body!==undefined&&e.body!==null){if(e.bodyIsStream){if(!this.headers.get("Transfer-Encoding")){this.headers.set("Transfer-Encoding","chunked")}if(this.headers.get("Content-Type")!=="application/octet-stream"){this.headers.set("Content-Type","application/octet-stream")}}else{if(e.serializationMapper){this.body=new Serializer(e.mappers).serialize(e.serializationMapper,e.body,"requestBody")}if(!e.disableJsonStringifyOnBody){this.body=JSON.stringify(e.body)}}}if(e.spanOptions){this.spanOptions=e.spanOptions}if(e.tracingContext){this.tracingContext=e.tracingContext}this.abortSignal=e.abortSignal;this.onDownloadProgress=e.onDownloadProgress;this.onUploadProgress=e.onUploadProgress;return this};e.prototype.clone=function(){var t=new e(this.url,this.method,this.body,this.query,this.headers&&this.headers.clone(),this.streamResponseBody,this.withCredentials,this.abortSignal,this.timeout,this.onUploadProgress,this.onDownloadProgress,this.proxySettings,this.keepAlive,this.decompressResponse,this.streamResponseStatusCodes);if(this.formData){t.formData=this.formData}if(this.operationSpec){t.operationSpec=this.operationSpec}if(this.shouldDeserialize){t.shouldDeserialize=this.shouldDeserialize}if(this.operationResponseGetter){t.operationResponseGetter=this.operationResponseGetter}return t};return e}();
|
|
1
|
+
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function a(){this.constructor=t}t.prototype=r===null?Object.create(r):(a.prototype=r.prototype,new a)}}();var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):n(e.value).then(o,s)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};import{g as getRenderingRef,f as forceUpdate,r as registerInstance,c as createEvent,h,H as Host,a as getElement,d as getAssetPath,F as Fragment}from"./index-3ac1b749.js";var appendToMap=function(e,t,r){var a=e.get(t);if(!a){e.set(t,[r])}else if(!a.includes(r)){a.push(r)}};var debounce=function(e,t){var r;return function(){var a=[];for(var n=0;n<arguments.length;n++){a[n]=arguments[n]}if(r){clearTimeout(r)}r=setTimeout((function(){r=0;e.apply(void 0,a)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,r=e.keys();t<r.length;t++){var a=r[t];e.set(a,e.get(a).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var r=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){r.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(r,e,t)}}));t("set",(function(e){var t=r.get(e);if(t){r.set(e,t.filter(forceUpdate))}cleanupElements(r)}));t("reset",(function(){r.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(r)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var a={dispose:[],get:[],set:[],reset:[]};var n=function(){r=new Map(Object.entries(e!==null&&e!==void 0?e:{}));a.reset.forEach((function(e){return e()}))};var i=function(){a.dispose.forEach((function(e){return e()}));n()};var o=function(e){a.get.forEach((function(t){return t(e)}));return r.get(e)};var s=function(e,n){var i=r.get(e);if(t(n,i,e)){r.set(e,n);a.set.forEach((function(t){return t(e,n,i)}))}};var l=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return o(t)},ownKeys:function(e){return Array.from(r.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return r.has(t)},set:function(e,t,r){s(t,r);return true}});var c=function(e,t){a[e].push(t);return function(){removeFromArray(a[e],t)}};var p=function(t,r){var a=c("set",(function(e,a){if(e===t){r(a)}}));var n=c("reset",(function(){return r(e[t])}));return function(){a();n()}};var d=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){c("set",e.set)}if(e.get){c("get",e.get)}if(e.reset){c("reset",e.reset)}}))};var u=function(e){var t=r.get(e);a.set.forEach((function(r){return r(e,t,t)}))};return{state:l,get:o,set:s,on:c,onChange:p,use:d,dispose:i,reset:n,forceUpdate:u}};var removeFromArray=function(e,t){var r=e.indexOf(t);if(r>=0){e[r]=e[e.length-1];e.length--}};var createStore=function(e,t){var r=createObservableMap(e,t);stencilSubscription(r);return r};function _typeof$1(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof$1=function e(t){return typeof t}}else{_typeof$1=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _typeof$1(e)}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{};var a=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){a=a.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}a.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;if("value"in a)a.writable=true;Object.defineProperty(e,a.key,a)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);return e}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _typeof_1=createCommonjsModule((function(e){function t(r){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){e.exports=t=function e(t){return typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}else{e.exports=t=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports["default"]=e.exports,e.exports.__esModule=true}return t(r)}e.exports=t;e.exports["default"]=e.exports,e.exports.__esModule=true}));var _typeof=getDefaultExportFromCjs(_typeof_1);function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return _setPrototypeOf(e,t)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}var consoleLogger={type:"logger",log:function e(t){this.output("log",t)},warn:function e(t){this.output("warn",t)},error:function e(t){this.output("error",t)},output:function e(t,r){if(console&&console[t])console[t].apply(console,r)}};var Logger=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.init(t,r)}_createClass(e,[{key:"init",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=r.prefix||"i18next:";this.logger=t||consoleLogger;this.options=r;this.debug=r.debug}},{key:"setDebug",value:function e(t){this.debug=t}},{key:"log",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"log","",true)}},{key:"warn",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"warn","",true)}},{key:"error",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"error","")}},{key:"deprecate",value:function e(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++){r[a]=arguments[a]}return this.forward(r,"warn","WARNING DEPRECATED: ",true)}},{key:"forward",value:function e(t,r,a,n){if(n&&!this.debug)return null;if(typeof t[0]==="string")t[0]="".concat(a).concat(this.prefix," ").concat(t[0]);return this.logger[r](t)}},{key:"create",value:function t(r){return new e(this.logger,_objectSpread({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]);return e}();var baseLogger=new Logger;var EventEmitter$1=function(){function e(){_classCallCheck(this,e);this.observers={}}_createClass(e,[{key:"on",value:function e(t,r){var a=this;t.split(" ").forEach((function(e){a.observers[e]=a.observers[e]||[];a.observers[e].push(r)}));return this}},{key:"off",value:function e(t,r){if(!this.observers[t])return;if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter((function(e){return e!==r}))}},{key:"emit",value:function e(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}if(this.observers[t]){var i=[].concat(this.observers[t]);i.forEach((function(e){e.apply(void 0,a)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(e){e.apply(e,[t].concat(a))}))}}}]);return e}();function defer(){var e;var t;var r=new Promise((function(r,a){e=r;t=a}));r.resolve=e;r.reject=t;return r}function makeString(e){if(e==null)return"";return""+e}function copy(e,t,r){e.forEach((function(e){if(t[e])r[e]=t[e]}))}function getLastOfPath(e,t,r){function a(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function n(){return!e||typeof e==="string"}var i=typeof t!=="string"?[].concat(t):t.split(".");while(i.length>1){if(n())return{};var o=a(i.shift());if(!e[o]&&r)e[o]=new r;if(Object.prototype.hasOwnProperty.call(e,o)){e=e[o]}else{e={}}}if(n())return{};return{obj:e,k:a(i.shift())}}function setPath(e,t,r){var a=getLastOfPath(e,t,Object),n=a.obj,i=a.k;n[i]=r}function pushPath(e,t,r,a){var n=getLastOfPath(e,t,Object),i=n.obj,o=n.k;i[o]=i[o]||[];if(a)i[o]=i[o].concat(r);if(!a)i[o].push(r)}function getPath(e,t){var r=getLastOfPath(e,t),a=r.obj,n=r.k;if(!a)return undefined;return a[n]}function getPathWithDefaults(e,t,r){var a=getPath(e,r);if(a!==undefined){return a}return getPath(t,r)}function deepExtend(e,t,r){for(var a in t){if(a!=="__proto__"&&a!=="constructor"){if(a in e){if(typeof e[a]==="string"||e[a]instanceof String||typeof t[a]==="string"||t[a]instanceof String){if(r)e[a]=t[a]}else{deepExtend(e[a],t[a],r)}}else{e[a]=t[a]}}}return e}function regexEscape(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(e){if(typeof e==="string"){return e.replace(/[&<>"'\/]/g,(function(e){return _entityMap[e]}))}return e}var isIE10=typeof window!=="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;var chars=[" ",",","?","!",";"];function looksLikeObjectPath(e,t,r){t=t||"";r=r||"";var a=chars.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(a.length===0)return true;var n=new RegExp("(".concat(a.map((function(e){return e==="?"?"\\?":e})).join("|"),")"));var i=!n.test(e);if(!i){var o=e.indexOf(r);if(o>0&&!n.test(e.substring(0,o))){i=true}}return i}function deepFind(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:".";if(!e)return undefined;if(e[t])return e[t];var a=t.split(r);var n=e;for(var i=0;i<a.length;++i){if(!n)return undefined;if(typeof n[a[i]]==="string"&&i+1<a.length){return undefined}if(n[a[i]]===undefined){var o=2;var s=a.slice(i,i+o).join(r);var l=n[s];while(l===undefined&&a.length>i+o){o++;s=a.slice(i,i+o).join(r);l=n[s]}if(l===undefined)return undefined;if(typeof l==="string")return l;if(s&&typeof l[s]==="string")return l[s];var c=a.slice(i+o).join(r);if(c)return deepFind(l,c,r);return undefined}n=n[a[i]]}return n}var ResourceStore=function(e){_inherits(t,e);function t(e){var r;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(r))}r.data=e||{};r.options=a;if(r.options.keySeparator===undefined){r.options.keySeparator="."}if(r.options.ignoreJSONStructure===undefined){r.options.ignoreJSONStructure=true}return r}_createClass(t,[{key:"addNamespaces",value:function e(t){if(this.options.ns.indexOf(t)<0){this.options.ns.push(t)}}},{key:"removeNamespaces",value:function e(t){var r=this.options.ns.indexOf(t);if(r>-1){this.options.ns.splice(r,1)}}},{key:"getResource",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=n.keySeparator!==undefined?n.keySeparator:this.options.keySeparator;var o=n.ignoreJSONStructure!==undefined?n.ignoreJSONStructure:this.options.ignoreJSONStructure;var s=[t,r];if(a&&typeof a!=="string")s=s.concat(a);if(a&&typeof a==="string")s=s.concat(i?a.split(i):a);if(t.indexOf(".")>-1){s=t.split(".")}var l=getPath(this.data,s);if(l||!o||typeof a!=="string")return l;return deepFind(this.data&&this.data[t]&&this.data[t][r],a,i)}},{key:"addResource",value:function e(t,r,a,n){var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:false};var o=this.options.keySeparator;if(o===undefined)o=".";var s=[t,r];if(a)s=s.concat(o?a.split(o):a);if(t.indexOf(".")>-1){s=t.split(".");n=r;r=s[1]}this.addNamespaces(r);setPath(this.data,s,n);if(!i.silent)this.emit("added",t,r,a,n)}},{key:"addResources",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{silent:false};for(var i in a){if(typeof a[i]==="string"||Object.prototype.toString.apply(a[i])==="[object Array]")this.addResource(t,r,i,a[i],{silent:true})}if(!n.silent)this.emit("added",t,r,a)}},{key:"addResourceBundle",value:function e(t,r,a,n,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{silent:false};var s=[t,r];if(t.indexOf(".")>-1){s=t.split(".");n=a;a=r;r=s[1]}this.addNamespaces(r);var l=getPath(this.data,s)||{};if(n){deepExtend(l,a,i)}else{l=_objectSpread({},l,a)}setPath(this.data,s,l);if(!o.silent)this.emit("added",t,r,a)}},{key:"removeResourceBundle",value:function e(t,r){if(this.hasResourceBundle(t,r)){delete this.data[t][r]}this.removeNamespaces(r);this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function e(t,r){return this.getResource(t,r)!==undefined}},{key:"getResourceBundle",value:function e(t,r){if(!r)r=this.options.defaultNS;if(this.options.compatibilityAPI==="v1")return _objectSpread({},{},this.getResource(t,r));return this.getResource(t,r)}},{key:"getDataByLanguage",value:function e(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function e(t){var r=this.getDataByLanguage(t);var a=r&&Object.keys(r)||[];return!!a.find((function(e){return r[e]&&Object.keys(r[e]).length>0}))}},{key:"toJSON",value:function e(){return this.data}}]);return t}(EventEmitter$1);var postProcessor={processors:{},addPostProcessor:function e(t){this.processors[t.name]=t},handle:function e(t,r,a,n,i){var o=this;t.forEach((function(e){if(o.processors[e])r=o.processors[e].process(r,a,n,i)}));return r}};var checkedLoadedFor={};var Translator=function(e){_inherits(t,e);function t(e){var r;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,t);r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(r))}copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,_assertThisInitialized(r));r.options=a;if(r.options.keySeparator===undefined){r.options.keySeparator="."}r.logger=baseLogger.create("translator");return r}_createClass(t,[{key:"changeLanguage",value:function e(t){if(t)this.language=t}},{key:"exists",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};if(t===undefined||t===null){return false}var a=this.resolve(t,r);return a&&a.res!==undefined}},{key:"extractFromKey",value:function e(t,r){var a=r.nsSeparator!==undefined?r.nsSeparator:this.options.nsSeparator;if(a===undefined)a=":";var n=r.keySeparator!==undefined?r.keySeparator:this.options.keySeparator;var i=r.ns||this.options.defaultNS;var o=a&&t.indexOf(a)>-1;var s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!looksLikeObjectPath(t,a,n);if(o&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0){return{key:t,namespaces:i}}var c=t.split(a);if(a!==n||a===n&&this.options.ns.indexOf(c[0])>-1)i=c.shift();t=c.join(n)}if(typeof i==="string")i=[i];return{key:t,namespaces:i}}},{key:"translate",value:function e(r,a,n){var i=this;if(_typeof$1(a)!=="object"&&this.options.overloadTranslationOptionHandler){a=this.options.overloadTranslationOptionHandler(arguments)}if(!a)a={};if(r===undefined||r===null)return"";if(!Array.isArray(r))r=[String(r)];var o=a.keySeparator!==undefined?a.keySeparator:this.options.keySeparator;var s=this.extractFromKey(r[r.length-1],a),l=s.key,c=s.namespaces;var p=c[c.length-1];var d=a.lng||this.language;var u=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(u){var m=a.nsSeparator||this.options.nsSeparator;return p+m+l}return l}var f=this.resolve(r,a);var h=f&&f.res;var g=f&&f.usedKey||l;var y=f&&f.exactUsedKey||l;var b=Object.prototype.toString.apply(h);var v=["[object Number]","[object Function]","[object RegExp]"];var x=a.joinArrays!==undefined?a.joinArrays:this.options.joinArrays;var S=!this.i18nFormat||this.i18nFormat.handleAsObject;var N=typeof h!=="string"&&typeof h!=="boolean"&&typeof h!=="number";if(S&&h&&N&&v.indexOf(b)<0&&!(typeof x==="string"&&b==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){if(!this.options.returnedObjectHandler){this.logger.warn("accessing an object - but returnObjects options is not enabled!")}return this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,_objectSpread({},a,{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.")}if(o){var z=b==="[object Array]";var C=z?[]:{};var P=z?y:g;for(var R in h){if(Object.prototype.hasOwnProperty.call(h,R)){var E="".concat(P).concat(o).concat(R);C[R]=this.translate(E,_objectSpread({},a,{joinArrays:false,ns:c}));if(C[R]===E)C[R]=h[R]}}h=C}}else if(S&&typeof x==="string"&&b==="[object Array]"){h=h.join(x);if(h)h=this.extendTranslation(h,r,a,n)}else{var B=false;var w=false;var _=a.count!==undefined&&typeof a.count!=="string";var T=t.hasDefaultValue(a);var O=_?this.pluralResolver.getSuffix(d,a.count,a):"";var k=a["defaultValue".concat(O)]||a.defaultValue;if(!this.isValidLookup(h)&&T){B=true;h=k}if(!this.isValidLookup(h)){w=true;h=l}var A=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey;var I=A&&w?undefined:h;var L=T&&k!==h&&this.options.updateMissing;if(w||B||L){this.logger.log(L?"updateKey":"missingKey",d,p,l,L?k:h);if(o){var H=this.resolve(l,_objectSpread({},a,{keySeparator:false}));if(H&&H.res)this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var q=[];var M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0]){for(var D=0;D<M.length;D++){q.push(M[D])}}else if(this.options.saveMissingTo==="all"){q=this.languageUtils.toResolveHierarchy(a.lng||this.language)}else{q.push(a.lng||this.language)}var U=function e(t,r,n){if(i.options.missingKeyHandler){i.options.missingKeyHandler(t,p,r,L?n:I,L,a)}else if(i.backendConnector&&i.backendConnector.saveMissing){i.backendConnector.saveMissing(t,p,r,L?n:I,L,a)}i.emit("missingKey",t,p,r,h)};if(this.options.saveMissing){if(this.options.saveMissingPlurals&&_){q.forEach((function(e){i.pluralResolver.getSuffixes(e).forEach((function(t){U([e],l+t,a["defaultValue".concat(t)]||k)}))}))}else{U(q,l,k)}}}h=this.extendTranslation(h,r,a,f,n);if(w&&h===l&&this.options.appendNamespaceToMissingKey)h="".concat(p,":").concat(l);if((w||B)&&this.options.parseMissingKeyHandler)h=this.options.parseMissingKeyHandler(h)}return h}},{key:"extendTranslation",value:function e(t,r,a,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse){t=this.i18nFormat.parse(t,a,n.usedLng,n.usedNS,n.usedKey,{resolved:n})}else if(!a.skipInterpolation){if(a.interpolation)this.interpolator.init(_objectSpread({},a,{interpolation:_objectSpread({},this.options.interpolation,a.interpolation)}));var s=a.interpolation&&a.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var l;if(s){var c=t.match(this.interpolator.nestingRegexp);l=c&&c.length}var p=a.replace&&typeof a.replace!=="string"?a.replace:a;if(this.options.interpolation.defaultVariables)p=_objectSpread({},this.options.interpolation.defaultVariables,p);t=this.interpolator.interpolate(t,p,a.lng||this.language,a);if(s){var d=t.match(this.interpolator.nestingRegexp);var u=d&&d.length;if(l<u)a.nest=false}if(a.nest!==false)t=this.interpolator.nest(t,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}if(i&&i[0]===t[0]&&!a.context){o.logger.warn("It seems you are nesting recursively key: ".concat(t[0]," in key: ").concat(r[0]));return null}return o.translate.apply(o,t.concat([r]))}),a);if(a.interpolation)this.interpolator.reset()}var m=a.postProcess||this.options.postProcess;var f=typeof m==="string"?[m]:m;if(t!==undefined&&t!==null&&f&&f.length&&a.applyPostProcessor!==false){t=postProcessor.handle(f,t,r,this.options&&this.options.postProcessPassResolved?_objectSpread({i18nResolved:n},a):a,this)}return t}},{key:"resolve",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n;var i;var o;var s;var l;if(typeof t==="string")t=[t];t.forEach((function(e){if(r.isValidLookup(n))return;var t=r.extractFromKey(e,a);var c=t.key;i=c;var p=t.namespaces;if(r.options.fallbackNS)p=p.concat(r.options.fallbackNS);var d=a.count!==undefined&&typeof a.count!=="string";var u=a.context!==undefined&&(typeof a.context==="string"||typeof a.context==="number")&&a.context!=="";var m=a.lngs?a.lngs:r.languageUtils.toResolveHierarchy(a.lng||r.language,a.fallbackLng);p.forEach((function(e){if(r.isValidLookup(n))return;l=e;if(!checkedLoadedFor["".concat(m[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(l)){checkedLoadedFor["".concat(m[0],"-").concat(e)]=true;r.logger.warn('key "'.concat(i,'" for languages "').concat(m.join(", "),'" won\'t get resolved as namespace "').concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}m.forEach((function(t){if(r.isValidLookup(n))return;s=t;var i=c;var l=[i];if(r.i18nFormat&&r.i18nFormat.addLookupKeys){r.i18nFormat.addLookupKeys(l,c,t,e,a)}else{var p;if(d)p=r.pluralResolver.getSuffix(t,a.count,a);if(d&&u)l.push(i+p);if(u)l.push(i+="".concat(r.options.contextSeparator).concat(a.context));if(d)l.push(i+=p)}var m;while(m=l.pop()){if(!r.isValidLookup(n)){o=m;n=r.getResource(t,e,m,a)}}}))}))}));return{res:n,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}},{key:"isValidLookup",value:function e(t){return t!==undefined&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function e(t,r,a){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(this.i18nFormat&&this.i18nFormat.getResource)return this.i18nFormat.getResource(t,r,a,n);return this.resourceStore.getResource(t,r,a,n)}}],[{key:"hasDefaultValue",value:function e(t){var r="defaultValue";for(var a in t){if(Object.prototype.hasOwnProperty.call(t,a)&&r===a.substring(0,r.length)&&undefined!==t[a]){return true}}return false}}]);return t}(EventEmitter$1);function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}var LanguageUtil=function(){function e(t){_classCallCheck(this,e);this.options=t;this.supportedLngs=this.options.supportedLngs||false;this.logger=baseLogger.create("languageUtils")}_createClass(e,[{key:"getScriptPartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return null;var r=t.split("-");if(r.length===2)return null;r.pop();if(r[r.length-1].toLowerCase()==="x")return null;return this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function e(t){if(!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function e(t){if(typeof t==="string"&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"];var a=t.split("-");if(this.options.lowerCaseLng){a=a.map((function(e){return e.toLowerCase()}))}else if(a.length===2){a[0]=a[0].toLowerCase();a[1]=a[1].toUpperCase();if(r.indexOf(a[1].toLowerCase())>-1)a[1]=capitalize(a[1].toLowerCase())}else if(a.length===3){a[0]=a[0].toLowerCase();if(a[1].length===2)a[1]=a[1].toUpperCase();if(a[0]!=="sgn"&&a[2].length===2)a[2]=a[2].toUpperCase();if(r.indexOf(a[1].toLowerCase())>-1)a[1]=capitalize(a[1].toLowerCase());if(r.indexOf(a[2].toLowerCase())>-1)a[2]=capitalize(a[2].toLowerCase())}return a.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function e(t){if(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs){t=this.getLanguagePartFromCode(t)}return!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function e(t){var r=this;if(!t)return null;var a;t.forEach((function(e){if(a)return;var t=r.formatLanguageCode(e);if(!r.options.supportedLngs||r.isSupportedCode(t))a=t}));if(!a&&this.options.supportedLngs){t.forEach((function(e){if(a)return;var t=r.getLanguagePartFromCode(e);if(r.isSupportedCode(t))return a=t;a=r.options.supportedLngs.find((function(e){if(e.indexOf(t)===0)return e}))}))}if(!a)a=this.getFallbackCodes(this.options.fallbackLng)[0];return a}},{key:"getFallbackCodes",value:function e(t,r){if(!t)return[];if(typeof t==="function")t=t(r);if(typeof t==="string")t=[t];if(Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t["default"]||[];var a=t[r];if(!a)a=t[this.getScriptPartFromCode(r)];if(!a)a=t[this.formatLanguageCode(r)];if(!a)a=t[this.getLanguagePartFromCode(r)];if(!a)a=t["default"];return a||[]}},{key:"toResolveHierarchy",value:function e(t,r){var a=this;var n=this.getFallbackCodes(r||this.options.fallbackLng||[],t);var i=[];var o=function e(t){if(!t)return;if(a.isSupportedCode(t)){i.push(t)}else{a.logger.warn("rejecting language code not found in supportedLngs: ".concat(t))}};if(typeof t==="string"&&t.indexOf("-")>-1){if(this.options.load!=="languageOnly")o(this.formatLanguageCode(t));if(this.options.load!=="languageOnly"&&this.options.load!=="currentOnly")o(this.getScriptPartFromCode(t));if(this.options.load!=="currentOnly")o(this.getLanguagePartFromCode(t))}else if(typeof t==="string"){o(this.formatLanguageCode(t))}n.forEach((function(e){if(i.indexOf(e)<0)o(a.formatLanguageCode(e))}));return i}}]);return e}();var sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}];var _rulesPluralsTypes={1:function e(t){return Number(t>1)},2:function e(t){return Number(t!=1)},3:function e(t){return 0},4:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function e(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function e(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function e(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function e(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function e(t){return Number(t>=2)},10:function e(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function e(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function e(t){return Number(t%10!=1||t%100==11)},13:function e(t){return Number(t!==0)},14:function e(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function e(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function e(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function e(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function e(t){return Number(t==0?0:t==1?1:2)},19:function e(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function e(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function e(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function e(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};var deprecatedJsonVersions=["v1","v2","v3"];var suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){var e={};sets.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:_rulesPluralsTypes[t.fc]}}))}));return e}var PluralResolver=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e);this.languageUtils=t;this.options=r;this.logger=baseLogger.create("pluralResolver");if((!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl==="undefined"||!Intl.PluralRules)){this.options.compatibilityJSON="v3";this.logger.error("Your environment seems not to be Inlt API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")}this.rules=createRules()}_createClass(e,[{key:"addRule",value:function e(t,r){this.rules[t]=r}},{key:"getRule",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.shouldUseIntlApi()){try{return new Intl.PluralRules(t,{type:r.ordinal?"ordinal":"cardinal"})}catch(e){return}}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=this.getRule(t,r);if(this.shouldUseIntlApi()){return a&&a.resolvedOptions().pluralCategories.length>1}return a&&a.numbers.length>1}},{key:"getPluralFormsOfKey",value:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.getSuffixes(t,a).map((function(e){return"".concat(r).concat(e)}))}},{key:"getSuffixes",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=this.getRule(t,a);if(!n){return[]}if(this.shouldUseIntlApi()){return n.resolvedOptions().pluralCategories.sort((function(e,t){return suffixesOrder[e]-suffixesOrder[t]})).map((function(e){return"".concat(r.options.prepend).concat(e)}))}return n.numbers.map((function(e){return r.getSuffix(t,e,a)}))}},{key:"getSuffix",value:function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=this.getRule(t,a);if(n){if(this.shouldUseIntlApi()){return"".concat(this.options.prepend).concat(n.select(r))}return this.getSuffixRetroCompatible(n,r)}this.logger.warn("no plural rule found for: ".concat(t));return""}},{key:"getSuffixRetroCompatible",value:function e(t,r){var a=this;var n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));var i=t.numbers[n];if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){if(i===2){i="plural"}else if(i===1){i=""}}var o=function e(){return a.options.prepend&&i.toString()?a.options.prepend+i.toString():i.toString()};if(this.options.compatibilityJSON==="v1"){if(i===1)return"";if(typeof i==="number")return"_plural_".concat(i.toString());return o()}else if(this.options.compatibilityJSON==="v2"){return o()}else if(this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1){return o()}return this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function e(){return!deprecatedJsonVersions.includes(this.options.compatibilityJSON)}}]);return e}();var Interpolator=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,e);this.logger=baseLogger.create("interpolator");this.options=t;this.format=t.interpolation&&t.interpolation.format||function(e){return e};this.init(t)}_createClass(e,[{key:"init",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!t.interpolation)t.interpolation={escapeValue:true};var r=t.interpolation;this.escape=r.escape!==undefined?r.escape:escape$1;this.escapeValue=r.escapeValue!==undefined?r.escapeValue:true;this.useRawValueToEscape=r.useRawValueToEscape!==undefined?r.useRawValueToEscape:false;this.prefix=r.prefix?regexEscape(r.prefix):r.prefixEscaped||"{{";this.suffix=r.suffix?regexEscape(r.suffix):r.suffixEscaped||"}}";this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",";this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"";this.nestingPrefix=r.nestingPrefix?regexEscape(r.nestingPrefix):r.nestingPrefixEscaped||regexEscape("$t(");this.nestingSuffix=r.nestingSuffix?regexEscape(r.nestingSuffix):r.nestingSuffixEscaped||regexEscape(")");this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",";this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3;this.alwaysFormat=r.alwaysFormat!==undefined?r.alwaysFormat:false;this.resetRegExp()}},{key:"reset",value:function e(){if(this.options)this.init(this.options)}},{key:"resetRegExp",value:function e(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var a="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(a,"g")}},{key:"interpolate",value:function e(t,r,a,n){var i=this;var o;var s;var l;var c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(e){return e.replace(/\$/g,"$$$$")}var d=function e(t){if(t.indexOf(i.formatSeparator)<0){var o=getPathWithDefaults(r,c,t);return i.alwaysFormat?i.format(o,undefined,a,_objectSpread({},n,r,{interpolationkey:t})):o}var s=t.split(i.formatSeparator);var l=s.shift().trim();var p=s.join(i.formatSeparator).trim();return i.format(getPathWithDefaults(r,c,l),p,a,_objectSpread({},n,r,{interpolationkey:l}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;var m=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;var f=[{regex:this.regexpUnescape,safeValue:function e(t){return p(t)}},{regex:this.regexp,safeValue:function e(t){return i.escapeValue?p(i.escape(t)):p(t)}}];f.forEach((function(e){l=0;while(o=e.regex.exec(t)){s=d(o[1].trim());if(s===undefined){if(typeof u==="function"){var r=u(t,o,n);s=typeof r==="string"?r:""}else if(m){s=o[0];continue}else{i.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(t));s=""}}else if(typeof s!=="string"&&!i.useRawValueToEscape){s=makeString(s)}var a=e.safeValue(s);t=t.replace(o[0],a);if(m){e.regex.lastIndex+=a.length;e.regex.lastIndex-=o[0].length}else{e.regex.lastIndex=0}l++;if(l>=i.maxReplaces){break}}}));return t}},{key:"nest",value:function e(t,r){var a=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i;var o;var s=_objectSpread({},n);s.applyPostProcessor=false;delete s.defaultValue;function l(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var a=e.split(new RegExp("".concat(r,"[ ]*{")));var n="{".concat(a[1]);e=a[0];n=this.interpolate(n,s);n=n.replace(/'/g,'"');try{s=JSON.parse(n);if(t)s=_objectSpread({},t,s)}catch(t){this.logger.warn("failed parsing options string in nesting for key ".concat(e),t);return"".concat(e).concat(r).concat(n)}delete s.defaultValue;return e}while(i=this.nestingRegexp.exec(t)){var c=[];var p=false;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){var d=i[1].split(this.formatSeparator).map((function(e){return e.trim()}));i[1]=d.shift();c=d;p=true}o=r(l.call(this,i[1].trim(),s),s);if(o&&i[0]===t&&typeof o!=="string")return o;if(typeof o!=="string")o=makeString(o);if(!o){this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t));o=""}if(p){o=c.reduce((function(e,t){return a.format(e,t,n.lng,_objectSpread({},n,{interpolationkey:i[1].trim()}))}),o.trim())}t=t.replace(i[0],o);this.regexp.lastIndex=0}return t}}]);return e}();function remove(e,t){var r=e.indexOf(t);while(r!==-1){e.splice(r,1);r=e.indexOf(t)}}var Connector=function(e){_inherits(t,e);function t(e,r,a){var n;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};_classCallCheck(this,t);n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(n))}n.backend=e;n.store=r;n.services=a;n.languageUtils=a.languageUtils;n.options=i;n.logger=baseLogger.create("backendConnector");n.state={};n.queue=[];if(n.backend&&n.backend.init){n.backend.init(a,i.backend,i)}return n}_createClass(t,[{key:"queueLoad",value:function e(t,r,a,n){var i=this;var o=[];var s=[];var l=[];var c=[];t.forEach((function(e){var t=true;r.forEach((function(r){var n="".concat(e,"|").concat(r);if(!a.reload&&i.store.hasResourceBundle(e,r)){i.state[n]=2}else if(i.state[n]<0);else if(i.state[n]===1){if(s.indexOf(n)<0)s.push(n)}else{i.state[n]=1;t=false;if(s.indexOf(n)<0)s.push(n);if(o.indexOf(n)<0)o.push(n);if(c.indexOf(r)<0)c.push(r)}}));if(!t)l.push(e)}));if(o.length||s.length){this.queue.push({pending:s,loaded:{},errors:[],callback:n})}return{toLoad:o,pending:s,toLoadLanguages:l,toLoadNamespaces:c}}},{key:"loaded",value:function e(t,r,a){var n=t.split("|");var i=n[0];var o=n[1];if(r)this.emit("failedLoading",i,o,r);if(a){this.store.addResourceBundle(i,o,a)}this.state[t]=r?-1:2;var e={};this.queue.forEach((function(a){pushPath(a.loaded,[i],o);remove(a.pending,t);if(r)a.errors.push(r);if(a.pending.length===0&&!a.done){Object.keys(a.loaded).forEach((function(t){if(!e[t])e[t]=[];if(a.loaded[t].length){a.loaded[t].forEach((function(r){if(e[t].indexOf(r)<0)e[t].push(r)}))}}));a.done=true;if(a.errors.length){a.callback(a.errors)}else{a.callback()}}}));this.emit("loaded",e);this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function e(t,r,a){var n=this;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var o=arguments.length>4&&arguments[4]!==undefined?arguments[4]:350;var s=arguments.length>5?arguments[5]:undefined;if(!t.length)return s(null,{});return this.backend[a](t,r,(function(e,l){if(e&&l&&i<5){setTimeout((function(){n.read.call(n,t,r,a,i+1,o*2,s)}),o);return}s(e,l)}))}},{key:"prepareLoading",value:function e(t,r){var a=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=arguments.length>3?arguments[3]:undefined;if(!this.backend){this.logger.warn("No backend was added via i18next.use. Will not load resources.");return i&&i()}if(typeof t==="string")t=this.languageUtils.toResolveHierarchy(t);if(typeof r==="string")r=[r];var o=this.queueLoad(t,r,n,i);if(!o.toLoad.length){if(!o.pending.length)i();return null}o.toLoad.forEach((function(e){a.loadOne(e)}))}},{key:"load",value:function e(t,r,a){this.prepareLoading(t,r,{},a)}},{key:"reload",value:function e(t,r,a){this.prepareLoading(t,r,{reload:true},a)}},{key:"loadOne",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var n=t.split("|");var i=n[0];var o=n[1];this.read(i,o,"read",undefined,undefined,(function(e,n){if(e)r.logger.warn("".concat(a,"loading namespace ").concat(o," for language ").concat(i," failed"),e);if(!e&&n)r.logger.log("".concat(a,"loaded namespace ").concat(o," for language ").concat(i),n);r.loaded(t,e,n)}))}},{key:"saveMissing",value:function e(t,r,a,n,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(a===undefined||a===null||a==="")return;if(this.backend&&this.backend.create){this.backend.create(t,r,a,n,null,_objectSpread({},o,{isUpdate:i}))}if(!t||!t[0])return;this.store.addResource(t[0],r,a,n)}}]);return t}(EventEmitter$1);function get(){return{debug:false,initImmediate:true,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:false,supportedLngs:false,nonExplicitSupportedLngs:false,load:"all",preload:false,simplifyPluralSuffix:true,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:false,saveMissing:false,updateMissing:false,saveMissingTo:"fallback",saveMissingPlurals:true,missingKeyHandler:false,missingInterpolationHandler:false,postProcess:false,postProcessPassResolved:false,returnNull:true,returnEmptyString:true,returnObjects:false,joinArrays:false,returnedObjectHandler:false,parseMissingKeyHandler:false,appendNamespaceToMissingKey:false,appendNamespaceToCIMode:false,overloadTranslationOptionHandler:function e(t){var r={};if(_typeof$1(t[1])==="object")r=t[1];if(typeof t[1]==="string")r.defaultValue=t[1];if(typeof t[2]==="string")r.tDescription=t[2];if(_typeof$1(t[2])==="object"||_typeof$1(t[3])==="object"){var a=t[3]||t[2];Object.keys(a).forEach((function(e){r[e]=a[e]}))}return r},interpolation:{escapeValue:true,format:function e(t,r,a,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:true}}}function transformOptions(e){if(typeof e.ns==="string")e.ns=[e.ns];if(typeof e.fallbackLng==="string")e.fallbackLng=[e.fallbackLng];if(typeof e.fallbackNS==="string")e.fallbackNS=[e.fallbackNS];if(e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0){e.supportedLngs=e.supportedLngs.concat(["cimode"])}return e}function noop(){}var I18n=function(e){_inherits(t,e);function t(){var e;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;_classCallCheck(this,t);e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this));if(isIE10){EventEmitter$1.call(_assertThisInitialized(e))}e.options=transformOptions(r);e.services={};e.logger=baseLogger;e.modules={external:[]};if(a&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate){e.init(r,a);return _possibleConstructorReturn(e,_assertThisInitialized(e))}setTimeout((function(){e.init(r,a)}),0)}return e}_createClass(t,[{key:"init",value:function e(){var t=this;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;if(typeof r==="function"){a=r;r={}}if(!r.defaultNS&&r.ns){if(typeof r.ns==="string"){r.defaultNS=r.ns}else if(r.ns.indexOf("translation")<0){r.defaultNS=r.ns[0]}}this.options=_objectSpread({},get(),this.options,transformOptions(r));if(r.keySeparator!==undefined){this.options.userDefinedKeySeparator=r.keySeparator}this.format=this.options.interpolation.format;if(!a)a=noop;function n(e){if(!e)return null;if(typeof e==="function")return new e;return e}if(!this.options.isClone){if(this.modules.logger){baseLogger.init(n(this.modules.logger),this.options)}else{baseLogger.init(null,this.options)}var i=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var o=this.services;o.logger=baseLogger;o.resourceStore=this.store;o.languageUtils=i;o.pluralResolver=new PluralResolver(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix});o.interpolator=new Interpolator(this.options);o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)};o.backendConnector=new Connector(n(this.modules.backend),o.resourceStore,o,this.options);o.backendConnector.on("*",(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}t.emit.apply(t,[e].concat(a))}));if(this.modules.languageDetector){o.languageDetector=n(this.modules.languageDetector);o.languageDetector.init(o,this.options.detection,this.options)}if(this.modules.i18nFormat){o.i18nFormat=n(this.modules.i18nFormat);if(o.i18nFormat.init)o.i18nFormat.init(this)}this.translator=new Translator(this.services,this.options);this.translator.on("*",(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++){a[n-1]=arguments[n]}t.emit.apply(t,[e].concat(a))}));this.modules.external.forEach((function(e){if(e.init)e.init(t)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);if(s.length>0&&s[0]!=="dev")this.options.lng=s[0]}if(!this.services.languageDetector&&!this.options.lng){this.logger.warn("init: no languageDetector is used and no lng is defined")}var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(e){t[e]=function(){var r;return(r=t.store)[e].apply(r,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(e){t[e]=function(){var r;(r=t.store)[e].apply(r,arguments);return t}}));var p=defer();var d=function e(){var r=function e(r,n){if(t.isInitialized&&!t.initializedStoreOnce)t.logger.warn("init: i18next is already initialized. You should call init just once!");t.isInitialized=true;if(!t.options.isClone)t.logger.log("initialized",t.options);t.emit("initialized",t.options);p.resolve(n);a(r,n)};if(t.languages&&t.options.compatibilityAPI!=="v1"&&!t.isInitialized)return r(null,t.t.bind(t));t.changeLanguage(t.options.lng,r)};if(this.options.resources||!this.options.initImmediate){d()}else{setTimeout(d,0)}return p}},{key:"loadResources",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var n=a;var i=typeof t==="string"?t:this.language;if(typeof t==="function")n=t;if(!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return n();var o=[];var s=function e(t){if(!t)return;var a=r.services.languageUtils.toResolveHierarchy(t);a.forEach((function(e){if(o.indexOf(e)<0)o.push(e)}))};if(!i){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach((function(e){return s(e)}))}else{s(i)}if(this.options.preload){this.options.preload.forEach((function(e){return s(e)}))}this.services.backendConnector.load(o,this.options.ns,n)}else{n(null)}}},{key:"reloadResources",value:function e(t,r,a){var n=defer();if(!t)t=this.languages;if(!r)r=this.options.ns;if(!a)a=noop;this.services.backendConnector.reload(t,r,(function(e){n.resolve();a(e)}));return n}},{key:"use",value:function e(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");if(t.type==="backend"){this.modules.backend=t}if(t.type==="logger"||t.log&&t.warn&&t.error){this.modules.logger=t}if(t.type==="languageDetector"){this.modules.languageDetector=t}if(t.type==="i18nFormat"){this.modules.i18nFormat=t}if(t.type==="postProcessor"){postProcessor.addPostProcessor(t)}if(t.type==="3rdParty"){this.modules.external.push(t)}return this}},{key:"changeLanguage",value:function e(t,r){var a=this;this.isLanguageChangingTo=t;var n=defer();this.emit("languageChanging",t);var i=function e(t){a.language=t;a.languages=a.services.languageUtils.toResolveHierarchy(t);a.resolvedLanguage=undefined;if(["cimode","dev"].indexOf(t)>-1)return;for(var r=0;r<a.languages.length;r++){var n=a.languages[r];if(["cimode","dev"].indexOf(n)>-1)continue;if(a.store.hasLanguageSomeTranslations(n)){a.resolvedLanguage=n;break}}};var o=function e(t,o){if(o){i(o);a.translator.changeLanguage(o);a.isLanguageChangingTo=undefined;a.emit("languageChanged",o);a.logger.log("languageChanged",o)}else{a.isLanguageChangingTo=undefined}n.resolve((function(){return a.t.apply(a,arguments)}));if(r)r(t,(function(){return a.t.apply(a,arguments)}))};var s=function e(r){if(!t&&!r&&a.services.languageDetector)r=[];var n=typeof r==="string"?r:a.services.languageUtils.getBestMatchFromCodes(r);if(n){if(!a.language){i(n)}if(!a.translator.language)a.translator.changeLanguage(n);if(a.services.languageDetector)a.services.languageDetector.cacheUserLanguage(n)}a.loadResources(n,(function(e){o(e,n)}))};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async){s(this.services.languageDetector.detect())}else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){this.services.languageDetector.detect(s)}else{s(t)}return n}},{key:"getFixedT",value:function e(t,r,a){var n=this;var i=function e(t,r){var i;if(_typeof$1(r)!=="object"){for(var o=arguments.length,s=new Array(o>2?o-2:0),l=2;l<o;l++){s[l-2]=arguments[l]}i=n.options.overloadTranslationOptionHandler([t,r].concat(s))}else{i=_objectSpread({},r)}i.lng=i.lng||e.lng;i.lngs=i.lngs||e.lngs;i.ns=i.ns||e.ns;var c=n.options.keySeparator||".";var p=a?"".concat(a).concat(c).concat(t):t;return n.t(p,i)};if(typeof t==="string"){i.lng=t}else{i.lngs=t}i.ns=r;i.keyPrefix=a;return i}},{key:"t",value:function e(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function e(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function e(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function e(t){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this.isInitialized){this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages);return false}if(!this.languages||!this.languages.length){this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages);return false}var n=this.resolvedLanguage||this.languages[0];var i=this.options?this.options.fallbackLng:false;var o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return true;var s=function e(t,a){var n=r.services.backendConnector.state["".concat(t,"|").concat(a)];return n===-1||n===2};if(a.precheck){var l=a.precheck(this,s);if(l!==undefined)return l}if(this.hasResourceBundle(n,t))return true;if(!this.services.backendConnector.backend)return true;if(s(n,t)&&(!i||s(o,t)))return true;return false}},{key:"loadNamespaces",value:function e(t,r){var a=this;var n=defer();if(!this.options.ns){r&&r();return Promise.resolve()}if(typeof t==="string")t=[t];t.forEach((function(e){if(a.options.ns.indexOf(e)<0)a.options.ns.push(e)}));this.loadResources((function(e){n.resolve();if(r)r(e)}));return n}},{key:"loadLanguages",value:function e(t,r){var a=defer();if(typeof t==="string")t=[t];var n=this.options.preload||[];var i=t.filter((function(e){return n.indexOf(e)<0}));if(!i.length){if(r)r();return Promise.resolve()}this.options.preload=n.concat(i);this.loadResources((function(e){a.resolve();if(r)r(e)}));return a}},{key:"dir",value:function e(t){if(!t)t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language);if(!t)return"rtl";var r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function e(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=arguments.length>1?arguments[1]:undefined;return new t(r,a)}},{key:"cloneInstance",value:function e(){var r=this;var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:noop;var i=_objectSpread({},this.options,a,{isClone:true});var o=new t(i);var s=["store","services","language"];s.forEach((function(e){o[e]=r[e]}));o.services=_objectSpread({},this.services);o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)};o.translator=new Translator(o.services,o.options);o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++){r[a-1]=arguments[a]}o.emit.apply(o,[e].concat(r))}));o.init(i,n);o.translator.options=o.options;o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)};return o}},{key:"toJSON",value:function e(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]);return t}(EventEmitter$1);var i18next=new I18n;var login_dialog$1={heading:"Drucke mit ezeep Blue",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken.",action:"Anmelden"};var no_document_dialog$1={heading:"Keine Datei ausgewählt",description:"Wähle zunächst eine Datei zum Drucken aus.",action:"OK"};var printer_selection$1={loading:"Lade meine Drucker…",print:"Drucken",printer:"Drucker",print_processing:"Drucken…",print_success:"Erfolgreich gedruckt.",print_failed:"Druck fehlgeschlagen",not_supported:"Der ausgewählte Dateityp wird nicht unterstützt.",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Beidseitig",quality:"Druckqualität",select_printer:"Wähle einen Drucker",select_color:"Wähle Farbe/Graustufen",select_size:"Wähle Papierformat",select_orientation:"Wähle Ausrichtung",select_quality:"Wähle Druckqualität",select_duplex:"Wähle Beidseitig",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort",no_printers:"Keine Drucker gefunden.",prepare_upload:"Vorbereiten…",uploading:"Hochladen…",duplex_none:"Keine",copies:"Kopien",duplex_long:"auf der langen Seite umdrehen",duplex_short:"auf der kurzen Seite umdrehen",pull_print_success:"Bereit zum Auslösen.",width:"Breite",length:"Länge",paper_ranges:"Papier-Ranges"};var button_actions$1={login:"Anmelden",print:"Drucken",cancel:"Abbrechen",close:"Schließen",retry:"Wiederholen",select_printer:"Wähle Drucker"};var upload$1={description:"Ziehe eine Datei hier in den Browser ",meta_leading:"oder",meta_select:"wähle eine Datei aus",meta_trailing:"um mit ezeep Blue zu drucken.",selected_file:"Ausgewählte Datei:"};var user_menu$1={theme:"Farbschema",appearance:"Darstellung",system:"System",light:"Hell",dark:"Dunkel",account:"Konto verwalten",help:"Hilfe & Unterstützung",logout:"Ausloggen"};var translationsDE={login_dialog:login_dialog$1,no_document_dialog:no_document_dialog$1,printer_selection:printer_selection$1,button_actions:button_actions$1,upload:upload$1,user_menu:user_menu$1};var login_dialog={heading:"Print with ezeep Blue",description:"Sign in with your ezeep Blue account to print.",action:"Sign in"};var no_document_dialog={heading:"No file selected",description:"Select a file first to print.",action:"OK"};var printer_selection={loading:"Loading My Printers…",print_processing:"Printing…",print_success:"Successfully printed.",pull_print_success:"Ready to be released.",print_failed:"Print failed",not_supported:"The selected file type is not supported.",prepare_upload:"Preparing…",uploading:"Uploading…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper Size",duplex:"Double-sided",duplex_none:"None",duplex_long:"flip on long side",duplex_short:"flip on short side",quality:"Print Quality",select_printer:"Select a printer",select_color:"Select Color/Grayscale",select_orientation:"Select Orientation",select_size:"Select Paper Size",select_quality:"Select Print Quality",select_duplex:"Select Double-sided",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location",no_printers:"No printers found.",copies:"Copies",width:"Width",length:"Length",paper_ranges:"Paper Ranges"};var button_actions={login:"Sign In",print:"Print",cancel:"Cancel",close:"Close",retry:"Retry",select_printer:"Select Printer"};var upload={description:"Drop a file here into the browser ",meta_leading:"or",meta_select:"select a file",meta_trailing:"to print with ezeep Blue.",selected_file:"Selected File:"};var user_menu={theme:"Color theme",appearance:"Appearance",system:"System",light:"Light",dark:"Dark",account:"Manage Account",help:"Help & Support",logout:"Logout"};var translationsEN={login_dialog:login_dialog,no_document_dialog:no_document_dialog,printer_selection:printer_selection,button_actions:button_actions,upload:upload,user_menu:user_menu};function encodeFormData(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function initi18n(e){var t={en:{translation:translationsEN},de:{translation:translationsDE}};if(e!=""){i18next.init({resources:t,lng:e,nsSeparator:false,fallbackLng:"en"})}else{i18next.init({resources:t,lng:navigator.language,nsSeparator:false,fallbackLng:"en"})}}var poll=function(e){var t=e.fn,r=e.validate,a=e.interval,n=e.maxAttempts;return __awaiter(void 0,void 0,void 0,(function(){var e,i;return __generator(this,(function(o){e=0;i=function(o,s){return __awaiter(void 0,void 0,void 0,(function(){var l;return __generator(this,(function(c){switch(c.label){case 0:return[4,t()];case 1:l=c.sent();e++;if(r(l)){return[2,o(l)]}else if(n&&e===n){return[2,s(new Error("Exceeded max attempts."))]}else{setTimeout(i,a,o,s)}return[2]}}))}))};return[2,new Promise(i)]}))}))};var removeEmptyStrings=function(e){var t={};Object.keys(e).forEach((function(r){if(e[r]!==""){t[r]=e[r]}}));return t};var managePaperDimensions=function(e){if(e.paperid!=PAPER_ID){delete e.paperlength;delete e.paperwidth}if(e.paperlength&&e.paperwidth){e.paperlength=+e.paperlength*10;e.paperwidth=+e.paperwidth*10}return e};var validatePageRange=function(e){if(!e){return true}var t=/^(\d+(-\d+)?(,\d+(-\d+)?)*|(\d+,\d+(-\d+)?(,\d+(-\d+)?)*)+)$/;var r=t.test(e);if(!r){return false}var a=e.split(",");for(var n=0;n<a.length;n++){var i=a[n].trim();if(i.includes("-")){var o=i.split("-"),s=o[0],l=o[1];s=parseInt(s);l=parseInt(l);if(isNaN(s)||isNaN(l)||s>l||s<=0){return false}}else{var c=parseInt(i);if(isNaN(c)||c<=0){return false}}}return true};var PAPER_ID=256;var EzpAuthorizationService=function(){function e(e,t){this.urlParams=new URLSearchParams;this.isAuthorized=false;this.redirectURI=e;this.clientID=t;this.oauthUrl=authStore.state.authApiHostUrl;this.authURI=new URL("https://".concat(this.oauthUrl,"/oauth/authorize/"));this.accessTokenURL="https://".concat(this.oauthUrl,"/oauth/access_token/")}e.prototype.generateCodeVerifier=function(){if(authStore.state.codeVerifier!==""){this.codeVerifier=authStore.state.codeVerifier}else{var e=new Uint8Array(128);var t=crypto.getRandomValues(e);var r=btoa(t.toString()).substr(0,128);this.codeVerifier=r;authStore.state.codeVerifier=this.codeVerifier}};e.prototype.generateCodeChallenge=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=new TextEncoder;r=t.encode(e);return[4,crypto.subtle.digest("SHA-256",r)];case 1:a=i.sent();n=btoa(String.fromCharCode.apply(null,new Uint8Array(a)));this.codeChallenge=n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return[2]}}))}))};e.prototype.buildAuthURI=function(){this.urlParams.append("response_type","code");this.urlParams.append("client_id",this.clientID);this.urlParams.append("redirect_uri",this.redirectURI);this.urlParams.append("code_challenge",this.codeChallenge);this.urlParams.append("code_challenge_method","S256");this.authURI.search=this.urlParams.toString();authStore.state.authUri=this.authURI.toString()};e.prototype.getAccessToken=function(){var e=this;return fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"authorization_code",scope:"printing",code:authStore.state.code,redirect_uri:this.redirectURI,code_verifier:authStore.state.codeVerifier})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){authStore.state.isAuthorized=true;e.isAuthorized=authStore.state.isAuthorized;localStorage.setItem("isAuthorized",e.isAuthorized.toString());e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken}}))};e.prototype.refreshTokens=function(){var e=this;fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({grant_type:"refresh_token",scope:"printing",refresh_token:authStore.state.refreshToken})}).then((function(e){return e.json()})).then((function(t){if(t.access_token){e.accessToken=t.access_token;localStorage.setItem("access_token",e.accessToken);authStore.state.accessToken=e.accessToken;e.refreshToken=t.refresh_token;localStorage.setItem("refreshToken",e.refreshToken);authStore.state.refreshToken=e.refreshToken;authStore.state.isAuthorized=true}}))};e.prototype.revokeRefreshToken=function(){if(authStore.state.refreshToken)fetch("https://".concat(this.oauthUrl,"/oauth/revoke/"),{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:encodeFormData({token:authStore.state.refreshToken})}).catch((function(e){console.log(e)}))};return e}();var authStore=createStore({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:false,devApi:false,authApiHostUrl:"",redirectUri:"",authUri:""});function sendCodeToParentWindow(){var e=new URLSearchParams(window.location.search);var t=e.get("code");if(window.opener){if(t){window.opener.postMessage(t,authStore.state.redirectUri);window.close()}}}var ezpAuthCss=":host{--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent);display:block}";var EzpAuth=function(){function e(e){registerInstance(this,e);this.authCancel=createEvent(this,"authCancel",7);this.authSuccess=createEvent(this,"authSuccess",7);this.oauthPopupWindow=null;this.previousUrl=null}e.prototype.listenDialogAction=function(){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")};e.prototype.listenDialogClose=function(){this.authCancel.emit()};e.prototype.listenStatusCancel=function(){this.authCancel.emit()};e.prototype.openSignInWindow=function(e,t){var r=this;if(authStore.state.isAuthorized){this.authCancel.emit();this.authSuccess.emit();return}window.removeEventListener("message",this.receiveMessage);var a="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";if(this.oauthPopupWindow===null||this.oauthPopupWindow.closed){this.oauthPopupWindow=window.open(e,t,a)}else if(this.previousUrl!==this.auth.authURI.toString()){this.oauthPopupWindow=window.open(e,t,a);if(!this.oauthPopupWindow||this.oauthPopupWindow.closed||typeof this.oauthPopupWindow.closed=="undefined"){alert("popup blocked")}this.oauthPopupWindow.focus()}else{this.oauthPopupWindow.focus()}window.addEventListener("message",(function(e){return r.receiveMessage(e)}),false);this.previousUrl=this.auth.authURI};e.prototype.receiveMessage=function(e){var t=this;authStore.state.code=e.data;this.auth.getAccessToken().then((function(){t.authCancel.emit();t.authSuccess.emit()}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.auth=new EzpAuthorizationService(this.redirectURI,this.clientID);if(!this.code)return[3,2];authStore.state.code=this.code;return[4,this.auth.getAccessToken()];case 1:e.sent();this.authCancel.emit();this.authSuccess.emit();e.label=2;case 2:if(!(authStore.state.isAuthorized===false))return[3,4];this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 3:e.sent();this.auth.buildAuthURI();e.label=4;case 4:if(this.hidelogin&&this.trigger==="button"){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,this.hidelogin&&this.trigger==="button"?h("ezp-status",{description:i18next.t("login_dialog.action"),processing:true,cancel:true}):this.hidelogin&&this.trigger==="file"?h("ezp-text-button",{type:"button",level:"primary",onClick:function(){return e.openSignInWindow(e.auth.authURI.toString(),"ezeep Login")},label:i18next.t("button_actions.select_printer")}):h("ezp-dialog",{heading:i18next.t("login_dialog.heading"),description:i18next.t("login_dialog.description"),action:i18next.t("login_dialog.action"),iconName:"logo",iconSize:"huge",iconFramed:false,instance:"login"}))};return e}();EzpAuth.style=ezpAuthCss;var ezpBackdropCss=":host{-webkit-animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);background:var(--ezp-core-backdrop);border-radius:var(--ezp-backdrop-border-radius, 6px);display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--ezp-backdrop-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}";var EzpBackdrop=function(){function e(e){registerInstance(this,e);this.backdropHideStart=createEvent(this,"backdropHideStart",7);this.backdropHideEnd=createEvent(this,"backdropHideEnd",7);this.visible=true}e.prototype.handleClick=function(){this.visible=false;this.backdropHideStart.emit()};e.prototype.listenAnimationEnd=function(){if(!this.visible){this.backdropHideEnd.emit()}};e.prototype.render=function(){var e=this;return h(Host,{class:{hide:!this.visible},onClick:function(){return e.handleClick()}})};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();EzpBackdrop.style=ezpBackdropCss;var ezpDialogCss=":host{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-line-pack:center;align-content:center;background:var(--ezp-core-backdrop);display:grid;grid-template:auto/minmax(auto, 280px);height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}#box{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10))}#header{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;padding:var(--ezp-spacing-2) var(--ezp-spacing-3)}#body{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);padding:0 var(--ezp-spacing-5);text-align:center}#text{color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4)}#footer{display:grid;grid-template:auto/minmax(144px, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-5)}";var EzpDialog=function(){function e(e){var t=this;registerInstance(this,e);this.dialogClose=createEvent(this,"dialogClose",7);this.dialogAction=createEvent(this,"dialogAction",7);this.action=i18next.t("button_actions.close");this.iconSize="large";this.iconFramed=true;this.handleClose=function(){t.dialogClose.emit(t.instance)};this.handleAction=function(){t.dialogAction.emit(t.instance)}}e.prototype.componentWillLoad=function(){};e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},h("div",{id:"header"},h("ezp-icon-button",{level:"tertiary",icon:"close",type:"button",onClick:this.handleClose})),h("div",{id:"body"},this.iconName&&h("ezp-icon",{name:this.iconName,size:this.iconSize,framed:this.iconFramed}),h("div",{id:"text"},h("ezp-label",{text:this.heading,weight:"heavy"}),h("ezp-label",{text:this.description}))),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"primary",onClick:this.handleAction,label:this.action}))))};return e}();EzpDialog.style=ezpDialogCss;var ezpIconCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}";var EzpIcon=function(){function e(e){registerInstance(this,e);this.size="normal";this.framed=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,fetch(getAssetPath("./assets/glyph-".concat(this.name,".svg"))).then((function(e){return e.text()})).then((function(t){e.glyph=t})).catch((function(e){return console.log(e)}))];case 1:t.sent();return[2]}}))}))};e.prototype.render=function(){return h(Host,{class:"".concat(this.size," ").concat(this.framed?"framed":"")},h("div",{id:"glyph",innerHTML:this.glyph}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();EzpIcon.style=ezpIconCss;var ezpIconButtonCss=":host{display:block}:host(.primary){--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:var(--ezp-theme-solid);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-white-100);--ezp-iconButton-opacity-active:0.74;--ezp-iconButton-opacity-hover:0.84}:host(.secondary){--ezp-iconButton-background-active:var(--ezp-core-shade-tertiary);--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-hover:var(--ezp-core-shade-secondary);--ezp-iconButton-background-init:var(--ezp-core-shade-primary);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-iconButton-background-active:var(--ezp-core-shade-secondary);--ezp-iconButton-background-hover:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.quaternary){--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid);--ezp-iconButton-opacity-active:0.58;--ezp-iconButton-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-iconButton-background, var(--ezp-iconButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-iconButton-color, var(--ezp-iconButton-color-init));cursor:var(--ezp-iconButton-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-iconButton-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--ezp-iconButton-background:var(\n --ezp-iconButton-background-hover,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-iconButton-background:var(\n --ezp-iconButton-background-active,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-active, 1)}}#button:disabled{--ezp-iconButton-background:var(\n --ezp-iconButton-background-disabled,\n var(--ezp-iconButton-background-init)\n );--ezp-iconButton-color:var(--ezp-iconButton-color-disabled);--ezp-iconButton-cursor:default}";var EzpIconButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary"}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:"".concat(this.level)},h(e,Object.assign({id:"button"},t),h("ezp-icon",{name:this.icon})))};return e}();EzpIconButton.style=ezpIconButtonCss;var ezpInputCss=':host{display:grid;grid-template:var(--ezp-input-grid-template, auto/auto auto 1fr);height:30px;position:relative;gap:var(--ezp-spacing-3);background:var(--ezp-input-background, var(--ezp-core-surface-tertiary));padding:0 var(--ezp-spacing-3);z-index:var(--ezp-input-z-index, 3);border-radius:var(--ezp-input-border-radius, 0);-webkit-box-shadow:var(--ezp-input-box-shadow-position-top, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-right, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-bottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-left, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-input-box-shadow-position-top, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-right, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-bottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-input-box-shadow-position-left, -1px 0 0 0) var(--ezp-core-outline);-ms-flex-align:center;align-items:center;cursor:pointer}:host([suffix]){--ezp-input-grid-template:auto / auto auto 1fr auto;--ezp-input-input-padding-right:0}:host(.focused){--ezp-input-icon-color:var(--ezp-theme-solid);--ezp-input-label-color:var(--ezp-theme-solid)}:host(:first-child){--ezp-input-border-radius:3px 3px 0 0}:host(:last-child){--ezp-input-border-radius:0 0 3px 3px}:host(:first-child:last-child){--ezp-input-border-radius:3px}:host(:not(:last-child)){--ezp-input-box-shadow-position-bottom:0 0 0 0}:host(:hover){--ezp-input-background:linear-gradient(\n 0deg,\n var(--ezp-core-shade-primary) 0%,\n var(--ezp-core-shade-primary) 100%\n ),\n var(--ezp-core-surface-tertiary)}#label{color:var(--ezp-input-label-color, var(--ezp-core-foreground-secondary))}#icon{color:var(--ezp-input-icon-color, var(--ezp-core-foreground-secondary))}#input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0 var(--ezp-input-input-padding-right, var(--ezp-spacing-1)) 0 0;text-align:right;width:100%}#input[type=number]::-webkit-inner-spin-button,#input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}#suffix{color:var(--ezp-core-foreground-tertiary)}';var EzpInput=function(){function e(e){var t=this;registerInstance(this,e);this.inputValueChanged=createEvent(this,"inputValueChanged",7);this.timeout=null;this.label="Label";this.type="text";this.icon="color";this.placeholder="";this.focused=false;this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.handleChange=function(e){var t=this;if(this.timeout){clearTimeout(this.timeout)}this.value=e.target.value?e.target.value:this.type==="number"?0:"";this.timeout=setTimeout((function(){t.inputValueChanged.emit({type:t.eventType.toLowerCase(),value:t.value})}),500)};e.prototype.render=function(){var e=this;return h(Host,{class:{focused:this.focused},onClick:this.setFocus},h("ezp-icon",{id:"icon",name:this.icon}),h("ezp-label",{id:"label",noWrap:true,level:"secondary",text:this.label}),h("input",{id:"input",type:this.type,value:this.value,placeholder:this.placeholder,onInput:function(t){return e.handleChange(t)},ref:function(t){return e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur}),this.suffix?h("ezp-label",{id:"suffix",level:"secondary",text:this.suffix}):null)};return e}();EzpInput.style=ezpInputCss;var ezpLabelCss=':host{display:block;min-width:var(--ezp-label-minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--ezp-label-offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--ezp-label-offset) + 1px) * -1)}:host(.no-wrap){--ezp-label-whiteSpace:nowrap}:host(.ellipsis){--ezp-label-minWidth:0;--ezp-label-overflow:hidden;--ezp-label-textOverflow:ellipsis;--ezp-label-whiteSpace:nowrap;--ezp-label-width:100%}:host(.primary){--ezp-label-fontSize:17px;--ezp-label-lineHeight:24px;--ezp-label-letterSpacing:-0.0127756105em;--ezp-label-offset:6px}:host(.secondary){--ezp-label-fontSize:14px;--ezp-label-lineHeight:20px;--ezp-label-letterSpacing:-0.0062235443em;--ezp-label-offset:5px}:host(.tertiary){--ezp-label-fontSize:12px;--ezp-label-lineHeight:18px;--ezp-label-letterSpacing:0.0004907745em;--ezp-label-offset:5px}:host(.soft){--ezp-label-fontWeight:400}:host(.strong){--ezp-label-fontWeight:500}:host(.heavy){--ezp-label-fontWeight:600}#text{font-size:var(--ezp-label-fontSize);font-weight:var(--ezp-label-fontWeight);letter-spacing:var(--ezp-label-letterSpacing);line-height:var(--ezp-label-lineHeight);overflow:var(--ezp-label-overflow, visible);text-overflow:var(--ezp-label-textOverflow, clip);white-space:var(--ezp-label-whiteSpace, normal);width:var(--ezp-label-width, auto)}';var EzpLabel=function(){function e(e){registerInstance(this,e);this.ellipsis=false;this.level="secondary";this.noWrap=false;this.text="Label";this.weight="soft"}e.prototype.render=function(){return h(Host,{class:"".concat(this.level," ").concat(this.weight," ").concat(this.ellipsis?"ellipsis":""," ").concat(this.noWrap?"no-wrap":"")},h("div",{id:"text"},this.text))};return e}();EzpLabel.style=ezpLabelCss;var global$2=typeof globalThis!=="undefined"&&globalThis||typeof self!=="undefined"&&self||typeof global$2!=="undefined"&&global$2;var support={searchParams:"URLSearchParams"in global$2,iterable:"Symbol"in global$2&&"iterator"in Symbol,blob:"FileReader"in global$2&&"Blob"in global$2&&function(){try{new Blob;return true}catch(e){return false}}(),formData:"FormData"in global$2,arrayBuffer:"ArrayBuffer"in global$2};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}if(support.arrayBuffer){var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];var isArrayBufferView=ArrayBuffer.isView||function(e){return e&&viewClasses.indexOf(Object.prototype.toString.call(e))>-1}}function normalizeName(e){if(typeof e!=="string"){e=String(e)}if(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===""){throw new TypeError('Invalid character in header field name: "'+e+'"')}return e.toLowerCase()}function normalizeValue(e){if(typeof e!=="string"){e=String(e)}return e}function iteratorFor(e){var t={next:function(){var t=e.shift();return{done:t===undefined,value:t}}};if(support.iterable){t[Symbol.iterator]=function(){return t}}return t}function Headers(e){this.map={};if(e instanceof Headers){e.forEach((function(e,t){this.append(t,e)}),this)}else if(Array.isArray(e)){e.forEach((function(e){this.append(e[0],e[1])}),this)}else if(e){Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}}Headers.prototype.append=function(e,t){e=normalizeName(e);t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};Headers.prototype["delete"]=function(e){delete this.map[normalizeName(e)]};Headers.prototype.get=function(e){e=normalizeName(e);return this.has(e)?this.map[e]:null};Headers.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))};Headers.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)};Headers.prototype.forEach=function(e,t){for(var r in this.map){if(this.map.hasOwnProperty(r)){e.call(t,this.map[r],r,this)}}};Headers.prototype.keys=function(){var e=[];this.forEach((function(t,r){e.push(r)}));return iteratorFor(e)};Headers.prototype.values=function(){var e=[];this.forEach((function(t){e.push(t)}));return iteratorFor(e)};Headers.prototype.entries=function(){var e=[];this.forEach((function(t,r){e.push([r,t])}));return iteratorFor(e)};if(support.iterable){Headers.prototype[Symbol.iterator]=Headers.prototype.entries}function consumed(e){if(e.bodyUsed){return Promise.reject(new TypeError("Already read"))}e.bodyUsed=true}function fileReaderReady(e){return new Promise((function(t,r){e.onload=function(){t(e.result)};e.onerror=function(){r(e.error)}}))}function readBlobAsArrayBuffer(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsArrayBuffer(e);return r}function readBlobAsText(e){var t=new FileReader;var r=fileReaderReady(t);t.readAsText(e);return r}function readArrayBufferAsText(e){var t=new Uint8Array(e);var r=new Array(t.length);for(var a=0;a<t.length;a++){r[a]=String.fromCharCode(t[a])}return r.join("")}function bufferClone(e){if(e.slice){return e.slice(0)}else{var t=new Uint8Array(e.byteLength);t.set(new Uint8Array(e));return t.buffer}}function Body(){this.bodyUsed=false;this._initBody=function(e){this.bodyUsed=this.bodyUsed;this._bodyInit=e;if(!e){this._bodyText=""}else if(typeof e==="string"){this._bodyText=e}else if(support.blob&&Blob.prototype.isPrototypeOf(e)){this._bodyBlob=e}else if(support.formData&&FormData.prototype.isPrototypeOf(e)){this._bodyFormData=e}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this._bodyText=e.toString()}else if(support.arrayBuffer&&support.blob&&isDataView(e)){this._bodyArrayBuffer=bufferClone(e.buffer);this._bodyInit=new Blob([this._bodyArrayBuffer])}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))){this._bodyArrayBuffer=bufferClone(e)}else{this._bodyText=e=Object.prototype.toString.call(e)}if(!this.headers.get("content-type")){if(typeof e==="string"){this.headers.set("content-type","text/plain;charset=UTF-8")}else if(this._bodyBlob&&this._bodyBlob.type){this.headers.set("content-type",this._bodyBlob.type)}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)){this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")}}};if(support.blob){this.blob=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return Promise.resolve(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(new Blob([this._bodyArrayBuffer]))}else if(this._bodyFormData){throw new Error("could not read FormData body as blob")}else{return Promise.resolve(new Blob([this._bodyText]))}};this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=consumed(this);if(e){return e}if(ArrayBuffer.isView(this._bodyArrayBuffer)){return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength))}else{return Promise.resolve(this._bodyArrayBuffer)}}else{return this.blob().then(readBlobAsArrayBuffer)}}}this.text=function(){var e=consumed(this);if(e){return e}if(this._bodyBlob){return readBlobAsText(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))}else if(this._bodyFormData){throw new Error("could not read FormData body as text")}else{return Promise.resolve(this._bodyText)}};if(support.formData){this.formData=function(){return this.text().then(decode)}}this.json=function(){return this.text().then(JSON.parse)};return this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return methods.indexOf(t)>-1?t:e}function Request$1(e,t){if(!(this instanceof Request$1)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}t=t||{};var r=t.body;if(e instanceof Request$1){if(e.bodyUsed){throw new TypeError("Already read")}this.url=e.url;this.credentials=e.credentials;if(!t.headers){this.headers=new Headers(e.headers)}this.method=e.method;this.mode=e.mode;this.signal=e.signal;if(!r&&e._bodyInit!=null){r=e._bodyInit;e.bodyUsed=true}}else{this.url=String(e)}this.credentials=t.credentials||this.credentials||"same-origin";if(t.headers||!this.headers){this.headers=new Headers(t.headers)}this.method=normalizeMethod(t.method||this.method||"GET");this.mode=t.mode||this.mode||null;this.signal=t.signal||this.signal;this.referrer=null;if((this.method==="GET"||this.method==="HEAD")&&r){throw new TypeError("Body not allowed for GET or HEAD requests")}this._initBody(r);if(this.method==="GET"||this.method==="HEAD"){if(t.cache==="no-store"||t.cache==="no-cache"){var a=/([?&])_=[^&]*/;if(a.test(this.url)){this.url=this.url.replace(a,"$1_="+(new Date).getTime())}else{var n=/\?/;this.url+=(n.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})};function decode(e){var t=new FormData;e.trim().split("&").forEach((function(e){if(e){var r=e.split("=");var a=r.shift().replace(/\+/g," ");var n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(a),decodeURIComponent(n))}}));return t}function parseHeaders$1(e){var t=new Headers;var r=e.replace(/\r?\n[\t ]+/g," ");r.split("\r").map((function(e){return e.indexOf("\n")===0?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":");var a=r.shift().trim();if(a){var n=r.join(":").trim();t.append(a,n)}}));return t}Body.call(Request$1.prototype);function Response(e,t){if(!(this instanceof Response)){throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')}if(!t){t={}}this.type="default";this.status=t.status===undefined?200:t.status;this.ok=this.status>=200&&this.status<300;this.statusText=t.statusText===undefined?"":""+t.statusText;this.headers=new Headers(t.headers);this.url=t.url||"";this._initBody(e)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var e=new Response(null,{status:0,statusText:""});e.type="error";return e};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(e,t){if(redirectStatuses.indexOf(t)===-1){throw new RangeError("Invalid status code")}return new Response(null,{status:t,headers:{location:e}})};var DOMException=global$2.DOMException;try{new DOMException}catch(e){DOMException=function(e,t){this.message=e;this.name=t;var r=Error(e);this.stack=r.stack};DOMException.prototype=Object.create(Error.prototype);DOMException.prototype.constructor=DOMException}function fetch$1(e,t){return new Promise((function(r,a){var n=new Request$1(e,t);if(n.signal&&n.signal.aborted){return a(new DOMException("Aborted","AbortError"))}var i=new XMLHttpRequest;function o(){i.abort()}i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:parseHeaders$1(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;setTimeout((function(){r(new Response(t,e))}),0)};i.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)};i.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)};i.onabort=function(){setTimeout((function(){a(new DOMException("Aborted","AbortError"))}),0)};function s(e){try{return e===""&&global$2.location.href?global$2.location.href:e}catch(t){return e}}i.open(n.method,s(n.url),true);if(n.credentials==="include"){i.withCredentials=true}else if(n.credentials==="omit"){i.withCredentials=false}if("responseType"in i){if(support.blob){i.responseType="blob"}else if(support.arrayBuffer&&n.headers.get("Content-Type")&&n.headers.get("Content-Type").indexOf("application/octet-stream")!==-1){i.responseType="arraybuffer"}}if(t&&typeof t.headers==="object"&&!(t.headers instanceof Headers)){Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,normalizeValue(t.headers[e]))}))}else{n.headers.forEach((function(e,t){i.setRequestHeader(t,e)}))}if(n.signal){n.signal.addEventListener("abort",o);i.onreadystatechange=function(){if(i.readyState===4){n.signal.removeEventListener("abort",o)}}}i.send(typeof n._bodyInit==="undefined"?null:n._bodyInit)}))}fetch$1.polyfill=true;if(!global$2.fetch){global$2.fetch=fetch$1;global$2.Headers=Headers;global$2.Request=Request$1;global$2.Response=Response}var fetch$2=Object.freeze({__proto__:null,Headers:Headers,Request:Request$1,Response:Response,get DOMException(){return DOMException},fetch:fetch$1});var require$$0=getAugmentedNamespace(fetch$2);var browser=function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={exports:{},id:a,loaded:false};e[a].call(n.exports,n,n.exports,r);n.loaded=true;return n.exports}r.m=e;r.c=t;r.p="";return r(0)}([function(e,t,r){var a=r(1);var n=typeof importScripts==="function";e.exports=a(n?self:window)},function(e,t,r){function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++){r[t]=e[t]}return r}else{return Array.from(e)}}var n=[];function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++){r[i-1]=arguments[i]}var o=n.reduce((function(e,t){return[t].concat(e)}),[]);var s=Promise.resolve(r);o.forEach((function(e){var t=e.request,r=e.requestError;if(t||r){s=s.then((function(e){return t.apply(undefined,a(e))}),r)}}));s=s.then((function(t){var r=new(Function.prototype.bind.apply(Request,[null].concat(a(t))));return e(r).then((function(e){e.request=r;return e})).catch((function(e){e.request=r;return Promise.reject(e)}))}));o.forEach((function(e){var t=e.response,r=e.responseError;if(t||r){s=s.then(t,r)}}));return s}e.exports=function e(t){if(!t.fetch){try{r(2)}catch(e){throw Error("No fetch available. Unable to register fetch-intercept")}}t.fetch=function(e){return function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++){r[a]=arguments[a]}return i.apply(undefined,[e].concat(r))}}(t.fetch);return{register:function e(t){n.push(t);return function(){var e=n.indexOf(t);if(e>=0){n.splice(e,1)}}},clear:function e(){n=[]}}}},function(e,t){e.exports=require$$0}]);function getHeaderKey(e){return e.toLowerCase()}function isHttpHeadersLike(e){if(e&&typeof e==="object"){var t=e;if(typeof t.rawHeaders==="function"&&typeof t.clone==="function"&&typeof t.get==="function"&&typeof t.set==="function"&&typeof t.contains==="function"&&typeof t.remove==="function"&&typeof t.headersArray==="function"&&typeof t.headerValues==="function"&&typeof t.headerNames==="function"&&typeof t.toJson==="function"){return true}}return false}var HttpHeaders=function(){function e(e){this._headersMap={};if(e){for(var t in e){this.set(t,e[t])}}}e.prototype.set=function(e,t){this._headersMap[getHeaderKey(e)]={name:e,value:t.toString()}};e.prototype.get=function(e){var t=this._headersMap[getHeaderKey(e)];return!t?undefined:t.value};e.prototype.contains=function(e){return!!this._headersMap[getHeaderKey(e)]};e.prototype.remove=function(e){var t=this.contains(e);delete this._headersMap[getHeaderKey(e)];return t};e.prototype.rawHeaders=function(){return this.toJson({preserveCase:true})};e.prototype.headersArray=function(){var e=[];for(var t in this._headersMap){e.push(this._headersMap[t])}return e};e.prototype.headerNames=function(){var e=[];var t=this.headersArray();for(var r=0;r<t.length;++r){e.push(t[r].name)}return e};e.prototype.headerValues=function(){var e=[];var t=this.headersArray();for(var r=0;r<t.length;++r){e.push(t[r].value)}return e};e.prototype.toJson=function(e){if(e===void 0){e={}}var t={};if(e.preserveCase){for(var r in this._headersMap){var a=this._headersMap[r];t[a.name]=a.value}}else{for(var r in this._headersMap){var a=this._headersMap[r];t[getHeaderKey(a.name)]=a.value}}return t};e.prototype.toString=function(){return JSON.stringify(this.toJson({preserveCase:true}))};e.prototype.clone=function(){var t={};for(var r in this._headersMap){var a=this._headersMap[r];t[a.name]=a.value}return new e(t)};return e}();function encodeByteArray(e){var t="";for(var r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return btoa(t)}function decodeString(e){var t=atob(e);var r=new Uint8Array(t.length);for(var a=0;a<t.length;a++){r[a]=t.charCodeAt(a)}return r}var process_1=commonjsGlobal.process;var Constants={coreHttpVersion:"2.2.3",HTTP:"http:",HTTPS:"https:",HTTP_PROXY:"HTTP_PROXY",HTTPS_PROXY:"HTTPS_PROXY",NO_PROXY:"NO_PROXY",ALL_PROXY:"ALL_PROXY",HttpConstants:{HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429,ServiceUnavailable:503}},HeaderConstants:{AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",RETRY_AFTER:"Retry-After",USER_AGENT:"User-Agent"}};var XML_ATTRKEY="$";var XML_CHARKEY="_";var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=="undefined"&&typeof msCrypto.getRandomValues==="function"&&msCrypto.getRandomValues.bind(msCrypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}var REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return typeof e==="string"&®EX.test(e)}var byteToHex=[];for(var i=0;i<256;++i){byteToHex.push((i+256).toString(16).substr(1))}function stringify(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase();if(!validate(r)){throw TypeError("Stringified UUID is invalid")}return r}function v4(e,t,r){e=e||{};var a=e.random||(e.rng||rng)();a[6]=a[6]&15|64;a[8]=a[8]&63|128;if(t){r=r||0;for(var n=0;n<16;++n){t[r+n]=a[n]}return t}return stringify(a)}var validUuidRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;var isNode=typeof process_1!=="undefined"&&!!process_1.version&&!!process_1.versions&&!!process_1.versions.node;function isValidUuid(e){return validUuidRegex.test(e)}function generateUuid(){return v4()}function prepareXMLRootList(e,t,r,a){var n,i,o;if(!Array.isArray(e)){e=[e]}if(!r||!a){return n={},n[t]=e,n}var s=(i={},i[t]=e,i);s[XML_ATTRKEY]=(o={},o[r]=a,o);return s}var validateISODuration=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(e){return validateISODuration.test(e)}function replaceAll(e,t,r){return!e||!t?e:e.split(t).join(r||"")}function isPrimitiveType(e){return typeof e!=="object"&&typeof e!=="function"||e===null}function isObject(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}var Serializer=function(){function e(e,t){if(e===void 0){e={}}this.modelMappers=e;this.isXML=t}e.prototype.validateConstraints=function(e,t,r){var a=function(e,a){throw new Error('"'.concat(r,'" with value "').concat(t,'" should satisfy the constraint "').concat(e,'": ').concat(a,"."))};if(e.constraints&&t!=undefined){var n=t;var i=e.constraints,o=i.ExclusiveMaximum,s=i.ExclusiveMinimum,l=i.InclusiveMaximum,c=i.InclusiveMinimum,p=i.MaxItems,d=i.MaxLength,u=i.MinItems,m=i.MinLength,f=i.MultipleOf,h=i.Pattern,g=i.UniqueItems;if(o!=undefined&&n>=o){a("ExclusiveMaximum",o)}if(s!=undefined&&n<=s){a("ExclusiveMinimum",s)}if(l!=undefined&&n>l){a("InclusiveMaximum",l)}if(c!=undefined&&n<c){a("InclusiveMinimum",c)}var y=t;if(p!=undefined&&y.length>p){a("MaxItems",p)}if(d!=undefined&&y.length>d){a("MaxLength",d)}if(u!=undefined&&y.length<u){a("MinItems",u)}if(m!=undefined&&y.length<m){a("MinLength",m)}if(f!=undefined&&n%f!==0){a("MultipleOf",f)}if(h){var b=typeof h==="string"?new RegExp(h):h;if(typeof t!=="string"||t.match(b)===null){a("Pattern",h)}}if(g&&y.some((function(e,t,r){return r.indexOf(e)!==t}))){a("UniqueItems",g)}}};e.prototype.serialize=function(e,t,r,a){if(a===void 0){a={}}var n,i,o;var s={rootName:(n=a.rootName)!==null&&n!==void 0?n:"",includeRoot:(i=a.includeRoot)!==null&&i!==void 0?i:false,xmlCharKey:(o=a.xmlCharKey)!==null&&o!==void 0?o:XML_CHARKEY};var l={};var c=e.type.name;if(!r){r=e.serializedName}if(c.match(/^Sequence$/i)!==null){l=[]}if(e.isConstant){t=e.defaultValue}var p=e.required,d=e.nullable;if(p&&d&&t===undefined){throw new Error("".concat(r," cannot be undefined."))}if(p&&!d&&t==undefined){throw new Error("".concat(r," cannot be null or undefined."))}if(!p&&d===false&&t===null){throw new Error("".concat(r," cannot be null."))}if(t==undefined){l=t}else{this.validateConstraints(e,t,r);if(c.match(/^any$/i)!==null){l=t}else if(c.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)!==null){l=serializeBasicTypes(c,r,t)}else if(c.match(/^Enum$/i)!==null){var u=e;l=serializeEnumType(r,u.type.allowedValues,t)}else if(c.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)!==null){l=serializeDateTypes(c,t,r)}else if(c.match(/^ByteArray$/i)!==null){l=serializeByteArrayType(r,t)}else if(c.match(/^Base64Url$/i)!==null){l=serializeBase64UrlType(r,t)}else if(c.match(/^Sequence$/i)!==null){l=serializeSequenceType(this,e,t,r,Boolean(this.isXML),s)}else if(c.match(/^Dictionary$/i)!==null){l=serializeDictionaryType(this,e,t,r,Boolean(this.isXML),s)}else if(c.match(/^Composite$/i)!==null){l=serializeCompositeType(this,e,t,r,Boolean(this.isXML),s)}}return l};e.prototype.deserialize=function(e,t,r,a){if(a===void 0){a={}}var n,i,o;var s={rootName:(n=a.rootName)!==null&&n!==void 0?n:"",includeRoot:(i=a.includeRoot)!==null&&i!==void 0?i:false,xmlCharKey:(o=a.xmlCharKey)!==null&&o!==void 0?o:XML_CHARKEY};if(t==undefined){if(this.isXML&&e.type.name==="Sequence"&&!e.xmlIsWrapped){t=[]}if(e.defaultValue!==undefined){t=e.defaultValue}return t}var l;var c=e.type.name;if(!r){r=e.serializedName}if(c.match(/^Composite$/i)!==null){l=deserializeCompositeType(this,e,t,r,s)}else{if(this.isXML){var p=s.xmlCharKey;var d=t;if(d[XML_ATTRKEY]!=undefined&&d[p]!=undefined){t=d[p]}}if(c.match(/^Number$/i)!==null){l=parseFloat(t);if(isNaN(l)){l=t}}else if(c.match(/^Boolean$/i)!==null){if(t==="true"){l=true}else if(t==="false"){l=false}else{l=t}}else if(c.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)!==null){l=t}else if(c.match(/^(Date|DateTime|DateTimeRfc1123)$/i)!==null){l=new Date(t)}else if(c.match(/^UnixTime$/i)!==null){l=unixTimeToDate(t)}else if(c.match(/^ByteArray$/i)!==null){l=decodeString(t)}else if(c.match(/^Base64Url$/i)!==null){l=base64UrlToByteArray(t)}else if(c.match(/^Sequence$/i)!==null){l=deserializeSequenceType(this,e,t,r,s)}else if(c.match(/^Dictionary$/i)!==null){l=deserializeDictionaryType(this,e,t,r,s)}}if(e.isConstant){l=e.defaultValue}return l};return e}();function trimEnd(e,t){var r=e.length;while(r-1>=0&&e[r-1]===t){--r}return e.substr(0,r)}function bufferToBase64Url(e){if(!e){return undefined}if(!(e instanceof Uint8Array)){throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.")}var t=encodeByteArray(e);return trimEnd(t,"=").replace(/\+/g,"-").replace(/\//g,"_")}function base64UrlToByteArray(e){if(!e){return undefined}if(e&&typeof e.valueOf()!=="string"){throw new Error("Please provide an input of type string for converting to Uint8Array")}e=e.replace(/-/g,"+").replace(/_/g,"/");return decodeString(e)}function splitSerializeName(e){var t=[];var r="";if(e){var a=e.split(".");for(var n=0,i=a;n<i.length;n++){var o=i[n];if(o.charAt(o.length-1)==="\\"){r+=o.substr(0,o.length-1)+"."}else{r+=o;t.push(r);r=""}}}return t}function dateToUnixTime(e){if(!e){return undefined}if(typeof e.valueOf()==="string"){e=new Date(e)}return Math.floor(e.getTime()/1e3)}function unixTimeToDate(e){if(!e){return undefined}return new Date(e*1e3)}function serializeBasicTypes(e,t,r){if(r!==null&&r!==undefined){if(e.match(/^Number$/i)!==null){if(typeof r!=="number"){throw new Error("".concat(t," with value ").concat(r," must be of type number."))}}else if(e.match(/^String$/i)!==null){if(typeof r.valueOf()!=="string"){throw new Error("".concat(t,' with value "').concat(r,'" must be of type string.'))}}else if(e.match(/^Uuid$/i)!==null){if(!(typeof r.valueOf()==="string"&&isValidUuid(r))){throw new Error("".concat(t,' with value "').concat(r,'" must be of type string and a valid uuid.'))}}else if(e.match(/^Boolean$/i)!==null){if(typeof r!=="boolean"){throw new Error("".concat(t," with value ").concat(r," must be of type boolean."))}}else if(e.match(/^Stream$/i)!==null){var a=typeof r;if(a!=="string"&&a!=="function"&&!(r instanceof ArrayBuffer)&&!ArrayBuffer.isView(r)&&!((typeof Blob==="function"||typeof Blob==="object")&&r instanceof Blob)){throw new Error("".concat(t," must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."))}}}return r}function serializeEnumType(e,t,r){if(!t){throw new Error("Please provide a set of allowedValues to validate ".concat(e," as an Enum Type."))}var a=t.some((function(e){if(typeof e.valueOf()==="string"){return e.toLowerCase()===r.toLowerCase()}return e===r}));if(!a){throw new Error("".concat(r," is not a valid value for ").concat(e,". The valid values are: ").concat(JSON.stringify(t),"."))}return r}function serializeByteArrayType(e,t){var r="";if(t!=undefined){if(!(t instanceof Uint8Array)){throw new Error("".concat(e," must be of type Uint8Array."))}r=encodeByteArray(t)}return r}function serializeBase64UrlType(e,t){var r="";if(t!=undefined){if(!(t instanceof Uint8Array)){throw new Error("".concat(e," must be of type Uint8Array."))}r=bufferToBase64Url(t)||""}return r}function serializeDateTypes(e,t,r){if(t!=undefined){if(e.match(/^Date$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in ISO8601 format."))}t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(e.match(/^DateTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in ISO8601 format."))}t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(e.match(/^DateTimeRfc1123$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in RFC-1123 format."))}t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(e.match(/^UnixTime$/i)!==null){if(!(t instanceof Date||typeof t.valueOf()==="string"&&!isNaN(Date.parse(t)))){throw new Error("".concat(r," must be an instanceof Date or a string in RFC-1123/ISO8601 format ")+"for it to be serialized in UnixTime/Epoch format.")}t=dateToUnixTime(t)}else if(e.match(/^TimeSpan$/i)!==null){if(!isDuration(t)){throw new Error("".concat(r,' must be a string in ISO 8601 format. Instead was "').concat(t,'".'))}}}return t}function serializeSequenceType(e,t,r,a,n,i){var o,s;if(!Array.isArray(r)){throw new Error("".concat(a," must be of type Array."))}var l=t.type.element;if(!l||typeof l!=="object"){throw new Error('element" metadata for an Array must be defined in the '+'mapper and it must of type "object" in '.concat(a,"."))}var c=[];for(var p=0;p<r.length;p++){var d=e.serialize(l,r[p],a,i);if(n&&l.xmlNamespace){var u=l.xmlNamespacePrefix?"xmlns:".concat(l.xmlNamespacePrefix):"xmlns";if(l.type.name==="Composite"){c[p]=Object.assign({},d);c[p][XML_ATTRKEY]=(o={},o[u]=l.xmlNamespace,o)}else{c[p]={};c[p][i.xmlCharKey]=d;c[p][XML_ATTRKEY]=(s={},s[u]=l.xmlNamespace,s)}}else{c[p]=d}}return c}function serializeDictionaryType(e,t,r,a,n,i){var o;if(typeof r!=="object"){throw new Error("".concat(a," must be of type object."))}var s=t.type.value;if(!s||typeof s!=="object"){throw new Error('"value" metadata for a Dictionary must be defined in the '+'mapper and it must of type "object" in '.concat(a,"."))}var l={};for(var c=0,p=Object.keys(r);c<p.length;c++){var d=p[c];var u=e.serialize(s,r[d],a,i);l[d]=getXmlObjectValue(s,u,n,i)}if(n&&t.xmlNamespace){var m=t.xmlNamespacePrefix?"xmlns:".concat(t.xmlNamespacePrefix):"xmlns";var f=l;f[XML_ATTRKEY]=(o={},o[m]=t.xmlNamespace,o);return f}return l}function resolveAdditionalProperties(e,t,r){var a=t.type.additionalProperties;if(!a&&t.type.className){var n=resolveReferencedMapper(e,t,r);return n===null||n===void 0?void 0:n.type.additionalProperties}return a}function resolveReferencedMapper(e,t,r){var a=t.type.className;if(!a){throw new Error('Class name for model "'.concat(r,'" is not provided in the mapper "').concat(JSON.stringify(t,undefined,2),'".'))}return e.modelMappers[a]}function resolveModelProperties(e,t,r){var a=t.type.modelProperties;if(!a){var n=resolveReferencedMapper(e,t,r);if(!n){throw new Error('mapper() cannot be null or undefined for model "'.concat(t.type.className,'".'))}a=n===null||n===void 0?void 0:n.type.modelProperties;if(!a){throw new Error("modelProperties cannot be null or undefined in the "+'mapper "'.concat(JSON.stringify(n),'" of type "').concat(t.type.className,'" for object "').concat(r,'".'))}}return a}function serializeCompositeType(e,t,r,a,n,i){var o,s;if(getPolymorphicDiscriminatorRecursively(e,t)){t=getPolymorphicMapper(e,t,r,"clientName")}if(r!=undefined){var l={};var c=resolveModelProperties(e,t,a);for(var p=0,d=Object.keys(c);p<d.length;p++){var u=d[p];var m=c[u];if(m.readOnly){continue}var f=void 0;var h=l;if(e.isXML){if(m.xmlIsWrapped){f=m.xmlName}else{f=m.xmlElementName||m.xmlName}}else{var g=splitSerializeName(m.serializedName);f=g.pop();for(var y=0,b=g;y<b.length;y++){var v=b[y];var x=h[v];if(x==undefined&&(r[u]!=undefined||m.defaultValue!==undefined)){h[v]={}}h=h[v]}}if(h!=undefined){if(n&&t.xmlNamespace){var S=t.xmlNamespacePrefix?"xmlns:".concat(t.xmlNamespacePrefix):"xmlns";h[XML_ATTRKEY]=Object.assign(Object.assign({},h[XML_ATTRKEY]),(o={},o[S]=t.xmlNamespace,o))}var N=m.serializedName!==""?a+"."+m.serializedName:a;var z=r[u];var C=getPolymorphicDiscriminatorRecursively(e,t);if(C&&C.clientName===u&&z==undefined){z=t.serializedName}var P=e.serialize(m,z,N,i);if(P!==undefined&&f!=undefined){var R=getXmlObjectValue(m,P,n,i);if(n&&m.xmlIsAttribute){h[XML_ATTRKEY]=h[XML_ATTRKEY]||{};h[XML_ATTRKEY][f]=P}else if(n&&m.xmlIsWrapped){h[f]=(s={},s[m.xmlElementName]=R,s)}else{h[f]=R}}}}var E=resolveAdditionalProperties(e,t,a);if(E){var B=Object.keys(c);var w=function(t){var n=B.every((function(e){return e!==t}));if(n){l[t]=e.serialize(E,r[t],a+'["'+t+'"]',i)}};for(var _ in r){w(_)}}return l}return r}function getXmlObjectValue(e,t,r,a){var n;if(!r||!e.xmlNamespace){return t}var i=e.xmlNamespacePrefix?"xmlns:".concat(e.xmlNamespacePrefix):"xmlns";var o=(n={},n[i]=e.xmlNamespace,n);if(["Composite"].includes(e.type.name)){if(t[XML_ATTRKEY]){return t}else{var s=Object.assign({},t);s[XML_ATTRKEY]=o;return s}}var l={};l[a.xmlCharKey]=t;l[XML_ATTRKEY]=o;return l}function isSpecialXmlProperty(e,t){return[XML_ATTRKEY,t.xmlCharKey].includes(e)}function deserializeCompositeType(e,t,r,a,n){var i;if(getPolymorphicDiscriminatorRecursively(e,t)){t=getPolymorphicMapper(e,t,r,"serializedName")}var o=resolveModelProperties(e,t,a);var s={};var l=[];for(var c=0,p=Object.keys(o);c<p.length;c++){var d=p[c];var u=o[d];var m=splitSerializeName(o[d].serializedName);l.push(m[0]);var f=u.serializedName,h=u.xmlName,g=u.xmlElementName;var y=a;if(f!==""&&f!==undefined){y=a+"."+f}var b=u.headerCollectionPrefix;if(b){var v={};for(var x=0,S=Object.keys(r);x<S.length;x++){var N=S[x];if(N.startsWith(b)){v[N.substring(b.length)]=e.deserialize(u.type.value,r[N],y,n)}l.push(N)}s[d]=v}else if(e.isXML){if(u.xmlIsAttribute&&r[XML_ATTRKEY]){s[d]=e.deserialize(u,r[XML_ATTRKEY][h],y,n)}else{var z=g||h||f;if(u.xmlIsWrapped){var C=r[h];var P=(i=C===null||C===void 0?void 0:C[g])!==null&&i!==void 0?i:[];s[d]=e.deserialize(u,P,y,n)}else{var R=r[z];s[d]=e.deserialize(u,R,y,n)}}}else{var E=void 0;var B=r;for(var w=0,_=m;w<_.length;w++){var T=_[w];if(!B)break;B=B[T]}E=B;var O=t.type.polymorphicDiscriminator;if(O&&d===O.clientName&&E==undefined){E=t.serializedName}var k=void 0;if(Array.isArray(r[d])&&o[d].serializedName===""){E=r[d];var A=e.deserialize(u,E,y,n);for(var I=0,L=Object.entries(s);I<L.length;I++){var H=L[I],q=H[0],M=H[1];if(!Object.prototype.hasOwnProperty.call(A,q)){A[q]=M}}s=A}else if(E!==undefined||u.defaultValue!==undefined){k=e.deserialize(u,E,y,n);s[d]=k}}}var D=t.type.additionalProperties;if(D){var U=function(e){for(var t in o){var r=splitSerializeName(o[t].serializedName);if(r[0]===e){return false}}return true};for(var j in r){if(U(j)){s[j]=e.deserialize(D,r[j],a+'["'+j+'"]',n)}}}else if(r){for(var F=0,V=Object.keys(r);F<V.length;F++){var d=V[F];if(s[d]===undefined&&!l.includes(d)&&!isSpecialXmlProperty(d,n)){s[d]=r[d]}}}return s}function deserializeDictionaryType(e,t,r,a,n){var i=t.type.value;if(!i||typeof i!=="object"){throw new Error('"value" metadata for a Dictionary must be defined in the '+'mapper and it must of type "object" in '.concat(a))}if(r){var o={};for(var s=0,l=Object.keys(r);s<l.length;s++){var c=l[s];o[c]=e.deserialize(i,r[c],a,n)}return o}return r}function deserializeSequenceType(e,t,r,a,n){var i=t.type.element;if(!i||typeof i!=="object"){throw new Error('element" metadata for an Array must be defined in the '+'mapper and it must of type "object" in '.concat(a))}if(r){if(!Array.isArray(r)){r=[r]}var o=[];for(var s=0;s<r.length;s++){o[s]=e.deserialize(i,r[s],"".concat(a,"[").concat(s,"]"),n)}return o}return r}function getPolymorphicMapper(e,t,r,a){var n=getPolymorphicDiscriminatorRecursively(e,t);if(n){var i=n[a];if(i!=undefined){var o=r[i];if(o!=undefined){var s=t.type.uberParent||t.type.className;var l=o===s?o:s+"."+o;var c=e.modelMappers.discriminators[l];if(c){t=c}}}}return t}function getPolymorphicDiscriminatorRecursively(e,t){return t.type.polymorphicDiscriminator||getPolymorphicDiscriminatorSafely(e,t.type.uberParent)||getPolymorphicDiscriminatorSafely(e,t.type.className)}function getPolymorphicDiscriminatorSafely(e,t){return t&&e.modelMappers[t]&&e.modelMappers[t].type.polymorphicDiscriminator}function strEnum(e){var t={};for(var r=0,a=e;r<a.length;r++){var n=a[r];t[n]=n}return t}var MapperType=strEnum(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"]);function isWebResourceLike(e){if(e&&typeof e==="object"){var t=e;if(typeof t.url==="string"&&typeof t.method==="string"&&typeof t.headers==="object"&&isHttpHeadersLike(t.headers)&&typeof t.validateRequestProperties==="function"&&typeof t.prepare==="function"&&typeof t.clone==="function"){return true}}return false}var WebResource=function(){function e(e,t,r,a,n,i,o,s,l,c,p,d,u,m,f){this.streamResponseBody=i;this.streamResponseStatusCodes=f;this.url=e||"";this.method=t||"GET";this.headers=isHttpHeadersLike(n)?n:new HttpHeaders(n);this.body=r;this.query=a;this.formData=undefined;this.withCredentials=o||false;this.abortSignal=s;this.timeout=l||0;this.onUploadProgress=c;this.onDownloadProgress=p;this.proxySettings=d;this.keepAlive=u;this.decompressResponse=m;this.requestId=this.headers.get("x-ms-client-request-id")||generateUuid()}e.prototype.validateRequestProperties=function(){if(!this.method){throw new Error("WebResource.method is required.")}if(!this.url){throw new Error("WebResource.url is required.")}};e.prototype.prepare=function(e){if(!e){throw new Error("options object is required")}if(e.method===undefined||e.method===null||typeof e.method.valueOf()!=="string"){throw new Error("options.method must be a string.")}if(e.url&&e.pathTemplate){throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them.")}if((e.pathTemplate===undefined||e.pathTemplate===null||typeof e.pathTemplate.valueOf()!=="string")&&(e.url===undefined||e.url===null||typeof e.url.valueOf()!=="string")){throw new Error("Please provide exactly one of options.pathTemplate or options.url.")}if(e.url){if(typeof e.url!=="string"){throw new Error('options.url must be of type "string".')}this.url=e.url}if(e.method){var t=["GET","PUT","HEAD","DELETE","OPTIONS","POST","PATCH","TRACE"];if(t.indexOf(e.method.toUpperCase())===-1){throw new Error('The provided method "'+e.method+'" is invalid. Supported HTTP methods are: '+JSON.stringify(t))}}this.method=e.method.toUpperCase();if(e.pathTemplate){var r=e.pathTemplate,a=e.pathParameters;if(typeof r!=="string"){throw new Error('options.pathTemplate must be of type "string".')}if(!e.baseUrl){e.baseUrl="https://management.azure.com"}var n=e.baseUrl;var i=n+(n.endsWith("/")?"":"/")+(r.startsWith("/")?r.slice(1):r);var o=i.match(/({[\w-]*\s*[\w-]*})/gi);if(o&&o.length){if(!a){throw new Error("pathTemplate: ".concat(r," has been provided. Hence, options.pathParameters must also be provided."))}o.forEach((function(e){var t=e.slice(1,-1);var n=a[t];if(n===null||n===undefined||!(typeof n==="string"||typeof n==="object")){var o=JSON.stringify(a,undefined,2);throw new Error("pathTemplate: ".concat(r," contains the path parameter ").concat(t)+" however, it is not present in parameters: ".concat(o,".")+'The value of the path parameter can either be a "string" of the form { '.concat(t,': "some sample value" } or ')+'it can be an "object" of the form { "'.concat(t,'": { value: "some sample value", skipUrlEncoding: true } }.'))}if(typeof n.valueOf()==="string"){i=i.replace(e,encodeURIComponent(n))}if(typeof n.valueOf()==="object"){if(!n.value){throw new Error("options.pathParameters[".concat(t,'] is of type "object" but it does not contain a "value" property.'))}if(n.skipUrlEncoding){i=i.replace(e,n.value)}else{i=i.replace(e,encodeURIComponent(n.value))}}}))}this.url=i}if(e.queryParameters){var s=e.queryParameters;if(typeof s!=="object"){throw new Error("options.queryParameters must be of type object. It should be a JSON object "+'of "query-parameter-name" as the key and the "query-parameter-value" as the value. '+'The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.')}if(this.url&&this.url.indexOf("?")===-1){this.url+="?"}var l=[];this.query={};for(var c in s){var p=s[c];if(p){if(typeof p==="string"){l.push(c+"="+encodeURIComponent(p));this.query[c]=encodeURIComponent(p)}else if(typeof p==="object"){if(!p.value){throw new Error("options.queryParameters[".concat(c,'] is of type "object" but it does not contain a "value" property.'))}if(p.skipUrlEncoding){l.push(c+"="+p.value);this.query[c]=p.value}else{l.push(c+"="+encodeURIComponent(p.value));this.query[c]=encodeURIComponent(p.value)}}}}this.url+=l.join("&")}if(e.headers){var d=e.headers;for(var u=0,m=Object.keys(e.headers);u<m.length;u++){var f=m[u];this.headers.set(f,d[f])}}if(!this.headers.get("accept-language")){this.headers.set("accept-language","en-US")}if(!this.headers.get("x-ms-client-request-id")&&!e.disableClientRequestId){this.headers.set("x-ms-client-request-id",this.requestId)}if(!this.headers.get("Content-Type")){this.headers.set("Content-Type","application/json; charset=utf-8")}this.body=e.body;if(e.body!==undefined&&e.body!==null){if(e.bodyIsStream){if(!this.headers.get("Transfer-Encoding")){this.headers.set("Transfer-Encoding","chunked")}if(this.headers.get("Content-Type")!=="application/octet-stream"){this.headers.set("Content-Type","application/octet-stream")}}else{if(e.serializationMapper){this.body=new Serializer(e.mappers).serialize(e.serializationMapper,e.body,"requestBody")}if(!e.disableJsonStringifyOnBody){this.body=JSON.stringify(e.body)}}}if(e.spanOptions){this.spanOptions=e.spanOptions}if(e.tracingContext){this.tracingContext=e.tracingContext}this.abortSignal=e.abortSignal;this.onDownloadProgress=e.onDownloadProgress;this.onUploadProgress=e.onUploadProgress;return this};e.prototype.clone=function(){var t=new e(this.url,this.method,this.body,this.query,this.headers&&this.headers.clone(),this.streamResponseBody,this.withCredentials,this.abortSignal,this.timeout,this.onUploadProgress,this.onDownloadProgress,this.proxySettings,this.keepAlive,this.decompressResponse,this.streamResponseStatusCodes);if(this.formData){t.formData=this.formData}if(this.operationSpec){t.operationSpec=this.operationSpec}if(this.shouldDeserialize){t.shouldDeserialize=this.shouldDeserialize}if(this.operationResponseGetter){t.operationResponseGetter=this.operationResponseGetter}return t};return e}();
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -18,4 +18,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
18
18
|
*
|
|
19
19
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==undefined?global$1.TYPED_ARRAY_SUPPORT:true;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(t)}e.length=t}return e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,t,r)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,t,r,a){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return fromArrayBuffer(e,t,r,a)}if(typeof t==="string"){return fromString(e,t,r)}return fromObject(e,t)}Buffer.from=function(e,t,r){return from(null,e,t,r)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,t,r,a){assertSize(t);if(t<=0){return createBuffer(e,t)}if(r!==undefined){return typeof a==="string"?createBuffer(e,t).fill(r,a):createBuffer(e,t).fill(r)}return createBuffer(e,t)}Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)};function allocUnsafe(e,t){assertSize(t);e=createBuffer(e,t<0?0:checked(t)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var a=byteLength(t,r)|0;e=createBuffer(e,a);var n=e.write(t,r);if(n!==a){e=e.slice(0,n)}return e}function fromArrayLike(e,t){var r=t.length<0?0:checked(t.length)|0;e=createBuffer(e,r);for(var a=0;a<r;a+=1){e[a]=t[a]&255}return e}function fromArrayBuffer(e,t,r,a){if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(a||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&a===undefined){t=new Uint8Array(t)}else if(a===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,a)}if(Buffer.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,t)}return e}function fromObject(e,t){if(internalIsBuffer(t)){var r=checked(t.length)|0;e=createBuffer(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||isnan(t.length)){return createBuffer(e,0)}return fromArrayLike(e,t)}if(t.type==="Buffer"&&isArray(t.data)){return fromArrayLike(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function e(t,r){if(!internalIsBuffer(t)||!internalIsBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var a=t.length;var n=r.length;for(var i=0,o=Math.min(a,n);i<o;++i){if(t[i]!==r[i]){a=t[i];n=r[i];break}}if(a<n)return-1;if(n<a)return 1;return 0};Buffer.isEncoding=function e(t){switch(String(t).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 true;default:return false}};Buffer.concat=function e(t,r){if(!isArray(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return Buffer.alloc(0)}var a;if(r===undefined){r=0;for(a=0;a<t.length;++a){r+=t[a].length}}var n=Buffer.allocUnsafe(r);var i=0;for(a=0;a<t.length;++a){var o=t[a];if(!internalIsBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(n,i);i+=o.length}return n};function byteLength(e,t){if(internalIsBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var a=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(a)return utf8ToBytes(e).length;t=(""+t).toLowerCase();a=true}}}Buffer.byteLength=byteLength;function slowToString(e,t,r){var a=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();a=true}}}Buffer.prototype._isBuffer=true;function swap(e,t,r){var a=e[t];e[t]=e[r];e[r]=a}Buffer.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){swap(this,r,r+1)}return this};Buffer.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){swap(this,r,r+3);swap(this,r+1,r+2)}return this};Buffer.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){swap(this,r,r+7);swap(this,r+1,r+6);swap(this,r+2,r+5);swap(this,r+3,r+4)}return this};Buffer.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return utf8Slice(this,0,t);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function e(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return Buffer.compare(this,t)===0};Buffer.prototype.inspect=function e(){var t="";var r=INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return"<Buffer "+t+">"};Buffer.prototype.compare=function e(t,r,a,n,i){if(!internalIsBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(a===undefined){a=t?t.length:0}if(n===undefined){n=0}if(i===undefined){i=this.length}if(r<0||a>t.length||n<0||i>this.length){throw new RangeError("out of range index")}if(n>=i&&r>=a){return 0}if(n>=i){return-1}if(r>=a){return 1}r>>>=0;a>>>=0;n>>>=0;i>>>=0;if(this===t)return 0;var o=i-n;var s=a-r;var l=Math.min(o,s);var c=this.slice(n,i);var p=t.slice(r,a);for(var d=0;d<l;++d){if(c[d]!==p[d]){o=c[d];s=p[d];break}}if(o<s)return-1;if(s<o)return 1;return 0};function bidirectionalIndexOf(e,t,r,a,n){if(e.length===0)return-1;if(typeof r==="string"){a=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=n?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(n)return-1;else r=e.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof t==="string"){t=Buffer.from(t,a)}if(internalIsBuffer(t)){if(t.length===0){return-1}return arrayIndexOf(e,t,r,a,n)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return arrayIndexOf(e,[t],r,a,n)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,a,n){var i=1;var o=e.length;var s=t.length;if(a!==undefined){a=String(a).toLowerCase();if(a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le"){if(e.length<2||t.length<2){return-1}i=2;o/=2;s/=2;r/=2}}function l(e,t){if(i===1){return e[t]}else{return e.readUInt16BE(t*i)}}var c;if(n){var p=-1;for(c=r;c<o;c++){if(l(e,c)===l(t,p===-1?0:c-p)){if(p===-1)p=c;if(c-p+1===s)return p*i}else{if(p!==-1)c-=c-p;p=-1}}}else{if(r+s>o)r=o-s;for(c=r;c>=0;c--){var d=true;for(var u=0;u<s;u++){if(l(e,c+u)!==l(t,u)){d=false;break}}if(d)return c}}return-1}Buffer.prototype.includes=function e(t,r,a){return this.indexOf(t,r,a)!==-1};Buffer.prototype.indexOf=function e(t,r,a){return bidirectionalIndexOf(this,t,r,a,true)};Buffer.prototype.lastIndexOf=function e(t,r,a){return bidirectionalIndexOf(this,t,r,a,false)};function hexWrite(e,t,r,a){r=Number(r)||0;var n=e.length-r;if(!a){a=n}else{a=Number(a);if(a>n){a=n}}var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");if(a>i/2){a=i/2}for(var o=0;o<a;++o){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function utf8Write(e,t,r,a){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,a)}function asciiWrite(e,t,r,a){return blitBuffer(asciiToBytes(t),e,r,a)}function latin1Write(e,t,r,a){return asciiWrite(e,t,r,a)}function base64Write(e,t,r,a){return blitBuffer(base64ToBytes(t),e,r,a)}function ucs2Write(e,t,r,a){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,a)}Buffer.prototype.write=function e(t,r,a,n){if(r===undefined){n="utf8";a=this.length;r=0}else if(a===undefined&&typeof r==="string"){n=r;a=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(a)){a=a|0;if(n===undefined)n="utf8"}else{n=a;a=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var i=this.length-r;if(a===undefined||a>i)a=i;if(t.length>0&&(a<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return hexWrite(this,t,r,a);case"utf8":case"utf-8":return utf8Write(this,t,r,a);case"ascii":return asciiWrite(this,t,r,a);case"latin1":case"binary":return latin1Write(this,t,r,a);case"base64":return base64Write(this,t,r,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,r,a);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};Buffer.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,r){if(t===0&&r===e.length){return fromByteArray(e)}else{return fromByteArray(e.slice(t,r))}}function utf8Slice(e,t,r){r=Math.min(e.length,r);var a=[];var n=t;while(n<r){var i=e[n];var o=null;var s=i>239?4:i>223?3:i>191?2:1;if(n+s<=r){var l,c,p,d;switch(s){case 1:if(i<128){o=i}break;case 2:l=e[n+1];if((l&192)===128){d=(i&31)<<6|l&63;if(d>127){o=d}}break;case 3:l=e[n+1];c=e[n+2];if((l&192)===128&&(c&192)===128){d=(i&15)<<12|(l&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){o=d}}break;case 4:l=e[n+1];c=e[n+2];p=e[n+3];if((l&192)===128&&(c&192)===128&&(p&192)===128){d=(i&15)<<18|(l&63)<<12|(c&63)<<6|p&63;if(d>65535&&d<1114112){o=d}}}}if(o===null){o=65533;s=1}else if(o>65535){o-=65536;a.push(o>>>10&1023|55296);o=56320|o&1023}a.push(o);n+=s}return decodeCodePointsArray(a)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,e)}var r="";var a=0;while(a<t){r+=String.fromCharCode.apply(String,e.slice(a,a+=MAX_ARGUMENTS_LENGTH))}return r}function asciiSlice(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n){a+=String.fromCharCode(e[n]&127)}return a}function latin1Slice(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n){a+=String.fromCharCode(e[n])}return a}function hexSlice(e,t,r){var a=e.length;if(!t||t<0)t=0;if(!r||r<0||r>a)r=a;var n="";for(var i=t;i<r;++i){n+=toHex(e[i])}return n}function utf16leSlice(e,t,r){var a=e.slice(t,r);var n="";for(var i=0;i<a.length;i+=2){n+=String.fromCharCode(a[i]+a[i+1]*256)}return n}Buffer.prototype.slice=function e(t,r){var a=this.length;t=~~t;r=r===undefined?a:~~r;if(t<0){t+=a;if(t<0)t=0}else if(t>a){t=a}if(r<0){r+=a;if(r<0)r=0}else if(r>a){r=a}if(r<t)r=t;var n;if(Buffer.TYPED_ARRAY_SUPPORT){n=this.subarray(t,r);n.__proto__=Buffer.prototype}else{var i=r-t;n=new Buffer(i,undefined);for(var o=0;o<i;++o){n[o]=this[o+t]}}return n};function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o<r&&(i*=256)){n+=this[t+o]*i}return n};Buffer.prototype.readUIntBE=function e(t,r,a){t=t|0;r=r|0;if(!a){checkOffset(t,r,this.length)}var n=this[t+--r];var i=1;while(r>0&&(i*=256)){n+=this[t+--r]*i}return n};Buffer.prototype.readUInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);return this[t]};Buffer.prototype.readUInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]|this[t+1]<<8};Buffer.prototype.readUInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]<<8|this[t+1]};Buffer.prototype.readUInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Buffer.prototype.readUInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Buffer.prototype.readIntLE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o<r&&(i*=256)){n+=this[t+o]*i}i*=128;if(n>=i)n-=Math.pow(2,8*r);return n};Buffer.prototype.readIntBE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=r;var i=1;var o=this[t+--n];while(n>0&&(i*=256)){o+=this[t+--n]*i}i*=128;if(o>=i)o-=Math.pow(2,8*r);return o};Buffer.prototype.readInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Buffer.prototype.readInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);var a=this[t]|this[t+1]<<8;return a&32768?a|4294901760:a};Buffer.prototype.readInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);var a=this[t+1]|this[t]<<8;return a&32768?a|4294901760:a};Buffer.prototype.readInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Buffer.prototype.readInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Buffer.prototype.readFloatLE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,true,23,4)};Buffer.prototype.readFloatBE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,false,23,4)};Buffer.prototype.readDoubleLE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,true,52,8)};Buffer.prototype.readDoubleBE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,false,52,8)};function checkInt(e,t,r,a,n,i){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function e(t,r,a,n){t=+t;r=r|0;a=a|0;if(!n){var i=Math.pow(2,8*a)-1;checkInt(this,t,r,a,i,0)}var o=1;var s=0;this[r]=t&255;while(++s<a&&(o*=256)){this[r+s]=t/o&255}return r+a};Buffer.prototype.writeUIntBE=function e(t,r,a,n){t=+t;r=r|0;a=a|0;if(!n){var i=Math.pow(2,8*a)-1;checkInt(this,t,r,a,i,0)}var o=a-1;var s=1;this[r+o]=t&255;while(--o>=0&&(s*=256)){this[r+o]=t/s&255}return r+a};Buffer.prototype.writeUInt8=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function objectWriteUInt16(e,t,r,a){if(t<0)t=65535+t+1;for(var n=0,i=Math.min(e.length-r,2);n<i;++n){e[r+n]=(t&255<<8*(a?n:1-n))>>>(a?n:1-n)*8}}Buffer.prototype.writeUInt16LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeUInt16BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};function objectWriteUInt32(e,t,r,a){if(t<0)t=4294967295+t+1;for(var n=0,i=Math.min(e.length-r,4);n<i;++n){e[r+n]=t>>>(a?n:3-n)*8&255}}Buffer.prototype.writeUInt32LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeUInt32BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};Buffer.prototype.writeIntLE=function e(t,r,a,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*a-1);checkInt(this,t,r,a,i-1,-i)}var o=0;var s=1;var l=0;this[r]=t&255;while(++o<a&&(s*=256)){if(t<0&&l===0&&this[r+o-1]!==0){l=1}this[r+o]=(t/s>>0)-l&255}return r+a};Buffer.prototype.writeIntBE=function e(t,r,a,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*a-1);checkInt(this,t,r,a,i-1,-i)}var o=a-1;var s=1;var l=0;this[r+o]=t&255;while(--o>=0&&(s*=256)){if(t<0&&l===0&&this[r+o+1]!==0){l=1}this[r+o]=(t/s>>0)-l&255}return r+a};Buffer.prototype.writeInt8=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};Buffer.prototype.writeInt16LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeInt16BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};Buffer.prototype.writeInt32LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeInt32BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};function checkIEEE754(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,a,n){if(!n){checkIEEE754(e,t,r,4)}write(e,t,r,a,23,4);return r+4}Buffer.prototype.writeFloatLE=function e(t,r,a){return writeFloat(this,t,r,true,a)};Buffer.prototype.writeFloatBE=function e(t,r,a){return writeFloat(this,t,r,false,a)};function writeDouble(e,t,r,a,n){if(!n){checkIEEE754(e,t,r,8)}write(e,t,r,a,52,8);return r+8}Buffer.prototype.writeDoubleLE=function e(t,r,a){return writeDouble(this,t,r,true,a)};Buffer.prototype.writeDoubleBE=function e(t,r,a){return writeDouble(this,t,r,false,a)};Buffer.prototype.copy=function e(t,r,a,n){if(!a)a=0;if(!n&&n!==0)n=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(n>0&&n<a)n=a;if(n===a)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(a<0||a>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(t.length-r<n-a){n=t.length-r+a}var i=n-a;var o;if(this===t&&a<r&&r<n){for(o=i-1;o>=0;--o){t[o+r]=this[o+a]}}else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(o=0;o<i;++o){t[o+r]=this[o+a]}}else{Uint8Array.prototype.set.call(t,this.subarray(a,a+i),r)}return i};Buffer.prototype.fill=function e(t,r,a,n){if(typeof t==="string"){if(typeof r==="string"){n=r;r=0;a=this.length}else if(typeof a==="string"){n=a;a=this.length}if(t.length===1){var i=t.charCodeAt(0);if(i<256){t=i}}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!Buffer.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<a){throw new RangeError("Out of range index")}if(a<=r){return this}r=r>>>0;a=a===undefined?this.length:a>>>0;if(!t)t=0;var o;if(typeof t==="number"){for(o=r;o<a;++o){this[o]=t}}else{var s=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString());var l=s.length;for(o=0;o<a-r;++o){this[o+r]=s[o%l]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(INVALID_BASE64_RE,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,t){t=t||Infinity;var r;var a=e.length;var n=null;var i=[];for(var o=0;o<a;++o){r=e.charCodeAt(o);if(r>55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)i.push(239,191,189);continue}else if(o+1===a){if((t-=3)>-1)i.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)i.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((t-=3)>-1)i.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return i}function asciiToBytes(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function utf16leToBytes(e,t){var r,a,n;var i=[];for(var o=0;o<e.length;++o){if((t-=2)<0)break;r=e.charCodeAt(o);a=r>>8;n=r%256;i.push(n);i.push(a)}return i}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,a){for(var n=0;n<a;++n){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}function escapeURLPath(e){var t=URLBuilder.parse(e);var r=t.getPath();r=r||"/";r=escape(r);t.setPath(r);return t.toString()}function getProxyUriFromDevConnString(e){var t="";if(e.search("DevelopmentStorageProxyUri=")!==-1){var r=e.split(";");for(var a=0,n=r;a<n.length;a++){var i=n[a];if(i.trim().startsWith("DevelopmentStorageProxyUri=")){t=i.trim().match("DevelopmentStorageProxyUri=(.*)")[1]}}}return t}function getValueInConnString(e,t){var r=e.split(";");for(var a=0,n=r;a<n.length;a++){var i=n[a];if(i.trim().startsWith(t)){return i.trim().match(t+"=(.*)")[1]}}return""}function extractConnectionStringParts(e){var t="";if(e.startsWith("UseDevelopmentStorage=true")){t=getProxyUriFromDevConnString(e);e=DevelopmentConnectionString}var r=getValueInConnString(e,"BlobEndpoint");r=r.endsWith("/")?r.slice(0,-1):r;if(e.search("DefaultEndpointsProtocol=")!==-1&&e.search("AccountKey=")!==-1){var a="";var n="";var i=Buffer.from("accountKey","base64");var o="";n=getValueInConnString(e,"AccountName");i=Buffer.from(getValueInConnString(e,"AccountKey"),"base64");if(!r){a=getValueInConnString(e,"DefaultEndpointsProtocol");var s=a.toLowerCase();if(s!=="https"&&s!=="http"){throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'")}o=getValueInConnString(e,"EndpointSuffix");if(!o){throw new Error("Invalid EndpointSuffix in the provided Connection String")}r="".concat(a,"://").concat(n,".blob.").concat(o)}if(!n){throw new Error("Invalid AccountName in the provided Connection String")}else if(i.length===0){throw new Error("Invalid AccountKey in the provided Connection String")}return{kind:"AccountConnString",url:r,accountName:n,accountKey:i,proxyUri:t}}else{var l=getValueInConnString(e,"SharedAccessSignature");var n=getAccountNameFromUrl(r);if(!r){throw new Error("Invalid BlobEndpoint in the provided SAS Connection String")}else if(!l){throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String")}return{kind:"SASConnString",url:r,accountName:n,accountSas:l}}}function escape(e){return encodeURIComponent(e).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}function appendToURLPath(e,t){var r=URLBuilder.parse(e);var a=r.getPath();a=a?a.endsWith("/")?"".concat(a).concat(t):"".concat(a,"/").concat(t):t;r.setPath(a);return r.toString()}function setURLParameter(e,t,r){var a=URLBuilder.parse(e);a.setQueryParameter(t,r);return a.toString()}function getURLParameter(e,t){var r=URLBuilder.parse(e);return r.getQueryParameterValue(t)}function setURLHost(e,t){var r=URLBuilder.parse(e);r.setHost(t);return r.toString()}function getURLScheme(e){var t=URLBuilder.parse(e);return t.getScheme()}function appendToURLQuery(e,t){var r=URLBuilder.parse(e);var a=r.getQuery();if(a){a+="&"+t}else{a=t}r.setQuery(a);return r.toString()}function truncatedISO8061Date(e,t){if(t===void 0){t=true}var r=e.toISOString();return t?r.substring(0,r.length-1)+"0000"+"Z":r.substring(0,r.length-5)+"Z"}function base64encode(e){return!isNode?btoa(e):Buffer.from(e).toString("base64")}function generateBlockID(e,t){var r=48;var a=6;var n=r-a;if(e.length>n){e=e.slice(0,n)}var i=e+padStart(t.toString(),r-e.length,"0");return base64encode(i)}function delay(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(a){return[2,new Promise((function(a,n){var i;var o=function(){if(i!==undefined){clearTimeout(i)}n(r)};var s=function(){if(t!==undefined){t.removeEventListener("abort",o)}a()};i=setTimeout(s,e);if(t!==undefined){t.addEventListener("abort",o)}}))]}))}))}function padStart(e,t,r){if(r===void 0){r=" "}if(String.prototype.padStart){return e.padStart(t,r)}r=r||" ";if(e.length>t){return e}else{t=t-e.length;if(t>r.length){r+=r.repeat(t/r.length)}return r.slice(0,t)+e}}function iEqual(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()}function getAccountNameFromUrl(e){var t=URLBuilder.parse(e);var r;try{if(t.getHost().split(".")[1]==="blob"){r=t.getHost().split(".")[0]}else if(isIpEndpointStyle(t)){r=t.getPath().split("/")[1]}else{r=""}return r}catch(e){throw new Error("Unable to extract accountName with provided information.")}}function isIpEndpointStyle(e){if(e.getHost()===undefined){return false}var t=e.getHost()+(e.getPort()===undefined?"":":"+e.getPort());return/^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(t)}function toBlobTagsString(e){if(e===undefined){return undefined}var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var a=e[r];t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(a)))}}return t.join("&")}function toBlobTags(e){if(e===undefined){return undefined}var t={blobTagSet:[]};for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var a=e[r];t.blobTagSet.push({key:r,value:a})}}return t}function toTags(e){if(e===undefined){return undefined}var t={};for(var r=0,a=e.blobTagSet;r<a.length;r++){var n=a[r];t[n.key]=n.value}return t}function toQuerySerialization(e){if(e===undefined){return undefined}switch(e.kind){case"csv":return{format:{type:"delimited",delimitedTextConfiguration:{columnSeparator:e.columnSeparator||",",fieldQuote:e.fieldQuote||"",recordSeparator:e.recordSeparator,escapeChar:e.escapeCharacter||"",headersPresent:e.hasHeaders||false}}};case"json":return{format:{type:"json",jsonTextConfiguration:{recordSeparator:e.recordSeparator}}};case"arrow":return{format:{type:"arrow",arrowConfiguration:{schema:e.schema}}};case"parquet":return{format:{type:"parquet"}};default:throw Error("Invalid BlobQueryTextConfiguration.")}}function parseObjectReplicationRecord(e){if(!e){return undefined}if("policy-id"in e){return undefined}var t=[];var r=function(r){var a=r.split("_");var n="or-";if(a[0].startsWith(n)){a[0]=a[0].substring(n.length)}var i={ruleId:a[1],replicationStatus:e[r]};var o=t.findIndex((function(e){return e.policyId===a[0]}));if(o>-1){t[o].rules.push(i)}else{t.push({policyId:a[0],rules:[i]})}};for(var a in e){r(a)}return t}function attachCredential(e,t){e.credential=t;return e}function httpAuthorizationToString(e){return e?e.scheme+" "+e.value:undefined}var StorageBrowserPolicy=function(e){__extends(t,e);function t(t,r){return e.call(this,t,r)||this}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(isNode){return[2,this._nextPolicy.sendRequest(e)]}if(e.method.toUpperCase()==="GET"||e.method.toUpperCase()==="HEAD"){e.url=setURLParameter(e.url,URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,(new Date).getTime().toString())}e.headers.remove(HeaderConstants.COOKIE);e.headers.remove(HeaderConstants.CONTENT_LENGTH);return[2,this._nextPolicy.sendRequest(e)]}))}))};return t}(BaseRequestPolicy);var StorageBrowserPolicyFactory=function(){function e(){}e.prototype.create=function(e,t){return new StorageBrowserPolicy(e,t)};return e}();var StorageRetryPolicyType;(function(e){e[e["EXPONENTIAL"]=0]="EXPONENTIAL";e[e["FIXED"]=1]="FIXED"})(StorageRetryPolicyType||(StorageRetryPolicyType={}));var DEFAULT_RETRY_OPTIONS={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:StorageRetryPolicyType.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:undefined};var RETRY_ABORT_ERROR=new AbortError("The operation was aborted.");var StorageRetryPolicy=function(e){__extends(t,e);function t(t,r,a){if(a===void 0){a=DEFAULT_RETRY_OPTIONS}var n=e.call(this,t,r)||this;n.retryOptions={retryPolicyType:a.retryPolicyType?a.retryPolicyType:DEFAULT_RETRY_OPTIONS.retryPolicyType,maxTries:a.maxTries&&a.maxTries>=1?Math.floor(a.maxTries):DEFAULT_RETRY_OPTIONS.maxTries,tryTimeoutInMs:a.tryTimeoutInMs&&a.tryTimeoutInMs>=0?a.tryTimeoutInMs:DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,retryDelayInMs:a.retryDelayInMs&&a.retryDelayInMs>=0?Math.min(a.retryDelayInMs,a.maxRetryDelayInMs?a.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs):DEFAULT_RETRY_OPTIONS.retryDelayInMs,maxRetryDelayInMs:a.maxRetryDelayInMs&&a.maxRetryDelayInMs>=0?a.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,secondaryHost:a.secondaryHost?a.secondaryHost:DEFAULT_RETRY_OPTIONS.secondaryHost};return n}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.attemptSendRequest(e,false,1)]}))}))};t.prototype.attemptSendRequest=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=e.clone();n=t||!this.retryOptions.secondaryHost||!(e.method==="GET"||e.method==="HEAD"||e.method==="OPTIONS")||r%2===1;if(!n){a.url=setURLHost(a.url,this.retryOptions.secondaryHost)}if(this.retryOptions.tryTimeoutInMs){a.url=setURLParameter(a.url,URLConstants.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString())}s.label=1;case 1:s.trys.push([1,3,,4]);logger.info("RetryPolicy: =====> Try=".concat(r," ").concat(n?"Primary":"Secondary"));return[4,this._nextPolicy.sendRequest(a)];case 2:i=s.sent();if(!this.shouldRetry(n,r,i)){return[2,i]}t=t||!n&&i.status===404;return[3,4];case 3:o=s.sent();logger.error("RetryPolicy: Caught error, message: ".concat(o.message,", code: ").concat(o.code));if(!this.shouldRetry(n,r,i,o)){throw o}return[3,4];case 4:return[4,this.delay(n,r,e.abortSignal)];case 5:s.sent();return[2,this.attemptSendRequest(e,t,++r)]}}))}))};t.prototype.shouldRetry=function(e,t,r,a){if(t>=this.retryOptions.maxTries){logger.info("RetryPolicy: Attempt(s) ".concat(t," >= maxTries ").concat(this.retryOptions.maxTries,", no further try."));return false}var n=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(a){for(var i=0,o=n;i<o.length;i++){var s=o[i];if(a.name.toUpperCase().includes(s)||a.message.toUpperCase().includes(s)||a.code&&a.code.toString().toUpperCase()===s){logger.info("RetryPolicy: Network error ".concat(s," found, will retry."));return true}}}if(r||a){var l=r?r.status:a?a.statusCode:0;if(!e&&l===404){logger.info("RetryPolicy: Secondary access with 404, will retry.");return true}if(l===503||l===500){logger.info("RetryPolicy: Will retry for status code ".concat(l,"."));return true}}if((a===null||a===void 0?void 0:a.code)==="PARSE_ERROR"&&(a===null||a===void 0?void 0:a.message.startsWith('Error "Error: Unclosed root tag'))){logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");return true}return false};t.prototype.delay=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(n){a=0;if(e){switch(this.retryOptions.retryPolicyType){case StorageRetryPolicyType.EXPONENTIAL:a=Math.min((Math.pow(2,t-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case StorageRetryPolicyType.FIXED:a=this.retryOptions.retryDelayInMs;break}}else{a=Math.random()*1e3}logger.info("RetryPolicy: Delay for ".concat(a,"ms"));return[2,delay(a,r,RETRY_ABORT_ERROR)]}))}))};return t}(BaseRequestPolicy);var StorageRetryPolicyFactory=function(){function e(e){this.retryOptions=e}e.prototype.create=function(e,t){return new StorageRetryPolicy(e,t,this.retryOptions)};return e}();var CredentialPolicy=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.sendRequest=function(e){return this._nextPolicy.sendRequest(this.signRequest(e))};t.prototype.signRequest=function(e){return e};return t}(BaseRequestPolicy);var AnonymousCredentialPolicy=function(e){__extends(t,e);function t(t,r){return e.call(this,t,r)||this}return t}(CredentialPolicy);var Credential=function(){function e(){}e.prototype.create=function(e,t){throw new Error("Method should be implemented in children classes.")};return e}();var AnonymousCredential=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.create=function(e,t){return new AnonymousCredentialPolicy(e,t)};return t}(Credential);var TelemetryPolicy=function(e){__extends(t,e);function t(t,r,a){var n=e.call(this,t,r)||this;n.telemetry=a;return n}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(isNode){if(!e.headers){e.headers=new HttpHeaders}if(!e.headers.get(HeaderConstants.USER_AGENT)){e.headers.set(HeaderConstants.USER_AGENT,this.telemetry)}}return[2,this._nextPolicy.sendRequest(e)]}))}))};return t}(BaseRequestPolicy);var TelemetryPolicyFactory=function(){function e(e){var t=[];if(isNode){if(e){var r=e.userAgentPrefix||"";if(r.length>0&&t.indexOf(r)===-1){t.push(r)}}var a="azsdk-js-storageblob/".concat(SDK_VERSION);if(t.indexOf(a)===-1){t.push(a)}var n="(NODE-VERSION ".concat(process.version,"; ").concat(undefined()," ").concat(undefined(),")");if(t.indexOf(n)===-1){t.push(n)}}this.telemetryString=t.join(" ")}e.prototype.create=function(e,t){return new TelemetryPolicy(e,t,this.telemetryString)};return e}();var _defaultHttpClient=new XhrHttpClient;function getCachedDefaultHttpClient(){return _defaultHttpClient}function isPipelineLike(e){if(!e||typeof e!=="object"){return false}var t=e;return Array.isArray(t.factories)&&typeof t.options==="object"&&typeof t.toServiceClientOptions==="function"}var Pipeline=function(){function e(e,t){if(t===void 0){t={}}this.factories=e;this.options=Object.assign(Object.assign({},t),{httpClient:t.httpClient||getCachedDefaultHttpClient()})}e.prototype.toServiceClientOptions=function(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}};return e}();function newPipeline(e,t){if(t===void 0){t={}}if(e===undefined){e=new AnonymousCredential}var r=new TelemetryPolicyFactory(t.userAgentOptions);var a=[tracingPolicy({userAgent:r.telemetryString}),keepAlivePolicy(t.keepAliveOptions),r,generateClientRequestIdPolicy(),new StorageBrowserPolicyFactory,new StorageRetryPolicyFactory(t.retryOptions),deserializationPolicy(undefined,{xmlCharKey:"#"}),logPolicy({logger:logger.info,allowedHeaderNames:StorageBlobLoggingAllowedHeaderNames,allowedQueryParameters:StorageBlobLoggingAllowedQueryParameters})];if(isNode){a.push(proxyPolicy());a.push(disableResponseDecompressionPolicy())}a.push(isTokenCredential(e)?attachCredential(bearerTokenAuthenticationPolicy(e,StorageOAuthScopes),e):e);return new Pipeline(a,t)}var StorageSharedKeyCredential=function(){function e(){}return e}();var packageName="azure-storage-blob";var packageVersion="12.8.0";var StorageClientContext=function(e){__extends(t,e);function t(t,r){var a=this;if(t===undefined){throw new Error("'url' cannot be null")}if(!r){r={}}if(!r.userAgent){var n=getDefaultUserAgentValue();r.userAgent="".concat(packageName,"/").concat(packageVersion," ").concat(n)}a=e.call(this,undefined,r)||this;a.requestContentType="application/json; charset=utf-8";a.baseUri=r.endpoint||"{url}";a.url=t;a.version=r.version||"2020-10-02";return a}return t}(ServiceClient);var StorageClient=function(){function e(e,t){this.url=escapeURLPath(e);this.accountName=getAccountNameFromUrl(e);this.pipeline=t;this.storageClientContext=new StorageClientContext(this.url,t.toServiceClientOptions());this.isHttps=iEqual(getURLScheme(this.url)||"","https");this.credential=new AnonymousCredential;for(var r=0,a=this.pipeline.factories;r<a.length;r++){var n=a[r];if(isNode&&n instanceof StorageSharedKeyCredential||n instanceof AnonymousCredential){this.credential=n}else if(isTokenCredential(n.credential)){this.credential=n.credential}}var i=this.storageClientContext;i.requestContentType=undefined}return e}();var createSpan=createSpanFunction({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function convertTracingToRequestOptionsBase(e){var t,r;return{spanOptions:(t=e===null||e===void 0?void 0:e.tracingOptions)===null||t===void 0?void 0:t.spanOptions,tracingContext:(r=e===null||e===void 0?void 0:e.tracingOptions)===null||r===void 0?void 0:r.tracingContext}}var BlobSASPermissions=function(){function e(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false}e.parse=function(t){var r=new e;for(var a=0,n=t;a<n.length;a++){var i=n[a];switch(i){case"r":r.read=true;break;case"a":r.add=true;break;case"c":r.create=true;break;case"w":r.write=true;break;case"d":r.delete=true;break;case"x":r.deleteVersion=true;break;case"t":r.tag=true;break;case"m":r.move=true;break;case"e":r.execute=true;break;case"i":r.setImmutabilityPolicy=true;break;default:throw new RangeError("Invalid permission: ".concat(i))}}return r};e.from=function(t){var r=new e;if(t.read){r.read=true}if(t.add){r.add=true}if(t.create){r.create=true}if(t.write){r.write=true}if(t.delete){r.delete=true}if(t.deleteVersion){r.deleteVersion=true}if(t.tag){r.tag=true}if(t.move){r.move=true}if(t.execute){r.execute=true}if(t.setImmutabilityPolicy){r.setImmutabilityPolicy=true}return r};e.prototype.toString=function(){var e=[];if(this.read){e.push("r")}if(this.add){e.push("a")}if(this.create){e.push("c")}if(this.write){e.push("w")}if(this.delete){e.push("d")}if(this.deleteVersion){e.push("x")}if(this.tag){e.push("t")}if(this.move){e.push("m")}if(this.execute){e.push("e")}if(this.setImmutabilityPolicy){e.push("i")}return e.join("")};return e}();var ContainerSASPermissions=function(){function e(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false}e.parse=function(t){var r=new e;for(var a=0,n=t;a<n.length;a++){var i=n[a];switch(i){case"r":r.read=true;break;case"a":r.add=true;break;case"c":r.create=true;break;case"w":r.write=true;break;case"d":r.delete=true;break;case"l":r.list=true;break;case"t":r.tag=true;break;case"x":r.deleteVersion=true;break;case"m":r.move=true;break;case"e":r.execute=true;break;case"i":r.setImmutabilityPolicy=true;break;default:throw new RangeError("Invalid permission ".concat(i))}}return r};e.from=function(t){var r=new e;if(t.read){r.read=true}if(t.add){r.add=true}if(t.create){r.create=true}if(t.write){r.write=true}if(t.delete){r.delete=true}if(t.list){r.list=true}if(t.deleteVersion){r.deleteVersion=true}if(t.tag){r.tag=true}if(t.move){r.move=true}if(t.execute){r.execute=true}if(t.setImmutabilityPolicy){r.setImmutabilityPolicy=true}return r};e.prototype.toString=function(){var e=[];if(this.read){e.push("r")}if(this.add){e.push("a")}if(this.create){e.push("c")}if(this.write){e.push("w")}if(this.delete){e.push("d")}if(this.deleteVersion){e.push("x")}if(this.list){e.push("l")}if(this.tag){e.push("t")}if(this.move){e.push("m")}if(this.execute){e.push("e")}if(this.setImmutabilityPolicy){e.push("i")}return e.join("")};return e}();var UserDelegationKeyCredential=function(){function e(){}return e}();function ipRangeToString(e){return e.end?"".concat(e.start,"-").concat(e.end):e.start}var SASProtocol;(function(e){e["Https"]="https";e["HttpsAndHttp"]="https,http"})(SASProtocol||(SASProtocol={}));var SASQueryParameters=function(){function e(e,t,r,a,n,i,o,s,l,c,p,d,u,m,f,h,g,y,b){this.version=e;this.signature=t;if(r!==undefined&&typeof r!=="string"){this.permissions=r.permissions;this.services=r.services;this.resourceTypes=r.resourceTypes;this.protocol=r.protocol;this.startsOn=r.startsOn;this.expiresOn=r.expiresOn;this.ipRangeInner=r.ipRange;this.identifier=r.identifier;this.resource=r.resource;this.cacheControl=r.cacheControl;this.contentDisposition=r.contentDisposition;this.contentEncoding=r.contentEncoding;this.contentLanguage=r.contentLanguage;this.contentType=r.contentType;if(r.userDelegationKey){this.signedOid=r.userDelegationKey.signedObjectId;this.signedTenantId=r.userDelegationKey.signedTenantId;this.signedStartsOn=r.userDelegationKey.signedStartsOn;this.signedExpiresOn=r.userDelegationKey.signedExpiresOn;this.signedService=r.userDelegationKey.signedService;this.signedVersion=r.userDelegationKey.signedVersion;this.preauthorizedAgentObjectId=r.preauthorizedAgentObjectId;this.correlationId=r.correlationId}}else{this.services=a;this.resourceTypes=n;this.expiresOn=s;this.permissions=r;this.protocol=i;this.startsOn=o;this.ipRangeInner=l;this.identifier=c;this.resource=p;this.cacheControl=d;this.contentDisposition=u;this.contentEncoding=m;this.contentLanguage=f;this.contentType=h;if(g){this.signedOid=g.signedObjectId;this.signedTenantId=g.signedTenantId;this.signedStartsOn=g.signedStartsOn;this.signedExpiresOn=g.signedExpiresOn;this.signedService=g.signedService;this.signedVersion=g.signedVersion;this.preauthorizedAgentObjectId=y;this.correlationId=b}}}Object.defineProperty(e.prototype,"ipRange",{get:function(){if(this.ipRangeInner){return{end:this.ipRangeInner.end,start:this.ipRangeInner.start}}return undefined},enumerable:false,configurable:true});e.prototype.toString=function(){var e=["sv","ss","srt","spr","st","se","sip","si","skoid","sktid","skt","ske","sks","skv","sr","sp","sig","rscc","rscd","rsce","rscl","rsct","saoid","scid"];var t=[];for(var r=0,a=e;r<a.length;r++){var n=a[r];switch(n){case"sv":this.tryAppendQueryParameter(t,n,this.version);break;case"ss":this.tryAppendQueryParameter(t,n,this.services);break;case"srt":this.tryAppendQueryParameter(t,n,this.resourceTypes);break;case"spr":this.tryAppendQueryParameter(t,n,this.protocol);break;case"st":this.tryAppendQueryParameter(t,n,this.startsOn?truncatedISO8061Date(this.startsOn,false):undefined);break;case"se":this.tryAppendQueryParameter(t,n,this.expiresOn?truncatedISO8061Date(this.expiresOn,false):undefined);break;case"sip":this.tryAppendQueryParameter(t,n,this.ipRange?ipRangeToString(this.ipRange):undefined);break;case"si":this.tryAppendQueryParameter(t,n,this.identifier);break;case"skoid":this.tryAppendQueryParameter(t,n,this.signedOid);break;case"sktid":this.tryAppendQueryParameter(t,n,this.signedTenantId);break;case"skt":this.tryAppendQueryParameter(t,n,this.signedStartsOn?truncatedISO8061Date(this.signedStartsOn,false):undefined);break;case"ske":this.tryAppendQueryParameter(t,n,this.signedExpiresOn?truncatedISO8061Date(this.signedExpiresOn,false):undefined);break;case"sks":this.tryAppendQueryParameter(t,n,this.signedService);break;case"skv":this.tryAppendQueryParameter(t,n,this.signedVersion);break;case"sr":this.tryAppendQueryParameter(t,n,this.resource);break;case"sp":this.tryAppendQueryParameter(t,n,this.permissions);break;case"sig":this.tryAppendQueryParameter(t,n,this.signature);break;case"rscc":this.tryAppendQueryParameter(t,n,this.cacheControl);break;case"rscd":this.tryAppendQueryParameter(t,n,this.contentDisposition);break;case"rsce":this.tryAppendQueryParameter(t,n,this.contentEncoding);break;case"rscl":this.tryAppendQueryParameter(t,n,this.contentLanguage);break;case"rsct":this.tryAppendQueryParameter(t,n,this.contentType);break;case"saoid":this.tryAppendQueryParameter(t,n,this.preauthorizedAgentObjectId);break;case"scid":this.tryAppendQueryParameter(t,n,this.correlationId);break}}return t.join("&")};e.prototype.tryAppendQueryParameter=function(e,t,r){if(!r){return}t=encodeURIComponent(t);r=encodeURIComponent(r);if(t.length>0&&r.length>0){e.push("".concat(t,"=").concat(r))}};return e}();function generateBlobSASQueryParameters(e,t,r){var a=e.version?e.version:SERVICE_VERSION;var n=t instanceof StorageSharedKeyCredential?t:undefined;var i;if(n===undefined&&r!==undefined){i=new UserDelegationKeyCredential(r,t)}if(n===undefined&&i===undefined){throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.")}if(a>="2018-11-09"){if(n!==undefined){return generateBlobSASQueryParameters20181109(e,n)}else{if(a>="2020-02-10"){return generateBlobSASQueryParametersUDK20200210(e,i)}else{return generateBlobSASQueryParametersUDK20181109(e,i)}}}if(a>="2015-04-05"){if(n!==undefined){return generateBlobSASQueryParameters20150405(e,n)}else{throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.")}}throw new RangeError("'version' must be >= '2015-04-05'.")}function generateBlobSASQueryParameters20150405(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.identifier&&!(e.permissions&&e.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}var r="c";if(e.blobName){r="b"}var a;if(e.permissions){if(e.blobName){a=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{a=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var n=[a?a:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n");var i=t.computeHMACSHA256(n);return new SASQueryParameters(e.version,i,a,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType)}function generateBlobSASQueryParameters20181109(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.identifier&&!(e.permissions&&e.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType)}function generateBlobSASQueryParametersUDK20181109(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.permissions||!e.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?truncatedISO8061Date(t.userDelegationKey.signedStartsOn,false):"",t.userDelegationKey.signedExpiresOn?truncatedISO8061Date(t.userDelegationKey.signedExpiresOn,false):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey)}function generateBlobSASQueryParametersUDK20200210(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.permissions||!e.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?truncatedISO8061Date(t.userDelegationKey.signedStartsOn,false):"",t.userDelegationKey.signedExpiresOn?truncatedISO8061Date(t.userDelegationKey.signedExpiresOn,false):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,undefined,e.correlationId,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId)}function getCanonicalName(e,t,r){var a=["/blob/".concat(e,"/").concat(t)];if(r){a.push("/".concat(r))}return a.join("")}function SASSignatureValuesSanityCheckAndAutofill(e){var t=e.version?e.version:SERVICE_VERSION;if(e.snapshotTime&&t<"2018-11-09"){throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.")}if(e.blobName===undefined&&e.snapshotTime){throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.")}if(e.versionId&&t<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.")}if(e.blobName===undefined&&e.versionId){throw RangeError("Must provide 'blobName' when providing 'versionId'.")}if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(e.permissions&&e.permissions.deleteVersion&&t<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.")}if(e.permissions&&e.permissions.tag&&t<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.")}if(t<"2020-02-10"&&e.permissions&&(e.permissions.move||e.permissions.execute)){throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.")}if(t<"2020-02-10"&&(e.preauthorizedAgentObjectId||e.correlationId)){throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.")}e.version=t;return e}var BlobLeaseClient=function(){function e(e,t){var r=new StorageClientContext(e.url,e.pipeline.toServiceClientOptions());this._url=e.url;if(e.name===undefined){this._isContainer=true;this._containerOrBlobOperation=new Container(r)}else{this._isContainer=false;this._containerOrBlobOperation=new Blob$1(r)}if(!t){t=generateUuid()}this._leaseId=t}Object.defineProperty(e.prototype,"leaseId",{get:function(){return this._leaseId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"url",{get:function(){return this._url},enumerable:false,configurable:true});e.prototype.acquireLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d;return __generator(this,(function(u){switch(u.label){case 0:l=createSpan("BlobLeaseClient-acquireLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}u.label=1;case 1:u.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions}),proposedLeaseId:this._leaseId},convertTracingToRequestOptionsBase(p)))];case 2:return[2,u.sent()];case 3:d=u.sent();c.setStatus({code:SpanStatusCode.ERROR,message:d.message});throw d;case 4:c.end();return[7];case 5:return[2]}}))}))};e.prototype.changeLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:l=createSpan("BlobLeaseClient-changeLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}m.label=1;case 1:m.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.changeLease(this._leaseId,e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(p)))];case 2:d=m.sent();this._leaseId=e;return[2,d];case 3:u=m.sent();c.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 4:c.end();return[7];case 5:return[2]}}))}))};e.prototype.releaseLease=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:s=createSpan("BlobLeaseClient-releaseLease",e),l=s.span,c=s.updatedOptions;if(this._isContainer&&(((t=e.conditions)===null||t===void 0?void 0:t.ifMatch)&&((r=e.conditions)===null||r===void 0?void 0:r.ifMatch)!==ETagNone||((a=e.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((n=e.conditions)===null||n===void 0?void 0:n.ifNoneMatch)!==ETagNone||((i=e.conditions)===null||i===void 0?void 0:i.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.releaseLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(o=e.conditions)===null||o===void 0?void 0:o.tagConditions})},convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};e.prototype.renewLease=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:s=createSpan("BlobLeaseClient-renewLease",e),l=s.span,c=s.updatedOptions;if(this._isContainer&&(((t=e.conditions)===null||t===void 0?void 0:t.ifMatch)&&((r=e.conditions)===null||r===void 0?void 0:r.ifMatch)!==ETagNone||((a=e.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((n=e.conditions)===null||n===void 0?void 0:n.ifNoneMatch)!==ETagNone||((i=e.conditions)===null||i===void 0?void 0:i.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.renewLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(o=e.conditions)===null||o===void 0?void 0:o.tagConditions})},convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};e.prototype.breakLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:l=createSpan("BlobLeaseClient-breakLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}m.label=1;case 1:m.trys.push([1,3,4,5]);d=Object.assign({abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(p));return[4,this._containerOrBlobOperation.breakLease(d)];case 2:return[2,m.sent()];case 3:u=m.sent();c.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 4:c.end();return[7];case 5:return[2]}}))}))};return e}();var BlobDownloadResponse=1;var BlobQueryResponse=function(){function e(e,t){if(t===void 0){t={}}this.originalResponse=e}Object.defineProperty(e.prototype,"acceptRanges",{get:function(){return this.originalResponse.acceptRanges},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"cacheControl",{get:function(){return this.originalResponse.cacheControl},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentDisposition",{get:function(){return this.originalResponse.contentDisposition},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentEncoding",{get:function(){return this.originalResponse.contentEncoding},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLanguage",{get:function(){return this.originalResponse.contentLanguage},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobSequenceNumber",{get:function(){return this.originalResponse.blobSequenceNumber},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobType",{get:function(){return this.originalResponse.blobType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this.originalResponse.contentLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentMD5",{get:function(){return this.originalResponse.contentMD5},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentRange",{get:function(){return this.originalResponse.contentRange},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentType",{get:function(){return this.originalResponse.contentType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyCompletedOn",{get:function(){return undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyId",{get:function(){return this.originalResponse.copyId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyProgress",{get:function(){return this.originalResponse.copyProgress},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copySource",{get:function(){return this.originalResponse.copySource},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyStatus",{get:function(){return this.originalResponse.copyStatus},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyStatusDescription",{get:function(){return this.originalResponse.copyStatusDescription},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseDuration",{get:function(){return this.originalResponse.leaseDuration},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseState",{get:function(){return this.originalResponse.leaseState},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseStatus",{get:function(){return this.originalResponse.leaseStatus},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"date",{get:function(){return this.originalResponse.date},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobCommittedBlockCount",{get:function(){return this.originalResponse.blobCommittedBlockCount},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"etag",{get:function(){return this.originalResponse.etag},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"errorCode",{get:function(){return this.originalResponse.errorCode},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isServerEncrypted",{get:function(){return this.originalResponse.isServerEncrypted},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobContentMD5",{get:function(){return this.originalResponse.blobContentMD5},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"lastModified",{get:function(){return this.originalResponse.lastModified},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"metadata",{get:function(){return this.originalResponse.metadata},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"requestId",{get:function(){return this.originalResponse.requestId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"clientRequestId",{get:function(){return this.originalResponse.clientRequestId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"version",{get:function(){return this.originalResponse.version},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"encryptionKeySha256",{get:function(){return this.originalResponse.encryptionKeySha256},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentCrc64",{get:function(){return this.originalResponse.contentCrc64},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobBody",{get:function(){throw Error("Quick query in browser is not supported yet.")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"readableStreamBody",{get:function(){return undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"_response",{get:function(){return this.originalResponse._response},enumerable:false,configurable:true});return e}();var BlockBlobTier;(function(e){e["Hot"]="Hot";e["Cool"]="Cool";e["Archive"]="Archive"})(BlockBlobTier||(BlockBlobTier={}));var PremiumPageBlobTier;(function(e){e["P4"]="P4";e["P6"]="P6";e["P10"]="P10";e["P15"]="P15";e["P20"]="P20";e["P30"]="P30";e["P40"]="P40";e["P50"]="P50";e["P60"]="P60";e["P70"]="P70";e["P80"]="P80"})(PremiumPageBlobTier||(PremiumPageBlobTier={}));function toAccessTier(e){if(e===undefined){return undefined}return e}function ensureCpkIfSpecified(e,t){if(e&&!t){throw new RangeError("Customer-provided encryption key must be used over HTTPS.")}if(e&&!e.encryptionAlgorithm){e.encryptionAlgorithm=EncryptionAlgorithmAES25}}function rangeResponseFromModel(e){var t=(e._response.parsedBody.pageRange||[]).map((function(e){return{offset:e.start,count:e.end-e.start}}));var r=(e._response.parsedBody.clearRange||[]).map((function(e){return{offset:e.start,count:e.end-e.start}}));return Object.assign(Object.assign({},e),{pageRange:t,clearRange:r,_response:Object.assign(Object.assign({},e._response),{parsedBody:{pageRange:t,clearRange:r}})})}var PollerStoppedError=function(e){__extends(t,e);function t(r){var a=e.call(this,r)||this;a.name="PollerStoppedError";Object.setPrototypeOf(a,t.prototype);return a}return t}(Error);var PollerCancelledError=function(e){__extends(t,e);function t(r){var a=e.call(this,r)||this;a.name="PollerCancelledError";Object.setPrototypeOf(a,t.prototype);return a}return t}(Error);var Poller=function(){function e(e){var t=this;this.stopped=true;this.pollProgressCallbacks=[];this.operation=e;this.promise=new Promise((function(e,r){t.resolve=e;t.reject=r}));this.promise.catch((function(){}))}e.prototype.startPolling=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(this.stopped){this.stopped=false}e.label=1;case 1:if(!(!this.isStopped()&&!this.isDone()))return[3,4];return[4,this.poll()];case 2:e.sent();return[4,this.delay()];case 3:e.sent();return[3,1];case 4:return[2]}}))}))};e.prototype.pollOnce=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!!this.isDone())return[3,2];t=this;return[4,this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})];case 1:t.operation=a.sent();if(this.isDone()&&this.resolve){this.resolve(this.operation.state.result)}a.label=2;case 2:return[3,4];case 3:r=a.sent();this.operation.state.error=r;if(this.reject){this.reject(r)}throw r;case 4:return[2]}}))}))};e.prototype.fireProgress=function(e){for(var t=0,r=this.pollProgressCallbacks;t<r.length;t++){var a=r[t];a(e)}};e.prototype.cancelOnce=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this;return[4,this.operation.cancel(e)];case 1:t.operation=r.sent();if(this.reject){this.reject(new PollerCancelledError("Poller cancelled"))}return[2]}}))}))};e.prototype.poll=function(e){var t=this;if(e===void 0){e={}}if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);var r=function(){t.pollOncePromise=undefined};this.pollOncePromise.then(r,r).catch(this.reject)}return this.pollOncePromise};e.prototype.pollUntilDone=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.stopped){this.startPolling().catch(this.reject)}return[2,this.promise]}))}))};e.prototype.onProgress=function(e){var t=this;this.pollProgressCallbacks.push(e);return function(){t.pollProgressCallbacks=t.pollProgressCallbacks.filter((function(t){return t!==e}))}};e.prototype.isDone=function(){var e=this.operation.state;return Boolean(e.isCompleted||e.isCancelled||e.error)};e.prototype.stopPolling=function(){if(!this.stopped){this.stopped=true;if(this.reject){this.reject(new PollerStoppedError("This poller is already stopped"))}}};e.prototype.isStopped=function(){return this.stopped};e.prototype.cancelOperation=function(e){if(e===void 0){e={}}if(!this.stopped){this.stopped=true}if(!this.cancelPromise){this.cancelPromise=this.cancelOnce(e)}else if(e.abortSignal){throw new Error("A cancel request is currently pending")}return this.cancelPromise};e.prototype.getOperationState=function(){return this.operation.state};e.prototype.getResult=function(){var e=this.operation.state;return e.result};e.prototype.toString=function(){return this.operation.toString()};return e}();var BlobBeginCopyFromUrlPoller=function(e){__extends(t,e);function t(t){var r=this;var a=t.blobClient,n=t.copySource,i=t.intervalInMs,o=i===void 0?15e3:i,s=t.onProgress,l=t.resumeFrom,c=t.startCopyFromURLOptions;var p;if(l){p=JSON.parse(l).state}var d=makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({},p),{blobClient:a,copySource:n,startCopyFromURLOptions:c}));r=e.call(this,d)||this;if(typeof s==="function"){r.onProgress(s)}r.intervalInMs=o;return r}t.prototype.delay=function(){return delay$1(this.intervalInMs)};return t}(Poller);var cancel=function e(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:e=this.state;r=e.copyId;if(e.isCompleted){return[2,makeBlobBeginCopyFromURLPollOperation(e)]}if(!r){e.isCancelled=true;return[2,makeBlobBeginCopyFromURLPollOperation(e)]}return[4,e.blobClient.abortCopyFromURL(r,{abortSignal:t.abortSignal})];case 1:a.sent();e.isCancelled=true;return[2,makeBlobBeginCopyFromURLPollOperation(e)]}}))}))};var update=function e(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:e=this.state;r=e.blobClient,a=e.copySource,n=e.startCopyFromURLOptions;if(!!e.isStarted)return[3,2];e.isStarted=true;return[4,r.startCopyFromURL(a,n)];case 1:i=p.sent();e.copyId=i.copyId;if(i.copyStatus==="success"){e.result=i;e.isCompleted=true}return[3,6];case 2:if(!!e.isCompleted)return[3,6];p.label=3;case 3:p.trys.push([3,5,,6]);return[4,e.blobClient.getProperties({abortSignal:t.abortSignal})];case 4:i=p.sent();o=i.copyStatus,s=i.copyProgress;l=e.copyProgress;if(s){e.copyProgress=s}if(o==="pending"&&s!==l&&typeof t.fireProgress==="function"){t.fireProgress(e)}else if(o==="success"){e.result=i;e.isCompleted=true}else if(o==="failed"){e.error=new Error('Blob copy failed with reason: "'.concat(i.copyStatusDescription||"unknown",'"'));e.isCompleted=true}return[3,6];case 5:c=p.sent();e.error=c;e.isCompleted=true;return[3,6];case 6:return[2,makeBlobBeginCopyFromURLPollOperation(e)]}}))}))};var toString=function e(){return JSON.stringify({state:this.state},(function(e,t){if(e==="blobClient"){return undefined}return t}))};function makeBlobBeginCopyFromURLPollOperation(e){return{state:Object.assign({},e),cancel:cancel,toString:toString,update:update}}function rangeToString(e){if(e.offset<0){throw new RangeError("Range.offset cannot be smaller than 0.")}if(e.count&&e.count<=0){throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.")}return e.count?"bytes=".concat(e.offset,"-").concat(e.offset+e.count-1):"bytes=".concat(e.offset,"-")}var R=typeof Reflect==="object"?Reflect:null;var ReflectApply=R&&typeof R.apply==="function"?R.apply:function e(t,r,a){return Function.prototype.apply.call(t,r,a)};var ReflectOwnKeys;if(R&&typeof R.ownKeys==="function"){ReflectOwnKeys=R.ownKeys}else if(Object.getOwnPropertySymbols){ReflectOwnKeys=function e(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}}else{ReflectOwnKeys=function e(t){return Object.getOwnPropertyNames(t)}}function ProcessEmitWarning(e){if(console&&console.warn)console.warn(e)}var NumberIsNaN=Number.isNaN||function e(t){return t!==t};function EventEmitter(){EventEmitter.init.call(this)}var events=EventEmitter;var once_1=once;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;function checkListener(e){if(typeof e!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return defaultMaxListeners},set:function(e){if(typeof e!=="number"||e<0||NumberIsNaN(e)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".")}defaultMaxListeners=e}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};EventEmitter.prototype.setMaxListeners=function e(t){if(typeof t!=="number"||t<0||NumberIsNaN(t)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".")}this._maxListeners=t;return this};function _getMaxListeners(e){if(e._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return e._maxListeners}EventEmitter.prototype.getMaxListeners=function e(){return _getMaxListeners(this)};EventEmitter.prototype.emit=function e(t){var r=[];for(var a=1;a<arguments.length;a++)r.push(arguments[a]);var n=t==="error";var i=this._events;if(i!==undefined)n=n&&i.error===undefined;else if(!n)return false;if(n){var o;if(r.length>0)o=r[0];if(o instanceof Error){throw o}var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));s.context=o;throw s}var l=i[t];if(l===undefined)return false;if(typeof l==="function"){ReflectApply(l,this,r)}else{var c=l.length;var p=arrayClone(l,c);for(var a=0;a<c;++a)ReflectApply(p[a],this,r)}return true};function _addListener(e,t,r,a){var n;var i;var o;checkListener(r);i=e._events;if(i===undefined){i=e._events=Object.create(null);e._eventsCount=0}else{if(i.newListener!==undefined){e.emit("newListener",t,r.listener?r.listener:r);i=e._events}o=i[t]}if(o===undefined){o=i[t]=r;++e._eventsCount}else{if(typeof o==="function"){o=i[t]=a?[r,o]:[o,r]}else if(a){o.unshift(r)}else{o.push(r)}n=_getMaxListeners(e);if(n>0&&o.length>n&&!o.warned){o.warned=true;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");s.name="MaxListenersExceededWarning";s.emitter=e;s.type=t;s.count=o.length;ProcessEmitWarning(s)}}return e}EventEmitter.prototype.addListener=function e(t,r){return _addListener(this,t,r,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function e(t,r){return _addListener(this,t,r,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function _onceWrap(e,t,r){var a={fired:false,wrapFn:undefined,target:e,type:t,listener:r};var n=onceWrapper.bind(a);n.listener=r;a.wrapFn=n;return n}EventEmitter.prototype.once=function e(t,r){checkListener(r);this.on(t,_onceWrap(this,t,r));return this};EventEmitter.prototype.prependOnceListener=function e(t,r){checkListener(r);this.prependListener(t,_onceWrap(this,t,r));return this};EventEmitter.prototype.removeListener=function e(t,r){var a,n,i,o,s;checkListener(r);n=this._events;if(n===undefined)return this;a=n[t];if(a===undefined)return this;if(a===r||a.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[t];if(n.removeListener)this.emit("removeListener",t,a.listener||r)}}else if(typeof a!=="function"){i=-1;for(o=a.length-1;o>=0;o--){if(a[o]===r||a[o].listener===r){s=a[o].listener;i=o;break}}if(i<0)return this;if(i===0)a.shift();else{spliceOne(a,i)}if(a.length===1)n[t]=a[0];if(n.removeListener!==undefined)this.emit("removeListener",t,s||r)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function e(t){var r,a,n;a=this._events;if(a===undefined)return this;if(a.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(a[t]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete a[t]}return this}if(arguments.length===0){var i=Object.keys(a);var o;for(n=0;n<i.length;++n){o=i[n];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}r=a[t];if(typeof r==="function"){this.removeListener(t,r)}else if(r!==undefined){for(n=r.length-1;n>=0;n--){this.removeListener(t,r[n])}}return this};function _listeners(e,t,r){var a=e._events;if(a===undefined)return[];var n=a[t];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?unwrapListeners(n):arrayClone(n,n.length)}EventEmitter.prototype.listeners=function e(t){return _listeners(this,t,true)};EventEmitter.prototype.rawListeners=function e(t){return _listeners(this,t,false)};EventEmitter.listenerCount=function(e,t){if(typeof e.listenerCount==="function"){return e.listenerCount(t)}else{return listenerCount.call(e,t)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(e){var t=this._events;if(t!==undefined){var r=t[e];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}EventEmitter.prototype.eventNames=function e(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(e,t){var r=new Array(t);for(var a=0;a<t;++a)r[a]=e[a];return r}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){var t=new Array(e.length);for(var r=0;r<t.length;++r){t[r]=e[r].listener||e[r]}return t}function once(e,t){return new Promise((function(r,a){function n(r){e.removeListener(t,i);a(r)}function i(){if(typeof e.removeListener==="function"){e.removeListener("error",n)}r([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,i,{once:true});if(t!=="error"){addErrorHandlerIfEventEmitter(e,n,{once:true})}}))}function addErrorHandlerIfEventEmitter(e,t,r){if(typeof e.on==="function"){eventTargetAgnosticAddListener(e,"error",t,r)}}function eventTargetAgnosticAddListener(e,t,r,a){if(typeof e.on==="function"){if(a.once){e.once(t,r)}else{e.on(t,r)}}else if(typeof e.addEventListener==="function"){e.addEventListener(t,(function n(i){if(a.once){e.removeEventListener(t,n)}r(i)}))}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}}events.once=once_1;var BatchStates;(function(e){e[e["Good"]=0]="Good";e[e["Error"]=1]="Error"})(BatchStates||(BatchStates={}));var Batch=function(){function e(e){if(e===void 0){e=5}this.actives=0;this.completed=0;this.offset=0;this.operations=[];this.state=BatchStates.Good;if(e<1){throw new RangeError("concurrency must be larger than 0")}this.concurrency=e;this.emitter=new events.EventEmitter}e.prototype.addOperation=function(e){var t=this;this.operations.push((function(){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);this.actives++;return[4,e()];case 1:r.sent();this.actives--;this.completed++;this.parallelExecute();return[3,3];case 2:t=r.sent();this.emitter.emit("error",t);return[3,3];case 3:return[2]}}))}))}))};e.prototype.do=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.operations.length===0){return[2,Promise.resolve()]}this.parallelExecute();return[2,new Promise((function(t,r){e.emitter.on("finish",t);e.emitter.on("error",(function(t){e.state=BatchStates.Error;r(t)}))}))]}))}))};e.prototype.nextOperation=function(){if(this.offset<this.operations.length){return this.operations[this.offset++]}return null};e.prototype.parallelExecute=function(){if(this.state===BatchStates.Error){return}if(this.completed>=this.operations.length){this.emitter.emit("finish");return}while(this.actives<this.concurrency){var e=this.nextOperation();if(e){e()}else{return}}};return e}();var BufferScheduler=function(){function e(){}return e}();function streamToBuffer(){}function readStreamToLocalFile(){}var fsStat=function e(){};var fsCreateReadStream=function e(){};var BlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i;var o=this;n=n||{};var s;var l;if(isPipelineLike(r)){l=t;s=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){l=t;n=a;s=newPipeline(r,n)}else if(!r&&typeof r!=="string"){l=t;s=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var c=r;var p=a;var d=extractConnectionStringParts(t);if(d.kind==="AccountConnString"){if(isNode){var u=new StorageSharedKeyCredential(d.accountName,d.accountKey);l=appendToURLPath(appendToURLPath(d.url,encodeURIComponent(c)),encodeURIComponent(p));n.proxyOptions=getDefaultProxySettings();s=newPipeline(u,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(d.kind==="SASConnString"){l=appendToURLPath(appendToURLPath(d.url,encodeURIComponent(c)),encodeURIComponent(p))+"?"+d.accountSas;s=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}o=e.call(this,l,s)||this;i=o.getBlobAndContainerNamesFromUrl(),o._name=i.blobName,o._containerName=i.containerName;o.blobContext=new Blob$1(o.storageClientContext);o._snapshot=getURLParameter(o.url,URLConstants.Parameters.SNAPSHOT);o._versionId=getURLParameter(o.url,URLConstants.Parameters.VERSIONID);return o}Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"containerName",{get:function(){return this._containerName},enumerable:false,configurable:true});t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.withVersion=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.VERSIONID,e.length===0?undefined:e),this.pipeline)};t.prototype.getAppendBlobClient=function(){return new AppendBlobClient(this.url,this.pipeline)};t.prototype.getBlockBlobClient=function(){return new BlockBlobClient(this.url,this.pipeline)};t.prototype.getPageBlobClient=function(){return new PageBlobClient(this.url,this.pipeline)};t.prototype.download=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c;var p=this;return __generator(this,(function(d){switch(d.label){case 0:r.conditions=r.conditions||{};r.conditions=r.conditions||{};ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);n=createSpan("BlobClient-download",r),i=n.span,o=n.updatedOptions;d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this.blobContext.download(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onDownloadProgress:isNode?undefined:r.onProgress},range:e===0&&!t?undefined:rangeToString({offset:e,count:t}),rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey},convertTracingToRequestOptionsBase(o)))];case 2:s=d.sent();l=Object.assign(Object.assign({},s),{_response:s._response,objectReplicationDestinationPolicyId:s.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(s.objectReplicationRules)});if(!isNode){return[2,l]}if(r.maxRetryRequests===undefined||r.maxRetryRequests<0){r.maxRetryRequests=DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS}if(s.contentLength===undefined){throw new RangeError("File download response doesn't contain valid content length header")}if(!s.etag){throw new RangeError("File download response doesn't contain valid etag header")}return[2,new BlobDownloadResponse(l,(function(t){return __awaiter(p,void 0,void 0,(function(){var a,n;return __generator(this,(function(i){switch(i.label){case 0:n={leaseAccessConditions:r.conditions,modifiedAccessConditions:{ifMatch:r.conditions.ifMatch||s.etag,ifModifiedSince:r.conditions.ifModifiedSince,ifNoneMatch:r.conditions.ifNoneMatch,ifUnmodifiedSince:r.conditions.ifUnmodifiedSince,ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions},range:rangeToString({count:e+s.contentLength-t,offset:t}),rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey};return[4,this.blobContext.download(Object.assign({abortSignal:r.abortSignal},n))];case 1:return[2,i.sent().readableStreamBody]}}))}))}),e,s.contentLength,{maxRetryRequests:r.maxRetryRequests,onProgress:r.onProgress})];case 3:c=d.sent();i.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.exists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-exists",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:a.tracingOptions})];case 2:i.sent();return[2,true];case 3:n=i.sent();if(n.statusCode===404){r.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when checking blob existence"});return[2,false]}r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.getProperties=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:r=createSpan("BlobClient-getProperties",e),a=r.span,n=r.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);e.conditions=e.conditions||{};ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.blobContext.getProperties(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey},convertTracingToRequestOptionsBase(n)))];case 2:i=s.sent();return[2,Object.assign(Object.assign({},i),{_response:i._response,objectReplicationDestinationPolicyId:i.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(i.objectReplicationRules)})];case 3:o=s.sent();a.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.delete=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-delete",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.delete(Object.assign({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.deleteIfExists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:a=createSpan("BlobClient-deleteIfExists",e),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.delete(i)];case 2:o=l.sent();return[2,Object.assign(Object.assign({succeeded:true},o),{_response:o._response})];case 3:s=l.sent();if(((t=s.details)===null||t===void 0?void 0:t.errorCode)==="BlobNotFound"){n.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when deleting a blob or snapshot only if it exists."});return[2,Object.assign(Object.assign({succeeded:false},(r=s.response)===null||r===void 0?void 0:r.parsedHeaders),{_response:s.response})]}n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.undelete=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-undelete",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);return[4,this.blobContext.undelete(Object.assign({abortSignal:e.abortSignal},convertTracingToRequestOptionsBase(a)))];case 2:return[2,i.sent()];case 3:n=i.sent();r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.setHTTPHeaders=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setHTTPHeaders",t),n=a.span,i=a.updatedOptions;t.conditions=t.conditions||{};s.label=1;case 1:s.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blobContext.setHttpHeaders(Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.setMetadata=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setMetadata",t),n=a.span,i=a.updatedOptions;t.conditions=t.conditions||{};s.label=1;case 1:s.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blobContext.setMetadata(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.setTags=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setTags",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.blobContext.setTags(Object.assign(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)),{tags:toBlobTags(e)}))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.getTags=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r=createSpan("BlobClient-getTags",e),a=r.span,n=r.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.blobContext.getTags(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:i=l.sent();o=Object.assign(Object.assign({},i),{_response:i._response,tags:toTags({blobTagSet:i.blobTagSet})||{}});return[2,o];case 3:s=l.sent();a.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.getBlobLeaseClient=function(e){return new BlobLeaseClient(this,e)};t.prototype.createSnapshot=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-createSnapshot",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.blobContext.createSnapshot(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.beginCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a;var n=this;return __generator(this,(function(i){switch(i.label){case 0:r={abortCopyFromURL:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.abortCopyFromURL.apply(n,e)},getProperties:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.getProperties.apply(n,e)},startCopyFromURL:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.startCopyFromURL.apply(n,e)}};a=new BlobBeginCopyFromUrlPoller({blobClient:r,copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return[4,a.poll()];case 1:i.sent();return[2,a]}}))}))};t.prototype.abortCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-abortCopyFromURL",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.abortCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.syncCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlobClient-syncCopyFromURL",t),o=i.span,s=i.updatedOptions;t.conditions=t.conditions||{};t.sourceConditions=t.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.blobContext.copyFromURL(e,Object.assign({abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:httpAuthorizationToString(t.sourceAuthorization),blobTagsString:toBlobTagsString(t.tags),immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.setAccessTier=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setAccessTier",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.blobContext.setTier(toAccessTier(e),Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),rehydratePriority:t.rehydratePriority},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.downloadToBuffer=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l,c,p,d,u,m,f,h,g;var y=this;return __generator(this,(function(b){switch(b.label){case 0:i=0;o=0;s=a;if(e instanceof Buffer){n=e;i=t||0;o=typeof r==="number"?r:0}else{i=typeof e==="number"?e:0;o=typeof t==="number"?t:0;s=r||{}}l=createSpan("BlobClient-downloadToBuffer",s),c=l.span,p=l.updatedOptions;b.label=1;case 1:b.trys.push([1,5,6,7]);if(!s.blockSize){s.blockSize=0}if(s.blockSize<0){throw new RangeError("blockSize option must be >= 0")}if(s.blockSize===0){s.blockSize=DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES}if(i<0){throw new RangeError("offset option must be >= 0")}if(o&&o<=0){throw new RangeError("count option must be greater than 0")}if(!s.conditions){s.conditions={}}if(!!o)return[3,3];return[4,this.getProperties(Object.assign(Object.assign({},s),{tracingOptions:Object.assign(Object.assign({},s.tracingOptions),convertTracingToRequestOptionsBase(p))}))];case 2:d=b.sent();o=d.contentLength-i;if(o<0){throw new RangeError("offset ".concat(i," shouldn't be larger than blob size ").concat(d.contentLength))}b.label=3;case 3:if(!n){try{n=Buffer.alloc(o)}catch(e){throw new Error("Unable to allocate the buffer of size: ".concat(o,'(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ').concat(e.message))}}if(n.length<o){throw new RangeError("The buffer's size should be equal to or larger than the request count of bytes: ".concat(o))}u=0;m=new Batch(s.concurrency);f=function(e){m.addOperation((function(){return __awaiter(y,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=i+o;if(e+s.blockSize<t){t=e+s.blockSize}return[4,this.download(e,t-e,{abortSignal:s.abortSignal,conditions:s.conditions,maxRetryRequests:s.maxRetryRequestsPerBlock,customerProvidedKey:s.customerProvidedKey,tracingOptions:Object.assign(Object.assign({},s.tracingOptions),convertTracingToRequestOptionsBase(p))})];case 1:r.sent();return[4,streamToBuffer()];case 2:r.sent();u+=t-e;if(s.onProgress){s.onProgress({loadedBytes:u})}return[2]}}))}))}))};for(h=i;h<i+o;h=h+s.blockSize){f(h)}return[4,m.do()];case 4:b.sent();return[2,n];case 5:g=b.sent();c.setStatus({code:SpanStatusCode.ERROR,message:g.message});throw g;case 6:c.end();return[7];case 7:return[2]}}))}))};t.prototype.downloadToFile=function(e,t,r,a){if(t===void 0){t=0}if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:e=createSpan("BlobClient-downloadToFile",a),n=e.span,i=e.updatedOptions;l.label=1;case 1:l.trys.push([1,5,6,7]);return[4,this.download(t,r,Object.assign(Object.assign({},a),{tracingOptions:Object.assign(Object.assign({},a.tracingOptions),convertTracingToRequestOptionsBase(i))}))];case 2:o=l.sent();if(!o.readableStreamBody)return[3,4];return[4,readStreamToLocalFile()];case 3:l.sent();l.label=4;case 4:o.blobDownloadStream=undefined;return[2,o];case 5:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 6:n.end();return[7];case 7:return[2]}}))}))};t.prototype.getBlobAndContainerNamesFromUrl=function(){var e;var t;try{var r=URLBuilder.parse(this.url);if(r.getHost().split(".")[1]==="blob"){var a=r.getPath().match("/([^/]*)(/(.*))?");e=a[1];t=a[3]}else if(isIpEndpointStyle(r)){var a=r.getPath().match("/([^/]*)/([^/]*)(/(.*))?");e=a[2];t=a[4]}else{var a=r.getPath().match("/([^/]*)(/(.*))?");e=a[1];t=a[3]}e=decodeURIComponent(e);t=decodeURIComponent(t);t=t.replace(/\\/g,"/");if(!e){throw new Error("Provided containerName is invalid.")}return{blobName:t,containerName:e}}catch(e){throw new Error("Unable to extract blobName and containerName with provided information.")}};t.prototype.startCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlobClient-startCopyFromURL",t),o=i.span,s=i.updatedOptions;t.conditions=t.conditions||{};t.sourceConditions=t.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.blobContext.startCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags),sealBlob:t.sealBlob},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.generateSasUrl=function(e){var t=this;return new Promise((function(r){if(!(t.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}var a=generateBlobSASQueryParameters(Object.assign({containerName:t._containerName,blobName:t._name,snapshotTime:t._snapshot,versionId:t._versionId},e),t.credential).toString();r(appendToURLQuery(t.url,a))}))};t.prototype.deleteImmutabilityPolicy=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-deleteImmutabilityPolicy",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);return[4,this.blobContext.deleteImmutabilityPolicy(Object.assign({abortSignal:e===null||e===void 0?void 0:e.abortSignal},convertTracingToRequestOptionsBase(a)))];case 2:return[2,i.sent()];case 3:n=i.sent();r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.setImmutabilityPolicy=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-setImmutabilityPolicy",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.setImmutabilityPolicy(Object.assign({abortSignal:t===null||t===void 0?void 0:t.abortSignal,immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,modifiedAccessConditions:t===null||t===void 0?void 0:t.modifiedAccessCondition},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.setLegalHold=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-setLegalHold",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.setLegalHold(e,Object.assign({abortSignal:t===null||t===void 0?void 0:t.abortSignal},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};return t}(StorageClient);var AppendBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.appendBlobContext=new AppendBlob(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.create=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("AppendBlobClient-create",e),i=n.span,o=n.updatedOptions;e.conditions=e.conditions||{};l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.create(0,Object.assign({abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:(r=e.immutabilityPolicy)===null||r===void 0?void 0:r.expiriesOn,immutabilityPolicyMode:(a=e.immutabilityPolicy)===null||a===void 0?void 0:a.policyMode,legalHold:e.legalHold,blobTagsString:toBlobTagsString(e.tags)},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.createIfNotExists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a=createSpan("AppendBlobClient-createIfNotExists",e),n=a.span,i=a.updatedOptions;o={ifNoneMatch:ETagAny};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.create(Object.assign(Object.assign({},i),{conditions:o}))];case 2:s=c.sent();return[2,Object.assign(Object.assign({succeeded:true},s),{_response:s._response})];case 3:l=c.sent();if(((t=l.details)===null||t===void 0?void 0:t.errorCode)==="BlobAlreadyExists"){n.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return[2,Object.assign(Object.assign({succeeded:false},(r=l.response)===null||r===void 0?void 0:r.parsedHeaders),{_response:l.response})]}n.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.seal=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("AppendBlobClient-seal",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.appendBlobContext.seal(Object.assign({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.appendBlock=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("AppendBlobClient-appendBlock",r),i=n.span,o=n.updatedOptions;r.conditions=r.conditions||{};l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.appendBlock(t,e,Object.assign({abortSignal:r.abortSignal,appendPositionAccessConditions:r.conditions,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.appendBlockFromURL=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("AppendBlobClient-appendBlockFromURL",a),o=i.span,s=i.updatedOptions;a.conditions=a.conditions||{};a.sourceConditions=a.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.appendBlockFromUrl(e,0,Object.assign({abortSignal:a.abortSignal,sourceRange:rangeToString({offset:t,count:r}),sourceContentMD5:a.sourceContentMD5,sourceContentCrc64:a.sourceContentCrc64,leaseAccessConditions:a.conditions,appendPositionAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:a.sourceConditions.ifMatch,sourceIfModifiedSince:a.sourceConditions.ifModifiedSince,sourceIfNoneMatch:a.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:a.sourceConditions.ifUnmodifiedSince},copySourceAuthorization:httpAuthorizationToString(a.sourceAuthorization),cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};return t}(BlobClient);var BlockBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.blockBlobContext=new BlockBlob(i.storageClientContext);i._blobContext=new Blob$1(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.query=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);a=createSpan("BlockBlobClient-query",t),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);if(!isNode){throw new Error("This operation currently is only supported in Node.js.")}return[4,this._blobContext.query(Object.assign({abortSignal:t.abortSignal,queryRequest:{queryType:"SQL",expression:e,inputSerialization:toQuerySerialization(t.inputTextConfiguration),outputSerialization:toQuerySerialization(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:o=l.sent();return[2,new BlobQueryResponse(o,{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError})];case 3:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.upload=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:r.conditions=r.conditions||{};o=createSpan("BlockBlobClient-upload",r),s=o.span,l=o.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.upload(t,e,Object.assign({abortSignal:r.abortSignal,blobHttpHeaders:r.blobHTTPHeaders,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,immutabilityPolicyExpiry:(n=r.immutabilityPolicy)===null||n===void 0?void 0:n.expiriesOn,immutabilityPolicyMode:(i=r.immutabilityPolicy)===null||i===void 0?void 0:i.policyMode,legalHold:r.legalHold,tier:toAccessTier(r.tier),blobTagsString:toBlobTagsString(r.tags)},convertTracingToRequestOptionsBase(l)))];case 2:return[2,p.sent()];case 3:c=p.sent();s.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:s.end();return[7];case 5:return[2]}}))}))};t.prototype.syncUploadFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:t.conditions=t.conditions||{};s=createSpan("BlockBlobClient-syncUploadFromURL",t),l=s.span,c=s.updatedOptions;d.label=1;case 1:d.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.putBlobFromUrl(0,e,Object.assign(Object.assign(Object.assign({},t),{blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:t.conditions.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:(r=t.sourceConditions)===null||r===void 0?void 0:r.ifMatch,sourceIfModifiedSince:(a=t.sourceConditions)===null||a===void 0?void 0:a.ifModifiedSince,sourceIfNoneMatch:(n=t.sourceConditions)===null||n===void 0?void 0:n.ifNoneMatch,sourceIfUnmodifiedSince:(i=t.sourceConditions)===null||i===void 0?void 0:i.ifUnmodifiedSince,sourceIfTags:(o=t.sourceConditions)===null||o===void 0?void 0:o.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:httpAuthorizationToString(t.sourceAuthorization),tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)}),convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};t.prototype.stageBlock=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("BlockBlobClient-stageBlock",a),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.stageBlock(e,r,t,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,requestOptions:{onUploadProgress:a.onProgress},transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.stageBlockFromURL=function(e,t,r,a,n){if(r===void 0){r=0}if(n===void 0){n={}}return __awaiter(this,void 0,void 0,(function(){var i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlockBlobClient-stageBlockFromURL",n),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(n.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.stageBlockFromURL(e,0,t,Object.assign({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,sourceContentMD5:n.sourceContentMD5,sourceContentCrc64:n.sourceContentCrc64,sourceRange:r===0&&!a?undefined:rangeToString({offset:r,count:a}),cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,copySourceAuthorization:httpAuthorizationToString(n.sourceAuthorization)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.commitBlockList=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t.conditions=t.conditions||{};i=createSpan("BlockBlobClient-commitBlockList",t),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.commitBlockList({latest:e},Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.getBlockList=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:a=createSpan("BlockBlobClient-getBlockList",t),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.blockBlobContext.getBlockList(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:o=l.sent();if(!o.committedBlocks){o.committedBlocks=[]}if(!o.uncommittedBlocks){o.uncommittedBlocks=[]}return[2,o];case 3:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadData=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){r=createSpan("BlockBlobClient-uploadData",t),a=r.span,n=r.updatedOptions;try{if(isNode){if(e instanceof Buffer){i=e}else if(e instanceof ArrayBuffer){i=Buffer.from(e)}else{e=e;i=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}return[2,this.uploadSeekableInternal((function(e,t){return i.slice(e,e+t)}),i.byteLength,n)]}else{o=new Blob([e]);return[2,this.uploadSeekableInternal((function(e,t){return o.slice(e,e+t)}),o.size,n)]}}catch(e){a.setStatus({code:SpanStatusCode.ERROR,message:e.message});throw e}finally{a.end()}return[2]}))}))};t.prototype.uploadBrowserData=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:r=createSpan("BlockBlobClient-uploadBrowserData",t),a=r.span,n=r.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);i=new Blob([e]);return[4,this.uploadSeekableInternal((function(e,t){return i.slice(e,e+t)}),i.size,n)];case 2:return[2,s.sent()];case 3:o=s.sent();a.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadSeekableInternal=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c,p,d,u,m;var f=this;return __generator(this,(function(h){switch(h.label){case 0:if(!r.blockSize){r.blockSize=0}if(r.blockSize<0||r.blockSize>BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES){throw new RangeError("blockSize option must be >= 0 and <= ".concat(BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES))}if(r.maxSingleShotSize!==0&&!r.maxSingleShotSize){r.maxSingleShotSize=BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}if(r.maxSingleShotSize<0||r.maxSingleShotSize>BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES){throw new RangeError("maxSingleShotSize option must be >= 0 and <= ".concat(BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES))}if(r.blockSize===0){if(t>BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES*BLOCK_BLOB_MAX_BLOCKS){throw new RangeError("".concat(t," is too larger to upload to a block blob."))}if(t>r.maxSingleShotSize){r.blockSize=Math.ceil(t/BLOCK_BLOB_MAX_BLOCKS);if(r.blockSize<DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES){r.blockSize=DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES}}}if(!r.blobHTTPHeaders){r.blobHTTPHeaders={}}if(!r.conditions){r.conditions={}}a=createSpan("BlockBlobClient-uploadSeekableInternal",r),n=a.span,i=a.updatedOptions;h.label=1;case 1:h.trys.push([1,5,6,7]);if(!(t<=r.maxSingleShotSize))return[3,3];return[4,this.upload(e(0,t),t,i)];case 2:return[2,h.sent()];case 3:o=Math.floor((t-1)/r.blockSize)+1;if(o>BLOCK_BLOB_MAX_BLOCKS){throw new RangeError("The buffer's size is too big or the BlockSize is too small;"+"the number of blocks must be <= ".concat(BLOCK_BLOB_MAX_BLOCKS))}s=[];l=generateUuid();c=0;p=new Batch(r.concurrency);d=function(a){p.addOperation((function(){return __awaiter(f,void 0,void 0,(function(){var n,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:n=generateBlockID(l,a);p=r.blockSize*a;d=a===o-1?t:p+r.blockSize;u=d-p;s.push(n);return[4,this.stageBlock(n,e(p,u),u,{abortSignal:r.abortSignal,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})];case 1:m.sent();c+=u;if(r.onProgress){r.onProgress({loadedBytes:c})}return[2]}}))}))}))};for(u=0;u<o;u++){d(u)}return[4,p.do()];case 4:h.sent();return[2,this.commitBlockList(s,i)];case 5:m=h.sent();n.setStatus({code:SpanStatusCode.ERROR,message:m.message});throw m;case 6:n.end();return[7];case 7:return[2]}}))}))};t.prototype.uploadFile=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:e=createSpan("BlockBlobClient-uploadFile",t),r=e.span,a=e.updatedOptions;o.label=1;case 1:o.trys.push([1,4,5,6]);return[4,fsStat()];case 2:n=o.sent().size;return[4,this.uploadSeekableInternal((function(e,t){return function(){return fsCreateReadStream()}}),n,Object.assign(Object.assign({},t),{tracingOptions:Object.assign(Object.assign({},t.tracingOptions),convertTracingToRequestOptionsBase(a))}))];case 3:return[2,o.sent()];case 4:i=o.sent();r.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 5:r.end();return[7];case 6:return[2]}}))}))};t.prototype.uploadStream=function(e,t,r,a){if(t===void 0){t=DEFAULT_BLOCK_BUFFER_SIZE_BYTES}if(r===void 0){r=5}if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l,c,p,d,u;var m=this;return __generator(this,(function(f){switch(f.label){case 0:if(!a.blobHTTPHeaders){a.blobHTTPHeaders={}}if(!a.conditions){a.conditions={}}n=createSpan("BlockBlobClient-uploadStream",a),i=n.span,o=n.updatedOptions;f.label=1;case 1:f.trys.push([1,4,5,6]);s=0;l=generateUuid();c=0;p=[];d=new BufferScheduler(e,t,r,(function(e,t){return __awaiter(m,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:r=generateBlockID(l,s);p.push(r);s++;return[4,this.stageBlock(r,e,t,{conditions:a.conditions,encryptionScope:a.encryptionScope,tracingOptions:o.tracingOptions})];case 1:n.sent();c+=t;if(a.onProgress){a.onProgress({loadedBytes:c})}return[2]}}))}))}),Math.ceil(r/4*3));return[4,d.do()];case 2:f.sent();return[4,this.commitBlockList(p,Object.assign(Object.assign({},a),{tracingOptions:Object.assign(Object.assign({},a.tracingOptions),convertTracingToRequestOptionsBase(o))}))];case 3:return[2,f.sent()];case 4:u=f.sent();i.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 5:i.end();return[7];case 6:return[2]}}))}))};return t}(BlobClient);var PageBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.pageBlobContext=new PageBlob(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.create=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t.conditions=t.conditions||{};i=createSpan("PageBlobClient-create",t),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.create(0,e,Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.createIfNotExists=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:n=createSpan("PageBlobClient-createIfNotExists",t),i=n.span,o=n.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);s={ifNoneMatch:ETagAny};return[4,this.create(e,Object.assign(Object.assign({},t),{conditions:s,tracingOptions:o.tracingOptions}))];case 2:l=p.sent();return[2,Object.assign(Object.assign({succeeded:true},l),{_response:l._response})];case 3:c=p.sent();if(((r=c.details)===null||r===void 0?void 0:r.errorCode)==="BlobAlreadyExists"){i.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return[2,Object.assign(Object.assign({succeeded:false},(a=c.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:c.response})]}i.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadPages=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-uploadPages",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.uploadPages(r,e,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),requestOptions:{onUploadProgress:a.onProgress},range:rangeToString({offset:t,count:r}),sequenceNumberAccessConditions:a.conditions,transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadPagesFromURL=function(e,t,r,a,n){if(n===void 0){n={}}return __awaiter(this,void 0,void 0,(function(){var i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:n.conditions=n.conditions||{};n.sourceConditions=n.sourceConditions||{};o=createSpan("PageBlobClient-uploadPagesFromURL",n),s=o.span,l=o.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);ensureCpkIfSpecified(n.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.uploadPagesFromURL(e,rangeToString({offset:t,count:a}),0,rangeToString({offset:r,count:a}),Object.assign({abortSignal:n.abortSignal,sourceContentMD5:n.sourceContentMD5,sourceContentCrc64:n.sourceContentCrc64,leaseAccessConditions:n.conditions,sequenceNumberAccessConditions:n.conditions,modifiedAccessConditions:Object.assign(Object.assign({},n.conditions),{ifTags:(i=n.conditions)===null||i===void 0?void 0:i.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:n.sourceConditions.ifMatch,sourceIfModifiedSince:n.sourceConditions.ifModifiedSince,sourceIfNoneMatch:n.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:n.sourceConditions.ifUnmodifiedSince},cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,copySourceAuthorization:httpAuthorizationToString(n.sourceAuthorization)},convertTracingToRequestOptionsBase(l)))];case 2:return[2,p.sent()];case 3:c=p.sent();s.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:s.end();return[7];case 5:return[2]}}))}))};t.prototype.clearPages=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-clearPages",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.clearPages(0,Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:e,count:t}),sequenceNumberAccessConditions:r.conditions,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRanges=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-getPageRanges",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRanges(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(o))).then(rangeResponseFromModel)];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRangesDiff=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-getPageRangesDiff",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),prevsnapshot:r,range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(s))).then(rangeResponseFromModel)];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRangesDiffForManagedDisks=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),prevSnapshotUrl:r,range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(s))).then(rangeResponseFromModel)];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.resize=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:t.conditions=t.conditions||{};a=createSpan("PageBlobClient-resize",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.pageBlobContext.resize(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),encryptionScope:t.encryptionScope},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.updateSequenceNumber=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-updateSequenceNumber",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.updateSequenceNumber(e,Object.assign({abortSignal:r.abortSignal,blobSequenceNumber:t,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.startCopyIncremental=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("PageBlobClient-startCopyIncremental",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.pageBlobContext.copyIncremental(e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};return t}(BlobClient);var EzpPrintService=function(){function e(e,t){var r=this;this.getPrintStatus=function(){return fetch("https://".concat(r.printingApi,"/sfapi/Status/?id=").concat(encodeURIComponent(printStore.state.jobID)),{headers:{Authorization:"Bearer "+authStore.state.accessToken}}).then((function(e){return e.json()}))};this.redirectURI=e;this.clientID=t;this.printingApi=printStore.state.printApiHostUrl;this.checkStoredRefreshToken()}e.prototype.checkStoredRefreshToken=function(){if(authStore.state.refreshToken!==""){return}if(localStorage.getItem("refreshToken")===null){authStore.state.refreshToken=""}else{authStore.state.refreshToken=localStorage.getItem("refreshToken")}};e.prototype.registerFetchInterceptor=function(){var e=this;browser.register({request:function(e,t){return[e,t]},requestError:function(e){return Promise.reject(e)},response:function(t){if(t.status===401){if(authStore.state.refreshToken===""){return t}var r=new EzpAuthorizationService(e.redirectURI,e.clientID);r.refreshTokens()}return t},responseError:function(e){return Promise.reject(e)}})};e.prototype.getPrinterList=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinter/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getConfig=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetch("https://".concat(this.printingApi,"/sfapi/GetConfiguration/"),{method:"GET",headers:{Authorization:"Bearer "+e}})]}))}))};e.prototype.getPrinterProperties=function(e,t){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinterProperties/?id=").concat(t),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getAllPrinterProperties=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinterProperties/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.printFileByUrl=function(e,t,r,a,n,i,o){return fetch("https://".concat(this.printingApi,"/sfapi/Print/"),{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileurl:t,type:r,printerid:a},i&&{alias:i}),o&&{printanddelete:o}),{properties:n}))})};e.prototype.printByFileID=function(e,t,r,a,n,i,o){return fetch("https://".concat(this.printingApi,"/sfapi/Print/"),{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileid:t,type:r,printerid:a},i&&{alias:i}),o&&{printanddelete:o}),{properties:n}))}).then((function(e){return e.json()}))};e.prototype.prepareFileUpload=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/PrepareUpload/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.uploadFile=function(e,t){return fetch("".concat(e),{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type:":"multipart/form-data"},body:t}).then((function(e){return e.json()}))};e.prototype.uploadBlobFiles=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){switch(i.label){case 0:printStore.state.uploadProgress=0;r=newPipeline(new AnonymousCredential,{retryOptions:{maxTries:4},userAgentOptions:{userAgentPrefix:"AdvancedSample V1.0.0"},keepAliveOptions:{enable:false}});a=new BlockBlobClient(e,r);return[4,a.uploadData(t,{blockSize:4*1024*1024,concurrency:20,onProgress:function(e){var r=100*e.loadedBytes/t.size;printStore.state.uploadProgress=r},blobHTTPHeaders:{blobContentType:"application/octet-stream"}})];case 1:n=i.sent();return[2,n]}}))}))};return e}();var printStore=createStore({printers:[],jobID:"",printFinished:false,printApiHostUrl:"",printerProperties:{},fileID:"",fileUrl:"",fileType:"",printerID:"",fileName:"",uploadProgress:0,supportedFileExtensions:""});var EzpUserService=function(){function e(){}e.prototype.getUserInfo=function(){return fetch("https://".concat(authStore.state.authApiHostUrl,"/v1/users/me"),{headers:{Authorization:"Bearer "+authStore.state.accessToken,"Content-Type":"application/json"},method:"GET"}).then((function(e){return e.json()}))};return e}();var userStore=createStore({user:null,theme:"",appearance:""});var ezpPrinterSelectionCss=':host{-ms-flex-line-pack:var(--ezp-printerSelection-alignContent, center);align-content:var(--ezp-printerSelection-alignContent, center);background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));display:grid;grid-template:auto/var(--ezp-printerSelection-width, 320px);height:var(--ezp-printerSelection-height, 100vh);-ms-flex-pack:var(--ezp-printerSelection-justifyContent, center);justify-content:var(--ezp-printerSelection-justifyContent, center);left:0;position:var(--ezp-printerSelection-position, fixed);top:0;width:100%;z-index:1}:host(.seamless){--ezp-printerSelection-alignContent:stretch;--ezp-printerSelection-background:transparent;--ezp-printerSelection-body-background:transparent;--ezp-printerSelection-body-padding:0;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-borderRadius:0;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-footer-boxShadowPosition:0 0 0 0;--ezp-printerSelection-footer-padding:var(--ezp-spacing-2) 0;--ezp-printerSelection-header-boxShadowPosition:0 0 0 0;--ezp-printerSelection-header-padding:var(--ezp-spacing-4) 0;--ezp-printerSelection-justifyContent:stretch;--ezp-printerSelection-position:static}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:var(--ezp-printerSelection-box-borderRadius, 6px);-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));padding:var(--ezp-printerSelection-padding, 0);position:relative}#header{border-radius:6px 6px 0 0;-webkit-box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:grid;grid-column-gap:var(--ezp-spacing-2);grid-template-columns:auto 1fr auto;padding:var(--ezp-printerSelection-header-padding, var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4));position:relative;z-index:3}#toggle-menu{margin:calc(var(--ezp-spacing-3) * -1) 0;position:relative;z-index:2}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-secondary));-webkit-box-shadow:var(--ezp-printerSelection-body-boxShadow, none);box-shadow:var(--ezp-printerSelection-body-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);padding:var(--ezp-printerSelection-body-padding, var(--ezp-spacing-2))}#footer{border-radius:0 0 6px 6px;-webkit-box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-2);grid-template-areas:var(--ezp-printerSelection-footer-areas, "cancel print");grid-template-columns:var(--ezp-printerSelection-footer-columns, repeat(2, 1fr));grid-template-rows:var(--ezp-printerSelection-footer-rows, auto);-ms-flex-pack:center;justify-content:center;justify-items:stretch;padding:var(--ezp-printerSelection-footer-padding, var(--ezp-spacing-2));position:relative;z-index:3}#cancel{grid-area:cancel}#print{grid-area:print}';var EzpPrinterSelection=function(){function e(e){var t=this;registerInstance(this,e);this.printCancel=createEvent(this,"printCancel",7);this.printSubmit=createEvent(this,"printSubmit",7);this.logout=createEvent(this,"logout",7);this.sasUri="";this.fileExtension="";this.duplexOptions=[{id:1,title:i18next.t("printer_selection.duplex_none")},{id:2,title:i18next.t("printer_selection.duplex_long")},{id:3,title:i18next.t("printer_selection.duplex_short")}];this.hidemenu=false;this.hideheader=false;this.loading=true;this.printProcessing=false;this.uploading=false;this.preparingUpload=false;this.printSuccess=false;this.printFailed=false;this.notSupported=false;this.noPrinters=false;this.userMenuOpen=false;this.printStopped=false;this.selectedPrinterConfig={OrientationsSupported:[],PaperFormats:[],Resolutions:[],DuplexSupported:false,Color:false};this.selectedProperties={paper:"",paperid:"",color:false,duplex:true,duplexmode:1,orientation:1,copies:"",resolution:0,paperlength:0,paperwidth:0};this.handleCancel=function(){t.printCancel.emit()};this.validateData=function(e){if(e.jobstatus===0){t.printSuccess=true;t.printProcessing=false;return true}return false};this.POLL_INTERVAL=2e3;this.MAX_POLL_ATTEMPTS=Infinity;this.handlePrint=function(){return __awaiter(t,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){switch(r.label){case 0:this.printButton.blur();this.printProcessing=true;e=removeEmptyStrings(this.selectedProperties);e=managePaperDimensions(e);printStore.state.fileUrl=this.fileurl;printStore.state.fileID=this.fileid;printStore.state.fileType=this.filetype;printStore.state.printerID=this.selectedPrinter.id;printStore.state.printerProperties=this.selectedProperties;printStore.state.fileName=this.filename;if(this.fileurl){this.printService.printFileByUrl(authStore.state.accessToken,this.fileurl,this.filetype,this.selectedPrinter.id,e,this.filename).then((function(r){if(r.status===200&&t.selectedPrinter.is_queue){t.printProcessing=false;t.printSuccess=true}if(r.status===412){r.json().then((function(e){return t.fileid=e.fileid}));t.printService.printByFileID(authStore.state.accessToken,t.fileid,t.filetype,t.selectedPrinter.id,e,t.filename)}else{return r.json()}})).then((function(e){if(e.code===804){t.printFailed=true;t.printProcessing=false}if(e.jobid){printStore.state.jobID=e.jobid;poll({fn:t.printService.getPrintStatus,validate:t.validateData,interval:t.POLL_INTERVAL,maxAttempts:t.MAX_POLL_ATTEMPTS}).catch((function(e){console.warn(e);t.printFailed=true;t.printProcessing=false}))}else{t.printFailed=true;t.printProcessing=false}})).catch((function(e){console.log(e);t.printFailed=true;t.printProcessing=false}))}if(!this.file)return[3,2];return[4,this.handleFiles(this.file,e)];case 1:r.sent();r.label=2;case 2:localStorage.setItem("properties",JSON.stringify(this.selectedProperties));localStorage.setItem("printer",JSON.stringify(this.selectedPrinter));this.printStopped=false;return[2]}}))}))};this.handleUserMenu=function(){t.userMenuOpen=true};this.validateFileType=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.split(".").pop();this.fileExtension=t.toLowerCase();return[2,printStore.state.supportedFileExtensions.includes("".concat(this.fileExtension))]}))}))}}e.prototype.listenInputValueChanged=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenSelectSelection=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenStepperChanged=function(e){this.selectedProperties.copies=e.detail};e.prototype.listenUserMenuClosure=function(){this.userMenuOpen=false};e.prototype.listenLogout=function(){this.printCancel.emit();this.logout.emit()};e.prototype.listenStatusCancel=function(e){if(e.detail==="print-processing"){this.printStopped=true;this.printProcessing=false}};e.prototype.listenStatusClose=function(e){switch(e.detail){case"print-success":this.printSuccess=false;this.printCancel.emit();break;case"print-failed":this.printProcessing=false;this.printFailed=false;break;case"no-printers":this.noPrinters=false;break}};e.prototype.listenStatusRetry=function(e){switch(e.detail){case"not-supported":this.printCancel.emit();break;case"print-failed":this.printFailed=false;this.printProcessing=false;this.handlePrint();break}};e.prototype.getPropertiesFromLocalStorage=function(){if(localStorage.getItem("properties")){this.selectedProperties=JSON.parse(localStorage.getItem("properties"))}if(localStorage.getItem("printer")){var e=JSON.parse(localStorage.getItem("printer"));if(this.printers.some((function(t){return t.id===e.id}))){this.selectedPrinter=e}else{this.selectedPrinter={id:"",location:"",name:"",is_queue:false};localStorage.removeItem("printer");localStorage.removeItem("properties")}}else{this.selectedPrinter={id:"",location:"",name:"",is_queue:false}}this.setPaperid()};e.prototype.setPaperid=function(){this.paperid=this.selectedProperties.paperid};e.prototype.getUserInfo=function(){var e=this;var t=new EzpUserService;return t.getUserInfo().then((function(t){userStore.state.user=t;e.userName=userStore.state.user.display_name}))};e.prototype.setSelectedProperties=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(a){switch(a.label){case 0:t=e.type;switch(t){case"printer":return[3,1];case"color":return[3,3];case"orientation":return[3,4];case"format":return[3,5];case"quality":return[3,6];case"length":return[3,7];case"width":return[3,8];case"duplex":return[3,9]}return[3,10];case 1:this.selectedPrinter.id=e.id;this.selectedPrinter.name=e.title;this.selectedPrinter.is_queue=e.is_queue;return[4,this.printService.getPrinterProperties(authStore.state.accessToken,this.selectedPrinter.id).then((function(e){return r.selectedPrinterConfig=e[0]}))];case 2:a.sent();this.setDefaultPaperFormat();return[3,10];case 3:this.selectedProperties.color=!!e.id;return[3,10];case 4:this.selectedProperties.orientation=e.id;return[3,10];case 5:this.selectedProperties.paper=e.title;this.selectedProperties.paperid=e.id;return[3,10];case 6:this.selectedProperties.resolution=e.title;return[3,10];case 7:this.selectedProperties.paperlength=e.value;return[3,10];case 8:this.selectedProperties.paperwidth=e.value;return[3,10];case 9:if(e.title==="None"){this.selectedProperties.duplex=false}else{this.selectedProperties.duplex=true}this.selectedProperties.duplexmode=e.id;return[3,10];case 10:this.setPaperid();return[2]}}))}))};e.prototype.handleFiles=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n;var i=this;return __generator(this,(function(o){switch(o.label){case 0:this.preparingUpload=true;return[4,this.printService.prepareFileUpload(authStore.state.accessToken)];case 1:r=o.sent();this.preparingUpload=false;this.fileid=r.fileid;this.sasUri=r.sasUri;this.filetype=this.fileExtension;this.uploading=true;o.label=2;case 2:o.trys.push([2,4,,5]);return[4,this.printService.uploadBlobFiles(this.sasUri,e)];case 3:a=o.sent();return[3,5];case 4:n=o.sent();this.printProcessing=false;this.printFailed=true;return[3,5];case 5:this.uploading=false;if(a._response.status===201){this.printService.printByFileID(authStore.state.accessToken,this.fileid,this.filetype,this.selectedPrinter.id,t,this.filename).then((function(e){if(e.code===804){i.printFailed=true;i.printProcessing=false}if(e.jobid){printStore.state.jobID=e.jobid;poll({fn:i.printService.getPrintStatus,validate:i.validateData,interval:i.POLL_INTERVAL,maxAttempts:i.MAX_POLL_ATTEMPTS}).catch((function(e){console.log(e);i.printFailed=true;i.printProcessing=false}))}else{i.printFailed=true;i.printProcessing=false}})).catch((function(e){console.log(e);i.printFailed=true;i.printProcessing=false}))}else{this.printFailed=true;this.printProcessing=false}return[2]}}))}))};e.prototype.setDefaultPaperFormat=function(){var e;var t=navigator.language;if(t==="en-US"){e="Letter"}else if(t==="my"){e="Letter"}else{e="A4"}if(this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)}))){this.selectedProperties.paper=this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)})).Name;this.selectedProperties.paperid=this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)})).Id}else{this.selectedProperties.paper=this.selectedPrinterConfig.PaperFormats[0].Name;this.selectedProperties.paperid=this.selectedPrinterConfig.PaperFormats[0].Id}this.setPaperid()};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:this.printService=new EzpPrintService(this.redirectURI,this.clientID);this.printService.registerFetchInterceptor();return[4,this.getUserInfo()];case 1:t.sent();return[4,this.printService.getPrinterList(authStore.state.accessToken).then((function(t){e.printers=t;if(!(e.printers.length>0)){e.noPrinters=true}}))];case 2:t.sent();this.getPropertiesFromLocalStorage();if(!(this.selectedPrinter.id!=""))return[3,4];return[4,this.printService.getPrinterProperties(authStore.state.accessToken,this.selectedPrinter.id).then((function(t){return e.selectedPrinterConfig=t[0]}))];case 3:t.sent();if(this.selectedProperties.paper===""){this.setDefaultPaperFormat()}t.label=4;case 4:return[4,this.printService.getConfig(authStore.state.accessToken)];case 5:return[4,t.sent().json().then((function(e){printStore.state.supportedFileExtensions=e.System.FILEEXT}))];case 6:t.sent();return[4,this.printService.getAllPrinterProperties(authStore.state.accessToken).then((function(t){e.printerConfig=t}))];case 7:t.sent();if(!this.file)return[3,9];return[4,this.validateFileType(this.filename).then((function(t){e.notSupported=!t?true:false}))];case 8:t.sent();t.label=9;case 9:this.loading=false;return[2]}}))}))};e.prototype.render=function(){var e=this;return this.loading?h("ezp-status",{processing:true,description:i18next.t("printer_selection.loading"),instance:"loading"}):h(Host,{class:{seamless:this.seamless}},h("div",{id:"box","data-backdrop-surface":true},!this.printStopped&&h(Fragment,null,this.printProcessing?h("ezp-status",{processing:true,description:this.preparingUpload?i18next.t("printer_selection.prepare_upload"):this.uploading?i18next.t("printer_selection.uploading"):i18next.t("printer_selection.print_processing"),instance:"print-processing",cancel:true}):this.selectedPrinter.is_queue&&this.printSuccess?h("ezp-status",{icon:"checkmark-alt",description:i18next.t("printer_selection.pull_print_success"),instance:"print-success",close:true}):this.printSuccess?h("ezp-status",{icon:"checkmark-alt",description:i18next.t("printer_selection.print_success"),instance:"print-success",close:true}):this.printFailed?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.print_failed"),instance:"print-failed",close:true,retry:true}):this.notSupported?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.not_supported"),instance:"not-supported",retry:true}):this.noPrinters?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.no_printers"),instance:"no-printers",close:true}):null),!this.hideheader&&h("div",{id:"header"},h("ezp-label",{weight:"heavy",text:i18next.t("printer_selection.print")+"".concat(!this.notSupported?":":"")}),h("ezp-label",{text:!this.notSupported?this.filename:"",ellipsis:true}),!this.hidemenu&&h("ezp-icon-button",{level:"tertiary",icon:"menu",id:"toggle-menu",type:"button",onClick:this.handleUserMenu})),h("div",{id:"body"},h("div",{id:"printer"},h("ezp-select",{label:i18next.t("printer_selection.printer"),icon:"printer",placeholder:this.printers.length>0?i18next.t("printer_selection.select_printer"):i18next.t("printer_selection.no_printers"),toggleFlow:"vertical",optionFlow:"vertical",options:this.printers.map((function(e){return{id:e.id,title:e.name,meta:e.location!==""?e.location:"",type:"printer",is_queue:e.is_queue}})),preSelected:this.selectedPrinter.id?this.selectedPrinter.name:null,disabled:!(this.printers.length>0)})),h("div",{id:"options"},h("ezp-select",{label:i18next.t("printer_selection.color"),icon:"color",placeholder:i18next.t("printer_selection.select_color"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.Color?[{id:1,title:i18next.t("printer_selection.color_color"),meta:"",type:"color"},{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}]:[{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}],preSelected:this.selectedPrinter.id?this.selectedProperties.color?i18next.t("printer_selection.color_color"):i18next.t("printer_selection.color_grayscale"):null,disabled:!this.selectedPrinterConfig.Color}),h("ezp-select",{label:i18next.t("printer_selection.duplex"),icon:"duplex",placeholder:i18next.t("printer_selection.select_duplex"),toggleFlow:"horizontal",options:this.duplexOptions.map((function(e){return{id:e.id,title:e.title,meta:"",type:"duplex"}})),preSelected:this.selectedPrinter.id&&this.selectedProperties.duplex?this.duplexOptions.find((function(t){return t.id===e.selectedProperties.duplexmode})).id:null,disabled:!this.selectedPrinterConfig.DuplexSupported}),h("ezp-select",{label:i18next.t("printer_selection.size"),icon:"size",placeholder:i18next.t("printer_selection.select_size"),toggleFlow:"horizontal",optionFlow:"horizontal",options:this.selectedPrinterConfig.PaperFormats.map((function(e){return{id:e.Id,title:e.Name,meta:"".concat(e.XRes," x ").concat(e.YRes),type:"format"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.paper:null,disabled:!(this.selectedPrinterConfig.PaperFormats.length>0)}),this.paperid==PAPER_ID?h(Fragment,null,h("ezp-input",{icon:"width",suffix:"mm",value:this.selectedProperties.paperwidth,eventType:"width",type:"number",label:i18next.t("printer_selection.width")}),h("ezp-input",{icon:"height",suffix:"mm",value:this.selectedProperties.paperlength,eventType:"length",type:"number",label:i18next.t("printer_selection.length")})):null,h("ezp-select",{label:i18next.t("printer_selection.orientation"),icon:"orientation",placeholder:i18next.t("printer_selection.select_orientation"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.OrientationsSupported.map((function(e,t){return{id:t+1,title:i18next.t("printer_selection.orientation_".concat(e)),meta:"",type:"orientation"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.orientation:null,disabled:!(this.selectedPrinterConfig.OrientationsSupported.length>0)}),h("ezp-select",{label:i18next.t("printer_selection.quality"),icon:"quality",placeholder:i18next.t("printer_selection.select_quality"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.Resolutions.map((function(e,t){return{id:t,title:e,meta:"",type:"quality"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.resolution:null,disabled:!(this.selectedPrinterConfig.Resolutions.length>0)})),h("ezp-stepper",{label:i18next.t("printer_selection.copies"),max:10,icon:"copies"})),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"secondary",onClick:this.handleCancel,label:i18next.t("button_actions.cancel"),class:"action",id:"cancel"}),h("ezp-text-button",{disabled:this.selectedPrinter.id===""||this.printProcessing,type:"button",onClick:this.handlePrint,label:i18next.t("button_actions.print"),ref:function(t){return e.printButton=t},class:"action",id:"print"})),!this.hidemenu&&h("ezp-user-menu",{open:this.userMenuOpen,name:this.userName})))};return e}();EzpPrinterSelection.style=ezpPrinterSelectionCss;var authApiHostUrl="account.ezeep.com";var printingApiHostUrl="printapi.ezeep.com";var config={authApiHostUrl:authApiHostUrl,printingApiHostUrl:printingApiHostUrl};var ezpPrintingCss=':host{--ezp-black-5:rgba(0, 0, 0, 0.05);--ezp-black-10:rgba(0, 0, 0, 0.1);--ezp-black-20:rgba(0, 0, 0, 0.2);--ezp-black-30:rgba(0, 0, 0, 0.3);--ezp-black-40:rgba(0, 0, 0, 0.4);--ezp-black-50:rgba(0, 0, 0, 0.5);--ezp-black-60:rgba(0, 0, 0, 0.6);--ezp-black-70:rgba(0, 0, 0, 0.7);--ezp-black-80:rgba(0, 0, 0, 0.8);--ezp-black-90:rgba(0, 0, 0, 0.9);--ezp-black-95:rgba(0, 0, 0, 0.95);--ezp-black-100:black}:host{--ezp-white-5:rgba(255, 255, 255, 0.05);--ezp-white-10:rgba(255, 255, 255, 0.1);--ezp-white-20:rgba(255, 255, 255, 0.2);--ezp-white-30:rgba(255, 255, 255, 0.3);--ezp-white-40:rgba(255, 255, 255, 0.4);--ezp-white-50:rgba(255, 255, 255, 0.5);--ezp-white-60:rgba(255, 255, 255, 0.6);--ezp-white-70:rgba(255, 255, 255, 0.7);--ezp-white-80:rgba(255, 255, 255, 0.8);--ezp-white-90:rgba(255, 255, 255, 0.9);--ezp-white-95:rgba(255, 255, 255, 0.95);--ezp-white-100:white}:host{font-family:"Inter", sans-serif;-webkit-font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";-webkit-font-kerning:normal;font-kerning:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--ezp-duration-1:0.1s;--ezp-duration-2:0.16s;--ezp-duration-3:0.26s;--ezp-duration-4:0.42s;--ezp-duration-5:0.68s;--ezp-duration-6:1s;--ezp-spacing-1:4px;--ezp-spacing-2:6px;--ezp-spacing-3:10px;--ezp-spacing-4:16px;--ezp-spacing-5:26px;--ezp-spacing-6:42px;--ezp-spacing-7:68px;--ezp-spacing-8:110px;--ezp-easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--ezp-easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ezp-easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ezp-easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ezp-easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ezp-easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1)}:host(.light){--ezp-accent-pink-solid:#f23267;--ezp-accent-pink-solid-alt:#df1559;--ezp-accent-pink-translucent:rgba(242, 50, 103, 0.16);--ezp-accent-red-solid:#f23b22;--ezp-accent-red-solid-alt:#de2313;--ezp-accent-red-translucent:rgba(242, 59, 34, 0.16);--ezp-accent-orange-solid:#fe7200;--ezp-accent-orange-solid-alt:#f56200;--ezp-accent-orange-translucent:rgba(254, 114, 0, 0.16);--ezp-accent-yellow-solid:#ffa200;--ezp-accent-yellow-solid-alt:#fe9000;--ezp-accent-yellow-translucent:rgba(255, 162, 0, 0.16);--ezp-accent-green-solid:#5d9200;--ezp-accent-green-solid-alt:#518100;--ezp-accent-green-translucent:rgba(93, 146, 0, 0.16);--ezp-accent-teal-solid:#00967c;--ezp-accent-teal-solid-alt:#00846e;--ezp-accent-teal-translucent:rgba(0, 150, 124, 0.16);--ezp-accent-cyan-solid:#0091b4;--ezp-accent-cyan-solid-alt:#0080a0;--ezp-accent-cyan-translucent:rgba(0, 145, 180, 0.16);--ezp-accent-blue-solid:#5081f1;--ezp-accent-blue-solid-alt:#3b72df;--ezp-accent-blue-translucent:rgba(80, 129, 241, 0.16);--ezp-accent-violet-solid:#ae5ef3;--ezp-accent-violet-solid-alt:#9d4ee2;--ezp-accent-violet-translucent:rgba(174, 94, 243, 0.16);--ezp-core-surface-primary:white;--ezp-core-surface-secondary:#f3f3f3;--ezp-core-surface-tertiary:white;--ezp-core-foreground-primary:rgba(0, 0, 0, 0.94);--ezp-core-foreground-secondary:rgba(62, 62, 62, 0.68);--ezp-core-foreground-tertiary:rgba(62, 62, 62, 0.42);--ezp-core-shade-primary:rgba(139, 139, 139, 0.1);--ezp-core-shade-secondary:rgba(139, 139, 139, 0.16);--ezp-core-shade-tertiary:rgba(139, 139, 139, 0.22);--ezp-core-outline:rgba(99, 99, 99, 0.16);--ezp-core-edge:rgba(0, 0, 0, 0.1);--ezp-core-backdrop:rgba(0, 0, 0, 0.26)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-accent-pink-solid:color(display-p3 0.949 0.196 0.404/100%);--ezp-accent-pink-solid-alt:color(display-p3 0.875 0.082 0.349/100%);--ezp-accent-pink-translucent:color(display-p3 0.949 0.196 0.404/16%);--ezp-accent-red-solid:color(display-p3 0.949 0.231 0.133/100%);--ezp-accent-red-solid-alt:color(display-p3 0.871 0.137 0.075/100%);--ezp-accent-red-translucent:color(display-p3 0.949 0.231 0.133/16%);--ezp-accent-orange-solid:color(display-p3 0.996 0.447 0/100%);--ezp-accent-orange-solid-alt:color(display-p3 0.961 0.384 0/100%);--ezp-accent-orange-translucent:color(display-p3 0.996 0.447 0/16%);--ezp-accent-yellow-solid:color(display-p3 1 0.635 0/100%);--ezp-accent-yellow-solid-alt:color(display-p3 0.996 0.565 0/100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.635 0/16%);--ezp-accent-green-solid:color(display-p3 0.365 0.573 0/100%);--ezp-accent-green-solid-alt:color(display-p3 0.318 0.506 0/100%);--ezp-accent-green-translucent:color(display-p3 0.365 0.573 0/16%);--ezp-accent-teal-solid:color(display-p3 0 0.588 0.486/100%);--ezp-accent-teal-solid-alt:color(display-p3 0 0.518 0.431/100%);--ezp-accent-teal-translucent:color(display-p3 0 0.588 0.486/16%);--ezp-accent-cyan-solid:color(display-p3 0 0.569 0.706/100%);--ezp-accent-cyan-solid-alt:color(display-p3 0 0.502 0.627/100%);--ezp-accent-cyan-translucent:color(display-p3 0 0.569 0.706/16%);--ezp-accent-blue-solid:color(display-p3 0.314 0.506 0.945/100%);--ezp-accent-blue-solid-alt:color(display-p3 0.231 0.447 0.875/100%);--ezp-accent-blue-translucent:color(display-p3 0.314 0.506 0.945/16%);--ezp-accent-violet-solid:color(display-p3 0.682 0.369 0.953/100%);--ezp-accent-violet-solid-alt:color(display-p3 0.616 0.306 0.886/100%);--ezp-accent-violet-translucent:color(display-p3 0.682 0.369 0.953/16%)}}}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-core-surface-primary:color(display-p3 1 1 1/100%);--ezp-core-surface-secondary:color(display-p3 0.953 0.953 0.953/100%);--ezp-core-surface-tertiary:color(display-p3 1 1 1/100%);--ezp-core-foreground-primary:color(display-p3 0 0 0/94%);--ezp-core-foreground-secondary:color(display-p3 0.243 0.243 0.243/68%);--ezp-core-foreground-tertiary:color(display-p3 0.243 0.243 0.243/42%);--ezp-core-shade-primary:color(display-p3 0.545 0.545 0.545/10%);--ezp-core-shade-secondary:color(display-p3 0.545 0.545 0.545/16%);--ezp-core-shade-tertiary:color(display-p3 0.545 0.545 0.545/22%);--ezp-core-outline:color(display-p3 0.388 0.388 0.388/16%);--ezp-core-edge:color(display-p3 0 0 0/10%);--ezp-core-backdrop:color(display-p3 0 0 0/26%)}}}:host(.dark){--ezp-dialog-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-body-boxShadow:inset 1px 0 0 0 var(--ezp-core-outline),\n inset -1px 0 0 0 var(--ezp-core-outline);--ezp-printerSelection-box-boxShadow:0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-footer-boxShadowPosition:inset 0 0 0 1px;--ezp-printerSelection-header-boxShadowPosition:inset 0 0 0 1px;--ezp-select-wrap-boxShadowPositionBottom:inset 0 -1px 0 0;--ezp-select-wrap-boxShadowPositionLeft:inset 1px 0 0 0;--ezp-select-wrap-boxShadowPositionRight:inset -1px 0 0 0;--ezp-select-wrap-boxShadowPositionTop:inset 0 1px 0 0;--ezp-status-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-stepper-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-userMenu-header-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-links-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-theme-boxShadowPosition:inset 0 -1px 0 0;--ezp-input-box-shadow-position-top:inset 0 1px 0 0;--ezp-input-box-shadow-position-right:inset -1px 0 0 0;--ezp-input-box-shadow-position-bottom:inset 0 -1px 0 0;--ezp-input-box-shadow-position-left:inset 1px 0 0 0;--ezp-accent-pink-solid:#ff4171;--ezp-accent-pink-translucent:rgba(255, 65, 113, 0.26);--ezp-accent-red-solid:#ff482c;--ezp-accent-red-translucent:rgba(255, 72, 44, 0.26);--ezp-accent-orange-solid:#ff811c;--ezp-accent-orange-translucent:rgba(255, 129, 28, 0.26);--ezp-accent-yellow-solid:#ffaf3a;--ezp-accent-yellow-translucent:rgba(255, 175, 58, 0.26);--ezp-accent-green-solid:#679c15;--ezp-accent-green-translucent:rgba(103, 156, 21, 0.26);--ezp-accent-teal-solid:#1da086;--ezp-accent-teal-translucent:rgba(29, 160, 134, 0.26);--ezp-accent-cyan-solid:#209bbf;--ezp-accent-cyan-translucent:rgba(32, 155, 191, 0.26);--ezp-accent-blue-solid:#5d8bfd;--ezp-accent-blue-translucent:rgba(93, 139, 253, 0.26);--ezp-accent-violet-solid:#ba69ff;--ezp-accent-violet-translucent:rgba(186, 105, 255, 0.26);--ezp-core-surface-primary:black;--ezp-core-surface-secondary:#1b1b1b;--ezp-core-surface-tertiary:#282828;--ezp-core-foreground-primary:rgba(255, 255, 255, 0.94);--ezp-core-foreground-secondary:rgba(182, 182, 182, 0.68);--ezp-core-foreground-tertiary:rgba(182, 182, 182, 0.42);--ezp-core-shade-primary:rgba(99, 99, 99, 0.26);--ezp-core-shade-secondary:rgba(99, 99, 99, 0.32);--ezp-core-shade-tertiary:rgba(99, 99, 99, 0.38);--ezp-core-outline:rgba(139, 139, 139, 0.26);--ezp-core-edge:rgba(255, 255, 255, 0.16);--ezp-core-backdrop:rgba(0, 0, 0, 0.68)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-accent-pink-solid:color(display-p3 1 0.255 0.443/100%);--ezp-accent-pink-translucent:color(display-p3 1 0.255 0.443/26%);--ezp-accent-red-solid:color(display-p3 1 0.282 0.173/100%);--ezp-accent-red-translucent:color(display-p3 1 0.282 0.173/26%);--ezp-accent-orange-solid:color(display-p3 1 0.506 0.11/100%);--ezp-accent-orange-translucent:color(display-p3 1 0.506 0.11/26%);--ezp-accent-yellow-solid:color(display-p3 1 0.686 0.227/100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.686 0.227/26%);--ezp-accent-green-solid:color(display-p3 0.404 0.612 0.082/100%);--ezp-accent-green-translucent:color(display-p3 0.404 0.612 0.082/26%);--ezp-accent-teal-solid:color(display-p3 0.114 0.627 0.525/100%);--ezp-accent-teal-translucent:color(display-p3 0.114 0.627 0.525/26%);--ezp-accent-cyan-solid:color(display-p3 0.125 0.608 0.749/100%);--ezp-accent-cyan-translucent:color(display-p3 0.125 0.608 0.749/26%);--ezp-accent-blue-solid:color(display-p3 0.365 0.545 0.992/100%);--ezp-accent-blue-translucent:color(display-p3 0.365 0.545 0.992/26%);--ezp-accent-violet-solid:color(display-p3 0.729 0.412 1/100%);--ezp-accent-violet-translucent:color(display-p3 0.729 0.412 1/26%)}}}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-core-surface-primary:color(display-p3 0 0 0/100%);--ezp-core-surface-secondary:color(display-p3 0.106 0.106 0.106/100%);--ezp-core-surface-tertiary:color(display-p3 0.157 0.157 0.157/100%);--ezp-core-foreground-primary:color(display-p3 1 1 1/94%);--ezp-core-foreground-secondary:color(display-p3 0.714 0.714 0.714/68%);--ezp-core-foreground-tertiary:color(display-p3 0.714 0.714 0.714/42%);--ezp-core-shade-primary:color(display-p3 0.388 0.388 0.388/26%);--ezp-core-shade-secondary:color(display-p3 0.388 0.388 0.388/32%);--ezp-core-shade-tertiary:color(display-p3 0.388 0.388 0.388/38%);--ezp-core-outline:color(display-p3 0.545 0.545 0.545/26%);--ezp-core-edge:color(display-p3 1 1 1/16%);--ezp-core-backdrop:color(display-p3 0 0 0/68%)}}}:host(.seamless){--ezp-status-border-radius:0;--ezp-backdrop-border-radius:0}:host(.blue){--ezp-theme-solid:var(--ezp-accent-blue-solid);--ezp-theme-translucent:var(--ezp-accent-blue-translucent)}:host(.cyan){--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent)}:host(.green){--ezp-theme-solid:var(--ezp-accent-green-solid);--ezp-theme-translucent:var(--ezp-accent-green-translucent)}:host(.teal){--ezp-theme-solid:var(--ezp-accent-teal-solid);--ezp-theme-translucent:var(--ezp-accent-teal-translucent)}:host(.orange){--ezp-theme-solid:var(--ezp-accent-orange-solid);--ezp-theme-translucent:var(--ezp-accent-orange-translucent)}:host(.pink){--ezp-theme-solid:var(--ezp-accent-pink-solid);--ezp-theme-translucent:var(--ezp-accent-pink-translucent)}:host(.red){--ezp-theme-solid:var(--ezp-accent-red-solid);--ezp-theme-translucent:var(--ezp-accent-red-translucent)}:host(.violet){--ezp-theme-solid:var(--ezp-accent-violet-solid);--ezp-theme-translucent:var(--ezp-accent-violet-translucent)}';var EzpPrinting=function(){function e(e){registerInstance(this,e);this.printFinished=createEvent(this,"printFinished",7);this.filename="";this.hidemenu=false;this.hideheader=false;this.theme="cyan";this.appearance="system";this.language="";this.seamless=false;this.printOpen=false;this.authOpen=false;this.onlyGetSasUri=false;this.noDocumentOpen=false}e.prototype.watchFileData=function(e,t){console.log(e);if(e!==t&&e.length>0){var r=new Uint8Array(e.length);for(var a=0;a<e.length;a++){r[a]=e.charCodeAt(a)}this.file=new File([r],this.filename)}};e.prototype.watchFilename=function(e,t){if(e!==t&&e.length>0){this.filename=e}};e.prototype.watchFileUrl=function(e,t){if(e!==t&&e.length>0){this.fileurl=e}};e.prototype.watchLanguage=function(e,t){if(e!==t&&e.length>0){this.language=e}};e.prototype.listenPrintCancel=function(){this.printOpen=false;this.printFinished.emit()};e.prototype.listenPrintSubmit=function(){this.printOpen=false;this.printFinished.emit();this.checkAuth()};e.prototype.listenAuthCancel=function(){this.authOpen=false;this.checkAuth()};e.prototype.listenAuthSuccess=function(){if(this.onlyGetSasUri){this.printOpen=false;this.onlyGetSasUri=false}else if(this.filename!=""){this.printOpen=true}else{this.noDocumentOpen=true}};e.prototype.listenUploadFile=function(e){this.filename=e.detail[0].name;this.file=e.detail[0];this.open()};e.prototype.listenDialogClose=function(e){if(e.detail==="no-document-selected"){this.noDocumentOpen=false}};e.prototype.listenDialogAction=function(e){if(e.detail==="no-document-selected"){this.noDocumentOpen=false}};e.prototype.listenLogout=function(){this.logOut()};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(authStore.state.isAuthorized){if(this.filename){this.printOpen=true}else{this.noDocumentOpen=true}}else{this.authOpen=true}return[2]}))}))};e.prototype.logOut=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.auth.revokeRefreshToken();localStorage.removeItem("properties");localStorage.removeItem("refreshToken");localStorage.removeItem("access_token");localStorage.removeItem("printer");localStorage.removeItem("isAuthorized");this.printOpen=false;return[2]}))}))};e.prototype.getSasUri=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:this.onlyGetSasUri=true;e=new EzpPrintService(this.redirecturi,this.clientid);return[4,e.prepareFileUpload(authStore.state.accessToken).catch((function(){a.open();return null}))];case 1:t=n.sent();if(t){r=t.sasUri;return[2,r]}return[2]}}))}))};e.prototype.getAuthUri=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 1:e.sent();this.auth.buildAuthURI();return[2,authStore.state.authUri]}}))}))};e.prototype.checkAuth=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=new EzpPrintService(this.redirecturi,this.clientid);t=authStore.state.accessToken;if(t===""){t=localStorage.getItem("access_token");authStore.state.accessToken=t}if(localStorage.getItem("isAuthorized")){authStore.state.isAuthorized=localStorage.getItem("isAuthorized")==="true"}return[4,e.getConfig(authStore.state.accessToken).then((function(e){if(e.ok){authStore.state.isAuthorized=true}if(!e.ok){authStore.state.isAuthorized=false;throw new Error("http status "+e.status)}})).catch((function(){authStore.state.isAuthorized=false}))];case 1:r.sent();localStorage.setItem("isAuthorized",authStore.state.isAuthorized.toString());return[2,authStore.state.isAuthorized]}}))}))};e.prototype.refreshTokensPeriodically=function(e){var t=new EzpAuthorizationService(this.redirecturi,this.clientid);setInterval((function(){t.refreshTokens()}),e*1e3)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){e=window.matchMedia("(prefers-color-scheme: dark)");this.systemAppearance=e.matches?"dark":"light";e.addEventListener("change",(function(e){t.systemAppearance=e.matches?"dark":"light"}));authStore.state.redirectUri=this.redirecturi;userStore.state.theme=this.theme;userStore.state.appearance=this.appearance;if(this.authapihosturl){authStore.state.authApiHostUrl=this.authapihosturl}else{authStore.state.authApiHostUrl=config.authApiHostUrl}if(this.printapihosturl){printStore.state.printApiHostUrl=this.printapihosturl}else{printStore.state.printApiHostUrl=config.printingApiHostUrl}this.auth=new EzpAuthorizationService(this.redirecturi,this.clientid);sendCodeToParentWindow();initi18n(this.language);this.checkAuth();return[2]}))}))};e.prototype.componentDidLoad=function(){this.refreshTokensPeriodically(1800)};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(userStore.state.theme," ").concat(userStore.state.appearance==="system"?this.systemAppearance:userStore.state.appearance," ").concat(this.seamless?"seamless":"")},this.trigger==="custom"?h("slot",null):this.trigger==="file"?h("ezp-upload",null):this.trigger==="button"&&h("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:function(){return e.open()}}),this.authOpen?h("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin,trigger:this.trigger,code:this.code}):this.printOpen?h("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype,fileid:this.fileid,file:this.file,hidemenu:this.hidemenu,hideheader:this.hideheader,seamless:this.seamless}):this.noDocumentOpen?h("ezp-dialog",{heading:i18next.t("no_document_dialog.heading"),description:i18next.t("no_document_dialog.description"),action:i18next.t("no_document_dialog.action"),iconName:"question-mark",instance:"no-document-selected"}):null)};Object.defineProperty(e,"watchers",{get:function(){return{filedata:["watchFileData"],filename:["watchFilename"],fileurl:["watchFileUrl"],language:["watchLanguage"]}},enumerable:false,configurable:true});return e}();EzpPrinting.style=ezpPrintingCss;var ezpSelectCss=':host{--ezp-select-duration:var(--ezp-duration-3);display:block;height:var(--ezp-select-toggle-height);position:relative;-webkit-transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));z-index:var(--ezp-select-zIndex, 3)}:host(:first-child){--ezp-select-wrap-borderRadius:3px 3px 0 0}:host(:last-child){--ezp-select-wrap-borderRadius:0 0 3px 3px}:host(:first-child:last-child){--ezp-select-wrap-borderRadius:3px}:host(:not(:last-child):not(.is-expanded)){--ezp-select-wrap-boxShadowPositionBottom:0 0 0 0}:host(.toggle-horizontal){--ezp-select-label-alignSelf:start;--ezp-select-toggle-gridTemplateAreas:"label value accessory";--ezp-select-toggle-gridTemplateColumns:1fr repeat(2, auto);--ezp-select-toggle-height:30px;--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-alignSelf:end}:host(.toggle-horizontal.has-icon){--ezp-select-toggle-gridTemplateAreas:"icon label value accessory";--ezp-select-toggle-gridTemplateColumns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--ezp-select-label-alignSelf:center;--ezp-select-toggle-gridTemplateAreas:"label accessory" "value accessory";--ezp-select-toggle-gridTemplateColumns:1fr auto;--ezp-select-toggle-height:48px;--ezp-select-toggle-gridTemplateRows:repeat(2, auto);--ezp-select-value-alignSelf:center}:host(.toggle-vertical.has-icon){--ezp-select-toggle-gridTemplateAreas:"icon label accessory" "icon value accessory";--ezp-select-toggle-gridTemplateColumns:auto 1fr auto}:host(.option-horizontal){--ezp-select-details-gridTemplateColumns:repeat(2, 1fr);--ezp-select-details-gridTemplateRows:auto;--ezp-select-option-height:30px}:host(.option-vertical){--ezp-select-details-gridTemplateColumns:1fr;--ezp-select-details-gridTemplateRows:repeat(2, auto);--ezp-select-option-height:48px}:host(.is-expanded){--ezp-select-accessory-color:var(--ezp-theme-solid);--ezp-select-transition:z-index 0s 0s;--ezp-select-zIndex:9999;--ezp-select-icon-color:var(--ezp-theme-solid);--ezp-select-label-color:var(--ezp-theme-solid);--ezp-select-wrap-borderRadius:3px}:host(.disabled){--ezp-select-accessory-color:var(--ezp-core-foreground-tertiary);--ezp-select-icon-color:var(--ezp-core-foreground-tertiary);--ezp-select-label-color:var(--ezp-core-foreground-tertiary);--ezp-select-toggle-background-hover:transparent;--ezp-select-toggle-cursor:default;--value-color:var(--ezp-core-foreground-tertiary)}#wrap{background:var(--ezp-core-surface-tertiary);border-radius:var(--ezp-select-wrap-borderRadius, 0);-webkit-box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);-webkit-transform:translateY(var(--ezp-select-wrap-translateY, 0));transform:translateY(var(--ezp-select-wrap-translateY, 0));-webkit-transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart)}#toggle{background:var(--ezp-select-toggle-background, transparent);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:var(--ezp-select-toggle-cursor, pointer);display:grid;gap:var(--ezp-spacing-2) var(--ezp-spacing-3);grid-template-areas:var(--ezp-select-toggle-gridTemplateAreas, none);grid-template-columns:var(--ezp-select-toggle-gridTemplateColumns, none);grid-template-rows:var(--ezp-select-toggle-gridTemplateRows, auto);height:var(--ezp-select-toggle-height, auto);padding:var(--ezp-spacing-3)}#toggle:hover{--ezp-select-toggle-background:var(\n --ezp-select-toggle-background-hover,\n var(--ezp-core-shade-primary)\n )}#icon{align-self:center;color:var(--ezp-select-icon-color, var(--ezp-core-foreground-secondary));grid-area:icon;margin:calc(var(--ezp-spacing-2) * -1) 0}#label{align-self:var(--ezp-select-label-alignSelf, auto);color:var(--ezp-select-label-color, var(--ezp-core-foreground-secondary));grid-area:label}#value{align-self:var(--ezp-select-value-alignSelf, auto);color:var(--value-color, var(--ezp-core-foreground-primary));grid-area:value}#accessory{align-self:center;color:var(--ezp-select-accessory-color, var(--ezp-core-foreground-secondary));grid-area:accessory;margin:calc(var(--ezp-spacing-2) * -1) 0}#list{-webkit-box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);height:var(--ezp-select-list-height, 0);overflow:auto;-webkit-transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart)}.option{background:var(--ezp-select-option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;height:var(--ezp-select-option-height, auto);padding:0 0 0 var(--ezp-spacing-3)}.option:not(:last-child){--ezp-select-details-boxShadow:inset 0 -1px 0 0 var(--ezp-core-outline)}.option:hover{--ezp-select-option-background:var(--ezp-core-shade-primary)}.option:active{--ezp-select-option-background:var(--ezp-core-shade-secondary)}.option.is-selected{--ezp-select-indicator-opacity:1;--ezp-select-indicator-transform:translateX(0);--ezp-select-indicator-transition:opacity var(--ezp-select-duration)\n var(--ezp-easing-out-quart),\n transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-select-indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0;opacity:var(--ezp-select-indicator-opacity, 0);-webkit-transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));-webkit-transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));visibility:var(--ezp-select-indicator-visibility, hidden)}.details{-webkit-box-shadow:var(--ezp-select-details-boxShadow);box-shadow:var(--ezp-select-details-boxShadow);display:grid;gap:var(--ezp-spacing-2);grid-template-columns:var(--ezp-select-details-gridTemplateColumns, 1fr);grid-template-rows:var(--ezp-select-details-gridTemplateRows, auto);padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--ezp-core-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--ezp-core-foreground-secondary)}';var EzpSelect=function(){function e(e){var t=this;registerInstance(this,e);this.selectToggle=createEvent(this,"selectToggle",7);this.selectSelection=createEvent(this,"selectSelection",7);this.backdrop=document.createElement("ezp-backdrop");this.containerHeight=0;this.expandCover=false;this.expandRise=false;this.listHeight=0;this.spacing=6;this.toggleHeight=0;this.wrapDiff=0;this.wrapHeight=0;this.wrapTop=0;this.duration=0;this.label="Label";this.placeholder="Placeholder";this.toggleFlow="horizontal";this.disabled=false;this.expanded=false;this.selected={id:false,title:"",meta:""};this.toggle=function(){t.containerHeight=t.container.clientHeight-t.spacing*2;t.listHeight=t.list.scrollHeight;t.wrapTop=t.component.offsetTop;t.wrapHeight=t.toggleHeight+t.listHeight;t.expandCover=t.wrapHeight>t.containerHeight;t.expandRise=t.wrapHeight>t.containerHeight-t.wrapTop;t.wrapDiff=t.containerHeight-t.wrapHeight-t.wrapTop;t.expanded=!t.expanded;t.selectToggle.emit(t.expanded)};this.select=function(e){var r=t.selected.id===e?0:t.duration*1e3;t.selected=t.options.find((function(t){return t.id===e}));t.selectSelection.emit(t.selected);window.setTimeout((function(){t.toggle()}),r)};this.preSelect=function(){t.selected=t.options.find((function(e){return typeof t.preSelected==="number"?e.id===t.preSelected:typeof t.preSelected==="string"?e.title===t.preSelected:null}))}}e.prototype.watchExpanded=function(){if(this.expandCover){this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.containerHeight-this.toggleHeight,"px"):"0px");this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?"".concat(this.wrapTop*-1+this.spacing,"px"):"0px")}else if(this.expandRise){this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.listHeight,"px"):"0px");this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?"".concat(this.wrapDiff+this.spacing,"px"):"0px")}else{this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.listHeight,"px"):"0px")}if(this.expanded){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.expanded=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}));if(this.preSelected!==undefined&&this.preSelected!==""&&this.preSelected!==null){this.preSelect()}};e.prototype.componentDidLoad=function(){var e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--ezp-select-toggle-height"));this.duration=parseFloat(e.getPropertyValue("--ezp-select-duration"))};e.prototype.componentWillUpdate=function(){if(this.selected.id===false&&this.preSelected!==undefined&&this.preSelected!==""&&this.preSelected!==null){this.preSelect()}};e.prototype.render=function(){var e=this;var t=[this.expanded?"is-expanded":"",this.icon?"has-icon":"","toggle-".concat(this.toggleFlow),this.optionFlow?"option-".concat(this.optionFlow):"",this.disabled?"disabled":""];var r=this.toggleFlow==="horizontal"?"secondary":"tertiary";return h(Host,{class:t.join(" ")},h("div",{id:"wrap"},h("div",{id:"toggle",onClick:function(){return!e.disabled&&e.toggle()}},this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,level:r,text:this.label}),h("ezp-label",{id:"value",ellipsis:true,text:this.selected.title!==""?this.selected.title:this.placeholder}),h("ezp-icon",{id:"accessory",name:"expand"})),h("div",{id:"list",ref:function(t){return e.list=t}},this.options.map((function(t){if(t.title!==""){return h("div",{class:"option ".concat(t.id===e.selected.id?"is-selected":""," ").concat(t.meta!==""?"has-meta":""," "),onClick:function(){return e.select(t.id)}},h("ezp-icon",{name:"checkmark",class:"indicator"}),h("div",{class:"details"},h("ezp-label",{class:"title",ellipsis:true,text:t.title}),t.meta!==""?h("ezp-label",{level:"tertiary",class:"meta",text:t.meta,ellipsis:true}):null))}})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}();EzpSelect.style=ezpSelectCss;var ezpStatusCss=":host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-backdrop);border-radius:var(--ezp-status-border-radius, 6px);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;-ms-flex-pack:center;justify-content:center;left:0;padding:var(--ezp-spacing-6);position:absolute;top:0;width:100%;z-index:9999}@media (prefers-color-scheme: dark){:host{--box-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#box{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);padding:var(--ezp-spacing-4) var(--ezp-spacing-5)}#indicator{-webkit-animation:rotate var(--ezp-duration-6) linear infinite;animation:rotate var(--ezp-duration-6) linear infinite;display:block;height:42px;-webkit-transform:rotate(0);transform:rotate(0);width:42px}#track{fill:none;stroke:var(--ezp-core-outline);stroke-width:4px}#value{-webkit-animation:offset var(--ezp-duration-6) linear alternate infinite;animation:offset var(--ezp-duration-6) linear alternate infinite;fill:none;stroke:var(--ezp-theme-solid);stroke-dasharray:110;stroke-dashoffset:110;stroke-linecap:round;stroke-width:4px}#description{color:var(--ezp-core-foreground-primary)}#footer{display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}@-webkit-keyframes offset{100%{stroke-dashoffset:55}}@keyframes offset{100%{stroke-dashoffset:55}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";var EzpStatus=function(){function e(e){var t=this;registerInstance(this,e);this.statusCancel=createEvent(this,"statusCancel",7);this.statusClose=createEvent(this,"statusClose",7);this.statusRetry=createEvent(this,"statusRetry",7);this.description="Description";this.processing=false;this.handleCancel=function(){t.statusCancel.emit(t.instance)};this.handleClose=function(){t.statusClose.emit(t.instance)};this.handleRetry=function(){t.statusRetry.emit(t.instance)}}e.prototype.componentWillLoad=function(){};e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},this.processing?h("svg",{id:"indicator",viewBox:"0 0 42 42",xmlns:"http://www.w3.org/2000/svg"},h("circle",{id:"track",cx:"21",cy:"21",r:"18"}),h("circle",{id:"value",cx:"21",cy:"21",r:"18"})):this.icon?h("ezp-icon",{name:this.icon,framed:true}):null,h("ezp-label",{id:"description",level:"tertiary",weight:"strong",text:this.description}),(this.cancel||this.close||this.retry)&&h("div",{id:"footer"},this.cancel&&h("ezp-text-button",{level:"secondary",small:true,onClick:this.handleCancel,label:typeof this.cancel==="string"?this.cancel:i18next.t("button_actions.cancel")}),this.close&&h("ezp-text-button",{level:this.retry?"secondary":"primary",small:true,onClick:this.handleClose,label:typeof this.close==="string"?this.close:i18next.t("button_actions.close")}),this.retry&&h("ezp-text-button",{level:"primary",small:true,onClick:this.handleRetry,label:typeof this.retry==="string"?this.retry:i18next.t("button_actions.retry")}))))};return e}();EzpStatus.style=ezpStatusCss;var ezpStepperCss=':host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-stepper-gridTemplate, auto/auto 1fr auto);padding:0 var(--ezp-spacing-2) 0 var(--ezp-spacing-3);position:relative;z-index:0}:host(.focused){--ezp-stepper-icon-color:var(--ezp-theme-solid);--ezp-stepper-label-color:var(--ezp-theme-solid)}:host(.has-icon){--ezp-stepper-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--ezp-stepper-toggle-background, transparent);border-radius:3px;cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}@media (hover: hover){#toggle:hover{--ezp-stepper-toggle-background:var(--ezp-core-shade-primary)}}#icon{color:var(--ezp-stepper-icon-color, var(--ezp-core-foreground-secondary));pointer-events:none}#label{color:var(--ezp-stepper-label-color, var(--ezp-core-foreground-secondary));pointer-events:none}#input{-moz-appearance:textfield;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0;pointer-events:none;text-align:right;width:100%}#input::-webkit-outer-spin-button,#input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.buttons{display:-ms-flexbox;display:flex}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-stepper-button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-stepper-button-color, var(--ezp-theme-solid));cursor:var(--ezp-stepper-button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--ezp-stepper-button-background:var(--ezp-core-shade-primary)}.button:not(:disabled):active{--ezp-stepper-button-background:var(--ezp-core-shade-secondary)}}.button:disabled{--ezp-stepper-button-color:var(--ezp-core-foreground-tertiary);--ezp-stepper-button-cursor:default}';var EzpStepper=function(){function e(e){var t=this;registerInstance(this,e);this.stepperChanged=createEvent(this,"stepperChanged",7);this.label="Label";this.min=1;this.canDecrease=true;this.canIncrease=true;this.focused=false;this.value=1;this.handleDecrease=function(){t.value--};this.handleIncrease=function(){t.value++};this.handleInput=function(){t.value=t.input.value!==""?parseInt(t.input.value):t.min};this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.watchValue=function(){this.canIncrease=this.max!==undefined?this.value<this.max:true;this.canDecrease=this.min!==undefined?this.value>this.min:true;this.stepperChanged.emit(this.value)};e.prototype.componentWillLoad=function(){this.watchValue()};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(this.focused?"focused":""," ").concat(this.icon?"has-icon":"")},h("div",{id:"toggle",onClick:this.setFocus}),this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,text:this.label}),h("input",{id:"input",type:"number",ref:function(t){return e.input=t},min:this.min.toString(),max:this.max.toString(),value:this.value.toString(),onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),h("div",{class:"buttons"},h("button",{class:"button",disabled:!this.canDecrease,onClick:this.handleDecrease},h("ezp-icon",{name:"minus"})),h("button",{class:"button",disabled:!this.canIncrease,onClick:this.handleIncrease},h("ezp-icon",{name:"plus"}))))};Object.defineProperty(e,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:false,configurable:true});return e}();EzpStepper.style=ezpStepperCss;var ezpTextButtonCss=":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-init:var(--ezp-theme-solid);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-white-100);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-core-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-hover:var(--ezp-core-shade-secondary);--ezp-textButton-background-init:var(--ezp-core-shade-primary);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var(\n --ezp-textButton-background-hover,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var(\n --ezp-textButton-background-active,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}";var EzpTextButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary";this.small=false}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:"".concat(this.level)},h(e,Object.assign({id:"button"},t),h("ezp-label",{id:"label",weight:"heavy",text:this.label,level:this.small?"tertiary":"secondary"})))};return e}();EzpTextButton.style=ezpTextButtonCss;var ezpUploadCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-upload-background, transparent);border:1px dashed var(--ezp-upload-border-color, var(--ezp-core-foreground-tertiary));border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:grid;grid-template:auto/minmax(auto, 280px);height:var(--ezp-upload-height, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);position:relative;-webkit-transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);width:var(--ezp-upload-width, auto)}:host(.dragging){--ezp-upload-background:var(--ezp-theme-translucent);--ezp-upload-border-color:var(--ezp-theme-translucent);--ezp-upload-header-blur:16px;--ezp-upload-header-opacity:0.42}#header{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-webkit-filter:blur(var(--ezp-upload-header-blur, 0));filter:blur(var(--ezp-upload-header-blur, 0));-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);opacity:var(--ezp-upload-header-opacity, 1);text-align:center;-webkit-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart)}#meta{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--ezp-spacing-3) 3px;-ms-flex-pack:center;justify-content:center}#select{color:var(--ezp-theme-solid);cursor:pointer;opacity:var(--ezp-upload-select-opacity, 1);text-decoration:underline;white-space:nowrap}@media (hover: hover){#select:hover{--ezp-upload-select-opacity:0.58}}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}";var EzpUpload=function(){function e(e){var t=this;registerInstance(this,e);this.uploadFile=createEvent(this,"uploadFile",7);this.filename="";this.dragging=false;this.handleInput=function(){t.filename=t.input.files[0].name;t.uploadFile.emit(t.input.files)}}e.prototype.handleDragEnter=function(){this.dragging=true};e.prototype.handleDragOver=function(e){e.stopPropagation();e.preventDefault();e.dataTransfer.dropEffect="copy"};e.prototype.handleDragLeave=function(){this.dragging=false};e.prototype.handleDrop=function(e){e.stopPropagation();e.preventDefault();this.dragging=false;this.filename=e.dataTransfer.files[0].name;this.uploadFile.emit(e.dataTransfer.files)};e.prototype.listenPrintCancel=function(){this.form.reset();this.filename=""};e.prototype.render=function(){var e=this;return h(Host,{class:{dragging:this.dragging}},h("form",{id:"form",ref:function(t){return e.form=t}},h("div",{id:"header"},h("ezp-icon",{name:"drag-drop",size:"huge",framed:true}),h("ezp-label",{weight:"strong",text:i18next.t("upload.description")}),h("div",{id:"meta"},h("ezp-label",{level:"tertiary",text:i18next.t("upload.meta_leading")}),h("label",{htmlFor:"input",id:"select"},h("ezp-label",{level:"tertiary",weight:"strong",text:i18next.t("upload.meta_select")})),h("input",{type:"file",name:"input",id:"input",ref:function(t){return e.input=t},onInput:this.handleInput}),h("ezp-label",{level:"tertiary",text:i18next.t("upload.meta_trailing")})),this.filename!=""&&h(Fragment,null,h("ezp-label",{level:"secondary",text:i18next.t("upload.selected_file")}),h("ezp-label",{level:"tertiary",text:this.filename})))))};return e}();EzpUpload.style=ezpUploadCss;var ezpUserMenuCss=":host{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));display:block;opacity:var(--ezp-userMenu-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));visibility:var(--ezp-userMenu-visibility, hidden);z-index:5}:host(.is-open){--ezp-userMenu-opacity:1;--ezp-userMenu-scale:1, 1;--ezp-userMenu-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart),\n transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-userMenu-visibility:visible}@media (prefers-color-scheme: dark){:host{--ezp-userMenu-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4)}#name{color:var(--ezp-core-foreground-primary)}#close{margin:calc(var(--ezp-spacing-3) * -1) 0}#links{-webkit-box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--ezp-spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--ezp-userMenu-link-background, transparent);border-radius:3px;color:var(--ezp-core-foreground-primary);cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;padding:var(--ezp-spacing-3);text-decoration:none}.link:hover{--ezp-userMenu-link-background:var(--ezp-core-shade-primary)}.link__icon{color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0}.caption{color:var(--ezp-core-foreground-primary)}#theme{-webkit-box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--ezp-spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-swatch-background, transparent);border:0;border-radius:50%;color:var(--ezp-userMenu-swatch-color);cursor:var(--ezp-userMenu-swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-userMenu-swatch-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent)}.swatch:not(.selected):active{--ezp-userMenu-swatch-opacity:0.74}}.swatch.selected{--ezp-userMenu-dot-boxShadowSize:10px;--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent);--ezp-userMenu-swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--ezp-duration-2) ease-in-out;animation:dot-bounce var(--ezp-duration-2) ease-in-out}.swatch--blue{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-blue-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-blue-translucent)}.swatch--cyan{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-cyan-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-cyan-translucent)}.swatch--green{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-green-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-green-translucent)}.swatch--teal{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-teal-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-teal-translucent)}.swatch--orange{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-orange-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-orange-translucent)}.swatch--pink{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-pink-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-pink-translucent)}.swatch--red{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-red-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-red-translucent)}.swatch--violet{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-violet-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-violet-translucent)}.dot{background:var(--ezp-userMenu-dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--ezp-duration-2);transition:-webkit-box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2), -webkit-box-shadow var(--ezp-duration-2);width:18px}#appearance{display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--ezp-spacing-2) * -1)}.tab{--ezp-icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-tab-background, transparent);border:0;border-radius:14px;color:var(--ezp-userMenu-tab-color, var(--ezp-core-foreground-secondary));cursor:var(--ezp-userMenu-tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--ezp-userMenu-tab-background:var(--ezp-core-shade-primary)}.tab:not(.selected):active{--ezp-userMenu-tab-background:var(--ezp-core-shade-secondary)}}.tab.selected{--ezp-userMenu-tab-background:var(--ezp-theme-translucent);--ezp-userMenu-tab-color:var(--ezp-theme-solid);--ezp-userMenu-tab-cursor:normal}@-webkit-keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}";var EzpUserMenu=function(){function e(e){var t=this;registerInstance(this,e);this.userMenuClosure=createEvent(this,"userMenuClosure",7);this.logoutEmitter=createEvent(this,"logoutEmitter",7);this.backdrop=document.createElement("ezp-backdrop");this.links=[{title:i18next.t("user_menu.account"),icon:"account",href:"https://app.ezeep.com"},{title:i18next.t("user_menu.help"),icon:"help",href:"https://support.ezeep.com"}];this.themes=["pink","red","orange","green","teal","cyan","blue","violet"];this.appearances=[{title:i18next.t("user_menu.system"),name:"system"},{title:i18next.t("user_menu.light"),name:"light"},{title:i18next.t("user_menu.dark"),name:"dark"}];this.name="John Doe";this.open=false;this.handleClose=function(){t.userMenuClosure.emit()};this.logOut=function(){localStorage.removeItem("properties");localStorage.removeItem("refreshToken");localStorage.removeItem("access_token");localStorage.removeItem("printer");localStorage.removeItem("isAuthorized");authStore.state.isAuthorized=false;t.logoutEmitter.emit()};this.handleTheme=function(e){userStore.state.theme=e};this.handleAppearance=function(e){userStore.state.appearance=e}}e.prototype.watchOpen=function(){if(this.open){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false;this.userMenuClosure.emit()}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.open=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}))};e.prototype.render=function(){var e=this;return h(Host,{class:this.open?"is-open":""},h("div",{id:"header"},h("ezp-label",{ellipsis:true,id:"name",weight:"heavy",text:this.name}),h("ezp-icon-button",{id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),h("div",{id:"links"},this.links.map((function(e){return h("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},h("ezp-icon",{class:"link__icon",name:e.icon}),h("ezp-label",{text:e.title}))})),h("a",{class:"link",onClick:this.logOut},h("ezp-icon",{class:"link__icon",name:"logout"}),h("ezp-label",{text:i18next.t("user_menu.logout")}))),h("div",{id:"theme"},h("ezp-label",{class:"caption",text:"".concat(i18next.t("user_menu.theme"),":"),weight:"heavy"}),h("div",{id:"swatches"},this.themes.map((function(t){return h("button",{class:"swatch swatch--".concat(t," ").concat(t===userStore.state.theme?"selected":""),onClick:function(){return e.handleTheme(t)}},h("span",{class:"dot"}))})))),h("div",{id:"appearance"},h("ezp-label",{class:"caption",text:"".concat(i18next.t("user_menu.appearance"),":"),weight:"heavy"}),h("div",{id:"tabs"},this.appearances.map((function(t){return h("button",{class:"tab ".concat(t.name===userStore.state.appearance?"selected":""),onClick:function(){return e.handleAppearance(t.name)}},h("ezp-icon",{name:t.name}),h("ezp-label",{text:t.title,level:"tertiary",weight:"strong"}))})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["watchOpen"]}},enumerable:false,configurable:true});return e}();EzpUserMenu.style=ezpUserMenuCss;export{EzpAuth as ezp_auth,EzpBackdrop as ezp_backdrop,EzpDialog as ezp_dialog,EzpIcon as ezp_icon,EzpIconButton as ezp_icon_button,EzpInput as ezp_input,EzpLabel as ezp_label,EzpPrinterSelection as ezp_printer_selection,EzpPrinting as ezp_printing,EzpSelect as ezp_select,EzpStatus as ezp_status,EzpStepper as ezp_stepper,EzpTextButton as ezp_text_button,EzpUpload as ezp_upload,EzpUserMenu as ezp_user_menu};
|
|
21
|
+
*/var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==undefined?global$1.TYPED_ARRAY_SUPPORT:true;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(t)}e.length=t}return e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,t,r)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,t,r,a){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return fromArrayBuffer(e,t,r,a)}if(typeof t==="string"){return fromString(e,t,r)}return fromObject(e,t)}Buffer.from=function(e,t,r){return from(null,e,t,r)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,t,r,a){assertSize(t);if(t<=0){return createBuffer(e,t)}if(r!==undefined){return typeof a==="string"?createBuffer(e,t).fill(r,a):createBuffer(e,t).fill(r)}return createBuffer(e,t)}Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)};function allocUnsafe(e,t){assertSize(t);e=createBuffer(e,t<0?0:checked(t)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var a=byteLength(t,r)|0;e=createBuffer(e,a);var n=e.write(t,r);if(n!==a){e=e.slice(0,n)}return e}function fromArrayLike(e,t){var r=t.length<0?0:checked(t.length)|0;e=createBuffer(e,r);for(var a=0;a<r;a+=1){e[a]=t[a]&255}return e}function fromArrayBuffer(e,t,r,a){if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(a||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&a===undefined){t=new Uint8Array(t)}else if(a===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,a)}if(Buffer.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,t)}return e}function fromObject(e,t){if(internalIsBuffer(t)){var r=checked(t.length)|0;e=createBuffer(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||isnan(t.length)){return createBuffer(e,0)}return fromArrayLike(e,t)}if(t.type==="Buffer"&&isArray(t.data)){return fromArrayLike(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function e(t,r){if(!internalIsBuffer(t)||!internalIsBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var a=t.length;var n=r.length;for(var i=0,o=Math.min(a,n);i<o;++i){if(t[i]!==r[i]){a=t[i];n=r[i];break}}if(a<n)return-1;if(n<a)return 1;return 0};Buffer.isEncoding=function e(t){switch(String(t).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 true;default:return false}};Buffer.concat=function e(t,r){if(!isArray(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return Buffer.alloc(0)}var a;if(r===undefined){r=0;for(a=0;a<t.length;++a){r+=t[a].length}}var n=Buffer.allocUnsafe(r);var i=0;for(a=0;a<t.length;++a){var o=t[a];if(!internalIsBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(n,i);i+=o.length}return n};function byteLength(e,t){if(internalIsBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var a=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(a)return utf8ToBytes(e).length;t=(""+t).toLowerCase();a=true}}}Buffer.byteLength=byteLength;function slowToString(e,t,r){var a=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();a=true}}}Buffer.prototype._isBuffer=true;function swap(e,t,r){var a=e[t];e[t]=e[r];e[r]=a}Buffer.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){swap(this,r,r+1)}return this};Buffer.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){swap(this,r,r+3);swap(this,r+1,r+2)}return this};Buffer.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){swap(this,r,r+7);swap(this,r+1,r+6);swap(this,r+2,r+5);swap(this,r+3,r+4)}return this};Buffer.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return utf8Slice(this,0,t);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function e(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return Buffer.compare(this,t)===0};Buffer.prototype.inspect=function e(){var t="";var r=INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return"<Buffer "+t+">"};Buffer.prototype.compare=function e(t,r,a,n,i){if(!internalIsBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(a===undefined){a=t?t.length:0}if(n===undefined){n=0}if(i===undefined){i=this.length}if(r<0||a>t.length||n<0||i>this.length){throw new RangeError("out of range index")}if(n>=i&&r>=a){return 0}if(n>=i){return-1}if(r>=a){return 1}r>>>=0;a>>>=0;n>>>=0;i>>>=0;if(this===t)return 0;var o=i-n;var s=a-r;var l=Math.min(o,s);var c=this.slice(n,i);var p=t.slice(r,a);for(var d=0;d<l;++d){if(c[d]!==p[d]){o=c[d];s=p[d];break}}if(o<s)return-1;if(s<o)return 1;return 0};function bidirectionalIndexOf(e,t,r,a,n){if(e.length===0)return-1;if(typeof r==="string"){a=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=n?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(n)return-1;else r=e.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof t==="string"){t=Buffer.from(t,a)}if(internalIsBuffer(t)){if(t.length===0){return-1}return arrayIndexOf(e,t,r,a,n)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return arrayIndexOf(e,[t],r,a,n)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,a,n){var i=1;var o=e.length;var s=t.length;if(a!==undefined){a=String(a).toLowerCase();if(a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le"){if(e.length<2||t.length<2){return-1}i=2;o/=2;s/=2;r/=2}}function l(e,t){if(i===1){return e[t]}else{return e.readUInt16BE(t*i)}}var c;if(n){var p=-1;for(c=r;c<o;c++){if(l(e,c)===l(t,p===-1?0:c-p)){if(p===-1)p=c;if(c-p+1===s)return p*i}else{if(p!==-1)c-=c-p;p=-1}}}else{if(r+s>o)r=o-s;for(c=r;c>=0;c--){var d=true;for(var u=0;u<s;u++){if(l(e,c+u)!==l(t,u)){d=false;break}}if(d)return c}}return-1}Buffer.prototype.includes=function e(t,r,a){return this.indexOf(t,r,a)!==-1};Buffer.prototype.indexOf=function e(t,r,a){return bidirectionalIndexOf(this,t,r,a,true)};Buffer.prototype.lastIndexOf=function e(t,r,a){return bidirectionalIndexOf(this,t,r,a,false)};function hexWrite(e,t,r,a){r=Number(r)||0;var n=e.length-r;if(!a){a=n}else{a=Number(a);if(a>n){a=n}}var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");if(a>i/2){a=i/2}for(var o=0;o<a;++o){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function utf8Write(e,t,r,a){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,a)}function asciiWrite(e,t,r,a){return blitBuffer(asciiToBytes(t),e,r,a)}function latin1Write(e,t,r,a){return asciiWrite(e,t,r,a)}function base64Write(e,t,r,a){return blitBuffer(base64ToBytes(t),e,r,a)}function ucs2Write(e,t,r,a){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,a)}Buffer.prototype.write=function e(t,r,a,n){if(r===undefined){n="utf8";a=this.length;r=0}else if(a===undefined&&typeof r==="string"){n=r;a=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(a)){a=a|0;if(n===undefined)n="utf8"}else{n=a;a=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var i=this.length-r;if(a===undefined||a>i)a=i;if(t.length>0&&(a<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return hexWrite(this,t,r,a);case"utf8":case"utf-8":return utf8Write(this,t,r,a);case"ascii":return asciiWrite(this,t,r,a);case"latin1":case"binary":return latin1Write(this,t,r,a);case"base64":return base64Write(this,t,r,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,r,a);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};Buffer.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,r){if(t===0&&r===e.length){return fromByteArray(e)}else{return fromByteArray(e.slice(t,r))}}function utf8Slice(e,t,r){r=Math.min(e.length,r);var a=[];var n=t;while(n<r){var i=e[n];var o=null;var s=i>239?4:i>223?3:i>191?2:1;if(n+s<=r){var l,c,p,d;switch(s){case 1:if(i<128){o=i}break;case 2:l=e[n+1];if((l&192)===128){d=(i&31)<<6|l&63;if(d>127){o=d}}break;case 3:l=e[n+1];c=e[n+2];if((l&192)===128&&(c&192)===128){d=(i&15)<<12|(l&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){o=d}}break;case 4:l=e[n+1];c=e[n+2];p=e[n+3];if((l&192)===128&&(c&192)===128&&(p&192)===128){d=(i&15)<<18|(l&63)<<12|(c&63)<<6|p&63;if(d>65535&&d<1114112){o=d}}}}if(o===null){o=65533;s=1}else if(o>65535){o-=65536;a.push(o>>>10&1023|55296);o=56320|o&1023}a.push(o);n+=s}return decodeCodePointsArray(a)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,e)}var r="";var a=0;while(a<t){r+=String.fromCharCode.apply(String,e.slice(a,a+=MAX_ARGUMENTS_LENGTH))}return r}function asciiSlice(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n){a+=String.fromCharCode(e[n]&127)}return a}function latin1Slice(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n){a+=String.fromCharCode(e[n])}return a}function hexSlice(e,t,r){var a=e.length;if(!t||t<0)t=0;if(!r||r<0||r>a)r=a;var n="";for(var i=t;i<r;++i){n+=toHex(e[i])}return n}function utf16leSlice(e,t,r){var a=e.slice(t,r);var n="";for(var i=0;i<a.length;i+=2){n+=String.fromCharCode(a[i]+a[i+1]*256)}return n}Buffer.prototype.slice=function e(t,r){var a=this.length;t=~~t;r=r===undefined?a:~~r;if(t<0){t+=a;if(t<0)t=0}else if(t>a){t=a}if(r<0){r+=a;if(r<0)r=0}else if(r>a){r=a}if(r<t)r=t;var n;if(Buffer.TYPED_ARRAY_SUPPORT){n=this.subarray(t,r);n.__proto__=Buffer.prototype}else{var i=r-t;n=new Buffer(i,undefined);for(var o=0;o<i;++o){n[o]=this[o+t]}}return n};function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o<r&&(i*=256)){n+=this[t+o]*i}return n};Buffer.prototype.readUIntBE=function e(t,r,a){t=t|0;r=r|0;if(!a){checkOffset(t,r,this.length)}var n=this[t+--r];var i=1;while(r>0&&(i*=256)){n+=this[t+--r]*i}return n};Buffer.prototype.readUInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);return this[t]};Buffer.prototype.readUInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]|this[t+1]<<8};Buffer.prototype.readUInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]<<8|this[t+1]};Buffer.prototype.readUInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Buffer.prototype.readUInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Buffer.prototype.readIntLE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=this[t];var i=1;var o=0;while(++o<r&&(i*=256)){n+=this[t+o]*i}i*=128;if(n>=i)n-=Math.pow(2,8*r);return n};Buffer.prototype.readIntBE=function e(t,r,a){t=t|0;r=r|0;if(!a)checkOffset(t,r,this.length);var n=r;var i=1;var o=this[t+--n];while(n>0&&(i*=256)){o+=this[t+--n]*i}i*=128;if(o>=i)o-=Math.pow(2,8*r);return o};Buffer.prototype.readInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Buffer.prototype.readInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);var a=this[t]|this[t+1]<<8;return a&32768?a|4294901760:a};Buffer.prototype.readInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);var a=this[t+1]|this[t]<<8;return a&32768?a|4294901760:a};Buffer.prototype.readInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Buffer.prototype.readInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Buffer.prototype.readFloatLE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,true,23,4)};Buffer.prototype.readFloatBE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,false,23,4)};Buffer.prototype.readDoubleLE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,true,52,8)};Buffer.prototype.readDoubleBE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,false,52,8)};function checkInt(e,t,r,a,n,i){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function e(t,r,a,n){t=+t;r=r|0;a=a|0;if(!n){var i=Math.pow(2,8*a)-1;checkInt(this,t,r,a,i,0)}var o=1;var s=0;this[r]=t&255;while(++s<a&&(o*=256)){this[r+s]=t/o&255}return r+a};Buffer.prototype.writeUIntBE=function e(t,r,a,n){t=+t;r=r|0;a=a|0;if(!n){var i=Math.pow(2,8*a)-1;checkInt(this,t,r,a,i,0)}var o=a-1;var s=1;this[r+o]=t&255;while(--o>=0&&(s*=256)){this[r+o]=t/s&255}return r+a};Buffer.prototype.writeUInt8=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function objectWriteUInt16(e,t,r,a){if(t<0)t=65535+t+1;for(var n=0,i=Math.min(e.length-r,2);n<i;++n){e[r+n]=(t&255<<8*(a?n:1-n))>>>(a?n:1-n)*8}}Buffer.prototype.writeUInt16LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeUInt16BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};function objectWriteUInt32(e,t,r,a){if(t<0)t=4294967295+t+1;for(var n=0,i=Math.min(e.length-r,4);n<i;++n){e[r+n]=t>>>(a?n:3-n)*8&255}}Buffer.prototype.writeUInt32LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeUInt32BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};Buffer.prototype.writeIntLE=function e(t,r,a,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*a-1);checkInt(this,t,r,a,i-1,-i)}var o=0;var s=1;var l=0;this[r]=t&255;while(++o<a&&(s*=256)){if(t<0&&l===0&&this[r+o-1]!==0){l=1}this[r+o]=(t/s>>0)-l&255}return r+a};Buffer.prototype.writeIntBE=function e(t,r,a,n){t=+t;r=r|0;if(!n){var i=Math.pow(2,8*a-1);checkInt(this,t,r,a,i-1,-i)}var o=a-1;var s=1;var l=0;this[r+o]=t&255;while(--o>=0&&(s*=256)){if(t<0&&l===0&&this[r+o+1]!==0){l=1}this[r+o]=(t/s>>0)-l&255}return r+a};Buffer.prototype.writeInt8=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};Buffer.prototype.writeInt16LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeInt16BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};Buffer.prototype.writeInt32LE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeInt32BE=function e(t,r,a){t=+t;r=r|0;if(!a)checkInt(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};function checkIEEE754(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,a,n){if(!n){checkIEEE754(e,t,r,4)}write(e,t,r,a,23,4);return r+4}Buffer.prototype.writeFloatLE=function e(t,r,a){return writeFloat(this,t,r,true,a)};Buffer.prototype.writeFloatBE=function e(t,r,a){return writeFloat(this,t,r,false,a)};function writeDouble(e,t,r,a,n){if(!n){checkIEEE754(e,t,r,8)}write(e,t,r,a,52,8);return r+8}Buffer.prototype.writeDoubleLE=function e(t,r,a){return writeDouble(this,t,r,true,a)};Buffer.prototype.writeDoubleBE=function e(t,r,a){return writeDouble(this,t,r,false,a)};Buffer.prototype.copy=function e(t,r,a,n){if(!a)a=0;if(!n&&n!==0)n=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(n>0&&n<a)n=a;if(n===a)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(a<0||a>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(t.length-r<n-a){n=t.length-r+a}var i=n-a;var o;if(this===t&&a<r&&r<n){for(o=i-1;o>=0;--o){t[o+r]=this[o+a]}}else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(o=0;o<i;++o){t[o+r]=this[o+a]}}else{Uint8Array.prototype.set.call(t,this.subarray(a,a+i),r)}return i};Buffer.prototype.fill=function e(t,r,a,n){if(typeof t==="string"){if(typeof r==="string"){n=r;r=0;a=this.length}else if(typeof a==="string"){n=a;a=this.length}if(t.length===1){var i=t.charCodeAt(0);if(i<256){t=i}}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!Buffer.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<a){throw new RangeError("Out of range index")}if(a<=r){return this}r=r>>>0;a=a===undefined?this.length:a>>>0;if(!t)t=0;var o;if(typeof t==="number"){for(o=r;o<a;++o){this[o]=t}}else{var s=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString());var l=s.length;for(o=0;o<a-r;++o){this[o+r]=s[o%l]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(INVALID_BASE64_RE,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,t){t=t||Infinity;var r;var a=e.length;var n=null;var i=[];for(var o=0;o<a;++o){r=e.charCodeAt(o);if(r>55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)i.push(239,191,189);continue}else if(o+1===a){if((t-=3)>-1)i.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)i.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((t-=3)>-1)i.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return i}function asciiToBytes(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function utf16leToBytes(e,t){var r,a,n;var i=[];for(var o=0;o<e.length;++o){if((t-=2)<0)break;r=e.charCodeAt(o);a=r>>8;n=r%256;i.push(n);i.push(a)}return i}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,a){for(var n=0;n<a;++n){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}function escapeURLPath(e){var t=URLBuilder.parse(e);var r=t.getPath();r=r||"/";r=escape(r);t.setPath(r);return t.toString()}function getProxyUriFromDevConnString(e){var t="";if(e.search("DevelopmentStorageProxyUri=")!==-1){var r=e.split(";");for(var a=0,n=r;a<n.length;a++){var i=n[a];if(i.trim().startsWith("DevelopmentStorageProxyUri=")){t=i.trim().match("DevelopmentStorageProxyUri=(.*)")[1]}}}return t}function getValueInConnString(e,t){var r=e.split(";");for(var a=0,n=r;a<n.length;a++){var i=n[a];if(i.trim().startsWith(t)){return i.trim().match(t+"=(.*)")[1]}}return""}function extractConnectionStringParts(e){var t="";if(e.startsWith("UseDevelopmentStorage=true")){t=getProxyUriFromDevConnString(e);e=DevelopmentConnectionString}var r=getValueInConnString(e,"BlobEndpoint");r=r.endsWith("/")?r.slice(0,-1):r;if(e.search("DefaultEndpointsProtocol=")!==-1&&e.search("AccountKey=")!==-1){var a="";var n="";var i=Buffer.from("accountKey","base64");var o="";n=getValueInConnString(e,"AccountName");i=Buffer.from(getValueInConnString(e,"AccountKey"),"base64");if(!r){a=getValueInConnString(e,"DefaultEndpointsProtocol");var s=a.toLowerCase();if(s!=="https"&&s!=="http"){throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'")}o=getValueInConnString(e,"EndpointSuffix");if(!o){throw new Error("Invalid EndpointSuffix in the provided Connection String")}r="".concat(a,"://").concat(n,".blob.").concat(o)}if(!n){throw new Error("Invalid AccountName in the provided Connection String")}else if(i.length===0){throw new Error("Invalid AccountKey in the provided Connection String")}return{kind:"AccountConnString",url:r,accountName:n,accountKey:i,proxyUri:t}}else{var l=getValueInConnString(e,"SharedAccessSignature");var n=getAccountNameFromUrl(r);if(!r){throw new Error("Invalid BlobEndpoint in the provided SAS Connection String")}else if(!l){throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String")}return{kind:"SASConnString",url:r,accountName:n,accountSas:l}}}function escape(e){return encodeURIComponent(e).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}function appendToURLPath(e,t){var r=URLBuilder.parse(e);var a=r.getPath();a=a?a.endsWith("/")?"".concat(a).concat(t):"".concat(a,"/").concat(t):t;r.setPath(a);return r.toString()}function setURLParameter(e,t,r){var a=URLBuilder.parse(e);a.setQueryParameter(t,r);return a.toString()}function getURLParameter(e,t){var r=URLBuilder.parse(e);return r.getQueryParameterValue(t)}function setURLHost(e,t){var r=URLBuilder.parse(e);r.setHost(t);return r.toString()}function getURLScheme(e){var t=URLBuilder.parse(e);return t.getScheme()}function appendToURLQuery(e,t){var r=URLBuilder.parse(e);var a=r.getQuery();if(a){a+="&"+t}else{a=t}r.setQuery(a);return r.toString()}function truncatedISO8061Date(e,t){if(t===void 0){t=true}var r=e.toISOString();return t?r.substring(0,r.length-1)+"0000"+"Z":r.substring(0,r.length-5)+"Z"}function base64encode(e){return!isNode?btoa(e):Buffer.from(e).toString("base64")}function generateBlockID(e,t){var r=48;var a=6;var n=r-a;if(e.length>n){e=e.slice(0,n)}var i=e+padStart(t.toString(),r-e.length,"0");return base64encode(i)}function delay(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(a){return[2,new Promise((function(a,n){var i;var o=function(){if(i!==undefined){clearTimeout(i)}n(r)};var s=function(){if(t!==undefined){t.removeEventListener("abort",o)}a()};i=setTimeout(s,e);if(t!==undefined){t.addEventListener("abort",o)}}))]}))}))}function padStart(e,t,r){if(r===void 0){r=" "}if(String.prototype.padStart){return e.padStart(t,r)}r=r||" ";if(e.length>t){return e}else{t=t-e.length;if(t>r.length){r+=r.repeat(t/r.length)}return r.slice(0,t)+e}}function iEqual(e,t){return e.toLocaleLowerCase()===t.toLocaleLowerCase()}function getAccountNameFromUrl(e){var t=URLBuilder.parse(e);var r;try{if(t.getHost().split(".")[1]==="blob"){r=t.getHost().split(".")[0]}else if(isIpEndpointStyle(t)){r=t.getPath().split("/")[1]}else{r=""}return r}catch(e){throw new Error("Unable to extract accountName with provided information.")}}function isIpEndpointStyle(e){if(e.getHost()===undefined){return false}var t=e.getHost()+(e.getPort()===undefined?"":":"+e.getPort());return/^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(t)}function toBlobTagsString(e){if(e===undefined){return undefined}var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var a=e[r];t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(a)))}}return t.join("&")}function toBlobTags(e){if(e===undefined){return undefined}var t={blobTagSet:[]};for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){var a=e[r];t.blobTagSet.push({key:r,value:a})}}return t}function toTags(e){if(e===undefined){return undefined}var t={};for(var r=0,a=e.blobTagSet;r<a.length;r++){var n=a[r];t[n.key]=n.value}return t}function toQuerySerialization(e){if(e===undefined){return undefined}switch(e.kind){case"csv":return{format:{type:"delimited",delimitedTextConfiguration:{columnSeparator:e.columnSeparator||",",fieldQuote:e.fieldQuote||"",recordSeparator:e.recordSeparator,escapeChar:e.escapeCharacter||"",headersPresent:e.hasHeaders||false}}};case"json":return{format:{type:"json",jsonTextConfiguration:{recordSeparator:e.recordSeparator}}};case"arrow":return{format:{type:"arrow",arrowConfiguration:{schema:e.schema}}};case"parquet":return{format:{type:"parquet"}};default:throw Error("Invalid BlobQueryTextConfiguration.")}}function parseObjectReplicationRecord(e){if(!e){return undefined}if("policy-id"in e){return undefined}var t=[];var r=function(r){var a=r.split("_");var n="or-";if(a[0].startsWith(n)){a[0]=a[0].substring(n.length)}var i={ruleId:a[1],replicationStatus:e[r]};var o=t.findIndex((function(e){return e.policyId===a[0]}));if(o>-1){t[o].rules.push(i)}else{t.push({policyId:a[0],rules:[i]})}};for(var a in e){r(a)}return t}function attachCredential(e,t){e.credential=t;return e}function httpAuthorizationToString(e){return e?e.scheme+" "+e.value:undefined}var StorageBrowserPolicy=function(e){__extends(t,e);function t(t,r){return e.call(this,t,r)||this}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(isNode){return[2,this._nextPolicy.sendRequest(e)]}if(e.method.toUpperCase()==="GET"||e.method.toUpperCase()==="HEAD"){e.url=setURLParameter(e.url,URLConstants.Parameters.FORCE_BROWSER_NO_CACHE,(new Date).getTime().toString())}e.headers.remove(HeaderConstants.COOKIE);e.headers.remove(HeaderConstants.CONTENT_LENGTH);return[2,this._nextPolicy.sendRequest(e)]}))}))};return t}(BaseRequestPolicy);var StorageBrowserPolicyFactory=function(){function e(){}e.prototype.create=function(e,t){return new StorageBrowserPolicy(e,t)};return e}();var StorageRetryPolicyType;(function(e){e[e["EXPONENTIAL"]=0]="EXPONENTIAL";e[e["FIXED"]=1]="FIXED"})(StorageRetryPolicyType||(StorageRetryPolicyType={}));var DEFAULT_RETRY_OPTIONS={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:StorageRetryPolicyType.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:undefined};var RETRY_ABORT_ERROR=new AbortError("The operation was aborted.");var StorageRetryPolicy=function(e){__extends(t,e);function t(t,r,a){if(a===void 0){a=DEFAULT_RETRY_OPTIONS}var n=e.call(this,t,r)||this;n.retryOptions={retryPolicyType:a.retryPolicyType?a.retryPolicyType:DEFAULT_RETRY_OPTIONS.retryPolicyType,maxTries:a.maxTries&&a.maxTries>=1?Math.floor(a.maxTries):DEFAULT_RETRY_OPTIONS.maxTries,tryTimeoutInMs:a.tryTimeoutInMs&&a.tryTimeoutInMs>=0?a.tryTimeoutInMs:DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,retryDelayInMs:a.retryDelayInMs&&a.retryDelayInMs>=0?Math.min(a.retryDelayInMs,a.maxRetryDelayInMs?a.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs):DEFAULT_RETRY_OPTIONS.retryDelayInMs,maxRetryDelayInMs:a.maxRetryDelayInMs&&a.maxRetryDelayInMs>=0?a.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,secondaryHost:a.secondaryHost?a.secondaryHost:DEFAULT_RETRY_OPTIONS.secondaryHost};return n}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.attemptSendRequest(e,false,1)]}))}))};t.prototype.attemptSendRequest=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=e.clone();n=t||!this.retryOptions.secondaryHost||!(e.method==="GET"||e.method==="HEAD"||e.method==="OPTIONS")||r%2===1;if(!n){a.url=setURLHost(a.url,this.retryOptions.secondaryHost)}if(this.retryOptions.tryTimeoutInMs){a.url=setURLParameter(a.url,URLConstants.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString())}s.label=1;case 1:s.trys.push([1,3,,4]);logger.info("RetryPolicy: =====> Try=".concat(r," ").concat(n?"Primary":"Secondary"));return[4,this._nextPolicy.sendRequest(a)];case 2:i=s.sent();if(!this.shouldRetry(n,r,i)){return[2,i]}t=t||!n&&i.status===404;return[3,4];case 3:o=s.sent();logger.error("RetryPolicy: Caught error, message: ".concat(o.message,", code: ").concat(o.code));if(!this.shouldRetry(n,r,i,o)){throw o}return[3,4];case 4:return[4,this.delay(n,r,e.abortSignal)];case 5:s.sent();return[2,this.attemptSendRequest(e,t,++r)]}}))}))};t.prototype.shouldRetry=function(e,t,r,a){if(t>=this.retryOptions.maxTries){logger.info("RetryPolicy: Attempt(s) ".concat(t," >= maxTries ").concat(this.retryOptions.maxTries,", no further try."));return false}var n=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(a){for(var i=0,o=n;i<o.length;i++){var s=o[i];if(a.name.toUpperCase().includes(s)||a.message.toUpperCase().includes(s)||a.code&&a.code.toString().toUpperCase()===s){logger.info("RetryPolicy: Network error ".concat(s," found, will retry."));return true}}}if(r||a){var l=r?r.status:a?a.statusCode:0;if(!e&&l===404){logger.info("RetryPolicy: Secondary access with 404, will retry.");return true}if(l===503||l===500){logger.info("RetryPolicy: Will retry for status code ".concat(l,"."));return true}}if((a===null||a===void 0?void 0:a.code)==="PARSE_ERROR"&&(a===null||a===void 0?void 0:a.message.startsWith('Error "Error: Unclosed root tag'))){logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");return true}return false};t.prototype.delay=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(n){a=0;if(e){switch(this.retryOptions.retryPolicyType){case StorageRetryPolicyType.EXPONENTIAL:a=Math.min((Math.pow(2,t-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case StorageRetryPolicyType.FIXED:a=this.retryOptions.retryDelayInMs;break}}else{a=Math.random()*1e3}logger.info("RetryPolicy: Delay for ".concat(a,"ms"));return[2,delay(a,r,RETRY_ABORT_ERROR)]}))}))};return t}(BaseRequestPolicy);var StorageRetryPolicyFactory=function(){function e(e){this.retryOptions=e}e.prototype.create=function(e,t){return new StorageRetryPolicy(e,t,this.retryOptions)};return e}();var CredentialPolicy=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.sendRequest=function(e){return this._nextPolicy.sendRequest(this.signRequest(e))};t.prototype.signRequest=function(e){return e};return t}(BaseRequestPolicy);var AnonymousCredentialPolicy=function(e){__extends(t,e);function t(t,r){return e.call(this,t,r)||this}return t}(CredentialPolicy);var Credential=function(){function e(){}e.prototype.create=function(e,t){throw new Error("Method should be implemented in children classes.")};return e}();var AnonymousCredential=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.create=function(e,t){return new AnonymousCredentialPolicy(e,t)};return t}(Credential);var TelemetryPolicy=function(e){__extends(t,e);function t(t,r,a){var n=e.call(this,t,r)||this;n.telemetry=a;return n}t.prototype.sendRequest=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(isNode){if(!e.headers){e.headers=new HttpHeaders}if(!e.headers.get(HeaderConstants.USER_AGENT)){e.headers.set(HeaderConstants.USER_AGENT,this.telemetry)}}return[2,this._nextPolicy.sendRequest(e)]}))}))};return t}(BaseRequestPolicy);var TelemetryPolicyFactory=function(){function e(e){var t=[];if(isNode){if(e){var r=e.userAgentPrefix||"";if(r.length>0&&t.indexOf(r)===-1){t.push(r)}}var a="azsdk-js-storageblob/".concat(SDK_VERSION);if(t.indexOf(a)===-1){t.push(a)}var n="(NODE-VERSION ".concat(process.version,"; ").concat(undefined()," ").concat(undefined(),")");if(t.indexOf(n)===-1){t.push(n)}}this.telemetryString=t.join(" ")}e.prototype.create=function(e,t){return new TelemetryPolicy(e,t,this.telemetryString)};return e}();var _defaultHttpClient=new XhrHttpClient;function getCachedDefaultHttpClient(){return _defaultHttpClient}function isPipelineLike(e){if(!e||typeof e!=="object"){return false}var t=e;return Array.isArray(t.factories)&&typeof t.options==="object"&&typeof t.toServiceClientOptions==="function"}var Pipeline=function(){function e(e,t){if(t===void 0){t={}}this.factories=e;this.options=Object.assign(Object.assign({},t),{httpClient:t.httpClient||getCachedDefaultHttpClient()})}e.prototype.toServiceClientOptions=function(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}};return e}();function newPipeline(e,t){if(t===void 0){t={}}if(e===undefined){e=new AnonymousCredential}var r=new TelemetryPolicyFactory(t.userAgentOptions);var a=[tracingPolicy({userAgent:r.telemetryString}),keepAlivePolicy(t.keepAliveOptions),r,generateClientRequestIdPolicy(),new StorageBrowserPolicyFactory,new StorageRetryPolicyFactory(t.retryOptions),deserializationPolicy(undefined,{xmlCharKey:"#"}),logPolicy({logger:logger.info,allowedHeaderNames:StorageBlobLoggingAllowedHeaderNames,allowedQueryParameters:StorageBlobLoggingAllowedQueryParameters})];if(isNode){a.push(proxyPolicy());a.push(disableResponseDecompressionPolicy())}a.push(isTokenCredential(e)?attachCredential(bearerTokenAuthenticationPolicy(e,StorageOAuthScopes),e):e);return new Pipeline(a,t)}var StorageSharedKeyCredential=function(){function e(){}return e}();var packageName="azure-storage-blob";var packageVersion="12.8.0";var StorageClientContext=function(e){__extends(t,e);function t(t,r){var a=this;if(t===undefined){throw new Error("'url' cannot be null")}if(!r){r={}}if(!r.userAgent){var n=getDefaultUserAgentValue();r.userAgent="".concat(packageName,"/").concat(packageVersion," ").concat(n)}a=e.call(this,undefined,r)||this;a.requestContentType="application/json; charset=utf-8";a.baseUri=r.endpoint||"{url}";a.url=t;a.version=r.version||"2020-10-02";return a}return t}(ServiceClient);var StorageClient=function(){function e(e,t){this.url=escapeURLPath(e);this.accountName=getAccountNameFromUrl(e);this.pipeline=t;this.storageClientContext=new StorageClientContext(this.url,t.toServiceClientOptions());this.isHttps=iEqual(getURLScheme(this.url)||"","https");this.credential=new AnonymousCredential;for(var r=0,a=this.pipeline.factories;r<a.length;r++){var n=a[r];if(isNode&&n instanceof StorageSharedKeyCredential||n instanceof AnonymousCredential){this.credential=n}else if(isTokenCredential(n.credential)){this.credential=n.credential}}var i=this.storageClientContext;i.requestContentType=undefined}return e}();var createSpan=createSpanFunction({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function convertTracingToRequestOptionsBase(e){var t,r;return{spanOptions:(t=e===null||e===void 0?void 0:e.tracingOptions)===null||t===void 0?void 0:t.spanOptions,tracingContext:(r=e===null||e===void 0?void 0:e.tracingOptions)===null||r===void 0?void 0:r.tracingContext}}var BlobSASPermissions=function(){function e(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false}e.parse=function(t){var r=new e;for(var a=0,n=t;a<n.length;a++){var i=n[a];switch(i){case"r":r.read=true;break;case"a":r.add=true;break;case"c":r.create=true;break;case"w":r.write=true;break;case"d":r.delete=true;break;case"x":r.deleteVersion=true;break;case"t":r.tag=true;break;case"m":r.move=true;break;case"e":r.execute=true;break;case"i":r.setImmutabilityPolicy=true;break;default:throw new RangeError("Invalid permission: ".concat(i))}}return r};e.from=function(t){var r=new e;if(t.read){r.read=true}if(t.add){r.add=true}if(t.create){r.create=true}if(t.write){r.write=true}if(t.delete){r.delete=true}if(t.deleteVersion){r.deleteVersion=true}if(t.tag){r.tag=true}if(t.move){r.move=true}if(t.execute){r.execute=true}if(t.setImmutabilityPolicy){r.setImmutabilityPolicy=true}return r};e.prototype.toString=function(){var e=[];if(this.read){e.push("r")}if(this.add){e.push("a")}if(this.create){e.push("c")}if(this.write){e.push("w")}if(this.delete){e.push("d")}if(this.deleteVersion){e.push("x")}if(this.tag){e.push("t")}if(this.move){e.push("m")}if(this.execute){e.push("e")}if(this.setImmutabilityPolicy){e.push("i")}return e.join("")};return e}();var ContainerSASPermissions=function(){function e(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false}e.parse=function(t){var r=new e;for(var a=0,n=t;a<n.length;a++){var i=n[a];switch(i){case"r":r.read=true;break;case"a":r.add=true;break;case"c":r.create=true;break;case"w":r.write=true;break;case"d":r.delete=true;break;case"l":r.list=true;break;case"t":r.tag=true;break;case"x":r.deleteVersion=true;break;case"m":r.move=true;break;case"e":r.execute=true;break;case"i":r.setImmutabilityPolicy=true;break;default:throw new RangeError("Invalid permission ".concat(i))}}return r};e.from=function(t){var r=new e;if(t.read){r.read=true}if(t.add){r.add=true}if(t.create){r.create=true}if(t.write){r.write=true}if(t.delete){r.delete=true}if(t.list){r.list=true}if(t.deleteVersion){r.deleteVersion=true}if(t.tag){r.tag=true}if(t.move){r.move=true}if(t.execute){r.execute=true}if(t.setImmutabilityPolicy){r.setImmutabilityPolicy=true}return r};e.prototype.toString=function(){var e=[];if(this.read){e.push("r")}if(this.add){e.push("a")}if(this.create){e.push("c")}if(this.write){e.push("w")}if(this.delete){e.push("d")}if(this.deleteVersion){e.push("x")}if(this.list){e.push("l")}if(this.tag){e.push("t")}if(this.move){e.push("m")}if(this.execute){e.push("e")}if(this.setImmutabilityPolicy){e.push("i")}return e.join("")};return e}();var UserDelegationKeyCredential=function(){function e(){}return e}();function ipRangeToString(e){return e.end?"".concat(e.start,"-").concat(e.end):e.start}var SASProtocol;(function(e){e["Https"]="https";e["HttpsAndHttp"]="https,http"})(SASProtocol||(SASProtocol={}));var SASQueryParameters=function(){function e(e,t,r,a,n,i,o,s,l,c,p,d,u,m,f,h,g,y,b){this.version=e;this.signature=t;if(r!==undefined&&typeof r!=="string"){this.permissions=r.permissions;this.services=r.services;this.resourceTypes=r.resourceTypes;this.protocol=r.protocol;this.startsOn=r.startsOn;this.expiresOn=r.expiresOn;this.ipRangeInner=r.ipRange;this.identifier=r.identifier;this.resource=r.resource;this.cacheControl=r.cacheControl;this.contentDisposition=r.contentDisposition;this.contentEncoding=r.contentEncoding;this.contentLanguage=r.contentLanguage;this.contentType=r.contentType;if(r.userDelegationKey){this.signedOid=r.userDelegationKey.signedObjectId;this.signedTenantId=r.userDelegationKey.signedTenantId;this.signedStartsOn=r.userDelegationKey.signedStartsOn;this.signedExpiresOn=r.userDelegationKey.signedExpiresOn;this.signedService=r.userDelegationKey.signedService;this.signedVersion=r.userDelegationKey.signedVersion;this.preauthorizedAgentObjectId=r.preauthorizedAgentObjectId;this.correlationId=r.correlationId}}else{this.services=a;this.resourceTypes=n;this.expiresOn=s;this.permissions=r;this.protocol=i;this.startsOn=o;this.ipRangeInner=l;this.identifier=c;this.resource=p;this.cacheControl=d;this.contentDisposition=u;this.contentEncoding=m;this.contentLanguage=f;this.contentType=h;if(g){this.signedOid=g.signedObjectId;this.signedTenantId=g.signedTenantId;this.signedStartsOn=g.signedStartsOn;this.signedExpiresOn=g.signedExpiresOn;this.signedService=g.signedService;this.signedVersion=g.signedVersion;this.preauthorizedAgentObjectId=y;this.correlationId=b}}}Object.defineProperty(e.prototype,"ipRange",{get:function(){if(this.ipRangeInner){return{end:this.ipRangeInner.end,start:this.ipRangeInner.start}}return undefined},enumerable:false,configurable:true});e.prototype.toString=function(){var e=["sv","ss","srt","spr","st","se","sip","si","skoid","sktid","skt","ske","sks","skv","sr","sp","sig","rscc","rscd","rsce","rscl","rsct","saoid","scid"];var t=[];for(var r=0,a=e;r<a.length;r++){var n=a[r];switch(n){case"sv":this.tryAppendQueryParameter(t,n,this.version);break;case"ss":this.tryAppendQueryParameter(t,n,this.services);break;case"srt":this.tryAppendQueryParameter(t,n,this.resourceTypes);break;case"spr":this.tryAppendQueryParameter(t,n,this.protocol);break;case"st":this.tryAppendQueryParameter(t,n,this.startsOn?truncatedISO8061Date(this.startsOn,false):undefined);break;case"se":this.tryAppendQueryParameter(t,n,this.expiresOn?truncatedISO8061Date(this.expiresOn,false):undefined);break;case"sip":this.tryAppendQueryParameter(t,n,this.ipRange?ipRangeToString(this.ipRange):undefined);break;case"si":this.tryAppendQueryParameter(t,n,this.identifier);break;case"skoid":this.tryAppendQueryParameter(t,n,this.signedOid);break;case"sktid":this.tryAppendQueryParameter(t,n,this.signedTenantId);break;case"skt":this.tryAppendQueryParameter(t,n,this.signedStartsOn?truncatedISO8061Date(this.signedStartsOn,false):undefined);break;case"ske":this.tryAppendQueryParameter(t,n,this.signedExpiresOn?truncatedISO8061Date(this.signedExpiresOn,false):undefined);break;case"sks":this.tryAppendQueryParameter(t,n,this.signedService);break;case"skv":this.tryAppendQueryParameter(t,n,this.signedVersion);break;case"sr":this.tryAppendQueryParameter(t,n,this.resource);break;case"sp":this.tryAppendQueryParameter(t,n,this.permissions);break;case"sig":this.tryAppendQueryParameter(t,n,this.signature);break;case"rscc":this.tryAppendQueryParameter(t,n,this.cacheControl);break;case"rscd":this.tryAppendQueryParameter(t,n,this.contentDisposition);break;case"rsce":this.tryAppendQueryParameter(t,n,this.contentEncoding);break;case"rscl":this.tryAppendQueryParameter(t,n,this.contentLanguage);break;case"rsct":this.tryAppendQueryParameter(t,n,this.contentType);break;case"saoid":this.tryAppendQueryParameter(t,n,this.preauthorizedAgentObjectId);break;case"scid":this.tryAppendQueryParameter(t,n,this.correlationId);break}}return t.join("&")};e.prototype.tryAppendQueryParameter=function(e,t,r){if(!r){return}t=encodeURIComponent(t);r=encodeURIComponent(r);if(t.length>0&&r.length>0){e.push("".concat(t,"=").concat(r))}};return e}();function generateBlobSASQueryParameters(e,t,r){var a=e.version?e.version:SERVICE_VERSION;var n=t instanceof StorageSharedKeyCredential?t:undefined;var i;if(n===undefined&&r!==undefined){i=new UserDelegationKeyCredential(r,t)}if(n===undefined&&i===undefined){throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.")}if(a>="2018-11-09"){if(n!==undefined){return generateBlobSASQueryParameters20181109(e,n)}else{if(a>="2020-02-10"){return generateBlobSASQueryParametersUDK20200210(e,i)}else{return generateBlobSASQueryParametersUDK20181109(e,i)}}}if(a>="2015-04-05"){if(n!==undefined){return generateBlobSASQueryParameters20150405(e,n)}else{throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.")}}throw new RangeError("'version' must be >= '2015-04-05'.")}function generateBlobSASQueryParameters20150405(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.identifier&&!(e.permissions&&e.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}var r="c";if(e.blobName){r="b"}var a;if(e.permissions){if(e.blobName){a=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{a=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var n=[a?a:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n");var i=t.computeHMACSHA256(n);return new SASQueryParameters(e.version,i,a,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType)}function generateBlobSASQueryParameters20181109(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.identifier&&!(e.permissions&&e.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),e.identifier,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl?e.cacheControl:"",e.contentDisposition?e.contentDisposition:"",e.contentEncoding?e.contentEncoding:"",e.contentLanguage?e.contentLanguage:"",e.contentType?e.contentType:""].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType)}function generateBlobSASQueryParametersUDK20181109(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.permissions||!e.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?truncatedISO8061Date(t.userDelegationKey.signedStartsOn,false):"",t.userDelegationKey.signedExpiresOn?truncatedISO8061Date(t.userDelegationKey.signedExpiresOn,false):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey)}function generateBlobSASQueryParametersUDK20200210(e,t){e=SASSignatureValuesSanityCheckAndAutofill(e);if(!e.permissions||!e.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}var r="c";var a=e.snapshotTime;if(e.blobName){r="b";if(e.snapshotTime){r="bs"}else if(e.versionId){r="bv";a=e.versionId}}var n;if(e.permissions){if(e.blobName){n=BlobSASPermissions.parse(e.permissions.toString()).toString()}else{n=ContainerSASPermissions.parse(e.permissions.toString()).toString()}}var i=[n?n:"",e.startsOn?truncatedISO8061Date(e.startsOn,false):"",e.expiresOn?truncatedISO8061Date(e.expiresOn,false):"",getCanonicalName(t.accountName,e.containerName,e.blobName),t.userDelegationKey.signedObjectId,t.userDelegationKey.signedTenantId,t.userDelegationKey.signedStartsOn?truncatedISO8061Date(t.userDelegationKey.signedStartsOn,false):"",t.userDelegationKey.signedExpiresOn?truncatedISO8061Date(t.userDelegationKey.signedExpiresOn,false):"",t.userDelegationKey.signedService,t.userDelegationKey.signedVersion,e.preauthorizedAgentObjectId,undefined,e.correlationId,e.ipRange?ipRangeToString(e.ipRange):"",e.protocol?e.protocol:"",e.version,r,a,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType].join("\n");var o=t.computeHMACSHA256(i);return new SASQueryParameters(e.version,o,n,undefined,undefined,e.protocol,e.startsOn,e.expiresOn,e.ipRange,e.identifier,r,e.cacheControl,e.contentDisposition,e.contentEncoding,e.contentLanguage,e.contentType,t.userDelegationKey,e.preauthorizedAgentObjectId,e.correlationId)}function getCanonicalName(e,t,r){var a=["/blob/".concat(e,"/").concat(t)];if(r){a.push("/".concat(r))}return a.join("")}function SASSignatureValuesSanityCheckAndAutofill(e){var t=e.version?e.version:SERVICE_VERSION;if(e.snapshotTime&&t<"2018-11-09"){throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.")}if(e.blobName===undefined&&e.snapshotTime){throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.")}if(e.versionId&&t<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.")}if(e.blobName===undefined&&e.versionId){throw RangeError("Must provide 'blobName' when providing 'versionId'.")}if(e.permissions&&e.permissions.setImmutabilityPolicy&&t<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(e.permissions&&e.permissions.deleteVersion&&t<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.")}if(e.permissions&&e.permissions.tag&&t<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.")}if(t<"2020-02-10"&&e.permissions&&(e.permissions.move||e.permissions.execute)){throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.")}if(t<"2020-02-10"&&(e.preauthorizedAgentObjectId||e.correlationId)){throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.")}e.version=t;return e}var BlobLeaseClient=function(){function e(e,t){var r=new StorageClientContext(e.url,e.pipeline.toServiceClientOptions());this._url=e.url;if(e.name===undefined){this._isContainer=true;this._containerOrBlobOperation=new Container(r)}else{this._isContainer=false;this._containerOrBlobOperation=new Blob$1(r)}if(!t){t=generateUuid()}this._leaseId=t}Object.defineProperty(e.prototype,"leaseId",{get:function(){return this._leaseId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"url",{get:function(){return this._url},enumerable:false,configurable:true});e.prototype.acquireLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d;return __generator(this,(function(u){switch(u.label){case 0:l=createSpan("BlobLeaseClient-acquireLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}u.label=1;case 1:u.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:t.abortSignal,duration:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions}),proposedLeaseId:this._leaseId},convertTracingToRequestOptionsBase(p)))];case 2:return[2,u.sent()];case 3:d=u.sent();c.setStatus({code:SpanStatusCode.ERROR,message:d.message});throw d;case 4:c.end();return[7];case 5:return[2]}}))}))};e.prototype.changeLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:l=createSpan("BlobLeaseClient-changeLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}m.label=1;case 1:m.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.changeLease(this._leaseId,e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(p)))];case 2:d=m.sent();this._leaseId=e;return[2,d];case 3:u=m.sent();c.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 4:c.end();return[7];case 5:return[2]}}))}))};e.prototype.releaseLease=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:s=createSpan("BlobLeaseClient-releaseLease",e),l=s.span,c=s.updatedOptions;if(this._isContainer&&(((t=e.conditions)===null||t===void 0?void 0:t.ifMatch)&&((r=e.conditions)===null||r===void 0?void 0:r.ifMatch)!==ETagNone||((a=e.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((n=e.conditions)===null||n===void 0?void 0:n.ifNoneMatch)!==ETagNone||((i=e.conditions)===null||i===void 0?void 0:i.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.releaseLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(o=e.conditions)===null||o===void 0?void 0:o.tagConditions})},convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};e.prototype.renewLease=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:s=createSpan("BlobLeaseClient-renewLease",e),l=s.span,c=s.updatedOptions;if(this._isContainer&&(((t=e.conditions)===null||t===void 0?void 0:t.ifMatch)&&((r=e.conditions)===null||r===void 0?void 0:r.ifMatch)!==ETagNone||((a=e.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((n=e.conditions)===null||n===void 0?void 0:n.ifNoneMatch)!==ETagNone||((i=e.conditions)===null||i===void 0?void 0:i.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this._containerOrBlobOperation.renewLease(this._leaseId,Object.assign({abortSignal:e.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(o=e.conditions)===null||o===void 0?void 0:o.tagConditions})},convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};e.prototype.breakLease=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:l=createSpan("BlobLeaseClient-breakLease",t),c=l.span,p=l.updatedOptions;if(this._isContainer&&(((r=t.conditions)===null||r===void 0?void 0:r.ifMatch)&&((a=t.conditions)===null||a===void 0?void 0:a.ifMatch)!==ETagNone||((n=t.conditions)===null||n===void 0?void 0:n.ifNoneMatch)&&((i=t.conditions)===null||i===void 0?void 0:i.ifNoneMatch)!==ETagNone||((o=t.conditions)===null||o===void 0?void 0:o.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}m.label=1;case 1:m.trys.push([1,3,4,5]);d=Object.assign({abortSignal:t.abortSignal,breakPeriod:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(s=t.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(p));return[4,this._containerOrBlobOperation.breakLease(d)];case 2:return[2,m.sent()];case 3:u=m.sent();c.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 4:c.end();return[7];case 5:return[2]}}))}))};return e}();var BlobDownloadResponse=1;var BlobQueryResponse=function(){function e(e,t){if(t===void 0){t={}}this.originalResponse=e}Object.defineProperty(e.prototype,"acceptRanges",{get:function(){return this.originalResponse.acceptRanges},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"cacheControl",{get:function(){return this.originalResponse.cacheControl},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentDisposition",{get:function(){return this.originalResponse.contentDisposition},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentEncoding",{get:function(){return this.originalResponse.contentEncoding},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLanguage",{get:function(){return this.originalResponse.contentLanguage},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobSequenceNumber",{get:function(){return this.originalResponse.blobSequenceNumber},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobType",{get:function(){return this.originalResponse.blobType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this.originalResponse.contentLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentMD5",{get:function(){return this.originalResponse.contentMD5},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentRange",{get:function(){return this.originalResponse.contentRange},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentType",{get:function(){return this.originalResponse.contentType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyCompletedOn",{get:function(){return undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyId",{get:function(){return this.originalResponse.copyId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyProgress",{get:function(){return this.originalResponse.copyProgress},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copySource",{get:function(){return this.originalResponse.copySource},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyStatus",{get:function(){return this.originalResponse.copyStatus},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"copyStatusDescription",{get:function(){return this.originalResponse.copyStatusDescription},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseDuration",{get:function(){return this.originalResponse.leaseDuration},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseState",{get:function(){return this.originalResponse.leaseState},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"leaseStatus",{get:function(){return this.originalResponse.leaseStatus},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"date",{get:function(){return this.originalResponse.date},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobCommittedBlockCount",{get:function(){return this.originalResponse.blobCommittedBlockCount},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"etag",{get:function(){return this.originalResponse.etag},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"errorCode",{get:function(){return this.originalResponse.errorCode},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isServerEncrypted",{get:function(){return this.originalResponse.isServerEncrypted},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobContentMD5",{get:function(){return this.originalResponse.blobContentMD5},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"lastModified",{get:function(){return this.originalResponse.lastModified},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"metadata",{get:function(){return this.originalResponse.metadata},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"requestId",{get:function(){return this.originalResponse.requestId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"clientRequestId",{get:function(){return this.originalResponse.clientRequestId},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"version",{get:function(){return this.originalResponse.version},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"encryptionKeySha256",{get:function(){return this.originalResponse.encryptionKeySha256},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentCrc64",{get:function(){return this.originalResponse.contentCrc64},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blobBody",{get:function(){throw Error("Quick query in browser is not supported yet.")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"readableStreamBody",{get:function(){return undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"_response",{get:function(){return this.originalResponse._response},enumerable:false,configurable:true});return e}();var BlockBlobTier;(function(e){e["Hot"]="Hot";e["Cool"]="Cool";e["Archive"]="Archive"})(BlockBlobTier||(BlockBlobTier={}));var PremiumPageBlobTier;(function(e){e["P4"]="P4";e["P6"]="P6";e["P10"]="P10";e["P15"]="P15";e["P20"]="P20";e["P30"]="P30";e["P40"]="P40";e["P50"]="P50";e["P60"]="P60";e["P70"]="P70";e["P80"]="P80"})(PremiumPageBlobTier||(PremiumPageBlobTier={}));function toAccessTier(e){if(e===undefined){return undefined}return e}function ensureCpkIfSpecified(e,t){if(e&&!t){throw new RangeError("Customer-provided encryption key must be used over HTTPS.")}if(e&&!e.encryptionAlgorithm){e.encryptionAlgorithm=EncryptionAlgorithmAES25}}function rangeResponseFromModel(e){var t=(e._response.parsedBody.pageRange||[]).map((function(e){return{offset:e.start,count:e.end-e.start}}));var r=(e._response.parsedBody.clearRange||[]).map((function(e){return{offset:e.start,count:e.end-e.start}}));return Object.assign(Object.assign({},e),{pageRange:t,clearRange:r,_response:Object.assign(Object.assign({},e._response),{parsedBody:{pageRange:t,clearRange:r}})})}var PollerStoppedError=function(e){__extends(t,e);function t(r){var a=e.call(this,r)||this;a.name="PollerStoppedError";Object.setPrototypeOf(a,t.prototype);return a}return t}(Error);var PollerCancelledError=function(e){__extends(t,e);function t(r){var a=e.call(this,r)||this;a.name="PollerCancelledError";Object.setPrototypeOf(a,t.prototype);return a}return t}(Error);var Poller=function(){function e(e){var t=this;this.stopped=true;this.pollProgressCallbacks=[];this.operation=e;this.promise=new Promise((function(e,r){t.resolve=e;t.reject=r}));this.promise.catch((function(){}))}e.prototype.startPolling=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(this.stopped){this.stopped=false}e.label=1;case 1:if(!(!this.isStopped()&&!this.isDone()))return[3,4];return[4,this.poll()];case 2:e.sent();return[4,this.delay()];case 3:e.sent();return[3,1];case 4:return[2]}}))}))};e.prototype.pollOnce=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!!this.isDone())return[3,2];t=this;return[4,this.operation.update({abortSignal:e.abortSignal,fireProgress:this.fireProgress.bind(this)})];case 1:t.operation=a.sent();if(this.isDone()&&this.resolve){this.resolve(this.operation.state.result)}a.label=2;case 2:return[3,4];case 3:r=a.sent();this.operation.state.error=r;if(this.reject){this.reject(r)}throw r;case 4:return[2]}}))}))};e.prototype.fireProgress=function(e){for(var t=0,r=this.pollProgressCallbacks;t<r.length;t++){var a=r[t];a(e)}};e.prototype.cancelOnce=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=this;return[4,this.operation.cancel(e)];case 1:t.operation=r.sent();if(this.reject){this.reject(new PollerCancelledError("Poller cancelled"))}return[2]}}))}))};e.prototype.poll=function(e){var t=this;if(e===void 0){e={}}if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(e);var r=function(){t.pollOncePromise=undefined};this.pollOncePromise.then(r,r).catch(this.reject)}return this.pollOncePromise};e.prototype.pollUntilDone=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.stopped){this.startPolling().catch(this.reject)}return[2,this.promise]}))}))};e.prototype.onProgress=function(e){var t=this;this.pollProgressCallbacks.push(e);return function(){t.pollProgressCallbacks=t.pollProgressCallbacks.filter((function(t){return t!==e}))}};e.prototype.isDone=function(){var e=this.operation.state;return Boolean(e.isCompleted||e.isCancelled||e.error)};e.prototype.stopPolling=function(){if(!this.stopped){this.stopped=true;if(this.reject){this.reject(new PollerStoppedError("This poller is already stopped"))}}};e.prototype.isStopped=function(){return this.stopped};e.prototype.cancelOperation=function(e){if(e===void 0){e={}}if(!this.stopped){this.stopped=true}if(!this.cancelPromise){this.cancelPromise=this.cancelOnce(e)}else if(e.abortSignal){throw new Error("A cancel request is currently pending")}return this.cancelPromise};e.prototype.getOperationState=function(){return this.operation.state};e.prototype.getResult=function(){var e=this.operation.state;return e.result};e.prototype.toString=function(){return this.operation.toString()};return e}();var BlobBeginCopyFromUrlPoller=function(e){__extends(t,e);function t(t){var r=this;var a=t.blobClient,n=t.copySource,i=t.intervalInMs,o=i===void 0?15e3:i,s=t.onProgress,l=t.resumeFrom,c=t.startCopyFromURLOptions;var p;if(l){p=JSON.parse(l).state}var d=makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({},p),{blobClient:a,copySource:n,startCopyFromURLOptions:c}));r=e.call(this,d)||this;if(typeof s==="function"){r.onProgress(s)}r.intervalInMs=o;return r}t.prototype.delay=function(){return delay$1(this.intervalInMs)};return t}(Poller);var cancel=function e(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(a){switch(a.label){case 0:e=this.state;r=e.copyId;if(e.isCompleted){return[2,makeBlobBeginCopyFromURLPollOperation(e)]}if(!r){e.isCancelled=true;return[2,makeBlobBeginCopyFromURLPollOperation(e)]}return[4,e.blobClient.abortCopyFromURL(r,{abortSignal:t.abortSignal})];case 1:a.sent();e.isCancelled=true;return[2,makeBlobBeginCopyFromURLPollOperation(e)]}}))}))};var update=function e(t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:e=this.state;r=e.blobClient,a=e.copySource,n=e.startCopyFromURLOptions;if(!!e.isStarted)return[3,2];e.isStarted=true;return[4,r.startCopyFromURL(a,n)];case 1:i=p.sent();e.copyId=i.copyId;if(i.copyStatus==="success"){e.result=i;e.isCompleted=true}return[3,6];case 2:if(!!e.isCompleted)return[3,6];p.label=3;case 3:p.trys.push([3,5,,6]);return[4,e.blobClient.getProperties({abortSignal:t.abortSignal})];case 4:i=p.sent();o=i.copyStatus,s=i.copyProgress;l=e.copyProgress;if(s){e.copyProgress=s}if(o==="pending"&&s!==l&&typeof t.fireProgress==="function"){t.fireProgress(e)}else if(o==="success"){e.result=i;e.isCompleted=true}else if(o==="failed"){e.error=new Error('Blob copy failed with reason: "'.concat(i.copyStatusDescription||"unknown",'"'));e.isCompleted=true}return[3,6];case 5:c=p.sent();e.error=c;e.isCompleted=true;return[3,6];case 6:return[2,makeBlobBeginCopyFromURLPollOperation(e)]}}))}))};var toString=function e(){return JSON.stringify({state:this.state},(function(e,t){if(e==="blobClient"){return undefined}return t}))};function makeBlobBeginCopyFromURLPollOperation(e){return{state:Object.assign({},e),cancel:cancel,toString:toString,update:update}}function rangeToString(e){if(e.offset<0){throw new RangeError("Range.offset cannot be smaller than 0.")}if(e.count&&e.count<=0){throw new RangeError("Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.")}return e.count?"bytes=".concat(e.offset,"-").concat(e.offset+e.count-1):"bytes=".concat(e.offset,"-")}var R=typeof Reflect==="object"?Reflect:null;var ReflectApply=R&&typeof R.apply==="function"?R.apply:function e(t,r,a){return Function.prototype.apply.call(t,r,a)};var ReflectOwnKeys;if(R&&typeof R.ownKeys==="function"){ReflectOwnKeys=R.ownKeys}else if(Object.getOwnPropertySymbols){ReflectOwnKeys=function e(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}}else{ReflectOwnKeys=function e(t){return Object.getOwnPropertyNames(t)}}function ProcessEmitWarning(e){if(console&&console.warn)console.warn(e)}var NumberIsNaN=Number.isNaN||function e(t){return t!==t};function EventEmitter(){EventEmitter.init.call(this)}var events=EventEmitter;var once_1=once;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;function checkListener(e){if(typeof e!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return defaultMaxListeners},set:function(e){if(typeof e!=="number"||e<0||NumberIsNaN(e)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".")}defaultMaxListeners=e}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};EventEmitter.prototype.setMaxListeners=function e(t){if(typeof t!=="number"||t<0||NumberIsNaN(t)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".")}this._maxListeners=t;return this};function _getMaxListeners(e){if(e._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return e._maxListeners}EventEmitter.prototype.getMaxListeners=function e(){return _getMaxListeners(this)};EventEmitter.prototype.emit=function e(t){var r=[];for(var a=1;a<arguments.length;a++)r.push(arguments[a]);var n=t==="error";var i=this._events;if(i!==undefined)n=n&&i.error===undefined;else if(!n)return false;if(n){var o;if(r.length>0)o=r[0];if(o instanceof Error){throw o}var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));s.context=o;throw s}var l=i[t];if(l===undefined)return false;if(typeof l==="function"){ReflectApply(l,this,r)}else{var c=l.length;var p=arrayClone(l,c);for(var a=0;a<c;++a)ReflectApply(p[a],this,r)}return true};function _addListener(e,t,r,a){var n;var i;var o;checkListener(r);i=e._events;if(i===undefined){i=e._events=Object.create(null);e._eventsCount=0}else{if(i.newListener!==undefined){e.emit("newListener",t,r.listener?r.listener:r);i=e._events}o=i[t]}if(o===undefined){o=i[t]=r;++e._eventsCount}else{if(typeof o==="function"){o=i[t]=a?[r,o]:[o,r]}else if(a){o.unshift(r)}else{o.push(r)}n=_getMaxListeners(e);if(n>0&&o.length>n&&!o.warned){o.warned=true;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");s.name="MaxListenersExceededWarning";s.emitter=e;s.type=t;s.count=o.length;ProcessEmitWarning(s)}}return e}EventEmitter.prototype.addListener=function e(t,r){return _addListener(this,t,r,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function e(t,r){return _addListener(this,t,r,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function _onceWrap(e,t,r){var a={fired:false,wrapFn:undefined,target:e,type:t,listener:r};var n=onceWrapper.bind(a);n.listener=r;a.wrapFn=n;return n}EventEmitter.prototype.once=function e(t,r){checkListener(r);this.on(t,_onceWrap(this,t,r));return this};EventEmitter.prototype.prependOnceListener=function e(t,r){checkListener(r);this.prependListener(t,_onceWrap(this,t,r));return this};EventEmitter.prototype.removeListener=function e(t,r){var a,n,i,o,s;checkListener(r);n=this._events;if(n===undefined)return this;a=n[t];if(a===undefined)return this;if(a===r||a.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[t];if(n.removeListener)this.emit("removeListener",t,a.listener||r)}}else if(typeof a!=="function"){i=-1;for(o=a.length-1;o>=0;o--){if(a[o]===r||a[o].listener===r){s=a[o].listener;i=o;break}}if(i<0)return this;if(i===0)a.shift();else{spliceOne(a,i)}if(a.length===1)n[t]=a[0];if(n.removeListener!==undefined)this.emit("removeListener",t,s||r)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function e(t){var r,a,n;a=this._events;if(a===undefined)return this;if(a.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(a[t]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete a[t]}return this}if(arguments.length===0){var i=Object.keys(a);var o;for(n=0;n<i.length;++n){o=i[n];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}r=a[t];if(typeof r==="function"){this.removeListener(t,r)}else if(r!==undefined){for(n=r.length-1;n>=0;n--){this.removeListener(t,r[n])}}return this};function _listeners(e,t,r){var a=e._events;if(a===undefined)return[];var n=a[t];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?unwrapListeners(n):arrayClone(n,n.length)}EventEmitter.prototype.listeners=function e(t){return _listeners(this,t,true)};EventEmitter.prototype.rawListeners=function e(t){return _listeners(this,t,false)};EventEmitter.listenerCount=function(e,t){if(typeof e.listenerCount==="function"){return e.listenerCount(t)}else{return listenerCount.call(e,t)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(e){var t=this._events;if(t!==undefined){var r=t[e];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}EventEmitter.prototype.eventNames=function e(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(e,t){var r=new Array(t);for(var a=0;a<t;++a)r[a]=e[a];return r}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){var t=new Array(e.length);for(var r=0;r<t.length;++r){t[r]=e[r].listener||e[r]}return t}function once(e,t){return new Promise((function(r,a){function n(r){e.removeListener(t,i);a(r)}function i(){if(typeof e.removeListener==="function"){e.removeListener("error",n)}r([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,i,{once:true});if(t!=="error"){addErrorHandlerIfEventEmitter(e,n,{once:true})}}))}function addErrorHandlerIfEventEmitter(e,t,r){if(typeof e.on==="function"){eventTargetAgnosticAddListener(e,"error",t,r)}}function eventTargetAgnosticAddListener(e,t,r,a){if(typeof e.on==="function"){if(a.once){e.once(t,r)}else{e.on(t,r)}}else if(typeof e.addEventListener==="function"){e.addEventListener(t,(function n(i){if(a.once){e.removeEventListener(t,n)}r(i)}))}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}}events.once=once_1;var BatchStates;(function(e){e[e["Good"]=0]="Good";e[e["Error"]=1]="Error"})(BatchStates||(BatchStates={}));var Batch=function(){function e(e){if(e===void 0){e=5}this.actives=0;this.completed=0;this.offset=0;this.operations=[];this.state=BatchStates.Good;if(e<1){throw new RangeError("concurrency must be larger than 0")}this.concurrency=e;this.emitter=new events.EventEmitter}e.prototype.addOperation=function(e){var t=this;this.operations.push((function(){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);this.actives++;return[4,e()];case 1:r.sent();this.actives--;this.completed++;this.parallelExecute();return[3,3];case 2:t=r.sent();this.emitter.emit("error",t);return[3,3];case 3:return[2]}}))}))}))};e.prototype.do=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.operations.length===0){return[2,Promise.resolve()]}this.parallelExecute();return[2,new Promise((function(t,r){e.emitter.on("finish",t);e.emitter.on("error",(function(t){e.state=BatchStates.Error;r(t)}))}))]}))}))};e.prototype.nextOperation=function(){if(this.offset<this.operations.length){return this.operations[this.offset++]}return null};e.prototype.parallelExecute=function(){if(this.state===BatchStates.Error){return}if(this.completed>=this.operations.length){this.emitter.emit("finish");return}while(this.actives<this.concurrency){var e=this.nextOperation();if(e){e()}else{return}}};return e}();var BufferScheduler=function(){function e(){}return e}();function streamToBuffer(){}function readStreamToLocalFile(){}var fsStat=function e(){};var fsCreateReadStream=function e(){};var BlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i;var o=this;n=n||{};var s;var l;if(isPipelineLike(r)){l=t;s=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){l=t;n=a;s=newPipeline(r,n)}else if(!r&&typeof r!=="string"){l=t;s=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var c=r;var p=a;var d=extractConnectionStringParts(t);if(d.kind==="AccountConnString"){if(isNode){var u=new StorageSharedKeyCredential(d.accountName,d.accountKey);l=appendToURLPath(appendToURLPath(d.url,encodeURIComponent(c)),encodeURIComponent(p));n.proxyOptions=getDefaultProxySettings();s=newPipeline(u,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(d.kind==="SASConnString"){l=appendToURLPath(appendToURLPath(d.url,encodeURIComponent(c)),encodeURIComponent(p))+"?"+d.accountSas;s=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}o=e.call(this,l,s)||this;i=o.getBlobAndContainerNamesFromUrl(),o._name=i.blobName,o._containerName=i.containerName;o.blobContext=new Blob$1(o.storageClientContext);o._snapshot=getURLParameter(o.url,URLConstants.Parameters.SNAPSHOT);o._versionId=getURLParameter(o.url,URLConstants.Parameters.VERSIONID);return o}Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"containerName",{get:function(){return this._containerName},enumerable:false,configurable:true});t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.withVersion=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.VERSIONID,e.length===0?undefined:e),this.pipeline)};t.prototype.getAppendBlobClient=function(){return new AppendBlobClient(this.url,this.pipeline)};t.prototype.getBlockBlobClient=function(){return new BlockBlobClient(this.url,this.pipeline)};t.prototype.getPageBlobClient=function(){return new PageBlobClient(this.url,this.pipeline)};t.prototype.download=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c;var p=this;return __generator(this,(function(d){switch(d.label){case 0:r.conditions=r.conditions||{};r.conditions=r.conditions||{};ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);n=createSpan("BlobClient-download",r),i=n.span,o=n.updatedOptions;d.label=1;case 1:d.trys.push([1,3,4,5]);return[4,this.blobContext.download(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onDownloadProgress:isNode?undefined:r.onProgress},range:e===0&&!t?undefined:rangeToString({offset:e,count:t}),rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey},convertTracingToRequestOptionsBase(o)))];case 2:s=d.sent();l=Object.assign(Object.assign({},s),{_response:s._response,objectReplicationDestinationPolicyId:s.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(s.objectReplicationRules)});if(!isNode){return[2,l]}if(r.maxRetryRequests===undefined||r.maxRetryRequests<0){r.maxRetryRequests=DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS}if(s.contentLength===undefined){throw new RangeError("File download response doesn't contain valid content length header")}if(!s.etag){throw new RangeError("File download response doesn't contain valid etag header")}return[2,new BlobDownloadResponse(l,(function(t){return __awaiter(p,void 0,void 0,(function(){var a,n;return __generator(this,(function(i){switch(i.label){case 0:n={leaseAccessConditions:r.conditions,modifiedAccessConditions:{ifMatch:r.conditions.ifMatch||s.etag,ifModifiedSince:r.conditions.ifModifiedSince,ifNoneMatch:r.conditions.ifNoneMatch,ifUnmodifiedSince:r.conditions.ifUnmodifiedSince,ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions},range:rangeToString({count:e+s.contentLength-t,offset:t}),rangeGetContentMD5:r.rangeGetContentMD5,rangeGetContentCRC64:r.rangeGetContentCrc64,snapshot:r.snapshot,cpkInfo:r.customerProvidedKey};return[4,this.blobContext.download(Object.assign({abortSignal:r.abortSignal},n))];case 1:return[2,i.sent().readableStreamBody]}}))}))}),e,s.contentLength,{maxRetryRequests:r.maxRetryRequests,onProgress:r.onProgress})];case 3:c=d.sent();i.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.exists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-exists",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.getProperties({abortSignal:e.abortSignal,customerProvidedKey:e.customerProvidedKey,conditions:e.conditions,tracingOptions:a.tracingOptions})];case 2:i.sent();return[2,true];case 3:n=i.sent();if(n.statusCode===404){r.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when checking blob existence"});return[2,false]}r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.getProperties=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:r=createSpan("BlobClient-getProperties",e),a=r.span,n=r.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);e.conditions=e.conditions||{};ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.blobContext.getProperties(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey},convertTracingToRequestOptionsBase(n)))];case 2:i=s.sent();return[2,Object.assign(Object.assign({},i),{_response:i._response,objectReplicationDestinationPolicyId:i.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(i.objectReplicationRules)})];case 3:o=s.sent();a.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.delete=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-delete",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.delete(Object.assign({abortSignal:e.abortSignal,deleteSnapshots:e.deleteSnapshots,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.deleteIfExists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:a=createSpan("BlobClient-deleteIfExists",e),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.delete(i)];case 2:o=l.sent();return[2,Object.assign(Object.assign({succeeded:true},o),{_response:o._response})];case 3:s=l.sent();if(((t=s.details)===null||t===void 0?void 0:t.errorCode)==="BlobNotFound"){n.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when deleting a blob or snapshot only if it exists."});return[2,Object.assign(Object.assign({succeeded:false},(r=s.response)===null||r===void 0?void 0:r.parsedHeaders),{_response:s.response})]}n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.undelete=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-undelete",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);return[4,this.blobContext.undelete(Object.assign({abortSignal:e.abortSignal},convertTracingToRequestOptionsBase(a)))];case 2:return[2,i.sent()];case 3:n=i.sent();r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.setHTTPHeaders=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setHTTPHeaders",t),n=a.span,i=a.updatedOptions;t.conditions=t.conditions||{};s.label=1;case 1:s.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blobContext.setHttpHeaders(Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:e,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.setMetadata=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setMetadata",t),n=a.span,i=a.updatedOptions;t.conditions=t.conditions||{};s.label=1;case 1:s.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blobContext.setMetadata(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:e,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.setTags=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setTags",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.blobContext.setTags(Object.assign(Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)),{tags:toBlobTags(e)}))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.getTags=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r=createSpan("BlobClient-getTags",e),a=r.span,n=r.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.blobContext.getTags(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:i=l.sent();o=Object.assign(Object.assign({},i),{_response:i._response,tags:toTags({blobTagSet:i.blobTagSet})||{}});return[2,o];case 3:s=l.sent();a.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.getBlobLeaseClient=function(e){return new BlobLeaseClient(this,e)};t.prototype.createSnapshot=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-createSnapshot",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.blobContext.createSnapshot(Object.assign({abortSignal:e.abortSignal,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.beginCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a;var n=this;return __generator(this,(function(i){switch(i.label){case 0:r={abortCopyFromURL:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.abortCopyFromURL.apply(n,e)},getProperties:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.getProperties.apply(n,e)},startCopyFromURL:function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return n.startCopyFromURL.apply(n,e)}};a=new BlobBeginCopyFromUrlPoller({blobClient:r,copySource:e,intervalInMs:t.intervalInMs,onProgress:t.onProgress,resumeFrom:t.resumeFrom,startCopyFromURLOptions:t});return[4,a.poll()];case 1:i.sent();return[2,a]}}))}))};t.prototype.abortCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-abortCopyFromURL",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.abortCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.syncCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlobClient-syncCopyFromURL",t),o=i.span,s=i.updatedOptions;t.conditions=t.conditions||{};t.sourceConditions=t.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.blobContext.copyFromURL(e,Object.assign({abortSignal:t.abortSignal,metadata:t.metadata,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince},sourceContentMD5:t.sourceContentMD5,copySourceAuthorization:httpAuthorizationToString(t.sourceAuthorization),blobTagsString:toBlobTagsString(t.tags),immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.setAccessTier=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("BlobClient-setAccessTier",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.blobContext.setTier(toAccessTier(e),Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),rehydratePriority:t.rehydratePriority},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.downloadToBuffer=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l,c,p,d,u,m,f,h,g;var y=this;return __generator(this,(function(b){switch(b.label){case 0:i=0;o=0;s=a;if(e instanceof Buffer){n=e;i=t||0;o=typeof r==="number"?r:0}else{i=typeof e==="number"?e:0;o=typeof t==="number"?t:0;s=r||{}}l=createSpan("BlobClient-downloadToBuffer",s),c=l.span,p=l.updatedOptions;b.label=1;case 1:b.trys.push([1,5,6,7]);if(!s.blockSize){s.blockSize=0}if(s.blockSize<0){throw new RangeError("blockSize option must be >= 0")}if(s.blockSize===0){s.blockSize=DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES}if(i<0){throw new RangeError("offset option must be >= 0")}if(o&&o<=0){throw new RangeError("count option must be greater than 0")}if(!s.conditions){s.conditions={}}if(!!o)return[3,3];return[4,this.getProperties(Object.assign(Object.assign({},s),{tracingOptions:Object.assign(Object.assign({},s.tracingOptions),convertTracingToRequestOptionsBase(p))}))];case 2:d=b.sent();o=d.contentLength-i;if(o<0){throw new RangeError("offset ".concat(i," shouldn't be larger than blob size ").concat(d.contentLength))}b.label=3;case 3:if(!n){try{n=Buffer.alloc(o)}catch(e){throw new Error("Unable to allocate the buffer of size: ".concat(o,'(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ').concat(e.message))}}if(n.length<o){throw new RangeError("The buffer's size should be equal to or larger than the request count of bytes: ".concat(o))}u=0;m=new Batch(s.concurrency);f=function(e){m.addOperation((function(){return __awaiter(y,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=i+o;if(e+s.blockSize<t){t=e+s.blockSize}return[4,this.download(e,t-e,{abortSignal:s.abortSignal,conditions:s.conditions,maxRetryRequests:s.maxRetryRequestsPerBlock,customerProvidedKey:s.customerProvidedKey,tracingOptions:Object.assign(Object.assign({},s.tracingOptions),convertTracingToRequestOptionsBase(p))})];case 1:r.sent();return[4,streamToBuffer()];case 2:r.sent();u+=t-e;if(s.onProgress){s.onProgress({loadedBytes:u})}return[2]}}))}))}))};for(h=i;h<i+o;h=h+s.blockSize){f(h)}return[4,m.do()];case 4:b.sent();return[2,n];case 5:g=b.sent();c.setStatus({code:SpanStatusCode.ERROR,message:g.message});throw g;case 6:c.end();return[7];case 7:return[2]}}))}))};t.prototype.downloadToFile=function(e,t,r,a){if(t===void 0){t=0}if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var e,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:e=createSpan("BlobClient-downloadToFile",a),n=e.span,i=e.updatedOptions;l.label=1;case 1:l.trys.push([1,5,6,7]);return[4,this.download(t,r,Object.assign(Object.assign({},a),{tracingOptions:Object.assign(Object.assign({},a.tracingOptions),convertTracingToRequestOptionsBase(i))}))];case 2:o=l.sent();if(!o.readableStreamBody)return[3,4];return[4,readStreamToLocalFile()];case 3:l.sent();l.label=4;case 4:o.blobDownloadStream=undefined;return[2,o];case 5:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 6:n.end();return[7];case 7:return[2]}}))}))};t.prototype.getBlobAndContainerNamesFromUrl=function(){var e;var t;try{var r=URLBuilder.parse(this.url);if(r.getHost().split(".")[1]==="blob"){var a=r.getPath().match("/([^/]*)(/(.*))?");e=a[1];t=a[3]}else if(isIpEndpointStyle(r)){var a=r.getPath().match("/([^/]*)/([^/]*)(/(.*))?");e=a[2];t=a[4]}else{var a=r.getPath().match("/([^/]*)(/(.*))?");e=a[1];t=a[3]}e=decodeURIComponent(e);t=decodeURIComponent(t);t=t.replace(/\\/g,"/");if(!e){throw new Error("Provided containerName is invalid.")}return{blobName:t,containerName:e}}catch(e){throw new Error("Unable to extract blobName and containerName with provided information.")}};t.prototype.startCopyFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlobClient-startCopyFromURL",t),o=i.span,s=i.updatedOptions;t.conditions=t.conditions||{};t.sourceConditions=t.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.blobContext.startCopyFromURL(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:t.sourceConditions.ifMatch,sourceIfModifiedSince:t.sourceConditions.ifModifiedSince,sourceIfNoneMatch:t.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:t.sourceConditions.ifUnmodifiedSince,sourceIfTags:t.sourceConditions.tagConditions},immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,rehydratePriority:t.rehydratePriority,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags),sealBlob:t.sealBlob},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.generateSasUrl=function(e){var t=this;return new Promise((function(r){if(!(t.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}var a=generateBlobSASQueryParameters(Object.assign({containerName:t._containerName,blobName:t._name,snapshotTime:t._snapshot,versionId:t._versionId},e),t.credential).toString();r(appendToURLQuery(t.url,a))}))};t.prototype.deleteImmutabilityPolicy=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=createSpan("BlobClient-deleteImmutabilityPolicy",e),r=t.span,a=t.updatedOptions;i.label=1;case 1:i.trys.push([1,3,4,5]);return[4,this.blobContext.deleteImmutabilityPolicy(Object.assign({abortSignal:e===null||e===void 0?void 0:e.abortSignal},convertTracingToRequestOptionsBase(a)))];case 2:return[2,i.sent()];case 3:n=i.sent();r.setStatus({code:SpanStatusCode.ERROR,message:n.message});throw n;case 4:r.end();return[7];case 5:return[2]}}))}))};t.prototype.setImmutabilityPolicy=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-setImmutabilityPolicy",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.setImmutabilityPolicy(Object.assign({abortSignal:t===null||t===void 0?void 0:t.abortSignal,immutabilityPolicyExpiry:e.expiriesOn,immutabilityPolicyMode:e.policyMode,modifiedAccessConditions:t===null||t===void 0?void 0:t.modifiedAccessCondition},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.setLegalHold=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("BlobClient-setLegalHold",t),a=r.span,n=r.updatedOptions;o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.blobContext.setLegalHold(e,Object.assign({abortSignal:t===null||t===void 0?void 0:t.abortSignal},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};return t}(StorageClient);var AppendBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.appendBlobContext=new AppendBlob(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.create=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("AppendBlobClient-create",e),i=n.span,o=n.updatedOptions;e.conditions=e.conditions||{};l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(e.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.create(0,Object.assign({abortSignal:e.abortSignal,blobHttpHeaders:e.blobHTTPHeaders,leaseAccessConditions:e.conditions,metadata:e.metadata,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions}),cpkInfo:e.customerProvidedKey,encryptionScope:e.encryptionScope,immutabilityPolicyExpiry:(r=e.immutabilityPolicy)===null||r===void 0?void 0:r.expiriesOn,immutabilityPolicyMode:(a=e.immutabilityPolicy)===null||a===void 0?void 0:a.policyMode,legalHold:e.legalHold,blobTagsString:toBlobTagsString(e.tags)},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.createIfNotExists=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a=createSpan("AppendBlobClient-createIfNotExists",e),n=a.span,i=a.updatedOptions;o={ifNoneMatch:ETagAny};c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.create(Object.assign(Object.assign({},i),{conditions:o}))];case 2:s=c.sent();return[2,Object.assign(Object.assign({succeeded:true},s),{_response:s._response})];case 3:l=c.sent();if(((t=l.details)===null||t===void 0?void 0:t.errorCode)==="BlobAlreadyExists"){n.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return[2,Object.assign(Object.assign({succeeded:false},(r=l.response)===null||r===void 0?void 0:r.parsedHeaders),{_response:l.response})]}n.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.seal=function(e){if(e===void 0){e={}}return __awaiter(this,void 0,void 0,(function(){var t,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:r=createSpan("AppendBlobClient-seal",e),a=r.span,n=r.updatedOptions;e.conditions=e.conditions||{};o.label=1;case 1:o.trys.push([1,3,4,5]);return[4,this.appendBlobContext.seal(Object.assign({abortSignal:e.abortSignal,appendPositionAccessConditions:e.conditions,leaseAccessConditions:e.conditions,modifiedAccessConditions:Object.assign(Object.assign({},e.conditions),{ifTags:(t=e.conditions)===null||t===void 0?void 0:t.tagConditions})},convertTracingToRequestOptionsBase(n)))];case 2:return[2,o.sent()];case 3:i=o.sent();a.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.appendBlock=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("AppendBlobClient-appendBlock",r),i=n.span,o=n.updatedOptions;r.conditions=r.conditions||{};l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.appendBlock(t,e,Object.assign({abortSignal:r.abortSignal,appendPositionAccessConditions:r.conditions,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},transactionalContentMD5:r.transactionalContentMD5,transactionalContentCrc64:r.transactionalContentCrc64,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.appendBlockFromURL=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("AppendBlobClient-appendBlockFromURL",a),o=i.span,s=i.updatedOptions;a.conditions=a.conditions||{};a.sourceConditions=a.sourceConditions||{};c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.appendBlobContext.appendBlockFromUrl(e,0,Object.assign({abortSignal:a.abortSignal,sourceRange:rangeToString({offset:t,count:r}),sourceContentMD5:a.sourceContentMD5,sourceContentCrc64:a.sourceContentCrc64,leaseAccessConditions:a.conditions,appendPositionAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:a.sourceConditions.ifMatch,sourceIfModifiedSince:a.sourceConditions.ifModifiedSince,sourceIfNoneMatch:a.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:a.sourceConditions.ifUnmodifiedSince},copySourceAuthorization:httpAuthorizationToString(a.sourceAuthorization),cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};return t}(BlobClient);var BlockBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.blockBlobContext=new BlockBlob(i.storageClientContext);i._blobContext=new Blob$1(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.query=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);a=createSpan("BlockBlobClient-query",t),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);if(!isNode){throw new Error("This operation currently is only supported in Node.js.")}return[4,this._blobContext.query(Object.assign({abortSignal:t.abortSignal,queryRequest:{queryType:"SQL",expression:e,inputSerialization:toQuerySerialization(t.inputTextConfiguration),outputSerialization:toQuerySerialization(t.outputTextConfiguration)},leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:o=l.sent();return[2,new BlobQueryResponse(o,{abortSignal:t.abortSignal,onProgress:t.onProgress,onError:t.onError})];case 3:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.upload=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:r.conditions=r.conditions||{};o=createSpan("BlockBlobClient-upload",r),s=o.span,l=o.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.upload(t,e,Object.assign({abortSignal:r.abortSignal,blobHttpHeaders:r.blobHTTPHeaders,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:r.onProgress},cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,immutabilityPolicyExpiry:(n=r.immutabilityPolicy)===null||n===void 0?void 0:n.expiriesOn,immutabilityPolicyMode:(i=r.immutabilityPolicy)===null||i===void 0?void 0:i.policyMode,legalHold:r.legalHold,tier:toAccessTier(r.tier),blobTagsString:toBlobTagsString(r.tags)},convertTracingToRequestOptionsBase(l)))];case 2:return[2,p.sent()];case 3:c=p.sent();s.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:s.end();return[7];case 5:return[2]}}))}))};t.prototype.syncUploadFromURL=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c,p;return __generator(this,(function(d){switch(d.label){case 0:t.conditions=t.conditions||{};s=createSpan("BlockBlobClient-syncUploadFromURL",t),l=s.span,c=s.updatedOptions;d.label=1;case 1:d.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.putBlobFromUrl(0,e,Object.assign(Object.assign(Object.assign({},t),{blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:t.conditions.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:(r=t.sourceConditions)===null||r===void 0?void 0:r.ifMatch,sourceIfModifiedSince:(a=t.sourceConditions)===null||a===void 0?void 0:a.ifModifiedSince,sourceIfNoneMatch:(n=t.sourceConditions)===null||n===void 0?void 0:n.ifNoneMatch,sourceIfUnmodifiedSince:(i=t.sourceConditions)===null||i===void 0?void 0:i.ifUnmodifiedSince,sourceIfTags:(o=t.sourceConditions)===null||o===void 0?void 0:o.tagConditions},cpkInfo:t.customerProvidedKey,copySourceAuthorization:httpAuthorizationToString(t.sourceAuthorization),tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)}),convertTracingToRequestOptionsBase(c)))];case 2:return[2,d.sent()];case 3:p=d.sent();l.setStatus({code:SpanStatusCode.ERROR,message:p.message});throw p;case 4:l.end();return[7];case 5:return[2]}}))}))};t.prototype.stageBlock=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:n=createSpan("BlockBlobClient-stageBlock",a),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.stageBlock(e,r,t,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,requestOptions:{onUploadProgress:a.onProgress},transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.stageBlockFromURL=function(e,t,r,a,n){if(r===void 0){r=0}if(n===void 0){n={}}return __awaiter(this,void 0,void 0,(function(){var i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:i=createSpan("BlockBlobClient-stageBlockFromURL",n),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(n.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.stageBlockFromURL(e,0,t,Object.assign({abortSignal:n.abortSignal,leaseAccessConditions:n.conditions,sourceContentMD5:n.sourceContentMD5,sourceContentCrc64:n.sourceContentCrc64,sourceRange:r===0&&!a?undefined:rangeToString({offset:r,count:a}),cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,copySourceAuthorization:httpAuthorizationToString(n.sourceAuthorization)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.commitBlockList=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t.conditions=t.conditions||{};i=createSpan("BlockBlobClient-commitBlockList",t),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.blockBlobContext.commitBlockList({latest:e},Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.getBlockList=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:a=createSpan("BlockBlobClient-getBlockList",t),n=a.span,i=a.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.blockBlobContext.getBlockList(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:o=l.sent();if(!o.committedBlocks){o.committedBlocks=[]}if(!o.uncommittedBlocks){o.uncommittedBlocks=[]}return[2,o];case 3:s=l.sent();n.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadData=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){r=createSpan("BlockBlobClient-uploadData",t),a=r.span,n=r.updatedOptions;try{if(isNode){if(e instanceof Buffer){i=e}else if(e instanceof ArrayBuffer){i=Buffer.from(e)}else{e=e;i=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}return[2,this.uploadSeekableInternal((function(e,t){return i.slice(e,e+t)}),i.byteLength,n)]}else{o=new Blob([e]);return[2,this.uploadSeekableInternal((function(e,t){return o.slice(e,e+t)}),o.size,n)]}}catch(e){a.setStatus({code:SpanStatusCode.ERROR,message:e.message});throw e}finally{a.end()}return[2]}))}))};t.prototype.uploadBrowserData=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:r=createSpan("BlockBlobClient-uploadBrowserData",t),a=r.span,n=r.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);i=new Blob([e]);return[4,this.uploadSeekableInternal((function(e,t){return i.slice(e,e+t)}),i.size,n)];case 2:return[2,s.sent()];case 3:o=s.sent();a.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:a.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadSeekableInternal=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,l,c,p,d,u,m;var f=this;return __generator(this,(function(h){switch(h.label){case 0:if(!r.blockSize){r.blockSize=0}if(r.blockSize<0||r.blockSize>BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES){throw new RangeError("blockSize option must be >= 0 and <= ".concat(BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES))}if(r.maxSingleShotSize!==0&&!r.maxSingleShotSize){r.maxSingleShotSize=BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}if(r.maxSingleShotSize<0||r.maxSingleShotSize>BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES){throw new RangeError("maxSingleShotSize option must be >= 0 and <= ".concat(BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES))}if(r.blockSize===0){if(t>BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES*BLOCK_BLOB_MAX_BLOCKS){throw new RangeError("".concat(t," is too larger to upload to a block blob."))}if(t>r.maxSingleShotSize){r.blockSize=Math.ceil(t/BLOCK_BLOB_MAX_BLOCKS);if(r.blockSize<DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES){r.blockSize=DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES}}}if(!r.blobHTTPHeaders){r.blobHTTPHeaders={}}if(!r.conditions){r.conditions={}}a=createSpan("BlockBlobClient-uploadSeekableInternal",r),n=a.span,i=a.updatedOptions;h.label=1;case 1:h.trys.push([1,5,6,7]);if(!(t<=r.maxSingleShotSize))return[3,3];return[4,this.upload(e(0,t),t,i)];case 2:return[2,h.sent()];case 3:o=Math.floor((t-1)/r.blockSize)+1;if(o>BLOCK_BLOB_MAX_BLOCKS){throw new RangeError("The buffer's size is too big or the BlockSize is too small;"+"the number of blocks must be <= ".concat(BLOCK_BLOB_MAX_BLOCKS))}s=[];l=generateUuid();c=0;p=new Batch(r.concurrency);d=function(a){p.addOperation((function(){return __awaiter(f,void 0,void 0,(function(){var n,p,d,u;return __generator(this,(function(m){switch(m.label){case 0:n=generateBlockID(l,a);p=r.blockSize*a;d=a===o-1?t:p+r.blockSize;u=d-p;s.push(n);return[4,this.stageBlock(n,e(p,u),u,{abortSignal:r.abortSignal,conditions:r.conditions,encryptionScope:r.encryptionScope,tracingOptions:i.tracingOptions})];case 1:m.sent();c+=u;if(r.onProgress){r.onProgress({loadedBytes:c})}return[2]}}))}))}))};for(u=0;u<o;u++){d(u)}return[4,p.do()];case 4:h.sent();return[2,this.commitBlockList(s,i)];case 5:m=h.sent();n.setStatus({code:SpanStatusCode.ERROR,message:m.message});throw m;case 6:n.end();return[7];case 7:return[2]}}))}))};t.prototype.uploadFile=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i;return __generator(this,(function(o){switch(o.label){case 0:e=createSpan("BlockBlobClient-uploadFile",t),r=e.span,a=e.updatedOptions;o.label=1;case 1:o.trys.push([1,4,5,6]);return[4,fsStat()];case 2:n=o.sent().size;return[4,this.uploadSeekableInternal((function(e,t){return function(){return fsCreateReadStream()}}),n,Object.assign(Object.assign({},t),{tracingOptions:Object.assign(Object.assign({},t.tracingOptions),convertTracingToRequestOptionsBase(a))}))];case 3:return[2,o.sent()];case 4:i=o.sent();r.setStatus({code:SpanStatusCode.ERROR,message:i.message});throw i;case 5:r.end();return[7];case 6:return[2]}}))}))};t.prototype.uploadStream=function(e,t,r,a){if(t===void 0){t=DEFAULT_BLOCK_BUFFER_SIZE_BYTES}if(r===void 0){r=5}if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l,c,p,d,u;var m=this;return __generator(this,(function(f){switch(f.label){case 0:if(!a.blobHTTPHeaders){a.blobHTTPHeaders={}}if(!a.conditions){a.conditions={}}n=createSpan("BlockBlobClient-uploadStream",a),i=n.span,o=n.updatedOptions;f.label=1;case 1:f.trys.push([1,4,5,6]);s=0;l=generateUuid();c=0;p=[];d=new BufferScheduler(e,t,r,(function(e,t){return __awaiter(m,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:r=generateBlockID(l,s);p.push(r);s++;return[4,this.stageBlock(r,e,t,{conditions:a.conditions,encryptionScope:a.encryptionScope,tracingOptions:o.tracingOptions})];case 1:n.sent();c+=t;if(a.onProgress){a.onProgress({loadedBytes:c})}return[2]}}))}))}),Math.ceil(r/4*3));return[4,d.do()];case 2:f.sent();return[4,this.commitBlockList(p,Object.assign(Object.assign({},a),{tracingOptions:Object.assign(Object.assign({},a.tracingOptions),convertTracingToRequestOptionsBase(o))}))];case 3:return[2,f.sent()];case 4:u=f.sent();i.setStatus({code:SpanStatusCode.ERROR,message:u.message});throw u;case 5:i.end();return[7];case 6:return[2]}}))}))};return t}(BlobClient);var PageBlobClient=function(e){__extends(t,e);function t(t,r,a,n){var i=this;var o;var s;n=n||{};if(isPipelineLike(r)){s=t;o=r}else if(isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential||isTokenCredential(r)){s=t;n=a;o=newPipeline(r,n)}else if(!r&&typeof r!=="string"){s=t;o=newPipeline(new AnonymousCredential,n)}else if(r&&typeof r==="string"&&a&&typeof a==="string"){var l=r;var c=a;var p=extractConnectionStringParts(t);if(p.kind==="AccountConnString"){if(isNode){var d=new StorageSharedKeyCredential(p.accountName,p.accountKey);s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c));n.proxyOptions=getDefaultProxySettings();o=newPipeline(d,n)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){s=appendToURLPath(appendToURLPath(p.url,encodeURIComponent(l)),encodeURIComponent(c))+"?"+p.accountSas;o=newPipeline(new AnonymousCredential,n)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}i=e.call(this,s,o)||this;i.pageBlobContext=new PageBlob(i.storageClientContext);return i}t.prototype.withSnapshot=function(e){return new t(setURLParameter(this.url,URLConstants.Parameters.SNAPSHOT,e.length===0?undefined:e),this.pipeline)};t.prototype.create=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t.conditions=t.conditions||{};i=createSpan("PageBlobClient-create",t),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(t.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.create(0,e,Object.assign({abortSignal:t.abortSignal,blobHttpHeaders:t.blobHTTPHeaders,blobSequenceNumber:t.blobSequenceNumber,leaseAccessConditions:t.conditions,metadata:t.metadata,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),cpkInfo:t.customerProvidedKey,encryptionScope:t.encryptionScope,immutabilityPolicyExpiry:(a=t.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(n=t.immutabilityPolicy)===null||n===void 0?void 0:n.policyMode,legalHold:t.legalHold,tier:toAccessTier(t.tier),blobTagsString:toBlobTagsString(t.tags)},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.createIfNotExists=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:n=createSpan("PageBlobClient-createIfNotExists",t),i=n.span,o=n.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);s={ifNoneMatch:ETagAny};return[4,this.create(e,Object.assign(Object.assign({},t),{conditions:s,tracingOptions:o.tracingOptions}))];case 2:l=p.sent();return[2,Object.assign(Object.assign({succeeded:true},l),{_response:l._response})];case 3:c=p.sent();if(((r=c.details)===null||r===void 0?void 0:r.errorCode)==="BlobAlreadyExists"){i.setStatus({code:SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return[2,Object.assign(Object.assign({succeeded:false},(a=c.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:c.response})]}i.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadPages=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-uploadPages",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.uploadPages(r,e,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),requestOptions:{onUploadProgress:a.onProgress},range:rangeToString({offset:t,count:r}),sequenceNumberAccessConditions:a.conditions,transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(s)))];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.uploadPagesFromURL=function(e,t,r,a,n){if(n===void 0){n={}}return __awaiter(this,void 0,void 0,(function(){var i,o,s,l,c;return __generator(this,(function(p){switch(p.label){case 0:n.conditions=n.conditions||{};n.sourceConditions=n.sourceConditions||{};o=createSpan("PageBlobClient-uploadPagesFromURL",n),s=o.span,l=o.updatedOptions;p.label=1;case 1:p.trys.push([1,3,4,5]);ensureCpkIfSpecified(n.customerProvidedKey,this.isHttps);return[4,this.pageBlobContext.uploadPagesFromURL(e,rangeToString({offset:t,count:a}),0,rangeToString({offset:r,count:a}),Object.assign({abortSignal:n.abortSignal,sourceContentMD5:n.sourceContentMD5,sourceContentCrc64:n.sourceContentCrc64,leaseAccessConditions:n.conditions,sequenceNumberAccessConditions:n.conditions,modifiedAccessConditions:Object.assign(Object.assign({},n.conditions),{ifTags:(i=n.conditions)===null||i===void 0?void 0:i.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:n.sourceConditions.ifMatch,sourceIfModifiedSince:n.sourceConditions.ifModifiedSince,sourceIfNoneMatch:n.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:n.sourceConditions.ifUnmodifiedSince},cpkInfo:n.customerProvidedKey,encryptionScope:n.encryptionScope,copySourceAuthorization:httpAuthorizationToString(n.sourceAuthorization)},convertTracingToRequestOptionsBase(l)))];case 2:return[2,p.sent()];case 3:c=p.sent();s.setStatus({code:SpanStatusCode.ERROR,message:c.message});throw c;case 4:s.end();return[7];case 5:return[2]}}))}))};t.prototype.clearPages=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-clearPages",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.clearPages(0,Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:e,count:t}),sequenceNumberAccessConditions:r.conditions,cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRanges=function(e,t,r){if(e===void 0){e=0}if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-getPageRanges",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRanges(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(o))).then(rangeResponseFromModel)];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRangesDiff=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-getPageRangesDiff",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),prevsnapshot:r,range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(s))).then(rangeResponseFromModel)];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.getPageRangesDiffForManagedDisks=function(e,t,r,a){if(a===void 0){a={}}return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:a.conditions=a.conditions||{};i=createSpan("PageBlobClient-GetPageRangesDiffForManagedDisks",a),o=i.span,s=i.updatedOptions;c.label=1;case 1:c.trys.push([1,3,4,5]);return[4,this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(n=a.conditions)===null||n===void 0?void 0:n.tagConditions}),prevSnapshotUrl:r,range:rangeToString({offset:e,count:t})},convertTracingToRequestOptionsBase(s))).then(rangeResponseFromModel)];case 2:return[2,c.sent()];case 3:l=c.sent();o.setStatus({code:SpanStatusCode.ERROR,message:l.message});throw l;case 4:o.end();return[7];case 5:return[2]}}))}))};t.prototype.resize=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:t.conditions=t.conditions||{};a=createSpan("PageBlobClient-resize",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.pageBlobContext.resize(e,Object.assign({abortSignal:t.abortSignal,leaseAccessConditions:t.conditions,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions}),encryptionScope:t.encryptionScope},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};t.prototype.updateSequenceNumber=function(e,t,r){if(r===void 0){r={}}return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s;return __generator(this,(function(l){switch(l.label){case 0:r.conditions=r.conditions||{};n=createSpan("PageBlobClient-updateSequenceNumber",r),i=n.span,o=n.updatedOptions;l.label=1;case 1:l.trys.push([1,3,4,5]);return[4,this.pageBlobContext.updateSequenceNumber(e,Object.assign({abortSignal:r.abortSignal,blobSequenceNumber:t,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(a=r.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(o)))];case 2:return[2,l.sent()];case 3:s=l.sent();i.setStatus({code:SpanStatusCode.ERROR,message:s.message});throw s;case 4:i.end();return[7];case 5:return[2]}}))}))};t.prototype.startCopyIncremental=function(e,t){if(t===void 0){t={}}return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:a=createSpan("PageBlobClient-startCopyIncremental",t),n=a.span,i=a.updatedOptions;s.label=1;case 1:s.trys.push([1,3,4,5]);return[4,this.pageBlobContext.copyIncremental(e,Object.assign({abortSignal:t.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},t.conditions),{ifTags:(r=t.conditions)===null||r===void 0?void 0:r.tagConditions})},convertTracingToRequestOptionsBase(i)))];case 2:return[2,s.sent()];case 3:o=s.sent();n.setStatus({code:SpanStatusCode.ERROR,message:o.message});throw o;case 4:n.end();return[7];case 5:return[2]}}))}))};return t}(BlobClient);var EzpPrintService=function(){function e(e,t){var r=this;this.getPrintStatus=function(){return fetch("https://".concat(r.printingApi,"/sfapi/Status/?id=").concat(encodeURIComponent(printStore.state.jobID)),{headers:{Authorization:"Bearer "+authStore.state.accessToken}}).then((function(e){return e.json()}))};this.redirectURI=e;this.clientID=t;this.printingApi=printStore.state.printApiHostUrl;this.checkStoredRefreshToken()}e.prototype.checkStoredRefreshToken=function(){if(authStore.state.refreshToken!==""){return}if(localStorage.getItem("refreshToken")===null){authStore.state.refreshToken=""}else{authStore.state.refreshToken=localStorage.getItem("refreshToken")}};e.prototype.registerFetchInterceptor=function(){var e=this;browser.register({request:function(e,t){return[e,t]},requestError:function(e){return Promise.reject(e)},response:function(t){if(t.status===401){if(authStore.state.refreshToken===""){return t}var r=new EzpAuthorizationService(e.redirectURI,e.clientID);r.refreshTokens()}return t},responseError:function(e){return Promise.reject(e)}})};e.prototype.getPrinterList=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinter/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getConfig=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,fetch("https://".concat(this.printingApi,"/sfapi/GetConfiguration/"),{method:"GET",headers:{Authorization:"Bearer "+e}})]}))}))};e.prototype.getPrinterProperties=function(e,t){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinterProperties/?id=").concat(t),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.getAllPrinterProperties=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/GetPrinterProperties/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.printFileByUrl=function(e,t,r,a,n,i,o){return fetch("https://".concat(this.printingApi,"/sfapi/Print/"),{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileurl:t,type:r,printerid:a},i&&{alias:i}),o&&{printanddelete:o}),{properties:n}))})};e.prototype.printByFileID=function(e,t,r,a,n,i,o){return fetch("https://".concat(this.printingApi,"/sfapi/Print/"),{method:"POST",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign(Object.assign({fileid:t,type:r,printerid:a},i&&{alias:i}),o&&{printanddelete:o}),{properties:n}))}).then((function(e){return e.json()}))};e.prototype.prepareFileUpload=function(e){return fetch("https://".concat(this.printingApi,"/sfapi/PrepareUpload/"),{method:"GET",headers:{Authorization:"Bearer "+e}}).then((function(e){return e.json()}))};e.prototype.uploadFile=function(e,t){return fetch("".concat(e),{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type:":"multipart/form-data"},body:t}).then((function(e){return e.json()}))};e.prototype.uploadBlobFiles=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n;return __generator(this,(function(i){switch(i.label){case 0:printStore.state.uploadProgress=0;r=newPipeline(new AnonymousCredential,{retryOptions:{maxTries:4},userAgentOptions:{userAgentPrefix:"AdvancedSample V1.0.0"},keepAliveOptions:{enable:false}});a=new BlockBlobClient(e,r);return[4,a.uploadData(t,{blockSize:4*1024*1024,concurrency:20,onProgress:function(e){var r=100*e.loadedBytes/t.size;printStore.state.uploadProgress=r},blobHTTPHeaders:{blobContentType:"application/octet-stream"}})];case 1:n=i.sent();return[2,n]}}))}))};return e}();var printStore=createStore({printers:[],jobID:"",printFinished:false,printApiHostUrl:"",printerProperties:{},fileID:"",fileUrl:"",fileType:"",printerID:"",fileName:"",uploadProgress:0,supportedFileExtensions:""});var EzpUserService=function(){function e(){}e.prototype.getUserInfo=function(){return fetch("https://".concat(authStore.state.authApiHostUrl,"/v1/users/me"),{headers:{Authorization:"Bearer "+authStore.state.accessToken,"Content-Type":"application/json"},method:"GET"}).then((function(e){return e.json()}))};return e}();var userStore=createStore({user:null,theme:"",appearance:""});var ezpPrinterSelectionCss=':host{-ms-flex-line-pack:var(--ezp-printerSelection-alignContent, center);align-content:var(--ezp-printerSelection-alignContent, center);background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));display:grid;grid-template:auto/var(--ezp-printerSelection-width, 320px);height:var(--ezp-printerSelection-height, 100vh);-ms-flex-pack:var(--ezp-printerSelection-justifyContent, center);justify-content:var(--ezp-printerSelection-justifyContent, center);left:0;position:var(--ezp-printerSelection-position, fixed);top:0;width:100%;z-index:1}:host(.seamless){--ezp-printerSelection-alignContent:stretch;--ezp-printerSelection-background:transparent;--ezp-printerSelection-body-background:transparent;--ezp-printerSelection-body-padding:0;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-borderRadius:0;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-footer-boxShadowPosition:0 0 0 0;--ezp-printerSelection-footer-padding:var(--ezp-spacing-2) 0;--ezp-printerSelection-header-boxShadowPosition:0 0 0 0;--ezp-printerSelection-header-padding:var(--ezp-spacing-4) 0;--ezp-printerSelection-justifyContent:stretch;--ezp-printerSelection-position:static}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:var(--ezp-printerSelection-box-borderRadius, 6px);-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));padding:var(--ezp-printerSelection-padding, 0);position:relative}#header{border-radius:6px 6px 0 0;-webkit-box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:grid;grid-column-gap:var(--ezp-spacing-2);grid-template-columns:auto 1fr auto;padding:var(--ezp-printerSelection-header-padding, var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4));position:relative;z-index:3}#toggle-menu{margin:calc(var(--ezp-spacing-3) * -1) 0;position:relative;z-index:2}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-secondary));-webkit-box-shadow:var(--ezp-printerSelection-body-boxShadow, none);box-shadow:var(--ezp-printerSelection-body-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);padding:var(--ezp-printerSelection-body-padding, var(--ezp-spacing-2))}#footer{border-radius:0 0 6px 6px;-webkit-box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-2);grid-template-areas:var(--ezp-printerSelection-footer-areas, "cancel print");grid-template-columns:var(--ezp-printerSelection-footer-columns, repeat(2, 1fr));grid-template-rows:var(--ezp-printerSelection-footer-rows, auto);-ms-flex-pack:center;justify-content:center;justify-items:stretch;padding:var(--ezp-printerSelection-footer-padding, var(--ezp-spacing-2));position:relative;z-index:3}#cancel{grid-area:cancel}#print{grid-area:print}';var EzpPrinterSelection=function(){function e(e){var t=this;registerInstance(this,e);this.printCancel=createEvent(this,"printCancel",7);this.printSubmit=createEvent(this,"printSubmit",7);this.logout=createEvent(this,"logout",7);this.sasUri="";this.fileExtension="";this.duplexOptions=[{id:1,title:i18next.t("printer_selection.duplex_none")},{id:2,title:i18next.t("printer_selection.duplex_long")},{id:3,title:i18next.t("printer_selection.duplex_short")}];this.hidemenu=false;this.hideheader=false;this.loading=true;this.printProcessing=false;this.pageRangeInvalid=false;this.uploading=false;this.preparingUpload=false;this.printSuccess=false;this.printFailed=false;this.notSupported=false;this.noPrinters=false;this.userMenuOpen=false;this.printStopped=false;this.selectedPrinterConfig={OrientationsSupported:[],PaperFormats:[],Resolutions:[],DuplexSupported:false,Color:false};this.selectedProperties={paper:"",paperid:"",color:false,duplex:true,duplexmode:1,orientation:1,copies:"",resolution:0,paperlength:0,paperwidth:0,PageRanges:""};this.handleCancel=function(){t.printCancel.emit()};this.validateData=function(e){if(e.jobstatus===0){t.printSuccess=true;t.printProcessing=false;return true}return false};this.POLL_INTERVAL=2e3;this.MAX_POLL_ATTEMPTS=Infinity;this.handlePrint=function(){return __awaiter(t,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){switch(r.label){case 0:this.printButton.blur();this.printProcessing=true;e=removeEmptyStrings(this.selectedProperties);e=managePaperDimensions(e);printStore.state.fileUrl=this.fileurl;printStore.state.fileID=this.fileid;printStore.state.fileType=this.filetype;printStore.state.printerID=this.selectedPrinter.id;printStore.state.printerProperties=this.selectedProperties;printStore.state.fileName=this.filename;if(this.fileurl){this.printService.printFileByUrl(authStore.state.accessToken,this.fileurl,this.filetype,this.selectedPrinter.id,e,this.filename).then((function(r){if(r.status===200&&t.selectedPrinter.is_queue){t.printProcessing=false;t.printSuccess=true}if(r.status===412){r.json().then((function(e){return t.fileid=e.fileid}));t.printService.printByFileID(authStore.state.accessToken,t.fileid,t.filetype,t.selectedPrinter.id,e,t.filename)}else{return r.json()}})).then((function(e){if(e.code===804){t.printFailed=true;t.printProcessing=false}if(e.jobid){printStore.state.jobID=e.jobid;poll({fn:t.printService.getPrintStatus,validate:t.validateData,interval:t.POLL_INTERVAL,maxAttempts:t.MAX_POLL_ATTEMPTS}).catch((function(e){console.warn(e);t.printFailed=true;t.printProcessing=false}))}else{t.printFailed=true;t.printProcessing=false}})).catch((function(e){console.log(e);t.printFailed=true;t.printProcessing=false}))}if(!this.file)return[3,2];return[4,this.handleFiles(this.file,e)];case 1:r.sent();r.label=2;case 2:localStorage.setItem("properties",JSON.stringify(this.selectedProperties));localStorage.setItem("printer",JSON.stringify(this.selectedPrinter));this.printStopped=false;return[2]}}))}))};this.handleUserMenu=function(){t.userMenuOpen=true};this.validateFileType=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){t=e.split(".").pop();this.fileExtension=t.toLowerCase();return[2,printStore.state.supportedFileExtensions.includes("".concat(this.fileExtension))]}))}))}}e.prototype.listenInputValueChanged=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenSelectSelection=function(e){this.setSelectedProperties(e.detail)};e.prototype.listenStepperChanged=function(e){this.selectedProperties.copies=e.detail};e.prototype.listenUserMenuClosure=function(){this.userMenuOpen=false};e.prototype.listenLogout=function(){this.printCancel.emit();this.logout.emit()};e.prototype.listenStatusCancel=function(e){if(e.detail==="print-processing"){this.printStopped=true;this.printProcessing=false}};e.prototype.listenStatusClose=function(e){switch(e.detail){case"print-success":this.printSuccess=false;this.printCancel.emit();break;case"print-failed":this.printProcessing=false;this.printFailed=false;break;case"no-printers":this.noPrinters=false;break}};e.prototype.listenStatusRetry=function(e){switch(e.detail){case"not-supported":this.printCancel.emit();break;case"print-failed":this.printFailed=false;this.printProcessing=false;this.handlePrint();break}};e.prototype.getPropertiesFromLocalStorage=function(){if(localStorage.getItem("properties")){this.selectedProperties=JSON.parse(localStorage.getItem("properties"))}if(localStorage.getItem("printer")){var e=JSON.parse(localStorage.getItem("printer"));if(this.printers.some((function(t){return t.id===e.id}))){this.selectedPrinter=e}else{this.selectedPrinter={id:"",location:"",name:"",is_queue:false};localStorage.removeItem("printer");localStorage.removeItem("properties")}}else{this.selectedPrinter={id:"",location:"",name:"",is_queue:false}}this.setPaperid()};e.prototype.setPaperid=function(){this.paperid=this.selectedProperties.paperid};e.prototype.getUserInfo=function(){var e=this;var t=new EzpUserService;return t.getUserInfo().then((function(t){userStore.state.user=t;e.userName=userStore.state.user.display_name}))};e.prototype.setSelectedProperties=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(a){switch(a.label){case 0:t=e.type;switch(t){case"printer":return[3,1];case"color":return[3,3];case"orientation":return[3,4];case"format":return[3,5];case"quality":return[3,6];case"length":return[3,7];case"width":return[3,8];case"paper_ranges":return[3,9];case"duplex":return[3,10]}return[3,11];case 1:this.selectedPrinter.id=e.id;this.selectedPrinter.name=e.title;this.selectedPrinter.is_queue=e.is_queue;return[4,this.printService.getPrinterProperties(authStore.state.accessToken,this.selectedPrinter.id).then((function(e){return r.selectedPrinterConfig=e[0]}))];case 2:a.sent();this.setDefaultPaperFormat();return[3,11];case 3:this.selectedProperties.color=!!e.id;return[3,11];case 4:this.selectedProperties.orientation=e.id;return[3,11];case 5:this.selectedProperties.paper=e.title;this.selectedProperties.paperid=e.id;return[3,11];case 6:this.selectedProperties.resolution=e.title;return[3,11];case 7:this.selectedProperties.paperlength=e.value;return[3,11];case 8:this.selectedProperties.paperwidth=e.value;return[3,11];case 9:this.selectedProperties.PageRanges=e.value;this.pageRangeInvalid=!validatePageRange(this.selectedProperties.PageRanges);return[3,11];case 10:if(e.title==="None"){this.selectedProperties.duplex=false}else{this.selectedProperties.duplex=true}this.selectedProperties.duplexmode=e.id;return[3,11];case 11:this.setPaperid();return[2]}}))}))};e.prototype.handleFiles=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,a,n;var i=this;return __generator(this,(function(o){switch(o.label){case 0:this.preparingUpload=true;return[4,this.printService.prepareFileUpload(authStore.state.accessToken)];case 1:r=o.sent();this.preparingUpload=false;this.fileid=r.fileid;this.sasUri=r.sasUri;this.filetype=this.fileExtension;this.uploading=true;o.label=2;case 2:o.trys.push([2,4,,5]);return[4,this.printService.uploadBlobFiles(this.sasUri,e)];case 3:a=o.sent();return[3,5];case 4:n=o.sent();this.printProcessing=false;this.printFailed=true;return[3,5];case 5:this.uploading=false;if(a._response.status===201){this.printService.printByFileID(authStore.state.accessToken,this.fileid,this.filetype,this.selectedPrinter.id,t,this.filename).then((function(e){if(e.code===804){i.printFailed=true;i.printProcessing=false}if(e.jobid){printStore.state.jobID=e.jobid;poll({fn:i.printService.getPrintStatus,validate:i.validateData,interval:i.POLL_INTERVAL,maxAttempts:i.MAX_POLL_ATTEMPTS}).catch((function(e){console.log(e);i.printFailed=true;i.printProcessing=false}))}else{i.printFailed=true;i.printProcessing=false}})).catch((function(e){console.log(e);i.printFailed=true;i.printProcessing=false}))}else{this.printFailed=true;this.printProcessing=false}return[2]}}))}))};e.prototype.setDefaultPaperFormat=function(){var e;var t=navigator.language;if(t==="en-US"){e="Letter"}else if(t==="my"){e="Letter"}else{e="A4"}if(this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)}))){this.selectedProperties.paper=this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)})).Name;this.selectedProperties.paperid=this.selectedPrinterConfig.PaperFormats.find((function(t){return t.Name.includes(e)})).Id}else{this.selectedProperties.paper=this.selectedPrinterConfig.PaperFormats[0].Name;this.selectedProperties.paperid=this.selectedPrinterConfig.PaperFormats[0].Id}this.setPaperid()};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:this.printService=new EzpPrintService(this.redirectURI,this.clientID);this.printService.registerFetchInterceptor();return[4,this.getUserInfo()];case 1:t.sent();return[4,this.printService.getPrinterList(authStore.state.accessToken).then((function(t){e.printers=t;if(!(e.printers.length>0)){e.noPrinters=true}}))];case 2:t.sent();this.getPropertiesFromLocalStorage();if(!(this.selectedPrinter.id!=""))return[3,4];return[4,this.printService.getPrinterProperties(authStore.state.accessToken,this.selectedPrinter.id).then((function(t){return e.selectedPrinterConfig=t[0]}))];case 3:t.sent();if(this.selectedProperties.paper===""){this.setDefaultPaperFormat()}t.label=4;case 4:return[4,this.printService.getConfig(authStore.state.accessToken)];case 5:return[4,t.sent().json().then((function(e){printStore.state.supportedFileExtensions=e.System.FILEEXT}))];case 6:t.sent();return[4,this.printService.getAllPrinterProperties(authStore.state.accessToken).then((function(t){e.printerConfig=t}))];case 7:t.sent();if(!this.file)return[3,9];return[4,this.validateFileType(this.filename).then((function(t){e.notSupported=!t?true:false}))];case 8:t.sent();t.label=9;case 9:this.loading=false;return[2]}}))}))};e.prototype.render=function(){var e=this;return this.loading?h("ezp-status",{processing:true,description:i18next.t("printer_selection.loading"),instance:"loading"}):h(Host,{class:{seamless:this.seamless}},h("div",{id:"box","data-backdrop-surface":true},!this.printStopped&&h(Fragment,null,this.printProcessing?h("ezp-status",{processing:true,description:this.preparingUpload?i18next.t("printer_selection.prepare_upload"):this.uploading?i18next.t("printer_selection.uploading"):i18next.t("printer_selection.print_processing"),instance:"print-processing",cancel:true}):this.selectedPrinter.is_queue&&this.printSuccess?h("ezp-status",{icon:"checkmark-alt",description:i18next.t("printer_selection.pull_print_success"),instance:"print-success",close:true}):this.printSuccess?h("ezp-status",{icon:"checkmark-alt",description:i18next.t("printer_selection.print_success"),instance:"print-success",close:true}):this.printFailed?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.print_failed"),instance:"print-failed",close:true,retry:true}):this.notSupported?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.not_supported"),instance:"not-supported",retry:true}):this.noPrinters?h("ezp-status",{icon:"exclamation-mark",description:i18next.t("printer_selection.no_printers"),instance:"no-printers",close:true}):null),!this.hideheader&&h("div",{id:"header"},h("ezp-label",{weight:"heavy",text:i18next.t("printer_selection.print")+"".concat(!this.notSupported?":":"")}),h("ezp-label",{text:!this.notSupported?this.filename:"",ellipsis:true}),!this.hidemenu&&h("ezp-icon-button",{level:"tertiary",icon:"menu",id:"toggle-menu",type:"button",onClick:this.handleUserMenu})),h("div",{id:"body"},h("div",{id:"printer"},h("ezp-select",{label:i18next.t("printer_selection.printer"),icon:"printer",placeholder:this.printers.length>0?i18next.t("printer_selection.select_printer"):i18next.t("printer_selection.no_printers"),toggleFlow:"vertical",optionFlow:"vertical",options:this.printers.map((function(e){return{id:e.id,title:e.name,meta:e.location!==""?e.location:"",type:"printer",is_queue:e.is_queue}})),preSelected:this.selectedPrinter.id?this.selectedPrinter.name:null,disabled:!(this.printers.length>0)})),h("div",{id:"options"},h("ezp-select",{label:i18next.t("printer_selection.color"),icon:"color",placeholder:i18next.t("printer_selection.select_color"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.Color?[{id:1,title:i18next.t("printer_selection.color_color"),meta:"",type:"color"},{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}]:[{id:0,title:i18next.t("printer_selection.color_grayscale"),meta:"",type:"color"}],preSelected:this.selectedPrinter.id?this.selectedProperties.color?i18next.t("printer_selection.color_color"):i18next.t("printer_selection.color_grayscale"):null,disabled:!this.selectedPrinterConfig.Color}),h("ezp-select",{label:i18next.t("printer_selection.duplex"),icon:"duplex",placeholder:i18next.t("printer_selection.select_duplex"),toggleFlow:"horizontal",options:this.duplexOptions.map((function(e){return{id:e.id,title:e.title,meta:"",type:"duplex"}})),preSelected:this.selectedPrinter.id&&this.selectedProperties.duplex?this.duplexOptions.find((function(t){return t.id===e.selectedProperties.duplexmode})).id:null,disabled:!this.selectedPrinterConfig.DuplexSupported}),h("ezp-select",{label:i18next.t("printer_selection.size"),icon:"size",placeholder:i18next.t("printer_selection.select_size"),toggleFlow:"horizontal",optionFlow:"horizontal",options:this.selectedPrinterConfig.PaperFormats.map((function(e){return{id:e.Id,title:e.Name,meta:"".concat(e.XRes," x ").concat(e.YRes),type:"format"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.paper:null,disabled:!(this.selectedPrinterConfig.PaperFormats.length>0)}),this.paperid==PAPER_ID?h(Fragment,null,h("ezp-input",{icon:"width",suffix:"mm",value:this.selectedProperties.paperwidth,eventType:"width",type:"number",label:i18next.t("printer_selection.width")}),h("ezp-input",{icon:"height",suffix:"mm",value:this.selectedProperties.paperlength,eventType:"length",type:"number",label:i18next.t("printer_selection.length")})):null,h("ezp-select",{label:i18next.t("printer_selection.orientation"),icon:"orientation",placeholder:i18next.t("printer_selection.select_orientation"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.OrientationsSupported.map((function(e,t){return{id:t+1,title:i18next.t("printer_selection.orientation_".concat(e)),meta:"",type:"orientation"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.orientation:null,disabled:!(this.selectedPrinterConfig.OrientationsSupported.length>0)}),h("ezp-select",{label:i18next.t("printer_selection.quality"),icon:"quality",placeholder:i18next.t("printer_selection.select_quality"),toggleFlow:"horizontal",options:this.selectedPrinterConfig.Resolutions.map((function(e,t){return{id:t,title:e,meta:"",type:"quality"}})),preSelected:this.selectedPrinter.id?this.selectedProperties.resolution:null,disabled:!(this.selectedPrinterConfig.Resolutions.length>0)}),h("ezp-input",{icon:"width",suffix:"",placeholder:"1-2,4-5,8",value:this.selectedProperties.PageRanges,eventType:"paper_ranges",type:"text",label:i18next.t("printer_selection.paper_ranges")})),h("ezp-stepper",{label:i18next.t("printer_selection.copies"),max:10,icon:"copies"})),h("div",{id:"footer"},h("ezp-text-button",{type:"button",level:"secondary",onClick:this.handleCancel,label:i18next.t("button_actions.cancel"),class:"action",id:"cancel"}),h("ezp-text-button",{disabled:this.selectedPrinter.id===""||this.printProcessing||this.pageRangeInvalid,type:"button",onClick:this.handlePrint,label:i18next.t("button_actions.print"),ref:function(t){return e.printButton=t},class:"action",id:"print"})),!this.hidemenu&&h("ezp-user-menu",{open:this.userMenuOpen,name:this.userName})))};return e}();EzpPrinterSelection.style=ezpPrinterSelectionCss;var authApiHostUrl="account.ezeep.com";var printingApiHostUrl="printapi.ezeep.com";var config={authApiHostUrl:authApiHostUrl,printingApiHostUrl:printingApiHostUrl};var ezpPrintingCss=':host{--ezp-black-5:rgba(0, 0, 0, 0.05);--ezp-black-10:rgba(0, 0, 0, 0.1);--ezp-black-20:rgba(0, 0, 0, 0.2);--ezp-black-30:rgba(0, 0, 0, 0.3);--ezp-black-40:rgba(0, 0, 0, 0.4);--ezp-black-50:rgba(0, 0, 0, 0.5);--ezp-black-60:rgba(0, 0, 0, 0.6);--ezp-black-70:rgba(0, 0, 0, 0.7);--ezp-black-80:rgba(0, 0, 0, 0.8);--ezp-black-90:rgba(0, 0, 0, 0.9);--ezp-black-95:rgba(0, 0, 0, 0.95);--ezp-black-100:black}:host{--ezp-white-5:rgba(255, 255, 255, 0.05);--ezp-white-10:rgba(255, 255, 255, 0.1);--ezp-white-20:rgba(255, 255, 255, 0.2);--ezp-white-30:rgba(255, 255, 255, 0.3);--ezp-white-40:rgba(255, 255, 255, 0.4);--ezp-white-50:rgba(255, 255, 255, 0.5);--ezp-white-60:rgba(255, 255, 255, 0.6);--ezp-white-70:rgba(255, 255, 255, 0.7);--ezp-white-80:rgba(255, 255, 255, 0.8);--ezp-white-90:rgba(255, 255, 255, 0.9);--ezp-white-95:rgba(255, 255, 255, 0.95);--ezp-white-100:white}:host{font-family:"Inter", sans-serif;-webkit-font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";font-feature-settings:"calt", "liga", "ss03", "zero", "cv05", "cv10";-webkit-font-kerning:normal;font-kerning:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;-webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;-webkit-text-size-adjust:none;--ezp-duration-1:0.1s;--ezp-duration-2:0.16s;--ezp-duration-3:0.26s;--ezp-duration-4:0.42s;--ezp-duration-5:0.68s;--ezp-duration-6:1s;--ezp-spacing-1:4px;--ezp-spacing-2:6px;--ezp-spacing-3:10px;--ezp-spacing-4:16px;--ezp-spacing-5:26px;--ezp-spacing-6:42px;--ezp-spacing-7:68px;--ezp-spacing-8:110px;--ezp-easing-in-quart:cubic-bezier(0.11, 0, 0.5, 0);--ezp-easing-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ezp-easing-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ezp-easing-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ezp-easing-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ezp-easing-out-expo:cubic-bezier(0.16, 1, 0.3, 1)}:host(.light){--ezp-accent-pink-solid:#f23267;--ezp-accent-pink-solid-alt:#df1559;--ezp-accent-pink-translucent:rgba(242, 50, 103, 0.16);--ezp-accent-red-solid:#f23b22;--ezp-accent-red-solid-alt:#de2313;--ezp-accent-red-translucent:rgba(242, 59, 34, 0.16);--ezp-accent-orange-solid:#fe7200;--ezp-accent-orange-solid-alt:#f56200;--ezp-accent-orange-translucent:rgba(254, 114, 0, 0.16);--ezp-accent-yellow-solid:#ffa200;--ezp-accent-yellow-solid-alt:#fe9000;--ezp-accent-yellow-translucent:rgba(255, 162, 0, 0.16);--ezp-accent-green-solid:#5d9200;--ezp-accent-green-solid-alt:#518100;--ezp-accent-green-translucent:rgba(93, 146, 0, 0.16);--ezp-accent-teal-solid:#00967c;--ezp-accent-teal-solid-alt:#00846e;--ezp-accent-teal-translucent:rgba(0, 150, 124, 0.16);--ezp-accent-cyan-solid:#0091b4;--ezp-accent-cyan-solid-alt:#0080a0;--ezp-accent-cyan-translucent:rgba(0, 145, 180, 0.16);--ezp-accent-blue-solid:#5081f1;--ezp-accent-blue-solid-alt:#3b72df;--ezp-accent-blue-translucent:rgba(80, 129, 241, 0.16);--ezp-accent-violet-solid:#ae5ef3;--ezp-accent-violet-solid-alt:#9d4ee2;--ezp-accent-violet-translucent:rgba(174, 94, 243, 0.16);--ezp-core-surface-primary:white;--ezp-core-surface-secondary:#f3f3f3;--ezp-core-surface-tertiary:white;--ezp-core-foreground-primary:rgba(0, 0, 0, 0.94);--ezp-core-foreground-secondary:rgba(62, 62, 62, 0.68);--ezp-core-foreground-tertiary:rgba(62, 62, 62, 0.42);--ezp-core-shade-primary:rgba(139, 139, 139, 0.1);--ezp-core-shade-secondary:rgba(139, 139, 139, 0.16);--ezp-core-shade-tertiary:rgba(139, 139, 139, 0.22);--ezp-core-outline:rgba(99, 99, 99, 0.16);--ezp-core-edge:rgba(0, 0, 0, 0.1);--ezp-core-backdrop:rgba(0, 0, 0, 0.26)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-accent-pink-solid:color(display-p3 0.949 0.196 0.404/100%);--ezp-accent-pink-solid-alt:color(display-p3 0.875 0.082 0.349/100%);--ezp-accent-pink-translucent:color(display-p3 0.949 0.196 0.404/16%);--ezp-accent-red-solid:color(display-p3 0.949 0.231 0.133/100%);--ezp-accent-red-solid-alt:color(display-p3 0.871 0.137 0.075/100%);--ezp-accent-red-translucent:color(display-p3 0.949 0.231 0.133/16%);--ezp-accent-orange-solid:color(display-p3 0.996 0.447 0/100%);--ezp-accent-orange-solid-alt:color(display-p3 0.961 0.384 0/100%);--ezp-accent-orange-translucent:color(display-p3 0.996 0.447 0/16%);--ezp-accent-yellow-solid:color(display-p3 1 0.635 0/100%);--ezp-accent-yellow-solid-alt:color(display-p3 0.996 0.565 0/100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.635 0/16%);--ezp-accent-green-solid:color(display-p3 0.365 0.573 0/100%);--ezp-accent-green-solid-alt:color(display-p3 0.318 0.506 0/100%);--ezp-accent-green-translucent:color(display-p3 0.365 0.573 0/16%);--ezp-accent-teal-solid:color(display-p3 0 0.588 0.486/100%);--ezp-accent-teal-solid-alt:color(display-p3 0 0.518 0.431/100%);--ezp-accent-teal-translucent:color(display-p3 0 0.588 0.486/16%);--ezp-accent-cyan-solid:color(display-p3 0 0.569 0.706/100%);--ezp-accent-cyan-solid-alt:color(display-p3 0 0.502 0.627/100%);--ezp-accent-cyan-translucent:color(display-p3 0 0.569 0.706/16%);--ezp-accent-blue-solid:color(display-p3 0.314 0.506 0.945/100%);--ezp-accent-blue-solid-alt:color(display-p3 0.231 0.447 0.875/100%);--ezp-accent-blue-translucent:color(display-p3 0.314 0.506 0.945/16%);--ezp-accent-violet-solid:color(display-p3 0.682 0.369 0.953/100%);--ezp-accent-violet-solid-alt:color(display-p3 0.616 0.306 0.886/100%);--ezp-accent-violet-translucent:color(display-p3 0.682 0.369 0.953/16%)}}}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.light){--ezp-core-surface-primary:color(display-p3 1 1 1/100%);--ezp-core-surface-secondary:color(display-p3 0.953 0.953 0.953/100%);--ezp-core-surface-tertiary:color(display-p3 1 1 1/100%);--ezp-core-foreground-primary:color(display-p3 0 0 0/94%);--ezp-core-foreground-secondary:color(display-p3 0.243 0.243 0.243/68%);--ezp-core-foreground-tertiary:color(display-p3 0.243 0.243 0.243/42%);--ezp-core-shade-primary:color(display-p3 0.545 0.545 0.545/10%);--ezp-core-shade-secondary:color(display-p3 0.545 0.545 0.545/16%);--ezp-core-shade-tertiary:color(display-p3 0.545 0.545 0.545/22%);--ezp-core-outline:color(display-p3 0.388 0.388 0.388/16%);--ezp-core-edge:color(display-p3 0 0 0/10%);--ezp-core-backdrop:color(display-p3 0 0 0/26%)}}}:host(.dark){--ezp-dialog-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-body-boxShadow:inset 1px 0 0 0 var(--ezp-core-outline),\n inset -1px 0 0 0 var(--ezp-core-outline);--ezp-printerSelection-box-boxShadow:0 0 0 1px var(--ezp-black-60);--ezp-printerSelection-footer-boxShadowPosition:inset 0 0 0 1px;--ezp-printerSelection-header-boxShadowPosition:inset 0 0 0 1px;--ezp-select-wrap-boxShadowPositionBottom:inset 0 -1px 0 0;--ezp-select-wrap-boxShadowPositionLeft:inset 1px 0 0 0;--ezp-select-wrap-boxShadowPositionRight:inset -1px 0 0 0;--ezp-select-wrap-boxShadowPositionTop:inset 0 1px 0 0;--ezp-status-box-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-stepper-boxShadowPosition:inset 0 0 0 1px;--ezp-userMenu-boxShadow:inset 0 0 0 1px var(--ezp-core-outline),\n 0 0 0 1px var(--ezp-black-60);--ezp-userMenu-header-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-links-boxShadowPosition:inset 0 -1px 0 0;--ezp-userMenu-theme-boxShadowPosition:inset 0 -1px 0 0;--ezp-input-box-shadow-position-top:inset 0 1px 0 0;--ezp-input-box-shadow-position-right:inset -1px 0 0 0;--ezp-input-box-shadow-position-bottom:inset 0 -1px 0 0;--ezp-input-box-shadow-position-left:inset 1px 0 0 0;--ezp-accent-pink-solid:#ff4171;--ezp-accent-pink-translucent:rgba(255, 65, 113, 0.26);--ezp-accent-red-solid:#ff482c;--ezp-accent-red-translucent:rgba(255, 72, 44, 0.26);--ezp-accent-orange-solid:#ff811c;--ezp-accent-orange-translucent:rgba(255, 129, 28, 0.26);--ezp-accent-yellow-solid:#ffaf3a;--ezp-accent-yellow-translucent:rgba(255, 175, 58, 0.26);--ezp-accent-green-solid:#679c15;--ezp-accent-green-translucent:rgba(103, 156, 21, 0.26);--ezp-accent-teal-solid:#1da086;--ezp-accent-teal-translucent:rgba(29, 160, 134, 0.26);--ezp-accent-cyan-solid:#209bbf;--ezp-accent-cyan-translucent:rgba(32, 155, 191, 0.26);--ezp-accent-blue-solid:#5d8bfd;--ezp-accent-blue-translucent:rgba(93, 139, 253, 0.26);--ezp-accent-violet-solid:#ba69ff;--ezp-accent-violet-translucent:rgba(186, 105, 255, 0.26);--ezp-core-surface-primary:black;--ezp-core-surface-secondary:#1b1b1b;--ezp-core-surface-tertiary:#282828;--ezp-core-foreground-primary:rgba(255, 255, 255, 0.94);--ezp-core-foreground-secondary:rgba(182, 182, 182, 0.68);--ezp-core-foreground-tertiary:rgba(182, 182, 182, 0.42);--ezp-core-shade-primary:rgba(99, 99, 99, 0.26);--ezp-core-shade-secondary:rgba(99, 99, 99, 0.32);--ezp-core-shade-tertiary:rgba(99, 99, 99, 0.38);--ezp-core-outline:rgba(139, 139, 139, 0.26);--ezp-core-edge:rgba(255, 255, 255, 0.16);--ezp-core-backdrop:rgba(0, 0, 0, 0.68)}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-accent-pink-solid:color(display-p3 1 0.255 0.443/100%);--ezp-accent-pink-translucent:color(display-p3 1 0.255 0.443/26%);--ezp-accent-red-solid:color(display-p3 1 0.282 0.173/100%);--ezp-accent-red-translucent:color(display-p3 1 0.282 0.173/26%);--ezp-accent-orange-solid:color(display-p3 1 0.506 0.11/100%);--ezp-accent-orange-translucent:color(display-p3 1 0.506 0.11/26%);--ezp-accent-yellow-solid:color(display-p3 1 0.686 0.227/100%);--ezp-accent-yellow-translucent:color(display-p3 1 0.686 0.227/26%);--ezp-accent-green-solid:color(display-p3 0.404 0.612 0.082/100%);--ezp-accent-green-translucent:color(display-p3 0.404 0.612 0.082/26%);--ezp-accent-teal-solid:color(display-p3 0.114 0.627 0.525/100%);--ezp-accent-teal-translucent:color(display-p3 0.114 0.627 0.525/26%);--ezp-accent-cyan-solid:color(display-p3 0.125 0.608 0.749/100%);--ezp-accent-cyan-translucent:color(display-p3 0.125 0.608 0.749/26%);--ezp-accent-blue-solid:color(display-p3 0.365 0.545 0.992/100%);--ezp-accent-blue-translucent:color(display-p3 0.365 0.545 0.992/26%);--ezp-accent-violet-solid:color(display-p3 0.729 0.412 1/100%);--ezp-accent-violet-translucent:color(display-p3 0.729 0.412 1/26%)}}}@media (color-gamut: p3){@supports (color: color(display-p3 1 1 1)){:host(.dark){--ezp-core-surface-primary:color(display-p3 0 0 0/100%);--ezp-core-surface-secondary:color(display-p3 0.106 0.106 0.106/100%);--ezp-core-surface-tertiary:color(display-p3 0.157 0.157 0.157/100%);--ezp-core-foreground-primary:color(display-p3 1 1 1/94%);--ezp-core-foreground-secondary:color(display-p3 0.714 0.714 0.714/68%);--ezp-core-foreground-tertiary:color(display-p3 0.714 0.714 0.714/42%);--ezp-core-shade-primary:color(display-p3 0.388 0.388 0.388/26%);--ezp-core-shade-secondary:color(display-p3 0.388 0.388 0.388/32%);--ezp-core-shade-tertiary:color(display-p3 0.388 0.388 0.388/38%);--ezp-core-outline:color(display-p3 0.545 0.545 0.545/26%);--ezp-core-edge:color(display-p3 1 1 1/16%);--ezp-core-backdrop:color(display-p3 0 0 0/68%)}}}:host(.seamless){--ezp-status-border-radius:0;--ezp-backdrop-border-radius:0}:host(.blue){--ezp-theme-solid:var(--ezp-accent-blue-solid);--ezp-theme-translucent:var(--ezp-accent-blue-translucent)}:host(.cyan){--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent)}:host(.green){--ezp-theme-solid:var(--ezp-accent-green-solid);--ezp-theme-translucent:var(--ezp-accent-green-translucent)}:host(.teal){--ezp-theme-solid:var(--ezp-accent-teal-solid);--ezp-theme-translucent:var(--ezp-accent-teal-translucent)}:host(.orange){--ezp-theme-solid:var(--ezp-accent-orange-solid);--ezp-theme-translucent:var(--ezp-accent-orange-translucent)}:host(.pink){--ezp-theme-solid:var(--ezp-accent-pink-solid);--ezp-theme-translucent:var(--ezp-accent-pink-translucent)}:host(.red){--ezp-theme-solid:var(--ezp-accent-red-solid);--ezp-theme-translucent:var(--ezp-accent-red-translucent)}:host(.violet){--ezp-theme-solid:var(--ezp-accent-violet-solid);--ezp-theme-translucent:var(--ezp-accent-violet-translucent)}';var EzpPrinting=function(){function e(e){registerInstance(this,e);this.printFinished=createEvent(this,"printFinished",7);this.filename="";this.hidemenu=false;this.hideheader=false;this.theme="cyan";this.appearance="system";this.language="";this.seamless=false;this.printOpen=false;this.authOpen=false;this.onlyGetSasUri=false;this.noDocumentOpen=false}e.prototype.watchFileData=function(e,t){console.log(e);if(e!==t&&e.length>0){var r=new Uint8Array(e.length);for(var a=0;a<e.length;a++){r[a]=e.charCodeAt(a)}this.file=new File([r],this.filename)}};e.prototype.watchFilename=function(e,t){if(e!==t&&e.length>0){this.filename=e}};e.prototype.watchFileUrl=function(e,t){if(e!==t&&e.length>0){this.fileurl=e}};e.prototype.watchLanguage=function(e,t){if(e!==t&&e.length>0){this.language=e}};e.prototype.listenPrintCancel=function(){this.printOpen=false;this.printFinished.emit()};e.prototype.listenPrintSubmit=function(){this.printOpen=false;this.printFinished.emit();this.checkAuth()};e.prototype.listenAuthCancel=function(){this.authOpen=false;this.checkAuth()};e.prototype.listenAuthSuccess=function(){if(this.onlyGetSasUri){this.printOpen=false;this.onlyGetSasUri=false}else if(this.filename!=""){this.printOpen=true}else{this.noDocumentOpen=true}};e.prototype.listenUploadFile=function(e){this.filename=e.detail[0].name;this.file=e.detail[0];this.open()};e.prototype.listenDialogClose=function(e){if(e.detail==="no-document-selected"){this.noDocumentOpen=false}};e.prototype.listenDialogAction=function(e){if(e.detail==="no-document-selected"){this.noDocumentOpen=false}};e.prototype.listenLogout=function(){this.logOut()};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(authStore.state.isAuthorized){if(this.filename){this.printOpen=true}else{this.noDocumentOpen=true}}else{this.authOpen=true}return[2]}))}))};e.prototype.logOut=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.auth.revokeRefreshToken();localStorage.removeItem("properties");localStorage.removeItem("refreshToken");localStorage.removeItem("access_token");localStorage.removeItem("printer");localStorage.removeItem("isAuthorized");this.printOpen=false;return[2]}))}))};e.prototype.getSasUri=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;var a=this;return __generator(this,(function(n){switch(n.label){case 0:this.onlyGetSasUri=true;e=new EzpPrintService(this.redirecturi,this.clientid);return[4,e.prepareFileUpload(authStore.state.accessToken).catch((function(){a.open();return null}))];case 1:t=n.sent();if(t){r=t.sasUri;return[2,r]}return[2]}}))}))};e.prototype.getAuthUri=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.auth.generateCodeVerifier();return[4,this.auth.generateCodeChallenge(authStore.state.codeVerifier)];case 1:e.sent();this.auth.buildAuthURI();return[2,authStore.state.authUri]}}))}))};e.prototype.checkAuth=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:e=new EzpPrintService(this.redirecturi,this.clientid);t=authStore.state.accessToken;if(t===""){t=localStorage.getItem("access_token");authStore.state.accessToken=t}if(localStorage.getItem("isAuthorized")){authStore.state.isAuthorized=localStorage.getItem("isAuthorized")==="true"}return[4,e.getConfig(authStore.state.accessToken).then((function(e){if(e.ok){authStore.state.isAuthorized=true}if(!e.ok){authStore.state.isAuthorized=false;throw new Error("http status "+e.status)}})).catch((function(){authStore.state.isAuthorized=false}))];case 1:r.sent();localStorage.setItem("isAuthorized",authStore.state.isAuthorized.toString());return[2,authStore.state.isAuthorized]}}))}))};e.prototype.refreshTokensPeriodically=function(e){var t=new EzpAuthorizationService(this.redirecturi,this.clientid);setInterval((function(){t.refreshTokens()}),e*1e3)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(r){e=window.matchMedia("(prefers-color-scheme: dark)");this.systemAppearance=e.matches?"dark":"light";e.addEventListener("change",(function(e){t.systemAppearance=e.matches?"dark":"light"}));authStore.state.redirectUri=this.redirecturi;userStore.state.theme=this.theme;userStore.state.appearance=this.appearance;if(this.authapihosturl){authStore.state.authApiHostUrl=this.authapihosturl}else{authStore.state.authApiHostUrl=config.authApiHostUrl}if(this.printapihosturl){printStore.state.printApiHostUrl=this.printapihosturl}else{printStore.state.printApiHostUrl=config.printingApiHostUrl}this.auth=new EzpAuthorizationService(this.redirecturi,this.clientid);sendCodeToParentWindow();initi18n(this.language);this.checkAuth();return[2]}))}))};e.prototype.componentDidLoad=function(){this.refreshTokensPeriodically(1800)};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(userStore.state.theme," ").concat(userStore.state.appearance==="system"?this.systemAppearance:userStore.state.appearance," ").concat(this.seamless?"seamless":"")},this.trigger==="custom"?h("slot",null):this.trigger==="file"?h("ezp-upload",null):this.trigger==="button"&&h("ezp-icon-button",{id:"print-trigger",icon:"printer",slot:"trigger",type:"button",onClick:function(){return e.open()}}),this.authOpen?h("ezp-auth",{clientID:this.clientid,redirectURI:this.redirecturi,hidelogin:this.hidelogin,trigger:this.trigger,code:this.code}):this.printOpen?h("ezp-printer-selection",{clientID:this.clientid,redirectURI:this.redirecturi,filename:this.filename,fileurl:this.fileurl,filetype:this.filetype,fileid:this.fileid,file:this.file,hidemenu:this.hidemenu,hideheader:this.hideheader,seamless:this.seamless}):this.noDocumentOpen?h("ezp-dialog",{heading:i18next.t("no_document_dialog.heading"),description:i18next.t("no_document_dialog.description"),action:i18next.t("no_document_dialog.action"),iconName:"question-mark",instance:"no-document-selected"}):null)};Object.defineProperty(e,"watchers",{get:function(){return{filedata:["watchFileData"],filename:["watchFilename"],fileurl:["watchFileUrl"],language:["watchLanguage"]}},enumerable:false,configurable:true});return e}();EzpPrinting.style=ezpPrintingCss;var ezpSelectCss=':host{--ezp-select-duration:var(--ezp-duration-3);display:block;height:var(--ezp-select-toggle-height);position:relative;-webkit-transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));transition:var(--ezp-select-transition, z-index 0s var(--ezp-select-duration));z-index:var(--ezp-select-zIndex, 3)}:host(:first-child){--ezp-select-wrap-borderRadius:3px 3px 0 0}:host(:last-child){--ezp-select-wrap-borderRadius:0 0 3px 3px}:host(:first-child:last-child){--ezp-select-wrap-borderRadius:3px}:host(:not(:last-child):not(.is-expanded)){--ezp-select-wrap-boxShadowPositionBottom:0 0 0 0}:host(.toggle-horizontal){--ezp-select-label-alignSelf:start;--ezp-select-toggle-gridTemplateAreas:"label value accessory";--ezp-select-toggle-gridTemplateColumns:1fr repeat(2, auto);--ezp-select-toggle-height:30px;--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-alignSelf:end}:host(.toggle-horizontal.has-icon){--ezp-select-toggle-gridTemplateAreas:"icon label value accessory";--ezp-select-toggle-gridTemplateColumns:auto 1fr repeat(2, auto)}:host(.toggle-vertical){--ezp-select-label-alignSelf:center;--ezp-select-toggle-gridTemplateAreas:"label accessory" "value accessory";--ezp-select-toggle-gridTemplateColumns:1fr auto;--ezp-select-toggle-height:48px;--ezp-select-toggle-gridTemplateRows:repeat(2, auto);--ezp-select-value-alignSelf:center}:host(.toggle-vertical.has-icon){--ezp-select-toggle-gridTemplateAreas:"icon label accessory" "icon value accessory";--ezp-select-toggle-gridTemplateColumns:auto 1fr auto}:host(.option-horizontal){--ezp-select-details-gridTemplateColumns:repeat(2, 1fr);--ezp-select-details-gridTemplateRows:auto;--ezp-select-option-height:30px}:host(.option-vertical){--ezp-select-details-gridTemplateColumns:1fr;--ezp-select-details-gridTemplateRows:repeat(2, auto);--ezp-select-option-height:48px}:host(.is-expanded){--ezp-select-accessory-color:var(--ezp-theme-solid);--ezp-select-transition:z-index 0s 0s;--ezp-select-zIndex:9999;--ezp-select-icon-color:var(--ezp-theme-solid);--ezp-select-label-color:var(--ezp-theme-solid);--ezp-select-wrap-borderRadius:3px}:host(.disabled){--ezp-select-accessory-color:var(--ezp-core-foreground-tertiary);--ezp-select-icon-color:var(--ezp-core-foreground-tertiary);--ezp-select-label-color:var(--ezp-core-foreground-tertiary);--ezp-select-toggle-background-hover:transparent;--ezp-select-toggle-cursor:default;--value-color:var(--ezp-core-foreground-tertiary)}#wrap{background:var(--ezp-core-surface-tertiary);border-radius:var(--ezp-select-wrap-borderRadius, 0);-webkit-box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-select-wrap-boxShadowPositionTop, 0 -1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionRight, 1px 0 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionBottom, 0 1px 0 0) var(--ezp-core-outline), var(--ezp-select-wrap-boxShadowPositionLeft, -1px 0 0 0) var(--ezp-core-outline);-webkit-transform:translateY(var(--ezp-select-wrap-translateY, 0));transform:translateY(var(--ezp-select-wrap-translateY, 0));-webkit-transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:transform var(--ezp-select-duration) var(--ezp-easing-out-quart), border-radius var(--ezp-select-duration) var(--ezp-easing-out-quart), box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-transform var(--ezp-select-duration) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-select-duration) var(--ezp-easing-out-quart)}#toggle{background:var(--ezp-select-toggle-background, transparent);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:var(--ezp-select-toggle-cursor, pointer);display:grid;gap:var(--ezp-spacing-2) var(--ezp-spacing-3);grid-template-areas:var(--ezp-select-toggle-gridTemplateAreas, none);grid-template-columns:var(--ezp-select-toggle-gridTemplateColumns, none);grid-template-rows:var(--ezp-select-toggle-gridTemplateRows, auto);height:var(--ezp-select-toggle-height, auto);padding:var(--ezp-spacing-3)}#toggle:hover{--ezp-select-toggle-background:var(\n --ezp-select-toggle-background-hover,\n var(--ezp-core-shade-primary)\n )}#icon{align-self:center;color:var(--ezp-select-icon-color, var(--ezp-core-foreground-secondary));grid-area:icon;margin:calc(var(--ezp-spacing-2) * -1) 0}#label{align-self:var(--ezp-select-label-alignSelf, auto);color:var(--ezp-select-label-color, var(--ezp-core-foreground-secondary));grid-area:label}#value{align-self:var(--ezp-select-value-alignSelf, auto);color:var(--value-color, var(--ezp-core-foreground-primary));grid-area:value}#accessory{align-self:center;color:var(--ezp-select-accessory-color, var(--ezp-core-foreground-secondary));grid-area:accessory;margin:calc(var(--ezp-spacing-2) * -1) 0}#list{-webkit-box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 1px 0 0 var(--ezp-core-outline);height:var(--ezp-select-list-height, 0);overflow:auto;-webkit-transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart);transition:height var(--ezp-select-duration) var(--ezp-easing-out-quart)}.option{background:var(--ezp-select-option-background);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;height:var(--ezp-select-option-height, auto);padding:0 0 0 var(--ezp-spacing-3)}.option:not(:last-child){--ezp-select-details-boxShadow:inset 0 -1px 0 0 var(--ezp-core-outline)}.option:hover{--ezp-select-option-background:var(--ezp-core-shade-primary)}.option:active{--ezp-select-option-background:var(--ezp-core-shade-secondary)}.option.is-selected{--ezp-select-indicator-opacity:1;--ezp-select-indicator-transform:translateX(0);--ezp-select-indicator-transition:opacity var(--ezp-select-duration)\n var(--ezp-easing-out-quart),\n transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-select-indicator-visibility:visible}.indicator{-ms-flex-item-align:center;align-self:center;color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0;opacity:var(--ezp-select-indicator-opacity, 0);-webkit-transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));transform:var(--ezp-select-indicator-transform, translateX(var(--ezp-spacing-3)));-webkit-transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));transition:var(--ezp-select-indicator-transition, opacity var(--ezp-select-duration) var(--ezp-easing-out-quart), transform var(--ezp-select-duration) var(--ezp-easing-out-quart), visibility 0s var(--ezp-select-duration));visibility:var(--ezp-select-indicator-visibility, hidden)}.details{-webkit-box-shadow:var(--ezp-select-details-boxShadow);box-shadow:var(--ezp-select-details-boxShadow);display:grid;gap:var(--ezp-spacing-2);grid-template-columns:var(--ezp-select-details-gridTemplateColumns, 1fr);grid-template-rows:var(--ezp-select-details-gridTemplateRows, auto);padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) 0}.title{-ms-flex-item-align:start;align-self:start;color:var(--ezp-core-foreground-primary)}.meta{-ms-flex-item-align:end;align-self:end;color:var(--ezp-core-foreground-secondary)}';var EzpSelect=function(){function e(e){var t=this;registerInstance(this,e);this.selectToggle=createEvent(this,"selectToggle",7);this.selectSelection=createEvent(this,"selectSelection",7);this.backdrop=document.createElement("ezp-backdrop");this.containerHeight=0;this.expandCover=false;this.expandRise=false;this.listHeight=0;this.spacing=6;this.toggleHeight=0;this.wrapDiff=0;this.wrapHeight=0;this.wrapTop=0;this.duration=0;this.label="Label";this.placeholder="Placeholder";this.toggleFlow="horizontal";this.disabled=false;this.expanded=false;this.selected={id:false,title:"",meta:""};this.toggle=function(){t.containerHeight=t.container.clientHeight-t.spacing*2;t.listHeight=t.list.scrollHeight;t.wrapTop=t.component.offsetTop;t.wrapHeight=t.toggleHeight+t.listHeight;t.expandCover=t.wrapHeight>t.containerHeight;t.expandRise=t.wrapHeight>t.containerHeight-t.wrapTop;t.wrapDiff=t.containerHeight-t.wrapHeight-t.wrapTop;t.expanded=!t.expanded;t.selectToggle.emit(t.expanded)};this.select=function(e){var r=t.selected.id===e?0:t.duration*1e3;t.selected=t.options.find((function(t){return t.id===e}));t.selectSelection.emit(t.selected);window.setTimeout((function(){t.toggle()}),r)};this.preSelect=function(){t.selected=t.options.find((function(e){return typeof t.preSelected==="number"?e.id===t.preSelected:typeof t.preSelected==="string"?e.title===t.preSelected:null}))}}e.prototype.watchExpanded=function(){if(this.expandCover){this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.containerHeight-this.toggleHeight,"px"):"0px");this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?"".concat(this.wrapTop*-1+this.spacing,"px"):"0px")}else if(this.expandRise){this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.listHeight,"px"):"0px");this.component.style.setProperty("--ezp-select-wrap-translateY",this.expanded?"".concat(this.wrapDiff+this.spacing,"px"):"0px")}else{this.component.style.setProperty("--ezp-select-list-height",this.expanded?"".concat(this.listHeight,"px"):"0px")}if(this.expanded){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.expanded=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}));if(this.preSelected!==undefined&&this.preSelected!==""&&this.preSelected!==null){this.preSelect()}};e.prototype.componentDidLoad=function(){var e=getComputedStyle(this.component);this.toggleHeight=parseInt(e.getPropertyValue("--ezp-select-toggle-height"));this.duration=parseFloat(e.getPropertyValue("--ezp-select-duration"))};e.prototype.componentWillUpdate=function(){if(this.selected.id===false&&this.preSelected!==undefined&&this.preSelected!==""&&this.preSelected!==null){this.preSelect()}};e.prototype.render=function(){var e=this;var t=[this.expanded?"is-expanded":"",this.icon?"has-icon":"","toggle-".concat(this.toggleFlow),this.optionFlow?"option-".concat(this.optionFlow):"",this.disabled?"disabled":""];var r=this.toggleFlow==="horizontal"?"secondary":"tertiary";return h(Host,{class:t.join(" ")},h("div",{id:"wrap"},h("div",{id:"toggle",onClick:function(){return!e.disabled&&e.toggle()}},this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,level:r,text:this.label}),h("ezp-label",{id:"value",ellipsis:true,text:this.selected.title!==""?this.selected.title:this.placeholder}),h("ezp-icon",{id:"accessory",name:"expand"})),h("div",{id:"list",ref:function(t){return e.list=t}},this.options.map((function(t){if(t.title!==""){return h("div",{class:"option ".concat(t.id===e.selected.id?"is-selected":""," ").concat(t.meta!==""?"has-meta":""," "),onClick:function(){return e.select(t.id)}},h("ezp-icon",{name:"checkmark",class:"indicator"}),h("div",{class:"details"},h("ezp-label",{class:"title",ellipsis:true,text:t.title}),t.meta!==""?h("ezp-label",{level:"tertiary",class:"meta",text:t.meta,ellipsis:true}):null))}})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}();EzpSelect.style=ezpSelectCss;var ezpStatusCss=":host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-backdrop);border-radius:var(--ezp-status-border-radius, 6px);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;-ms-flex-pack:center;justify-content:center;left:0;padding:var(--ezp-spacing-6);position:absolute;top:0;width:100%;z-index:9999}@media (prefers-color-scheme: dark){:host{--box-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#box{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-status-box-boxShadow, 0 0 0 1px var(--ezp-black-10));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);padding:var(--ezp-spacing-4) var(--ezp-spacing-5)}#indicator{-webkit-animation:rotate var(--ezp-duration-6) linear infinite;animation:rotate var(--ezp-duration-6) linear infinite;display:block;height:42px;-webkit-transform:rotate(0);transform:rotate(0);width:42px}#track{fill:none;stroke:var(--ezp-core-outline);stroke-width:4px}#value{-webkit-animation:offset var(--ezp-duration-6) linear alternate infinite;animation:offset var(--ezp-duration-6) linear alternate infinite;fill:none;stroke:var(--ezp-theme-solid);stroke-dasharray:110;stroke-dashoffset:110;stroke-linecap:round;stroke-width:4px}#description{color:var(--ezp-core-foreground-primary)}#footer{display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}@-webkit-keyframes offset{100%{stroke-dashoffset:55}}@keyframes offset{100%{stroke-dashoffset:55}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}";var EzpStatus=function(){function e(e){var t=this;registerInstance(this,e);this.statusCancel=createEvent(this,"statusCancel",7);this.statusClose=createEvent(this,"statusClose",7);this.statusRetry=createEvent(this,"statusRetry",7);this.description="Description";this.processing=false;this.handleCancel=function(){t.statusCancel.emit(t.instance)};this.handleClose=function(){t.statusClose.emit(t.instance)};this.handleRetry=function(){t.statusRetry.emit(t.instance)}}e.prototype.componentWillLoad=function(){};e.prototype.render=function(){return h(Host,null,h("div",{id:"box"},this.processing?h("svg",{id:"indicator",viewBox:"0 0 42 42",xmlns:"http://www.w3.org/2000/svg"},h("circle",{id:"track",cx:"21",cy:"21",r:"18"}),h("circle",{id:"value",cx:"21",cy:"21",r:"18"})):this.icon?h("ezp-icon",{name:this.icon,framed:true}):null,h("ezp-label",{id:"description",level:"tertiary",weight:"strong",text:this.description}),(this.cancel||this.close||this.retry)&&h("div",{id:"footer"},this.cancel&&h("ezp-text-button",{level:"secondary",small:true,onClick:this.handleCancel,label:typeof this.cancel==="string"?this.cancel:i18next.t("button_actions.cancel")}),this.close&&h("ezp-text-button",{level:this.retry?"secondary":"primary",small:true,onClick:this.handleClose,label:typeof this.close==="string"?this.close:i18next.t("button_actions.close")}),this.retry&&h("ezp-text-button",{level:"primary",small:true,onClick:this.handleRetry,label:typeof this.retry==="string"?this.retry:i18next.t("button_actions.retry")}))))};return e}();EzpStatus.style=ezpStatusCss;var ezpStepperCss=':host{-ms-flex-align:center;align-items:center;background:var(--ezp-core-surface-tertiary);border-radius:3px;-webkit-box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);box-shadow:var(--ezp-stepper-boxShadowPosition, 0 0 0 1px) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-stepper-gridTemplate, auto/auto 1fr auto);padding:0 var(--ezp-spacing-2) 0 var(--ezp-spacing-3);position:relative;z-index:0}:host(.focused){--ezp-stepper-icon-color:var(--ezp-theme-solid);--ezp-stepper-label-color:var(--ezp-theme-solid)}:host(.has-icon){--ezp-stepper-gridTemplate:auto / repeat(2, auto) 1fr auto}#toggle{background:var(--ezp-stepper-toggle-background, transparent);border-radius:3px;cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}@media (hover: hover){#toggle:hover{--ezp-stepper-toggle-background:var(--ezp-core-shade-primary)}}#icon{color:var(--ezp-stepper-icon-color, var(--ezp-core-foreground-secondary));pointer-events:none}#label{color:var(--ezp-stepper-label-color, var(--ezp-core-foreground-secondary));pointer-events:none}#input{-moz-appearance:textfield;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:inherit;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0;pointer-events:none;text-align:right;width:100%}#input::-webkit-outer-spin-button,#input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.buttons{display:-ms-flexbox;display:flex}.button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-stepper-button-background, transparent);border:0;border-radius:50%;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-stepper-button-color, var(--ezp-theme-solid));cursor:var(--ezp-stepper-button-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-1)}@media (hover: hover){.button:not(:disabled):hover{--ezp-stepper-button-background:var(--ezp-core-shade-primary)}.button:not(:disabled):active{--ezp-stepper-button-background:var(--ezp-core-shade-secondary)}}.button:disabled{--ezp-stepper-button-color:var(--ezp-core-foreground-tertiary);--ezp-stepper-button-cursor:default}';var EzpStepper=function(){function e(e){var t=this;registerInstance(this,e);this.stepperChanged=createEvent(this,"stepperChanged",7);this.label="Label";this.min=1;this.canDecrease=true;this.canIncrease=true;this.focused=false;this.value=1;this.handleDecrease=function(){t.value--};this.handleIncrease=function(){t.value++};this.handleInput=function(){t.value=t.input.value!==""?parseInt(t.input.value):t.min};this.setFocus=function(){t.input.focus()};this.handleBlur=function(){t.focused=false};this.handleFocus=function(){t.focused=true}}e.prototype.watchValue=function(){this.canIncrease=this.max!==undefined?this.value<this.max:true;this.canDecrease=this.min!==undefined?this.value>this.min:true;this.stepperChanged.emit(this.value)};e.prototype.componentWillLoad=function(){this.watchValue()};e.prototype.render=function(){var e=this;return h(Host,{class:"".concat(this.focused?"focused":""," ").concat(this.icon?"has-icon":"")},h("div",{id:"toggle",onClick:this.setFocus}),this.icon?h("ezp-icon",{id:"icon",name:this.icon}):null,h("ezp-label",{id:"label",noWrap:true,text:this.label}),h("input",{id:"input",type:"number",ref:function(t){return e.input=t},min:this.min.toString(),max:this.max.toString(),value:this.value.toString(),onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),h("div",{class:"buttons"},h("button",{class:"button",disabled:!this.canDecrease,onClick:this.handleDecrease},h("ezp-icon",{name:"minus"})),h("button",{class:"button",disabled:!this.canIncrease,onClick:this.handleIncrease},h("ezp-icon",{name:"plus"}))))};Object.defineProperty(e,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:false,configurable:true});return e}();EzpStepper.style=ezpStepperCss;var ezpTextButtonCss=":host{display:-ms-flexbox;display:flex}:host(.primary){--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-init:var(--ezp-theme-solid);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-white-100);--ezp-textButton-opacity-active:0.74;--ezp-textButton-opacity-hover:0.84}:host(.secondary){--ezp-textButton-background-active:var(--ezp-core-shade-tertiary);--ezp-textButton-background-disabled:var(--ezp-core-shade-primary);--ezp-textButton-background-hover:var(--ezp-core-shade-secondary);--ezp-textButton-background-init:var(--ezp-core-shade-primary);--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-disabled:transparent;--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-textButton-color-init:var(--ezp-theme-solid)}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-textButton-background, var(--ezp-textButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-textButton-color, var(--ezp-textButton-color-init));cursor:var(--ezp-textButton-cursor, pointer);display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-textButton-opacity, 1);outline:none;padding:var(--ezp-spacing-3);white-space:nowrap;width:100%}@media (hover: hover){#button:not(:disabled):hover{--ezp-textButton-background:var(\n --ezp-textButton-background-hover,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-textButton-background:var(\n --ezp-textButton-background-active,\n var(--ezp-textButton-background-init)\n );--ezp-textButton-opacity:var(--ezp-textButton-opacity-active, 1)}}#button:disabled{--ezp-textButton-background:var(--ezp-textButton-background-disabled);--ezp-textButton-color:var(--ezp-textButton-color-disabled);--ezp-textButton-cursor:default}#label{pointer-events:none}";var EzpTextButton=function(){function e(e){registerInstance(this,e);this.blank=false;this.disabled=false;this.level="primary";this.small=false}e.prototype.render=function(){var e=this.type!==undefined?"button":"a";var t=this.type!==undefined?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"};return h(Host,{class:"".concat(this.level)},h(e,Object.assign({id:"button"},t),h("ezp-label",{id:"label",weight:"heavy",text:this.label,level:this.small?"tertiary":"secondary"})))};return e}();EzpTextButton.style=ezpTextButtonCss;var ezpUploadCss=":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-upload-background, transparent);border:1px dashed var(--ezp-upload-border-color, var(--ezp-core-foreground-tertiary));border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:grid;grid-template:auto/minmax(auto, 280px);height:var(--ezp-upload-height, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);position:relative;-webkit-transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-3) var(--ezp-easing-out-quart), border-color var(--ezp-duration-3) var(--ezp-easing-out-quart);width:var(--ezp-upload-width, auto)}:host(.dragging){--ezp-upload-background:var(--ezp-theme-translucent);--ezp-upload-border-color:var(--ezp-theme-translucent);--ezp-upload-header-blur:16px;--ezp-upload-header-opacity:0.42}#header{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-webkit-filter:blur(var(--ezp-upload-header-blur, 0));filter:blur(var(--ezp-upload-header-blur, 0));-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);opacity:var(--ezp-upload-header-opacity, 1);text-align:center;-webkit-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:filter var(--ezp-duration-3) var(--ezp-easing-out-quart), opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-filter var(--ezp-duration-3) var(--ezp-easing-out-quart)}#meta{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--ezp-spacing-3) 3px;-ms-flex-pack:center;justify-content:center}#select{color:var(--ezp-theme-solid);cursor:pointer;opacity:var(--ezp-upload-select-opacity, 1);text-decoration:underline;white-space:nowrap}@media (hover: hover){#select:hover{--ezp-upload-select-opacity:0.58}}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}";var EzpUpload=function(){function e(e){var t=this;registerInstance(this,e);this.uploadFile=createEvent(this,"uploadFile",7);this.filename="";this.dragging=false;this.handleInput=function(){t.filename=t.input.files[0].name;t.uploadFile.emit(t.input.files)}}e.prototype.handleDragEnter=function(){this.dragging=true};e.prototype.handleDragOver=function(e){e.stopPropagation();e.preventDefault();e.dataTransfer.dropEffect="copy"};e.prototype.handleDragLeave=function(){this.dragging=false};e.prototype.handleDrop=function(e){e.stopPropagation();e.preventDefault();this.dragging=false;this.filename=e.dataTransfer.files[0].name;this.uploadFile.emit(e.dataTransfer.files)};e.prototype.listenPrintCancel=function(){this.form.reset();this.filename=""};e.prototype.render=function(){var e=this;return h(Host,{class:{dragging:this.dragging}},h("form",{id:"form",ref:function(t){return e.form=t}},h("div",{id:"header"},h("ezp-icon",{name:"drag-drop",size:"huge",framed:true}),h("ezp-label",{weight:"strong",text:i18next.t("upload.description")}),h("div",{id:"meta"},h("ezp-label",{level:"tertiary",text:i18next.t("upload.meta_leading")}),h("label",{htmlFor:"input",id:"select"},h("ezp-label",{level:"tertiary",weight:"strong",text:i18next.t("upload.meta_select")})),h("input",{type:"file",name:"input",id:"input",ref:function(t){return e.input=t},onInput:this.handleInput}),h("ezp-label",{level:"tertiary",text:i18next.t("upload.meta_trailing")})),this.filename!=""&&h(Fragment,null,h("ezp-label",{level:"secondary",text:i18next.t("upload.selected_file")}),h("ezp-label",{level:"tertiary",text:this.filename})))))};return e}();EzpUpload.style=ezpUploadCss;var ezpUserMenuCss=":host{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-userMenu-boxShadow, 0 0 0 1px var(--ezp-black-10));display:block;opacity:var(--ezp-userMenu-opacity, 0);position:absolute;right:0;top:0;-webkit-transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));transform:scale(var(--ezp-userMenu-scale, 0.94, 0.94));-webkit-transform-origin:right top;transform-origin:right top;-webkit-transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));transition:var(--ezp-userMenu-transition, opacity var(--ezp-duration-3) var(--ezp-easing-out-quart), transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s var(--ezp-duration-3));visibility:var(--ezp-userMenu-visibility, hidden);z-index:5}:host(.is-open){--ezp-userMenu-opacity:1;--ezp-userMenu-scale:1, 1;--ezp-userMenu-transition:opacity var(--ezp-duration-3) var(--ezp-easing-out-quart),\n transform var(--ezp-duration-3) var(--ezp-easing-out-quart), visibility 0s 0s;--ezp-userMenu-visibility:visible}@media (prefers-color-scheme: dark){:host{--ezp-userMenu-separator-position:inset 0 0 0 var(--hairline-width-positive)}}#header{-ms-flex-align:center;align-items:center;-webkit-box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);-webkit-box-shadow:0;box-shadow:0;display:grid;grid-template:auto/1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4)}#name{color:var(--ezp-core-foreground-primary)}#close{margin:calc(var(--ezp-spacing-3) * -1) 0}#links{-webkit-box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-links-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--ezp-spacing-2)}.link{-ms-flex-align:center;align-items:center;background:var(--ezp-userMenu-link-background, transparent);border-radius:3px;color:var(--ezp-core-foreground-primary);cursor:pointer;display:grid;gap:var(--ezp-spacing-3);grid-template:auto/auto 1fr;padding:var(--ezp-spacing-3);text-decoration:none}.link:hover{--ezp-userMenu-link-background:var(--ezp-core-shade-primary)}.link__icon{color:var(--ezp-theme-solid);margin:calc(var(--ezp-spacing-2) * -1) 0}.caption{color:var(--ezp-core-foreground-primary)}#theme{-webkit-box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);box-shadow:var(--ezp-userMenu-theme-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#swatches{display:-ms-flexbox;display:flex;margin:0 calc(var(--ezp-spacing-2) * -1)}.swatch{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-swatch-background, transparent);border:0;border-radius:50%;color:var(--ezp-userMenu-swatch-color);cursor:var(--ezp-userMenu-swatch-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-userMenu-swatch-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){.swatch:not(.selected):hover{--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent)}.swatch:not(.selected):active{--ezp-userMenu-swatch-opacity:0.74}}.swatch.selected{--ezp-userMenu-dot-boxShadowSize:10px;--ezp-userMenu-swatch-background:var(--ezp-userMenu-swatch-theme-translucent);--ezp-userMenu-swatch-cursor:normal}.swatch.selected>.dot{-webkit-animation:dot-bounce var(--ezp-duration-2) ease-in-out;animation:dot-bounce var(--ezp-duration-2) ease-in-out}.swatch--blue{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-blue-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-blue-translucent)}.swatch--cyan{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-cyan-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-cyan-translucent)}.swatch--green{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-green-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-green-translucent)}.swatch--teal{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-teal-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-teal-translucent)}.swatch--orange{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-orange-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-orange-translucent)}.swatch--pink{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-pink-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-pink-translucent)}.swatch--red{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-red-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-red-translucent)}.swatch--violet{--ezp-userMenu-swatch-theme-solid:var(--ezp-accent-violet-solid);--ezp-userMenu-swatch-theme-translucent:var(--ezp-accent-violet-translucent)}.dot{background:var(--ezp-userMenu-dot-background, transparent);border-radius:50%;-webkit-box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);box-shadow:inset 0 0 0 var(--ezp-userMenu-dot-boxShadowSize, 4px) var(--ezp-userMenu-swatch-theme-solid);height:18px;-webkit-transition:-webkit-box-shadow var(--ezp-duration-2);transition:-webkit-box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2);transition:box-shadow var(--ezp-duration-2), -webkit-box-shadow var(--ezp-duration-2);width:18px}#appearance{display:grid;gap:var(--ezp-spacing-3);grid-template:repeat(2, auto)/1fr;padding:var(--ezp-spacing-4) var(--ezp-spacing-4) var(--ezp-spacing-3)}#tabs{display:grid;grid-template:auto/repeat(3, 1fr);margin:0 calc(var(--ezp-spacing-2) * -1)}.tab{--ezp-icon-height:8px;-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-userMenu-tab-background, transparent);border:0;border-radius:14px;color:var(--ezp-userMenu-tab-color, var(--ezp-core-foreground-secondary));cursor:var(--ezp-userMenu-tab-cursor, pointer);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-3) var(--ezp-spacing-2)}@media (hover: hover){.tab:not(.selected):hover{--ezp-userMenu-tab-background:var(--ezp-core-shade-primary)}.tab:not(.selected):active{--ezp-userMenu-tab-background:var(--ezp-core-shade-secondary)}}.tab.selected{--ezp-userMenu-tab-background:var(--ezp-theme-translucent);--ezp-userMenu-tab-color:var(--ezp-theme-solid);--ezp-userMenu-tab-cursor:normal}@-webkit-keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}@keyframes dot-bounce{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}50%{-webkit-transform:scale(0.84, 0.84);transform:scale(0.84, 0.84)}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}}";var EzpUserMenu=function(){function e(e){var t=this;registerInstance(this,e);this.userMenuClosure=createEvent(this,"userMenuClosure",7);this.logoutEmitter=createEvent(this,"logoutEmitter",7);this.backdrop=document.createElement("ezp-backdrop");this.links=[{title:i18next.t("user_menu.account"),icon:"account",href:"https://app.ezeep.com"},{title:i18next.t("user_menu.help"),icon:"help",href:"https://support.ezeep.com"}];this.themes=["pink","red","orange","green","teal","cyan","blue","violet"];this.appearances=[{title:i18next.t("user_menu.system"),name:"system"},{title:i18next.t("user_menu.light"),name:"light"},{title:i18next.t("user_menu.dark"),name:"dark"}];this.name="John Doe";this.open=false;this.handleClose=function(){t.userMenuClosure.emit()};this.logOut=function(){localStorage.removeItem("properties");localStorage.removeItem("refreshToken");localStorage.removeItem("access_token");localStorage.removeItem("printer");localStorage.removeItem("isAuthorized");authStore.state.isAuthorized=false;t.logoutEmitter.emit()};this.handleTheme=function(e){userStore.state.theme=e};this.handleAppearance=function(e){userStore.state.appearance=e}}e.prototype.watchOpen=function(){if(this.open){this.backdrop.visible=true;this.container.appendChild(this.backdrop)}else{this.backdrop.visible=false;this.userMenuClosure.emit()}};e.prototype.componentWillLoad=function(){var e=this;this.container=this.component.closest("[data-backdrop-surface]");this.backdrop.addEventListener("backdropHideStart",(function(){e.open=false}));this.backdrop.addEventListener("backdropHideEnd",(function(){e.container.removeChild(e.backdrop)}))};e.prototype.render=function(){var e=this;return h(Host,{class:this.open?"is-open":""},h("div",{id:"header"},h("ezp-label",{ellipsis:true,id:"name",weight:"heavy",text:this.name}),h("ezp-icon-button",{id:"close",level:"tertiary",icon:"close",onClick:this.handleClose})),h("div",{id:"links"},this.links.map((function(e){return h("a",{class:"link",href:e.href,target:"_blank",rel:"noopener noreferrer"},h("ezp-icon",{class:"link__icon",name:e.icon}),h("ezp-label",{text:e.title}))})),h("a",{class:"link",onClick:this.logOut},h("ezp-icon",{class:"link__icon",name:"logout"}),h("ezp-label",{text:i18next.t("user_menu.logout")}))),h("div",{id:"theme"},h("ezp-label",{class:"caption",text:"".concat(i18next.t("user_menu.theme"),":"),weight:"heavy"}),h("div",{id:"swatches"},this.themes.map((function(t){return h("button",{class:"swatch swatch--".concat(t," ").concat(t===userStore.state.theme?"selected":""),onClick:function(){return e.handleTheme(t)}},h("span",{class:"dot"}))})))),h("div",{id:"appearance"},h("ezp-label",{class:"caption",text:"".concat(i18next.t("user_menu.appearance"),":"),weight:"heavy"}),h("div",{id:"tabs"},this.appearances.map((function(t){return h("button",{class:"tab ".concat(t.name===userStore.state.appearance?"selected":""),onClick:function(){return e.handleAppearance(t.name)}},h("ezp-icon",{name:t.name}),h("ezp-label",{text:t.title,level:"tertiary",weight:"strong"}))})))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["watchOpen"]}},enumerable:false,configurable:true});return e}();EzpUserMenu.style=ezpUserMenuCss;export{EzpAuth as ezp_auth,EzpBackdrop as ezp_backdrop,EzpDialog as ezp_dialog,EzpIcon as ezp_icon,EzpIconButton as ezp_icon_button,EzpInput as ezp_input,EzpLabel as ezp_label,EzpPrinterSelection as ezp_printer_selection,EzpPrinting as ezp_printing,EzpSelect as ezp_select,EzpStatus as ezp_status,EzpStepper as ezp_stepper,EzpTextButton as ezp_text_button,EzpUpload as ezp_upload,EzpUserMenu as ezp_user_menu};
|