@oaknational/google-classroom-addon 1.19.2 → 1.21.0
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/services/index.js +1 -1
- package/dist/cjs/services/index.js.map +1 -1
- package/dist/cjs/types/index.js +1 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/services/index.js +1 -1
- package/dist/esm/services/index.js.map +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/services.d.ts +2 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -96,5 +96,5 @@ Object.defineProperty(e,"__esModule",{value:!0}),e.loadFileDescriptorSetFromObje
|
|
|
96
96
|
* @copyright 2015 Toru Nagashima. All rights reserved.
|
|
97
97
|
* See LICENSE file in root directory for full license.
|
|
98
98
|
*/
|
|
99
|
-
const privateData=new WeakMap,wrappers=new WeakMap;function pd(e){const t=privateData.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function setCancelFlag(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function Event(e,t){privateData.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(t);for(let e=0;e<r.length;++e){const t=r[e];t in this||Object.defineProperty(this,t,defineRedirectDescriptor(t))}}function defineRedirectDescriptor(e){return{get(){return pd(this).event[e]},set(t){pd(this).event[e]=t},configurable:!0,enumerable:!0}}function defineCallDescriptor(e){return{value(){const t=pd(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function defineWrapper(e,t){const r=Object.keys(t);if(0===r.length)return e;function n(t,r){e.call(this,t,r)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<r.length;++o){const i=r[o];if(!(i in e.prototype)){const e="function"==typeof Object.getOwnPropertyDescriptor(t,i).value;Object.defineProperty(n.prototype,i,e?defineCallDescriptor(i):defineRedirectDescriptor(i))}}return n}function getWrapper(e){if(null==e||e===Object.prototype)return Event;let t=wrappers.get(e);return null==t&&(t=defineWrapper(getWrapper(Object.getPrototypeOf(e)),e),wrappers.set(e,t)),t}function wrapEvent(e,t){return new(getWrapper(Object.getPrototypeOf(t)))(e,t)}function isStopped(e){return pd(e).immediateStopped}function setEventPhase(e,t){pd(e).eventPhase=t}function setCurrentTarget(e,t){pd(e).currentTarget=t}function setPassiveListener(e,t){pd(e).passiveListener=t}Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const e=pd(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const e=pd(this);e.stopped=!0,"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){const e=pd(this);e.stopped=!0,e.immediateStopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(pd(this).event.bubbles)},get cancelable(){return Boolean(pd(this).event.cancelable)},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return Boolean(pd(this).event.composed)},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(e){if(!e)return;const t=pd(this);t.stopped=!0,"boolean"==typeof t.event.cancelBubble&&(t.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(e){e||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));const listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;function isObject(e){return null!==e&&"object"==typeof e}function getListeners(e){const t=listenersMap.get(e);if(null==t)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function defineEventAttributeDescriptor(e){return{get(){let t=getListeners(this).get(e);for(;null!=t;){if(t.listenerType===ATTRIBUTE)return t.listener;t=t.next}return null},set(t){"function"==typeof t||isObject(t)||(t=null);const r=getListeners(this);let n=null,o=r.get(e);for(;null!=o;)o.listenerType===ATTRIBUTE?null!==n?n.next=o.next:null!==o.next?r.set(e,o.next):r.delete(e):n=o,o=o.next;if(null!==t){const o={listener:t,listenerType:ATTRIBUTE,passive:!1,once:!1,next:null};null===n?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function defineEventAttribute(e,t){Object.defineProperty(e,`on${t}`,defineEventAttributeDescriptor(t))}function defineCustomEventTarget(e){function t(){EventTarget.call(this)}t.prototype=Object.create(EventTarget.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)defineEventAttribute(t.prototype,e[r]);return t}function EventTarget(){if(!(this instanceof EventTarget)){if(1===arguments.length&&Array.isArray(arguments[0]))return defineCustomEventTarget(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return defineCustomEventTarget(e)}throw new TypeError("Cannot call a class as a function")}listenersMap.set(this,new Map)}EventTarget.prototype={addEventListener(e,t,r){if(null==t)return;if("function"!=typeof t&&!isObject(t))throw new TypeError("'listener' should be a function or an object.");const n=getListeners(this),o=isObject(r),i=(o?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE,a={listener:t,listenerType:i,passive:o&&Boolean(r.passive),once:o&&Boolean(r.once),next:null};let s=n.get(e);if(void 0===s)return void n.set(e,a);let l=null;for(;null!=s;){if(s.listener===t&&s.listenerType===i)return;l=s,s=s.next}l.next=a},removeEventListener(e,t,r){if(null==t)return;const n=getListeners(this),o=(isObject(r)?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE;let i=null,a=n.get(e);for(;null!=a;){if(a.listener===t&&a.listenerType===o)return void(null!==i?i.next=a.next:null!==a.next?n.set(e,a.next):n.delete(e));i=a,a=a.next}},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw new TypeError('"event.type" should be a string.');const t=getListeners(this),r=e.type;let n=t.get(r);if(null==n)return!0;const o=wrapEvent(this,e);let i=null;for(;null!=n;){if(n.once?null!==i?i.next=n.next:null!==n.next?t.set(r,n.next):t.delete(r):i=n,setPassiveListener(o,n.passive?n.listener:null),"function"==typeof n.listener)try{n.listener.call(this,o)}catch(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}else n.listenerType!==ATTRIBUTE&&"function"==typeof n.listener.handleEvent&&n.listener.handleEvent(o);if(isStopped(o))break;n=n.next}return setPassiveListener(o,null),setEventPhase(o,0),setCurrentTarget(o,null),!o.defaultPrevented}},Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);class AbortSignal extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const e=abortedFlags.get(this);if("boolean"!=typeof e)throw new TypeError("Expected 'this' to be an 'AbortSignal' object, but got "+(null===this?"null":typeof this));return e}}function createAbortSignal(){const e=Object.create(AbortSignal.prototype);return EventTarget.call(e),abortedFlags.set(e,!1),e}function abortSignal(e){!1===abortedFlags.get(e)&&(abortedFlags.set(e,!0),e.dispatchEvent({type:"abort"}))}defineEventAttribute(AbortSignal.prototype,"abort");const abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});let AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}};const signals=new WeakMap;function getSignal(e){const t=signals.get(e);if(null==t)throw new TypeError("Expected 'this' to be an 'AbortController' object, but got "+(null===e?"null":typeof e));return t}Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});var abortController=Object.freeze({__proto__:null,AbortController:AbortController$1,AbortSignal:AbortSignal,default:AbortController$1}),require$$1=getAugmentedNamespace(abortController),streamArrayParser={},hasRequiredStreamArrayParser,hasRequiredFallbackServiceStub;function requireStreamArrayParser(){if(hasRequiredStreamArrayParser)return streamArrayParser;hasRequiredStreamArrayParser=1,Object.defineProperty(streamArrayParser,"__esModule",{value:!0}),streamArrayParser.StreamArrayParser=void 0;const e=require$$1,t=Stream__default.default,r=requireFallbackRest(),n=requireFeatureDetection();class o extends t.Transform{constructor(t,r){super(Object.assign({},r,{readableObjectMode:!0})),this._done=!1,this._prevBlock=Buffer.from(""),this._isInString=!1,this._isSkipped=!1,this._level=0,this.rpc=t,this.cancelController=(0,n.hasAbortController)()?new AbortController:new e.AbortController,this.cancelSignal=this.cancelController.signal,this.cancelRequested=!1}_transform(e,t,n){let o=0,i=0;for(0===this._level&&0===i&&("["!==String.fromCharCode(e[0])&&this.emit("error",new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(e[0])}`)),i++,this._level++);i<e.length;){const t=String.fromCharCode(e[i]);if(this._isSkipped)this._isSkipped=!1;else switch(t){case"{":this._isInString||this._level++,this._isInString||2!==this._level||(o=i);break;case'"':this._isInString=!this._isInString;break;case"}":if(this._isInString||this._level--,!this._isInString&&1===this._level){const t=Buffer.concat([this._prevBlock,e.slice(o,i+1)]);try{const e=(0,r.decodeResponse)(this.rpc,!0,t);this.push(e)}catch(e){this.emit("error",e)}o=i+1,this._prevBlock=Buffer.from("")}break;case"]":this._isInString||1!==this._level||(this._done=!0,this.push(null));break;case"\\":this._isSkipped=!0}i++}this._level>1&&(this._prevBlock=Buffer.concat([this._prevBlock,e.slice(o,i)])),n()}_flush(e){e()}cancel(){this._done=!0,this.cancelRequested=!0,this.cancelController.abort(),this.end()}}return streamArrayParser.StreamArrayParser=o,streamArrayParser}function requireFallbackServiceStub(){if(hasRequiredFallbackServiceStub)return fallbackServiceStub;hasRequiredFallbackServiceStub=1,Object.defineProperty(fallbackServiceStub,"__esModule",{value:!0}),fallbackServiceStub.generateServiceStub=function(i,a,s,l,p,d,u,c){const f=(0,r.hasWindowFetch)()?window.fetch:e.default,h={close:()=>({cancel:()=>{}})};for(const[e,m]of Object.entries(i))h[e]=(e,i,h,g)=>{let y;null!=i||(i={});try{y=d(m,a,s,l,e,c)}catch(e){return g&&g(e),{cancel(){}}}const v=(0,r.hasAbortController)()?new AbortController:new t.AbortController,b=v.signal;let O=!1;const w=y.url,S=y.headers;for(const e of Object.keys(i))S[e]=i[e][0];const _=new n.StreamArrayParser(m);return p.getRequestHeaders().then(e=>{const t={headers:{...e,...S},body:y.body,method:y.method,signal:b};return"GET"!==y.method&&"DELETE"!==y.method||delete t.body,f(w,t)}).then(e=>e.ok&&m.responseStream?void(0,o.pipeline)(e.body,_,e=>{e&&(!O||e instanceof Error&&"AbortError"!==e.name)&&(g&&g(e),_.emit("error",e))}):Promise.all([Promise.resolve(e.ok),e.arrayBuffer()]).then(([e,t])=>{const r=u(m,e,t);g(null,r)}).catch(e=>{if(!O||"AbortError"!==e.name)if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}})).catch(e=>{if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}}),m.responseStream?_:{cancel:()=>{O=!0,v.abort()}}};return h};const e=require$$2$1,t=require$$1,r=requireFeatureDetection(),n=requireStreamArrayParser(),o=Stream__default.default;return fallbackServiceStub}var streaming={},readable={exports:{}},stream,hasRequiredStream,buffer_list,hasRequiredBuffer_list,destroy_1,hasRequiredDestroy;function requireStream(){return hasRequiredStream?stream:(hasRequiredStream=1,stream=Stream__default.default)}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var i=require$$0__default$7.default.Buffer,a=require$$1__default$4.default.inspect,s=a&&a.custom||"inspect";function l(e,t,r){i.prototype.copy.call(e,t,r)}return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return n(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:s,value:function(e,r){return a(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy=1,destroy_1={destroy:function(n,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(r){!o&&r?i._writableState?i._writableState.errorEmitted?process.nextTick(t,i):(i._writableState.errorEmitted=!0,process.nextTick(e,i,r)):process.nextTick(e,i,r):o?(process.nextTick(t,i),o(r)):process.nextTick(t,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},destroy_1}var errors={},hasRequiredErrors,state,hasRequiredState;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;const e={};function t(t,r,n){n||(n=Error);class o extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function r(e,t){if(Array.isArray(e)){const r=e.length;return e=e.map(e=>String(e)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}return t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(e,t,n){let o;var i;let a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${o} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${o} ${r(t,"type")}`}return a+=". Received type "+typeof n,a},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errors.codes=e,errors}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrors().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,n,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,o,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(o?n:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}}var inherits={exports:{}},inherits_browser={exports:{}},hasRequiredInherits_browser,hasRequiredInherits,node$1,hasRequiredNode$1,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireInherits(){if(hasRequiredInherits)return inherits.exports;hasRequiredInherits=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";inherits.exports=e.inherits}catch(e){inherits.exports=requireInherits_browser()}return inherits.exports}function requireNode$1(){return hasRequiredNode$1?node$1:(hasRequiredNode$1=1,node$1=require$$1__default$4.default.deprecate)}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable=1,_stream_writable=w,w.WritableState=O;var r={deprecate:requireNode$1()},n=requireStream(),o=require$$0__default$7.default.Buffer,i=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,s=requireDestroy(),l=requireState().getHighWaterMark,p=requireErrors().codes,d=p.ERR_INVALID_ARG_TYPE,u=p.ERR_METHOD_NOT_IMPLEMENTED,c=p.ERR_MULTIPLE_CALLBACK,f=p.ERR_STREAM_CANNOT_PIPE,h=p.ERR_STREAM_DESTROYED,m=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,y=p.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function O(r,n,o){t=t||require_stream_duplex(),r=r||{},"boolean"!=typeof o&&(o=n instanceof t),this.objectMode=!!r.objectMode,o&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=l(this,r,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===r.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,v(e,n)):(o(n),e._writableState.errorEmitted=!0,v(e,n),C(e,t))}(e,r,n,t,o);else{var i=E(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?process.nextTick(_,e,r,i,o):_(e,r,i,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||require_stream_duplex());if(!r&&!a.call(w,this))return new w(e);this._writableState=new O(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function S(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new h("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function P(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var o=r.bufferedRequestCount,i=new Array(o),a=r.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,S(t,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var p=n.chunk,d=n.encoding,u=n.callback;if(S(t,r,!1,r.objectMode?1:p.length,p,d,u),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var r=E(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return requireInherits()(w,n),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===w&&(e&&e._writableState instanceof O)}})):a=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,l=!a.objectMode&&(n=e,o.isBuffer(n)||n instanceof i);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),l?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=b),a.ending?function(e,t){var r=new g;v(e,r),process.nextTick(t,r)}(this,r):(l||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(v(e,o),process.nextTick(n,o),!1)}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var l=t.objectMode?1:n.length;t.length+=l;var p=t.length<t.highWaterMark;p||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,l,n,i,a);return p}(this,a,l,e,t,r)),s},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=a;var t=require_stream_readable(),r=require_stream_writable();requireInherits()(a,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];a.prototype[i]||(a.prototype[i]=r.prototype[i])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||process.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer,hasRequiredString_decoder,endOfStream$1,hasRequiredEndOfStream$1,async_iterator,hasRequiredAsync_iterator,from_1,hasRequiredFrom,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,pipeline_1,hasRequiredPipeline,hasRequiredReadable;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=require$$0__default$7.default,n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=i,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=s,this.end=l,n=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var o=t.length-1;if(o<r)return 0;var i=n(t[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var o=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},string_decoder}function requireEndOfStream$1(){if(hasRequiredEndOfStream$1)return endOfStream$1;hasRequiredEndOfStream$1=1;var e=requireErrors().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream$1=function r(n,o,i){if("function"==typeof o)return r(n,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||t);var a=o.readable||!1!==o.readable&&n.readable,s=o.writable||!1!==o.writable&&n.writable,l=function(){n.writable||d()},p=n._writableState&&n._writableState.finished,d=function(){s=!1,p=!0,a||i.call(n)},u=n._readableState&&n._readableState.endEmitted,c=function(){a=!1,u=!0,s||i.call(n)},f=function(e){i.call(n,e)},h=function(){var t;return a&&!u?(n._readableState&&n._readableState.ended||(t=new e),i.call(n,t)):s&&!p?(n._writableState&&n._writableState.ended||(t=new e),i.call(n,t)):void 0},m=function(){n.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?s&&!n._writableState&&(n.on("end",l),n.on("close",l)):(n.on("complete",d),n.on("abort",h),n.req?m():n.on("request",m)),n.on("end",c),n.on("finish",d),!1!==o.error&&n.on("error",f),n.on("close",h),function(){n.removeListener("complete",d),n.removeListener("abort",h),n.removeListener("request",m),n.req&&n.req.removeListener("finish",d),n.removeListener("end",l),n.removeListener("close",l),n.removeListener("finish",d),n.removeListener("end",c),n.removeListener("error",f),n.removeListener("close",h)}},endOfStream$1}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream$1(),n=Symbol("lastResolve"),o=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),l=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function u(e){var t=e[n];if(null!==t){var r=e[p].read();null!==r&&(e[s]=null,e[n]=null,e[o]=null,t(d(r,!1)))}}function c(e){process.nextTick(u,e)}var f=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[a])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){process.nextTick(function(){e[i]?r(e[i]):t(d(void 0,!0))})});var r,n=this[s];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[a]?r(d(void 0,!0)):t[l](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[l])}return this[s]=r,r}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),f);return async_iterator=function(e){var u,f=Object.create(h,(t(u={},p,{value:e,writable:!0}),t(u,n,{value:null,writable:!0}),t(u,o,{value:null,writable:!0}),t(u,i,{value:null,writable:!0}),t(u,a,{value:e._readableState.endEmitted,writable:!0}),t(u,l,{value:function(e,t){var r=f[p].read();r?(f[s]=null,f[n]=null,f[o]=null,e(d(r,!1))):(f[n]=e,f[o]=t)},writable:!0}),u));return f[s]=null,r(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[o];return null!==t&&(f[s]=null,f[n]=null,f[o]=null,t(e)),void(f[i]=e)}var r=f[n];null!==r&&(f[s]=null,f[n]=null,f[o]=null,r(d(void 0,!0))),f[a]=!0}),e.on("readable",c.bind(null,f)),f},async_iterator}function requireFrom(){if(hasRequiredFrom)return from_1;function e(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredFrom=1;var n=requireErrors().codes.ERR_INVALID_ARG_TYPE;return from_1=function(o,i,a){var s;if(i&&"function"==typeof i.next)s=i;else if(i&&i[Symbol.asyncIterator])s=i[Symbol.asyncIterator]();else{if(!i||!i[Symbol.iterator])throw new n("iterable",["Iterable"],i);s=i[Symbol.iterator]()}var l=new o(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}({objectMode:!0},a)),p=!1;function d(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var e=yield s.next(),t=e.value;e.done?l.push(null):l.push(yield t)?d():p=!1}catch(e){l.destroy(e)}},u=function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,l,"next",t)}function l(t){e(a,o,i,s,l,"throw",t)}s(void 0)})},u.apply(this,arguments)}return l._read=function(){p||(p=!0,d())},l},from_1}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;var e;hasRequired_stream_readable=1,_stream_readable=w,w.ReadableState=O,require$$0__default$3.default.EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStream(),n=require$$0__default$7.default.Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var i,a=require$$1__default$4.default;i=a&&a.debuglog?a.debuglog("stream"):function(){};var s,l,p,d=requireBuffer_list(),u=requireDestroy(),c=requireState().getHighWaterMark,f=requireErrors().codes,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_STREAM_PUSH_AFTER_EOF,g=f.ERR_METHOD_NOT_IMPLEMENTED,y=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits()(w,r);var v=u.errorOrDestroy,b=["error","close","destroy","pause","resume"];function O(t,r,n){e=e||require_stream_duplex(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s||(s=requireString_decoder().StringDecoder),this.decoder=new s(t.encoding),this.encoding=t.encoding)}function w(t){if(e=e||require_stream_duplex(),!(this instanceof w))return new w(t);var n=this instanceof e;this._readableState=new O(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function S(e,t,r,a,s){i("readableAddChunk",t);var l,p=e._readableState;if(null===t)p.reading=!1,function(e,t){if(i("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,p);else if(s||(l=function(e,t){var r;i=t,n.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new h("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(p,t)),l)v(e,l);else if(p.objectMode||t&&t.length>0)if("string"==typeof t||p.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),a)p.endEmitted?v(e,new y):_(e,p,t,!0);else if(p.ended)v(e,new m);else{if(p.destroyed)return!1;p.reading=!1,p.decoder&&!r?(t=p.decoder.write(t),p.objectMode||0!==t.length?_(e,p,t,!1):R(e,p)):_(e,p,t,!1)}else a||(p.reading=!1,R(e,p));return!p.ended&&(p.length<p.highWaterMark||0===p.length)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),R(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=u.destroy,w.prototype._undestroy=u.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var r,o=this._readableState;return o.objectMode?r=!0:"string"==typeof e&&((t=t||o.defaultEncoding)!==o.encoding&&(e=n.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},w.prototype.unshift=function(e){return S(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){s||(s=requireString_decoder().StringDecoder);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var P=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,A(e)}function R(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function j(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function I(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(q,t,e))}function q(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return w.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){v(this,new g("_read()"))},w.prototype.pipe=function(e,r){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||!1!==r.end)&&e!==process.stdout&&e!==process.stderr?l:m;function s(t,r){i("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",p),e.removeListener("error",c),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",u),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){i("onend"),e.end()}o.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",s);var p=function(e){return function(){var r=e._readableState;i("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,A(e))}}(n);e.on("drain",p);var d=!1;function u(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!d&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function c(r){i("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&v(e,r)}function f(){e.removeListener("finish",h),m()}function h(){i("onfinish"),e.removeListener("close",f),m()}function m(){i("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",f),e.once("finish",h),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,i("on readable",o.length,o.reading),o.length?T(this):o.reading||process.nextTick(k,this))),n},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(x,this),n},w.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(x,this),t},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(j,e,t))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<b.length;a++)e.on(b[a],this.emit.bind(this,b[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=requireAsync_iterator()),l(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=N,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return void 0===p&&(p=requireFrom()),p(w,e,t)}),_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=s;var e=requireErrors().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=require_stream_duplex();function a(e,t){var n=this._transformState;n.transforming=!1;var o=n.writecb;if(null===o)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),o(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(t,r){p(e,t,r)})}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new n;return e.push(null)}return requireInherits()(s,i),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},s.prototype._transform=function(e,r,n){n(new t("_transform()"))},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},s.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,function(e){t(e)})},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=t;var e=require_stream_transform();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrors().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function i(e){e()}function a(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,s=new Array(t),l=0;l<t;l++)s[l]=arguments[l];var p,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new r("streams");var u=s.map(function(t,r){var o=r<s.length-1;return function(t,r,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;t.on("close",function(){a=!0}),void 0===e&&(e=requireEndOfStream$1()),e(t,{readable:r,writable:o},function(e){if(e)return i(e);a=!0,i()});var s=!1;return function(e){if(!a&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new n("pipe"))}}(t,o,r>0,function(e){p||(p=e),e&&u.forEach(i),o||(u.forEach(i),d(p))})});return s.reduce(a)},pipeline_1}function requireReadable(){return hasRequiredReadable||(hasRequiredReadable=1,function(e,t){var r=Stream__default.default;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=require_stream_readable()).Stream=r||t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough(),t.finished=requireEndOfStream$1(),t.pipeline=requirePipeline())}(readable,readable.exports)),readable.exports}var once={exports:{}},wrappy_1,hasRequiredWrappy,hasRequiredOnce,endOfStream,hasRequiredEndOfStream,streamShift,hasRequiredStreamShift,duplexify,hasRequiredDuplexify;function requireWrappy(){if(hasRequiredWrappy)return wrappy_1;return hasRequiredWrappy=1,wrappy_1=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}},wrappy_1}function requireOnce(){if(hasRequiredOnce)return once.exports;hasRequiredOnce=1;var e=requireWrappy();function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}return once.exports=e(t),once.exports.strict=e(r),t.proto=t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}),once.exports}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireOnce(),t=function(){},r=commonjsGlobal.Bare?queueMicrotask:process.nextTick.bind(process),n=function(o,i,a){if("function"==typeof i)return n(o,null,i);i||(i={}),a=e(a||t);var s=o._writableState,l=o._readableState,p=i.readable||!1!==i.readable&&o.readable,d=i.writable||!1!==i.writable&&o.writable,u=!1,c=function(){o.writable||f()},f=function(){d=!1,p||a.call(o)},h=function(){p=!1,d||a.call(o)},m=function(e){a.call(o,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(o,e)},y=function(){r(v)},v=function(){if(!u)return(!p||l&&l.ended&&!l.destroyed)&&(!d||s&&s.ended&&!s.destroyed)?void 0:a.call(o,new Error("premature close"))},b=function(){o.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(o)?d&&!s&&(o.on("end",c),o.on("close",c)):(o.on("complete",f),o.on("abort",y),o.req?b():o.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(o)&&o.on("exit",m),o.on("end",h),o.on("finish",f),!1!==i.error&&o.on("error",g),o.on("close",y),function(){u=!0,o.removeListener("complete",f),o.removeListener("abort",y),o.removeListener("request",b),o.req&&o.req.removeListener("finish",f),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",f),o.removeListener("exit",m),o.removeListener("end",h),o.removeListener("error",g),o.removeListener("close",y)}};return endOfStream=n}function requireStreamShift(){if(hasRequiredStreamShift)return streamShift;return hasRequiredStreamShift=1,streamShift=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null},streamShift}function requireDuplexify(){if(hasRequiredDuplexify)return duplexify;hasRequiredDuplexify=1;var e=requireReadable(),t=requireEndOfStream(),r=requireInherits(),n=requireStreamShift(),o=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),i=function(e,t){e._corked?e.once("uncork",t):t()},a=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===r.message?null:r):t&&!e._ended&&e.end()}},s=function(){},l=function(t,r,n){if(!(this instanceof l))return new l(t,r,n);e.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),r&&this.setReadable(r)};return r(l,e.Duplex),l.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new l(e,t,r)},l.prototype.cork=function(){1===++this._corked&&this.emit("cork")},l.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},l.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var r=this,n=t(e,{writable:!0,readable:!1},a(this,this._forwardEnd)),o=function(){var e=r._ondrain;r._ondrain=null,e&&e()};this._unwrite&&process.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=function(){r._writable.removeListener("drain",o),n()},this.uncork()}else this.end()},l.prototype.setReadable=function(r){if(this._unread&&this._unread(),this.destroyed)r&&r.destroy&&r.destroy();else{if(null===r||!1===r)return this.push(null),void this.resume();var n,o=this,i=t(r,{writable:!1,readable:!0},a(this)),s=function(){o._forward()},l=function(){o.push(null)};this._drained=!0,this._readable=r,this._readable2=r._readableState?r:(n=r,new e.Readable({objectMode:!0,highWaterMark:16}).wrap(n)),this._readable2.on("readable",s),this._readable2.on("end",l),this._unread=function(){o._readable2.removeListener("readable",s),o._readable2.removeListener("end",l),i()},this._forward()}},l.prototype._read=function(){this._drained=!0,this._forward()},l.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=n(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},l.prototype.destroy=function(e,t){if(t||(t=s),this.destroyed)return t(null);this.destroyed=!0;var r=this;process.nextTick(function(){r._destroy(e),t(null)})},l.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},l.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?i(this,this._write.bind(this,e,t,r)):e===o?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},l.prototype._finish=function(e){var t=this;this.emit("preend"),i(this,function(){var r,n;r=t._forwardEnd&&t._writable,n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),i(t,e)},r?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()})},l.prototype.end=function(t,r,n){return"function"==typeof t?this.end(null,null,t):"function"==typeof r?this.end(t,null,r):(this._ended=!0,t&&this.write(t),this._writableState.ending||this._writableState.destroyed||this.write(o),e.Writable.prototype.end.call(this,n))},duplexify=l}var retryRequest={exports:{}},extend,hasRequiredExtend,hasRequiredRetryRequest,hasRequiredStreaming;function requireExtend(){if(hasRequiredExtend)return extend;hasRequiredExtend=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return extend=function e(){var t,r,n,l,p,d,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c<f;++c)if(null!=(t=arguments[c]))for(r in t)n=s(u,r),u!==(l=s(t,r))&&(h&&l&&(i(l)||(p=o(l)))?(p?(p=!1,d=n&&o(n)?n:[]):d=n&&i(n)?n:{},a(u,{name:r,newValue:e(h,d,l)})):void 0!==l&&a(u,{name:r,newValue:l}));return u},extend}function requireRetryRequest(){if(hasRequiredRetryRequest)return retryRequest.exports;hasRequiredRetryRequest=1;const{PassThrough:e}=Stream__default.default,t=requireExtend();let r=()=>{};"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env&&"retry-request"===process.env.DEBUG&&(r=e=>{console.log("retry-request:",e)});const n={objectMode:!1,retries:2,maxRetryDelay:64,retryDelayMultiplier:2,totalTimeout:600,noResponseRetries:2,currentRetryAttempt:0,shouldRetryFn:function(e){const t=[[100,199],[429,429],[500,599]],n=e.statusCode;let o;for(r(`Response status: ${n}`);o=t.shift();)if(n>=o[0]&&n<=o[1])return!0}};function o(e){const{maxRetryDelay:t,retryDelayMultiplier:r,retryNumber:n,timeOfFirstRequest:o,totalTimeout:i}=e,a=1e3*t,s=1e3*i,l=Math.floor(1e3*Math.random()),p=1e3*Math.pow(r,n)+l,d=s-(Date.now()-o);return Math.min(p,d,a)}return retryRequest.exports=function(i,a,s){"string"==typeof i&&(i={url:i});const l="function"!=typeof arguments[arguments.length-1];"function"==typeof a&&(s=a);const p=a&&"number"==typeof a.currentRetryAttempt;if(void 0===(a=t({},n,a)).request)throw new Error("A request library must be provided to retry-request.");let d,u,c,f,h=a.currentRetryAttempt,m=0,g=!1;const y={abort:function(){f&&f.abort&&f.abort()}};l&&(d=new e({objectMode:a.objectMode}),d.abort=b);const v=Date.now();return h>0?w(h):O(),l?d:y;function b(){c=null,u&&(u.abort&&u.abort(),u.cancel&&u.cancel(),u.destroy?u.destroy():u.end&&u.end())}function O(){let t=!1;function n(e=[]){t||(t=!0,d.emit("complete",...e))}h++,r(`Current retry attempt: ${h}`),l?(g=!1,c=new e({objectMode:a.objectMode}),u=a.request(i),setImmediate(()=>{d.emit("request")}),u.on("error",e=>{g||(g=!0,S(e))}).on("response",(e,t)=>{g||(g=!0,S(null,e,t))}).on("complete",(...e)=>n(e)).on("finish",(...e)=>n(e)),u.pipe(c)):f=a.request(i,S)}function w(e){l&&b();const t=o({maxRetryDelay:a.maxRetryDelay,retryDelayMultiplier:a.retryDelayMultiplier,retryNumber:e,timeOfFirstRequest:v,totalTimeout:a.totalTimeout});r(`Next retry delay: ${t}`),t<=0?m=a.noResponseRetries+1:setTimeout(O,t)}function S(e,t,r){if(e)return m++,void(m<=a.noResponseRetries?w(m):l?(d.emit("error",e),d.end()):s(e,t,r));(p?h:h-1)<a.retries&&a.shouldRetryFn(t)?w(h):l?(d.emit("response",t),c.pipe(d),u.on("error",e=>{d.destroy(e)})):s(e,t,r)}},retryRequest.exports.defaults=n,retryRequest.exports.getNextRetryDelay=o,retryRequest.exports}function requireStreaming(){if(hasRequiredStreaming)return streaming;hasRequiredStreaming=1,Object.defineProperty(streaming,"__esModule",{value:!0}),streaming.StreamProxy=streaming.StreamType=void 0;const e=requireGax(),t=requireGoogleError(),r=requireStatus(),n=Stream__default.default,o=requireDuplexify(),i=requireRetryRequest();var a;!function(e){e[e.SERVER_STREAMING=1]="SERVER_STREAMING",e[e.CLIENT_STREAMING=2]="CLIENT_STREAMING",e[e.BIDI_STREAMING=3]="BIDI_STREAMING"}(a||(streaming.StreamType=a={}));return streaming.StreamProxy=class extends o{constructor(e,t,r,n){super(void 0,void 0,{objectMode:!0,readable:e!==a.CLIENT_STREAMING,writable:e!==a.SERVER_STREAMING}),this.type=e,this._callback=t,this._isCancelCalled=!1,this._responseHasSent=!1,this.rest=r,this.gaxServerStreamingRetries=n}shouldRetryRequest(e,r){const n=t.GoogleError.parseGRPCStatusDetails(e);let o=this.defaultShouldRetry(n,r);return r.shouldRetryFn&&(o=r.shouldRetryFn(n)),o}cancel(){this.stream?this.stream.cancel():this._isCancelCalled=!0}throwIfMaxRetriesOrTotalTimeoutExceeded(e,n,o,i,a,s){const l=(new Date).getTime();if(a&&(0===o||o<0||e&&l>=e)){const e=new t.GoogleError(`Total timeout of API exceeded ${a} milliseconds ${i?`retrying error ${i} `:""} before any response was received.`);throw e.code=r.Status.DEADLINE_EXCEEDED,e}if(0===n){const e=i;throw e.note="Max retries is set to zero.",e}if(s&&s>=n){const e=new t.GoogleError("Exceeded maximum number of retries "+(i?`retrying error ${i} `:"")+"before any response was received");throw e.code=r.Status.DEADLINE_EXCEEDED,e}}eventForwardHelper(e){["metadata","response","status"].forEach(t=>{e.on(t,this.emit.bind(this,t))})}statusMetadataHelper(e){e.on("status",()=>{this._responseHasSent||e.emit("response",{code:200,details:"",message:"OK"})}),e.on("metadata",t=>{e.emit("response",{code:200,details:"",message:"OK",metadata:t}),this._responseHasSent=!0})}forwardEvents(e){this.eventForwardHelper(e),this.statusMetadataHelper(e),e.on("error",e=>{t.GoogleError.parseGRPCStatusDetails(e)})}defaultShouldRetry(e,t){return!(t.retryCodes.length>0&&t.retryCodes.indexOf(e.code)<0||0===t.retryCodes.length)}setStream(e,t,r={},n){if(this.apiCall=e,this.argument=t,this.type===a.SERVER_STREAMING){if(this.rest){const r=e(t,this._callback);this.stream=r,this.setReadable(r)}else if(this.gaxServerStreamingRetries){const r=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return e(t,this._callback)},o=this.newStreamingRetryRequest({request:r,retry:n});this.stream=o,this.eventForwardHelper(o),this.setReadable(o)}else{const n=i(null,{objectMode:!0,request:()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());const r=e(t,this._callback);return this.stream=r,this.forwardEvents(r),r},retries:r.retries,currentRetryAttempt:r.currentRetryAttempt,noResponseRetries:r.noResponseRetries,shouldRetryFn:r.shouldRetryFn});this.setReadable(n)}return}const o=e(t,this._callback);this.stream=o,this.forwardEvents(o),this.type===a.CLIENT_STREAMING&&this.setWritable(o),this.type===a.BIDI_STREAMING&&(this.setReadable(o),this.setWritable(o)),this._isCancelCalled&&this.stream&&this.stream.cancel()}newStreamingRetryRequest(o){var i,a,s,l;const p=null!==(i=o.retry)&&void 0!==i?i:{retryCodes:[],backoffSettings:(0,e.createDefaultBackoffSettings)()};let d=0;const u=new n.PassThrough({objectMode:!0}),c=null!==(a=p.backoffSettings.totalTimeoutMillis)&&void 0!==a?a:void 0,f=null!==(s=p.backoffSettings.maxRetries)&&void 0!==s?s:void 0;let h=null!==(l=p.backoffSettings.initialRpcTimeoutMillis)&&void 0!==l?l:void 0,m=new Date,g=0;c&&(g=m.getTime()+c);const y=(e,r)=>{const n=t.GoogleError.parseGRPCStatusDetails(e);return n.note="Exception occurred in retry method that was not classified as transient",r.destroy(),u.destroy(n),u},v=e=>{let n=!1,i=!1,a=!1;const s=e.request(null);u.cancel=s.cancel;return["metadata","response","status"].forEach(e=>{s.on(e,u.emit.bind(u,e))}),this.statusMetadataHelper(s),s.on("data",e=>{d=0,this.emit.bind(this,"data")(e)}),s.on("status",()=>(i=!0,n&&u.end(),u)),s.on("end",()=>(a||(n=!0,i&&u.end()),u)),s.on("error",e=>{if(a=!0,void 0!==typeof f||void 0!==typeof c){if(this.shouldRetryRequest(e,p)){if(f&&c){const e=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");return e.code=r.Status.INVALID_ARGUMENT,s.destroy(),u.destroy(e),u}{try{this.throwIfMaxRetriesOrTotalTimeoutExceeded(g,f,h,e,c,d)}catch(e){const r=t.GoogleError.parseGRPCStatusDetails(e);return s.destroy(),u.destroy(r),u}const r=p.backoffSettings.retryDelayMultiplier,n=p.backoffSettings.maxRetryDelayMillis,i=p.backoffSettings.rpcTimeoutMultiplier,a=p.backoffSettings.maxRpcTimeoutMillis;let l=p.backoffSettings.initialRetryDelayMillis;const y=Math.random()*l;return(()=>{setTimeout(()=>{if(h){m=new Date,l=Math.min(l*r,n);const e=h&&i?h*i:0,t=a||0,o=g?g-m.getTime():0;h=Math.min(e,t,o)}d++;let e=this.argument;void 0!==p.getResumptionRequestFn&&(e=p.getResumptionRequestFn(e));return o.request=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return this.apiCall(e,this._callback)},v(o)},y)})()}}return y(e,s)}return y(e,s)}),u};return v(o)}},streaming}var pathTemplate={},hasRequiredPathTemplate;function requirePathTemplate(){if(hasRequiredPathTemplate)return pathTemplate;hasRequiredPathTemplate=1,Object.defineProperty(pathTemplate,"__esModule",{value:!0}),pathTemplate.PathTemplate=void 0;return pathTemplate.PathTemplate=class{constructor(e){this.bindings={},this.data=e,this.segments=this.parsePathTemplate(e),this.size=this.segments.length}match(e){let t=e.split("/");const r={};if(t.length!==this.segments.length){if(!this.data.includes("**"))throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same.`);if(t.length!==this.segments.length+1)throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`)}for(let e=0;e<this.segments.length&&t.length>0;e++)if(this.segments[e]!==t[0]){if(!this.segments[e].includes("*"))throw new TypeError(`segment does not match, ${this.segments[e]} and ${t[e]}.`);{let n=this.segments[e];const o=n.match(/\{[$0-9a-zA-Z_]+=.*?\}/g);if(!o)throw new Error(`Error processing path template segment ${n}`);const i=o.map(e=>e.replace(/^\{/,"").replace(/=.*/,""));if(n.includes("**"))r[i[0]]=t[0]+"/"+t[1],t=t.slice(2);else{if(1===i.length)r[i[0]]=t[0];else{const o=t[0].split(/[-_.~]/);if(o.length!==i.length)throw new Error(`segment ${n} does not match ${t[0]}`);for(const e of i)r[e]=o[0],n=n.replace(`{${e}=*}`,`${o[0]}`),o.shift();if(n!==t[0])throw new TypeError(`non slash resource pattern ${this.segments[e]} and ${t[0]} should have same separator`)}t.shift()}}}else t.shift();return r}render(e){if(Object.keys(e).length!==Object.keys(this.bindings).length)throw new TypeError(`The number of variables ${Object.keys(e).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);let t=this.inspect();for(const r of Object.keys(e)){const n=e[r].toString();if(!this.bindings[r])throw new TypeError(`render fails for not matching ${e[r]}`);const o=this.bindings[r];if("*"===o){if(!n.match(/[^/{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=*}`,`${n}`)}else if("**"===o){if(!n.match(/[^{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=**}`,`${n}`)}}return t}inspect(){return this.segments.join("/")}parsePathTemplate(e){const t=function(e){let t=0,r=0,n=0;const o=[];for(;r>=t&&r<e.length;){if("{"===e.charAt(r))n+=1;else if("}"===e.charAt(r))n-=1;else if("/"===e.charAt(r)){if(r===e.length-1)throw new TypeError("Invalid path, it can not be ended by /");0===n&&(o.push(e.substring(t,r)),t=r+1)}if(r===e.length-1){if(0!==n)throw new TypeError("Brackets are invalid.");o.push(e.substring(t))}r+=1}return o}(e);let r=0,n=0;const o=[];let i;if(t.forEach(e=>{if("*"===e||"**"===e)this.bindings[`$${r}`]=e,o.push(`{$${r}=${e}}`),r+=1,"**"===e&&++n;else if(i=e.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g)){for(const t of i){const r=t.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/);if(!r)throw new Error(`Cannot process path template segment ${t}`);const o=r[1];let i=r[2];i?"*"===i?this.bindings[o]=i:"**"===i&&(++n,this.bindings[o]=i):(i="*",e=e.replace(o,o+"=*"),this.bindings[o]=i)}o.push(e)}else e.match(/[0-9a-zA-Z-.~_]+/)&&o.push(e)}),n>1)throw new TypeError("Can not have more than one wildcard.");return o}},pathTemplate}var version$1="4.6.1",require$$19={version:version$1},descriptor={},longRunningDescriptor={},longRunningApiCaller={},longrunning={},hasRequiredLongrunning,hasRequiredLongRunningApiCaller,hasRequiredLongRunningDescriptor;function requireLongrunning(){if(hasRequiredLongrunning)return longrunning;hasRequiredLongrunning=1,Object.defineProperty(longrunning,"__esModule",{value:!0}),longrunning.Operation=void 0,longrunning.operation=function(e,t,r,n){return new o(e,t,r,n)};const e=require$$0__default$3.default,t=requireStatus(),r=requireGoogleError(),n=requireOperations();class o extends e.EventEmitter{constructor(e,t,r,n){super(),this.completeListeners=0,this.hasActiveListeners=!1,this.latestResponse=e,this.name=this.latestResponse.name,this.done=this.latestResponse.done,this.error=this.latestResponse.error,this.longrunningDescriptor=t,this.result=null,this.metadata=null,this.backoffSettings=r,this._unpackResponse(e),this._listenForEvents(),this._callOptions=n}_listenForEvents(){this.on("newListener",e=>{"complete"===e&&(this.completeListeners++,this.hasActiveListeners||(this.hasActiveListeners=!0,this.startPolling_()))}),this.on("removeListener",e=>{"complete"===e&&0===--this.completeListeners&&(this.hasActiveListeners=!1)})}cancel(){this.currentCallPromise_&&this.currentCallPromise_.cancel();const e=this.longrunningDescriptor.operationsClient,t=new n.google.longrunning.CancelOperationRequest;return t.name=this.latestResponse.name,e.cancelOperation(t)}getOperation(e){const t=this,o=this.longrunningDescriptor.operationsClient;function i(){if(!e)return new Promise((e,n)=>{if(t.latestResponse.error){const e=new r.GoogleError(t.latestResponse.error.message);e.code=t.latestResponse.error.code,n(e)}else e([t.result,t.metadata,t.latestResponse])})}if(this.latestResponse.done)return this._unpackResponse(this.latestResponse,e),i();const a=new n.google.longrunning.GetOperationRequest;a.name=this.latestResponse.name,this.currentCallPromise_=o.getOperationInternal(a,this._callOptions);const s=this.currentCallPromise_.then(r=>(t.latestResponse=r[0],t._unpackResponse(r[0],e),i()),t=>{if(!e)return Promise.reject(t);e(t)});return e?void 0:s}_unpackResponse(e,t){const n=this.longrunningDescriptor.responseDecoder,o=this.longrunningDescriptor.metadataDecoder;let i,a;if(e.done){if("error"===e.result){const n=new r.GoogleError(e.error.message);return n.code=e.error.code,this.error=n,void(t&&t(n))}n&&e.response&&(this.response=e.response,i=n(e.response.value),this.result=i,this.done=!0)}o&&e.metadata&&(a=o(e.metadata.value),this.metadata=a),t&&t(null,i,a,e)}startPolling_(){const e=this;let n=new Date;const o=this.backoffSettings.retryDelayMultiplier,i=this.backoffSettings.maxRetryDelayMillis;let a,s=this.backoffSettings.initialRetryDelayMillis,l=1/0;function p(t,...r){e.emit(t,...r)}this.backoffSettings.totalTimeoutMillis&&(l=n.getTime()+this.backoffSettings.totalTimeoutMillis),this.latestResponse.metadata&&(a=this.latestResponse.metadata.value),function d(){if(e.hasActiveListeners){if(n.getTime()>=l){const e=new r.GoogleError("Total timeout exceeded before any response was received");return e.code=t.Status.DEADLINE_EXCEEDED,void setImmediate(p,"error",e)}e.getOperation((e,t,r,l)=>{if(!e)return t?void setImmediate(p,"complete",t,r,l):(l.metadata&&(!a||l&&!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;++r)if(e[r]!==t[r])return!1;return!0}(l.metadata.value,a))&&(setImmediate(p,"progress",r,l),a=l.metadata.value),l.done?void setImmediate(p,"complete",{},r,l):void setTimeout(()=>{n=new Date,s=Math.min(s*o,i),d()},s));setImmediate(p,"error",e)})}}()}promise(){return new Promise((e,t)=>{this.on("error",t).on("complete",(t,r,n)=>{e([t,r,n])})})}}return longrunning.Operation=o,longrunning}function requireLongRunningApiCaller(){if(hasRequiredLongRunningApiCaller)return longRunningApiCaller;hasRequiredLongRunningApiCaller=1,Object.defineProperty(longRunningApiCaller,"__esModule",{value:!0}),longRunningApiCaller.LongrunningApiCaller=void 0;const e=requireCall(),t=requireGax(),r=requireLongrunning();return longRunningApiCaller.LongrunningApiCaller=class{constructor(e){this.longrunningDescriptor=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call((t,n)=>this._wrapOperation(e,r,t,n),t)}_wrapOperation(e,n,o,i){let a=n.longrunning;a||(a=(0,t.createDefaultBackoffSettings)());const s=this.longrunningDescriptor;return e(o,(e,t)=>{if(e)return void i(e,null,null,t);const o=new r.Operation(t,s,a,n);i(null,o,t)})}fail(e,t){e.callback(t)}result(e){return e.promise}},longRunningApiCaller}function requireLongRunningDescriptor(){if(hasRequiredLongRunningDescriptor)return longRunningDescriptor;hasRequiredLongRunningDescriptor=1,Object.defineProperty(longRunningDescriptor,"__esModule",{value:!0}),longRunningDescriptor.LongRunningDescriptor=void 0;const e=requireLongRunningApiCaller();return longRunningDescriptor.LongRunningDescriptor=class{constructor(e,t,r){this.operationsClient=e,this.responseDecoder=t,this.metadataDecoder=r}getApiCaller(){return new e.LongrunningApiCaller(this)}},longRunningDescriptor}var pageDescriptor={},pagedApiCaller={},resourceCollector={},hasRequiredResourceCollector,hasRequiredPagedApiCaller,hasRequiredPageDescriptor;function requireResourceCollector(){if(hasRequiredResourceCollector)return resourceCollector;hasRequiredResourceCollector=1,Object.defineProperty(resourceCollector,"__esModule",{value:!0}),resourceCollector.ResourceCollector=void 0;return resourceCollector.ResourceCollector=class{constructor(e,t=-1){this.apiCall=e,this.resources=[],this.maxResults=t}callback(e,t,r){if(e)return void this.rejectCallback(e);for(const e of t)if(this.resources.push(e),this.resources.length===this.maxResults){r=null;break}if(!r)return void this.resolveCallback(this.resources);setImmediate(this.apiCall,r,(...e)=>this.callback(...e))}processAllPages(e){return new Promise((t,r)=>{this.resolveCallback=t,this.rejectCallback=r;setImmediate(this.apiCall,e,(...e)=>this.callback(...e))})}},resourceCollector}function requirePagedApiCaller(){if(hasRequiredPagedApiCaller)return pagedApiCaller;hasRequiredPagedApiCaller=1,Object.defineProperty(pagedApiCaller,"__esModule",{value:!0}),pagedApiCaller.PagedApiCaller=void 0;const e=requireCall(),t=requireGoogleError(),r=requireResourceCollector(),n=requireWarnings();return pagedApiCaller.PagedApiCaller=class{constructor(e){this.pageDescriptor=e}generateParseResponseCallback(e,r){const n=this.pageDescriptor.resourceField,o=this.pageDescriptor.responsePageTokenField,i=this.pageDescriptor.requestPageTokenField;return(a,s)=>{if(a)return void r(a);if(!e)return void r(new t.GoogleError("Undefined request in pagination method callback."));if(!s)return void r(new t.GoogleError("Undefined response in pagination method callback."));const l=s[n]||[],p=s[o];let d=null;p&&(d=Object.assign({},e),d[i]=p),r(a,l,d,s)}}wrap(e){const t=this;return function(r,n,o,i){return e(r,n,o,t.generateParseResponseCallback(r,i))}}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}call(e,t,o,i){if(t=Object.assign({},t),!o.autoPaginate)return void i.call(e,t);t.pageSize&&o.autoPaginate&&(0,n.warn)("autoPaginate true","Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging","AutopaginateTrueWarning");const a=o.maxResults||-1;new r.ResourceCollector(e,a).processAllPages(t).then(e=>i.callback(null,e),e=>i.callback(e))}fail(e,t){e.callback(t)}result(e){return e.promise}},pagedApiCaller}function requirePageDescriptor(){if(hasRequiredPageDescriptor)return pageDescriptor;hasRequiredPageDescriptor=1,Object.defineProperty(pageDescriptor,"__esModule",{value:!0}),pageDescriptor.PageDescriptor=void 0;const e=Stream__default.default,t=requireNormalApiCaller(),r=requireWarnings(),n=requirePagedApiCaller();return pageDescriptor.PageDescriptor=class{constructor(e,t,r){this.requestPageTokenField=e,this.responsePageTokenField=t,this.resourceField=r}createStream(t,n,o){(null==o?void 0:o.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning");const i=new e.PassThrough({objectMode:!0}),a="maxResults"in(o=Object.assign({},o,{autoPaginate:!1}))?o.maxResults:-1;let s=0,l=!1;function p(e,r,d,u){if(e)i.emit("error",e);else{i.emit("response",u);for(let e=0;e<r.length;++e){if(i._readableState.ended)return;null!==r[e]&&(i.push(r[e]),s++,s===a&&i.end())}i._readableState.ended||(d?("pageToken"in o&&delete o.pageToken,i.isPaused()?(n=d,l=!1):setImmediate(t,d,o,p)):i.end())}}return i.on("resume",()=>{l||(l=!0,t(n,o,p))}),i}asyncIterate(e,t,n){(null==n?void 0:n.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning"),n=Object.assign({},n,{autoPaginate:!1});return this.createIterator(e,t,n)}createIterator(e,t,r){const n={[Symbol.asyncIterator](){let n=t;const o=[];return{async next(){if(o.length>0)return Promise.resolve({done:!1,value:o.shift()});let t=0;for(;0===o.length&&n;){let i;if([i,n]=await e(n,r),i&&!Array.isArray(i))for(const[e,t]of Object.entries(i))o.push([e,t]);else o.push(...i);if(0===o.length&&(++t,t>10))break}return 0===o.length?Promise.resolve({done:!0,value:void 0}):Promise.resolve({done:!1,value:o.shift()})}}}};return n}getApiCaller(e){return e.autoPaginate?new n.PagedApiCaller(this):new t.NormalApiCaller}},pageDescriptor}var streamDescriptor={},streamingApiCaller={},hasRequiredStreamingApiCaller,hasRequiredStreamDescriptor;function requireStreamingApiCaller(){if(hasRequiredStreamingApiCaller)return streamingApiCaller;hasRequiredStreamingApiCaller=1,Object.defineProperty(streamingApiCaller,"__esModule",{value:!0}),streamingApiCaller.StreamingApiCaller=void 0;const e=requireWarnings(),t=requireStreaming();return streamingApiCaller.StreamingApiCaller=class{constructor(e){this.descriptor=e}init(e){return new t.StreamProxy(this.descriptor.type,e,this.descriptor.rest,this.descriptor.gaxStreamingRetries)}wrap(r){switch(this.descriptor.type){case t.StreamType.SERVER_STREAMING:return(e,t,n)=>r(e,t,n);case t.StreamType.CLIENT_STREAMING:return(e,t,n,o)=>r(t,n,o);case t.StreamType.BIDI_STREAMING:return(e,t,n)=>r(t,n);default:(0,e.warn)("streaming_wrap_unknown_stream_type",`Unknown stream type: ${this.descriptor.type}`)}return r}call(e,t,r,n){n.setStream(e,t,r.retryRequestOptions,r.retry)}fail(e,t){e.emit("error",t)}result(e){return e}},streamingApiCaller}function requireStreamDescriptor(){if(hasRequiredStreamDescriptor)return streamDescriptor;hasRequiredStreamDescriptor=1,Object.defineProperty(streamDescriptor,"__esModule",{value:!0}),streamDescriptor.StreamDescriptor=void 0;const e=requireStreamingApiCaller();return streamDescriptor.StreamDescriptor=class{constructor(e,t,r){this.type=e,this.streaming=!0,this.rest=t,this.gaxStreamingRetries=r}getApiCaller(){return new e.StreamingApiCaller(this)}},streamDescriptor}var bundleDescriptor={},bundleApiCaller={},hasRequiredBundleApiCaller;function requireBundleApiCaller(){if(hasRequiredBundleApiCaller)return bundleApiCaller;hasRequiredBundleApiCaller=1,Object.defineProperty(bundleApiCaller,"__esModule",{value:!0}),bundleApiCaller.BundleApiCaller=void 0;const e=requireCall(),t=requireGoogleError();return bundleApiCaller.BundleApiCaller=class{constructor(e){this.bundler=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,r,n,o){if(!n.isBundling)throw new t.GoogleError("Bundling enabled with no isBundling!");o.call((t,r)=>(this.bundler.schedule(e,t,r),o),r)}fail(e,t){e.callback(t)}result(e){return e.promise}},bundleApiCaller}var bundleExecutor={},bundlingUtils={},hasRequiredBundlingUtils;function requireBundlingUtils(){if(hasRequiredBundlingUtils)return bundlingUtils;function e(e,t){const r=t.split(".");let n=e;for(const e of r)n=null==n?void 0:n[e];return n}return hasRequiredBundlingUtils=1,Object.defineProperty(bundlingUtils,"__esModule",{value:!0}),bundlingUtils.computeBundleId=function(t,r){const n=[];let o=!1;for(const i of r){const r=e(t,i);void 0===r?n.push(null):(o=!0,n.push(r))}if(!o)return;return JSON.stringify(n)},bundlingUtils}var task={},hasRequiredTask,hasRequiredBundleExecutor,hasRequiredBundleDescriptor,hasRequiredDescriptor;function requireTask(){if(hasRequiredTask)return task;hasRequiredTask=1,Object.defineProperty(task,"__esModule",{value:!0}),task.Task=void 0,task.deepCopyForResponse=r;const e=requireStatus(),t=requireGoogleError();function r(e,t){let n;return null===e?null:void 0!==e?Array.isArray(e)?(n=[],e.forEach(e=>{n.push(r(e,null))}),n):void 0!==e.copy?e.copy():e instanceof ArrayBuffer?e.slice(0):"object"==typeof e?(n={},Object.keys(e).forEach(o=>{t&&o===t.field&&Array.isArray(e[o])?n[o]=e[o].slice(t.start,t.end):n[o]=r(e[o],null)}),n):e:void 0}return task.Task=class{constructor(e,t,r,n){this._apiCall=e,this._request=t,this._bundledField=r,this._subresponseField=n,this._data=[]}getElementCount(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].elements.length;return e}getRequestByteSize(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].bytes;return e}run(){if(0===this._data.length)return[];const n=this._request,o=[],i=[];for(let e=0;e<this._data.length;++e)o.push(...this._data[e].elements),i.push(this._data[e].callback.id);n[this._bundledField]=o;const a=this;return this.callCanceller=this._apiCall(n,(n,o)=>{const i=[];if(n)a._data.forEach(()=>{i.push(void 0)});else{let e=null;a._subresponseField&&(e={field:a._subresponseField,start:0}),a._data.forEach(t=>{e&&(e.end=e.start+t.elements.length),i.push(r(o,e)),e&&(e.start=e.end)})}for(let r=0;r<a._data.length;++r)if(a._data[r].cancelled){const n=new t.GoogleError("cancelled");n.code=e.Status.CANCELLED,a._data[r].callback(n)}else a._data[r].callback(n,i[r])}),i}extend(e,t,r){this._data.push({elements:e,bytes:t,callback:r})}cancel(r){if(this.callCanceller){let e=!0;return this._data.forEach(t=>{t.callback.id===r&&(t.cancelled=!0),t.cancelled||(e=!1)}),e&&this.callCanceller.cancel(),e}for(let n=0;n<this._data.length;++n)if(this._data[n].callback.id===r){const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this._data[n].callback(r),this._data.splice(n,1);break}return 0===this._data.length}},task}function requireBundleExecutor(){if(hasRequiredBundleExecutor)return bundleExecutor;hasRequiredBundleExecutor=1,Object.defineProperty(bundleExecutor,"__esModule",{value:!0}),bundleExecutor.BundleExecutor=void 0;const e=requireStatus(),t=requireGoogleError(),r=requireWarnings(),n=requireBundlingUtils(),o=requireTask();function i(){}return bundleExecutor.BundleExecutor=class{constructor(e,t){this._options=e,this._descriptor=t,this._tasks={},this._timers={},this._invocations={},this._invocationId=0}schedule(a,s,l){const p=(0,n.computeBundleId)(s,this._descriptor.requestDiscriminatorFields);if(l=l||i,void 0===p)return(0,r.warn)("bundling_schedule_bundleid_undefined",`The request does not have enough information for request bundling. Invoking immediately. Request: ${JSON.stringify(s)} discriminator fields: ${this._descriptor.requestDiscriminatorFields}`),a(s,l);if(void 0===s[this._descriptor.bundledField])return(0,r.warn)("bundling_no_bundled_field",`Request does not contain field ${this._descriptor.bundledField} that must present for bundling. Invoking immediately. Request: ${JSON.stringify(s)}`),a(s,l);p in this._tasks||(this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField));let d=this._tasks[p];l.id=String(this._invocationId++),this._invocations[l.id]=p;const u=s[this._descriptor.bundledField],c=u.length;let f=0;const h=this;u.forEach(e=>{f+=this._descriptor.byteLengthFunction(e)});const m=this._options.elementCountLimit||0,g=this._options.requestByteLimit||0;if(m>0&&c>m||g>0&&f>=g){let r;r=m>0&&c>m?"The number of elements "+c+" exceeds the limit "+this._options.elementCountLimit:"The required bytes "+f+" exceeds the limit "+this._options.requestByteLimit;const n=new t.GoogleError(r);return n.code=e.Status.INVALID_ARGUMENT,l(n),{cancel:i}}const y=d.getElementCount(),v=d.getRequestByteSize();(m>0&&c+y>=m||g>0&&f+v>=g)&&(this._runNow(p),this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField),d=this._tasks[p]),d.extend(u,f,l);const b={cancel(){h._cancel(l.id)}},O=this._options.elementCountThreshold||0,w=this._options.requestByteThreshold||0;return O>0&&d.getElementCount()>=O||w>0&&d.getRequestByteSize()>=w?(this._runNow(p),b):(!(p in this._timers)&&this._options.delayThreshold>0&&(this._timers[p]=setTimeout(()=>{delete this._timers[p],this._runNow(p)},this._options.delayThreshold)),b)}_maybeClearTimeout(e){if(e in this._timers){const t=this._timers[e];delete this._timers[e],clearTimeout(t)}}_cancel(e){if(!(e in this._invocations))return;const t=this._invocations[e];if(!(t in this._tasks))return;const r=this._tasks[t];delete this._invocations[e],r.cancel(e)&&(this._maybeClearTimeout(t),delete this._tasks[t])}_runNow(e){if(!(e in this._tasks))return void(0,r.warn)("bundle_runnow_bundleid_unknown",`No such bundleid: ${e}`);this._maybeClearTimeout(e);const t=this._tasks[e];delete this._tasks[e],t.run().forEach(e=>{delete this._invocations[e]})}},bundleExecutor}function requireBundleDescriptor(){if(hasRequiredBundleDescriptor)return bundleDescriptor;hasRequiredBundleDescriptor=1,Object.defineProperty(bundleDescriptor,"__esModule",{value:!0}),bundleDescriptor.BundleDescriptor=void 0;const e=requireNormalApiCaller(),t=requireBundleApiCaller(),r=requireBundleExecutor(),n=requireUtil$2();return bundleDescriptor.BundleDescriptor=class{constructor(e,t,r,o){o||"function"!=typeof r||(o=r,r=null),this.bundledField=e,this.requestDiscriminatorFields=t.map(n.toCamelCase),this.subresponseField=r,this.byteLengthFunction=o}getApiCaller(n){return!1===n.isBundling?new e.NormalApiCaller:new t.BundleApiCaller(new r.BundleExecutor(n.bundleOptions,this))}},bundleDescriptor}function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BundleDescriptor=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=void 0;var t=requireLongRunningDescriptor();Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return t.LongRunningDescriptor}});var r=requirePageDescriptor();Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return r.PageDescriptor}});var n=requireStreamDescriptor();Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return n.StreamDescriptor}});var o=requireBundleDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return o.BundleDescriptor}})}(descriptor)),descriptor}var iamService={},interfaces$2={"google.iam.v1.IAMPolicy":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:2e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:2e4,total_timeout_millis:6e5}},methods:{GetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},SetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TestIamPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$2={interfaces:interfaces$2},nested$3={google:{nested:{iam:{nested:{v1:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.Cloud.Iam.V1",go_package:"google.golang.org/genproto/googleapis/iam/v1;iam",java_multiple_files:!0,java_outer_classname:"PolicyProto",java_package:"com.google.iam.v1",php_namespace:"Google\\Cloud\\Iam\\V1"},nested:{IAMPolicy:{options:{"(google.api.default_host)":"iam-meta-api.googleapis.com"},methods:{SetIamPolicy:{requestType:"SetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:setIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:setIamPolicy",body:"*"}}]},GetIamPolicy:{requestType:"GetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:getIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:getIamPolicy",body:"*"}}]},TestIamPermissions:{requestType:"TestIamPermissionsRequest",responseType:"TestIamPermissionsResponse",options:{"(google.api.http).post":"/v1/{resource=**}:testIamPermissions","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:testIamPermissions",body:"*"}}]}}},SetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},policy:{type:"Policy",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},options:{type:"GetPolicyOptions",id:2}}},TestIamPermissionsRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},permissions:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TestIamPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"string",id:1}}},GetPolicyOptions:{fields:{requestedPolicyVersion:{type:"int32",id:1}}},Policy:{fields:{version:{type:"int32",id:1},bindings:{rule:"repeated",type:"Binding",id:4},etag:{type:"bytes",id:3}}},Binding:{fields:{role:{type:"string",id:1},members:{rule:"repeated",type:"string",id:2},condition:{type:"google.type.Expr",id:3}}},PolicyDelta:{fields:{bindingDeltas:{rule:"repeated",type:"BindingDelta",id:1},auditConfigDeltas:{rule:"repeated",type:"AuditConfigDelta",id:2}}},BindingDelta:{fields:{action:{type:"Action",id:1},role:{type:"string",id:2},member:{type:"string",id:3},condition:{type:"google.type.Expr",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},AuditConfigDelta:{fields:{action:{type:"Action",id:1},service:{type:"string",id:2},exemptedMember:{type:"string",id:3},logType:{type:"string",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},logging:{options:{csharp_namespace:"Google.Cloud.Iam.V1.Logging",go_package:"google.golang.org/genproto/googleapis/iam/v1/logging;logging",java_multiple_files:!0,java_outer_classname:"AuditDataProto",java_package:"com.google.iam.v1.logging"},nested:{AuditData:{fields:{policyDelta:{type:"google.iam.v1.PolicyDelta",id:2}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}},type:{options:{go_package:"google.golang.org/genproto/googleapis/type/expr;expr",java_multiple_files:!0,java_outer_classname:"ExprProto",java_package:"com.google.type",objc_class_prefix:"GTP"},nested:{Expr:{fields:{expression:{type:"string",id:1},title:{type:"string",id:2},description:{type:"string",id:3},location:{type:"string",id:4}}}}}}}},require$$5$1={nested:nested$3},hasRequiredIamService;function requireIamService(){if(hasRequiredIamService)return iamService;hasRequiredIamService=1,Object.defineProperty(iamService,"__esModule",{value:!0}),iamService.IamClient=void 0;const e=requireCreateApiCall(),t=requireRoutingHeader(),r=require$$2,n=requireFallback();let o=require$$19.version;const i=require$$5$1;return iamService.IamClient=class{constructor(e,t){this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{}},this.innerApiCalls={},this.gaxGrpc=e;const a=Object.assign({servicePath:t.servicePath,port:t.port,clientConfig:t.clientConfig,apiEndpoint:t.apiEndpoint,fallback:t.fallback},t);o=a.fallback?n.version:o,a.scopes=this.constructor.scopes,this._opts=a,this.auth=e.auth;const s=[`gax/${o}`,`gapic/${o}`];"undefined"!=typeof process&&"versions"in process?s.push(`gl-node/${process.versions.node}`):s.push(`gl-web/${o}`),a.fallback||s.push(`grpc/${e.grpcVersion}`),a.libName&&a.libVersion&&s.push(`${a.libName}/${a.libVersion}`),this._protos=this.gaxGrpc.loadProtoJSON(i),this._defaults=e.constructSettings("google.iam.v1.IAMPolicy",r,a.clientConfig||{},{"x-goog-api-client":s.join(" ")}),this.innerApiCalls={}}initialize(){if(this.iamPolicyStub)return this.iamPolicyStub;this.iamPolicyStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.iam.v1.IAMPolicy"):this._protos.google.iam.v1.IAMPolicy,this._opts);const t=["getIamPolicy","setIamPolicy","testIamPermissions"];for(const r of t){const t=this.iamPolicyStub.then(e=>(...t)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[r].apply(e,t)},e=>()=>{throw e});this.innerApiCalls[r]=(0,e.createApiCall)(t,this._defaults[r],this.descriptors.page[r])}return this.iamPolicyStub}static get servicePath(){return"cloudkms.googleapis.com"}static get apiEndpoint(){return"cloudkms.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudkms"]}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.getIamPolicy(e,o,n)}setIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.setIamPolicy(e,o,n)}testIamPermissions(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.testIamPermissions(e,o,n)}close(){return this.initialize(),this._terminated?Promise.resolve():this.iamPolicyStub.then(e=>{this._terminated=!0,e.close()})}},iamService}var locationService={},nested$2={google:{nested:{cloud:{nested:{location:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/cloud/location;location",java_multiple_files:!0,java_outer_classname:"LocationsProto",java_package:"com.google.cloud.location"},nested:{Locations:{options:{"(google.api.default_host)":"cloud.googleapis.com","(google.api.oauth_scopes)":"https://www.googleapis.com/auth/cloud-platform"},methods:{ListLocations:{requestType:"ListLocationsRequest",responseType:"ListLocationsResponse",options:{"(google.api.http).get":"/v1/{name=locations}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*}/locations"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations}",additional_bindings:{get:"/v1/{name=projects/*}/locations"}}}]},GetLocation:{requestType:"GetLocationRequest",responseType:"Location",options:{"(google.api.http).get":"/v1/{name=locations/*}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*/locations/*}"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations/*}",additional_bindings:{get:"/v1/{name=projects/*/locations/*}"}}}]}}},ListLocationsRequest:{fields:{name:{type:"string",id:1},filter:{type:"string",id:2},pageSize:{type:"int32",id:3},pageToken:{type:"string",id:4}}},ListLocationsResponse:{fields:{locations:{rule:"repeated",type:"Location",id:1},nextPageToken:{type:"string",id:2}}},GetLocationRequest:{fields:{name:{type:"string",id:1}}},Location:{fields:{name:{type:"string",id:1},locationId:{type:"string",id:4},displayName:{type:"string",id:5},labels:{keyType:"string",type:"string",id:2},metadata:{type:"google.protobuf.Any",id:3}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}}}}},require$$5={nested:nested$2},interfaces$1={"google.cloud.location.Locations":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{ListLocations:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetLocation:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$6={interfaces:interfaces$1},hasRequiredLocationService,hasRequiredFallback;function requireLocationService(){if(hasRequiredLocationService)return locationService;hasRequiredLocationService=1,Object.defineProperty(locationService,"__esModule",{value:!0}),locationService.LocationsClient=void 0;const e=requireGax(),t=requireWarnings(),r=requireCreateApiCall(),n=requireRoutingHeader(),o=requirePageDescriptor(),i=require$$5,a=require$$6,s=require$$19.version;return locationService.LocationsClient=class{constructor(e,r){var n,l;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}},this.gaxGrpc=e;const p=this.constructor,d=(null==r?void 0:r.servicePath)||(null==r?void 0:r.apiEndpoint)||p.servicePath;this._providedCustomServicePath=!(!(null==r?void 0:r.servicePath)&&!(null==r?void 0:r.apiEndpoint));const u=(null==r?void 0:r.port)||p.port,c=null!==(n=null==r?void 0:r.clientConfig)&&void 0!==n?n:{},f=null!==(l=null==r?void 0:r.fallback)&&void 0!==l?l:"undefined"!=typeof window&&"function"==typeof(null===window||void 0===window?void 0:window.fetch);r=Object.assign({servicePath:d,port:u,clientConfig:c,fallback:f},r),d===p.servicePath||"scopes"in r||(r.scopes=p.scopes),this._opts=r,this.auth=e.auth,d===p.servicePath&&(this.auth.defaultScopes=p.scopes);const h=[`gax/${s}`,`gapic/${s}`];"undefined"!=typeof process&&"versions"in process?h.push(`gl-node/${process.versions.node}`):h.push(`gl-web/${s}`),r.fallback?"rest"===r.fallback&&h.push(`rest/${e.grpcVersion}`):h.push(`grpc/${e.grpcVersion}`),r.libName&&r.libVersion&&h.push(`${r.libName}/${r.libVersion}`),this._protos=e.loadProtoJSON(i),this.descriptors.page={listLocations:new o.PageDescriptor("pageToken","nextPageToken","locations")},this._defaults=e.constructSettings("google.cloud.location.Locations",a,r.clientConfig||{},{"x-goog-api-client":h.join(" ")}),this.innerApiCalls={},this.warn=t.warn}initialize(){if(this.locationsStub)return this.locationsStub;this.locationsStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.cloud.location.Locations"):this._protos.google.cloud.location.Locations,this._opts,this._providedCustomServicePath);const e=["listLocations","getLocation"];for(const t of e){const e=this.locationsStub.then(e=>(...r)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[t].apply(e,r)},e=>()=>{throw e}),n=this.descriptors.page[t]||void 0,o=(0,r.createApiCall)(e,this._defaults[t],n);this.innerApiCalls[t]=o}return this.locationsStub}static get servicePath(){return"cloud.googleapis.com"}static get apiEndpoint(){return"cloud.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform"]}getProjectId(e){if(!e)return this.auth.getProjectId();this.auth.getProjectId(e)}getLocation(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.getLocation(e,o,r)}listLocations(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.listLocations(e,o,r)}listLocationsAsync(t,r){t=t||{},(r=r||{}).otherArgs=r.otherArgs||{},r.otherArgs.headers=r.otherArgs.headers||{},r.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:t.name||""}),r=r||{};const o=new e.CallSettings(r);return this.initialize(),this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls.listLocations,t,o)}close(){return this.initialize(),this._terminated?Promise.resolve():this.locationsStub.then(e=>{this._terminated=!0,e.close()})}},locationService}function requireFallback(){return hasRequiredFallback||(hasRequiredFallback=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=t.GoogleError=t.operation=t.Operation=t.warn=t.protobufMinimal=t.protobuf=t.LocationProtos=t.IamProtos=t.operationsProtos=t.GrpcClient=t.defaultToObjectOptions=t.makeUUID=t.LocationsClient=t.IamClient=t.OperationsClient=t.StreamType=t.StreamDescriptor=t.PageDescriptor=t.LongrunningDescriptor=t.BundleDescriptor=t.version=t.createDefaultBackoffSettings=t.RetryOptions=t.constructSettings=t.CallSettings=t.routingHeader=t.PathTemplate=void 0,t.lro=function(e){(e=Object.assign({scopes:[]},e)).protoJson&&(e=Object.assign(e,{fallback:!0}));const t=new C(e);return new l.OperationsClientBuilder(t,e.protoJson)},t.createApiCall=function(e,t,r,n){if(r&&"streaming"in r&&r.type!==f.StreamType.SERVER_STREAMING)return()=>{throw new Error("The REST transport currently does not support client-streaming or bidi-stream calls.")};if(r&&"streaming"in r&&!(0,u.isNodeJS)())return()=>{throw new Error("Server streaming over the REST transport is only supported in Node.js.")};return(0,p.createApiCall)(e,t,r)};const r=requireObjectHash(),n=requireProtobufjs();t.protobuf=n;const o=requireGax(),i=requireRoutingHeader();t.routingHeader=i;const a=requireStatus(),s=require$$3__default.default,l=requireOperationsClient(),p=requireCreateApiCall(),d=requireFallbackRest(),u=requireFeatureDetection(),c=requireFallbackServiceStub(),f=requireStreaming(),h=requireUtil$2(),m=requireIam_service();t.IamProtos=m;const g=requireLocations();t.LocationProtos=g;const y=requireOperations();t.operationsProtos=y;var v=requirePathTemplate();Object.defineProperty(t,"PathTemplate",{enumerable:!0,get:function(){return v.PathTemplate}});var b=requireGax();Object.defineProperty(t,"CallSettings",{enumerable:!0,get:function(){return b.CallSettings}}),Object.defineProperty(t,"constructSettings",{enumerable:!0,get:function(){return b.constructSettings}}),Object.defineProperty(t,"RetryOptions",{enumerable:!0,get:function(){return b.RetryOptions}}),Object.defineProperty(t,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return b.createDefaultBackoffSettings}}),t.version=require$$19.version+"-fallback";var O=requireDescriptor();Object.defineProperty(t,"BundleDescriptor",{enumerable:!0,get:function(){return O.BundleDescriptor}}),Object.defineProperty(t,"LongrunningDescriptor",{enumerable:!0,get:function(){return O.LongrunningDescriptor}}),Object.defineProperty(t,"PageDescriptor",{enumerable:!0,get:function(){return O.PageDescriptor}}),Object.defineProperty(t,"StreamDescriptor",{enumerable:!0,get:function(){return O.StreamDescriptor}});var w=requireStreaming();Object.defineProperty(t,"StreamType",{enumerable:!0,get:function(){return w.StreamType}});var S=requireOperationsClient();Object.defineProperty(t,"OperationsClient",{enumerable:!0,get:function(){return S.OperationsClient}});var _=requireIamService();Object.defineProperty(t,"IamClient",{enumerable:!0,get:function(){return _.IamClient}});var P=requireLocationService();Object.defineProperty(t,"LocationsClient",{enumerable:!0,get:function(){return P.LocationsClient}});var E=requireUtil$2();Object.defineProperty(t,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}}),t.defaultToObjectOptions={keepCase:!1,longs:String,enums:String,defaults:!0,oneofs:!0};const T="x-goog-api-client";class C{static clearProtoCache(){C.protoCache.clear()}constructor(e={}){var t;if((0,u.isNodeJS)())this.auth=e.auth||new s.GoogleAuth(e);else{if(!e.auth)throw new Error(JSON.stringify(e)+"You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.");this.auth=e.auth}this.fallback=!!e.fallback,this.grpcVersion=require$$19.version,this.httpRules=e.httpRules,this.numericEnums=null!==(t=e.numericEnums)&&void 0!==t&&t}loadProto(e){return n.Root.fromJSON(e)}loadProtoJSON(e,t=!1){const o=r(JSON.stringify(e)).toString(),i=C.protoCache.get(o);if(i&&!t)return i;const a=n.Root.fromJSON(e);return C.protoCache.set(o,a),a}static getServiceMethods(e){const t={};for(const[r,n]of Object.entries(e.methods)){t[(0,h.toLowerCamelCase)(r)]=n}return t}constructSettings(e,r,n,i){return o.constructSettings(e,r,n,a.Status,{metadataBuilder:function(e,r){const n={};i||(i={});for(const e in i)n[e]=Array.isArray(i[e])?i[e]:[i[e]];const o=[];if(n[T]&&n[T][0]&&o.push(...n[T][0].split(" ")),o.push(`grpc-web/${t.version}`),n[T]=[o.join(" ")],!r)return n;for(const e in r)if(e.toLowerCase()!==T){const t=r[e];if(Array.isArray(t))if(void 0===n[e])n[e]=t;else{if(!Array.isArray(n[e]))throw new Error(`Can not add value ${t} to the call metadata.`);n[e].push(...t)}else n[e]=[t]}return n}})}async createStub(e,t,r){if(this.authClient||(this.auth&&"getClient"in this.auth?this.authClient=await this.auth.getClient():this.auth&&"getRequestHeaders"in this.auth&&(this.authClient=this.auth)),!this.authClient)throw new Error("No authentication was provided");if(t.universeDomain||(t.universeDomain="googleapis.com"),t.universeDomain){const e=this.authClient.universeDomain;if(e&&t.universeDomain!==e)throw new Error(`The configured universe domain (${t.universeDomain}) does not match the universe domain found in the credentials (${e}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`)}e.resolveAll();const n=C.getServiceMethods(e),o=t.protocol||"https";let i,a=t.servicePath;if(!a&&e.options&&e.options["(google.api.default_host)"]&&(a=e.options["(google.api.default_host)"]),!a)throw new Error(`Cannot determine service API path for service ${e.name}.`);const s=a.match(/^(.*):(\d+)$/);s&&(a=s[1],i=parseInt(s[2])),t.port?i=t.port:i||(i=443);const l=d.encodeRequest,p=d.decodeResponse;return(0,c.generateServiceStub)(n,o,a,i,this.authClient,l,p,this.numericEnums)}static createByteLengthFunction(e){return o.createByteLengthFunction(e)}}t.GrpcClient=C,C.protoCache=new Map,t.protobufMinimal=requireMinimal();var R=requireWarnings();Object.defineProperty(t,"warn",{enumerable:!0,get:function(){return R.warn}});var D=requireLongrunning();Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return D.Operation}}),Object.defineProperty(t,"operation",{enumerable:!0,get:function(){return D.operation}});var x=requireGoogleError();Object.defineProperty(t,"GoogleError",{enumerable:!0,get:function(){return x.GoogleError}});const k=e.exports;t.fallback=k}(fallback,fallback.exports)),fallback.exports}var nested$1={google:{nested:{protobuf:{nested:{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",java_multiple_files:!0,java_outer_classname:"ErrorDetailsProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}},RetryInfo:{fields:{retryDelay:{type:"google.protobuf.Duration",id:1}}},DebugInfo:{fields:{stackEntries:{rule:"repeated",type:"string",id:1},detail:{type:"string",id:2}}},QuotaFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{subject:{type:"string",id:1},description:{type:"string",id:2}}}}},ErrorInfo:{fields:{reason:{type:"string",id:1},domain:{type:"string",id:2},metadata:{keyType:"string",type:"string",id:3}}},PreconditionFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{type:{type:"string",id:1},subject:{type:"string",id:2},description:{type:"string",id:3}}}}},BadRequest:{fields:{fieldViolations:{rule:"repeated",type:"FieldViolation",id:1}},nested:{FieldViolation:{fields:{field:{type:"string",id:1},description:{type:"string",id:2}}}}},RequestInfo:{fields:{requestId:{type:"string",id:1},servingData:{type:"string",id:2}}},ResourceInfo:{fields:{resourceType:{type:"string",id:1},resourceName:{type:"string",id:2},owner:{type:"string",id:3},description:{type:"string",id:4}}},Help:{fields:{links:{rule:"repeated",type:"Link",id:1}},nested:{Link:{fields:{description:{type:"string",id:1},url:{type:"string",id:2}}}}},LocalizedMessage:{fields:{locale:{type:"string",id:1},message:{type:"string",id:2}}}}}}}},require$$4$1={nested:nested$1},hasRequiredGoogleError,hasRequiredCall,hasRequiredNormalApiCaller,hasRequiredApiCaller;function requireGoogleError(){if(hasRequiredGoogleError)return googleError;hasRequiredGoogleError=1,Object.defineProperty(googleError,"__esModule",{value:!0}),googleError.GoogleErrorDecoder=googleError.GoogleError=void 0;const e=requireStatus(),t=requireProtobufjs(),r=requireSrc$3(),n=requireFallback();class o extends Error{static parseGRPCStatusDetails(e){const t=new i;try{if(e.metadata&&e.metadata.get("grpc-status-details-bin")){const r=t.decodeGRPCStatusDetails(e.metadata.get("grpc-status-details-bin"));r&&r.details&&r.details.length>0&&(e.statusDetails=r.details),r&&r.errorInfo&&(e.reason=r.errorInfo.reason,e.domain=r.errorInfo.domain,e.errorInfoMetadata=r.errorInfo.metadata)}}catch(e){}return e}static parseHttpError(t){Array.isArray(t)&&(t=t.find(e=>"error"in e)),t.error||(t.error={},Object.keys(t).filter(e=>"error"!==e).forEach(e=>{t.error[e]=t[e],delete t[e]}));const r=new i,n=r.decodeHTTPError(t.error),a=Object.assign(new o(t.error.message),n);if(t.error.code?a.code=(0,e.rpcCodeFromHttpStatusCode)(t.error.code):delete a.code,a.details)try{const e=r.decodeHttpStatusDetails(a.details);e&&e.details&&e.details.length>0&&(a.statusDetails=e.details),e&&e.errorInfo&&(a.reason=e.errorInfo.reason,a.domain=e.errorInfo.domain,a.errorInfoMetadata=e.errorInfo.metadata)}catch(e){}return a}}googleError.GoogleError=o;class i{constructor(){const e=require$$4$1;this.root=t.Root.fromJSON(e),this.anyType=this.root.lookupType("google.protobuf.Any"),this.statusType=this.root.lookupType("google.rpc.Status")}decodeProtobufAny(e){const t=e.type_url.match(/^type.googleapis.com\/(.*)/);if(!t)throw new Error(`Unknown type encoded in google.protobuf.any: ${e.type_url}`);const r=t[1],n=this.root.lookupType(r);if(!n)throw new Error(`Cannot lookup type ${r}`);return n.decode(e.value)}decodeRpcStatus(e){const t=new Uint8Array(e),r=this.statusType.decode(t),n=[];let o;for(const e of r.details)try{const t=this.decodeProtobufAny(e);n.push(t),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(o=t)}catch(e){}return{code:r.code,message:r.message,statusDetails:n,reason:null==o?void 0:o.reason,domain:null==o?void 0:o.domain,errorInfoMetadata:null==o?void 0:o.metadata}}callErrorFromStatus(t){return t.message=`${t.code} ${e.Status[t.code]}: ${t.message}`,Object.assign(new o(t.message),t)}decodeErrorFromBuffer(e){return this.callErrorFromStatus(this.decodeRpcStatus(e))}decodeGRPCStatusDetails(e){const t=[];let r;e.forEach(e=>{const n=new Uint8Array(e),o=this.statusType.decode(n);for(const e of o.details)try{const n=this.decodeProtobufAny(e);t.push(n),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(r=n)}catch(e){}});return{details:t,errorInfo:r}}decodeHTTPError(e){const t=r.fromProto3JSON(this.statusType,e);if(!t)throw new Error(`Received error message ${e}, but failed to serialize as proto3 message`);return this.statusType.toObject(t,n.defaultToObjectOptions)}decodeHttpStatusDetails(e){const t=[];let r;for(const n of e)try{const e=this.decodeProtobufAny(n);t.push(e),"type.googleapis.com/google.rpc.ErrorInfo"===n.type_url&&(r=e)}catch(e){}return{details:t,errorInfo:r}}}return googleError.GoogleErrorDecoder=i,googleError}function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.OngoingCallPromise=call.OngoingCall=void 0;const e=requireStatus(),t=requireGoogleError();class r{constructor(e){this.callback=e,this.completed=!1}cancel(){if(!this.completed)if(this.completed=!0,this.cancelFunc)this.cancelFunc();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this.callback(r)}}call(e,r){if(this.completed)return;const n=e(r,(e,t,r,n)=>{this.completed=!0,setImmediate(this.callback,e,t,r,n)});n instanceof Promise&&n.catch(e=>{setImmediate(this.callback,new t.GoogleError(e),null,null,null)}),this.cancelFunc=()=>n.cancel()}}call.OngoingCall=r;return call.OngoingCallPromise=class extends r{constructor(){let e,r;const n=new Promise((t,n)=>{e=t,r=n});super((n,o,i,a)=>{if(n)n.metadata?r(t.GoogleError.parseGRPCStatusDetails(n)):r(n);else{if(void 0===o)throw new t.GoogleError("Neither error nor response are defined");e([o,i||null,a||null])}}),this.promise=n,this.promise.cancel=()=>{this.cancel()}}},call}function requireNormalApiCaller(){if(hasRequiredNormalApiCaller)return normalApiCaller;hasRequiredNormalApiCaller=1,Object.defineProperty(normalApiCaller,"__esModule",{value:!0}),normalApiCaller.NormalApiCaller=void 0;const e=requireCall();return normalApiCaller.NormalApiCaller=class{init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call(e,t)}fail(e,t){e.callback(t)}result(e){return e.promise}},normalApiCaller}function requireApiCaller(){if(hasRequiredApiCaller)return apiCaller;hasRequiredApiCaller=1,Object.defineProperty(apiCaller,"__esModule",{value:!0}),apiCaller.createAPICaller=function(t,r){if(!r)return new e.NormalApiCaller;return r.getApiCaller(t)};const e=requireNormalApiCaller();return apiCaller}var retries={},timeout={},hasRequiredTimeout,hasRequiredRetries,hasRequiredCreateApiCall;function requireTimeout(){if(hasRequiredTimeout)return timeout;return hasRequiredTimeout=1,Object.defineProperty(timeout,"__esModule",{value:!0}),timeout.addTimeoutArg=function(e,t,r,n){return(o,i)=>{const a=new Date,s=r.options||{};s.deadline=new Date(a.getTime()+t);const l=r.metadataBuilder?r.metadataBuilder(n,r.headers||{}):null;return e(o,l,s,i)}},timeout}function requireRetries(){if(hasRequiredRetries)return retries;hasRequiredRetries=1,Object.defineProperty(retries,"__esModule",{value:!0}),retries.retryable=function(n,o,i,a){const s=o.backoffSettings.retryDelayMultiplier,l=o.backoffSettings.maxRetryDelayMillis,p=o.backoffSettings.rpcTimeoutMultiplier,d=o.backoffSettings.maxRpcTimeoutMillis;let u=o.backoffSettings.initialRetryDelayMillis,c=o.backoffSettings.initialRpcTimeoutMillis;return(f,h)=>{let m,g,y,v=new Date;o.backoffSettings.totalTimeoutMillis&&(y=v.getTime()+o.backoffSettings.totalTimeoutMillis);let b=0;const O=o.backoffSettings.maxRetries;if(O&&y){const r=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");r.code=e.Status.INVALID_ARGUMENT,h(r)}else!function w(S){if(g=null,y&&v.getTime()>=y){const r=new t.GoogleError(`Total timeout of API ${a} exceeded ${o.backoffSettings.totalTimeoutMillis} milliseconds ${S?`retrying error ${S} `:""} before any response was received.`);return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}if(b&&b>=O){const r=new t.GoogleError("Exceeded maximum number of retries "+(S?`retrying error ${S} `:"")+"before any response was received");return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}b++;let _=S;const P=(0,r.addTimeoutArg)(n,c,i);m=P(f,(e,t,r,n)=>{if(e&&4!==e.code&&(_=e),e)if(m=null,o.retryCodes.length>0&&o.retryCodes.indexOf(e.code)<0)e.note="Exception occurred in retry method that was not classified as transient",h(e);else{const e=Math.random()*u;g=setTimeout(()=>{v=new Date,u=Math.min(u*s,l);const e=c&&p?c*p:0,t=d||0,r=y?y-v.getTime():0;c=Math.min(e,t,r),w(_)},e)}else h(null,t,r,n)}),m instanceof Promise&&m.catch(e=>{h(new t.GoogleError(e))})}();return{cancel(){if(g&&clearTimeout(g),m)m.cancel();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,h(r)}}}}};const e=requireStatus(),t=requireGoogleError(),r=requireTimeout();return retries}function requireCreateApiCall(){if(hasRequiredCreateApiCall)return createApiCall;hasRequiredCreateApiCall=1,Object.defineProperty(createApiCall,"__esModule",{value:!0}),createApiCall.createApiCall=function(a,s,l,p){const d="function"==typeof a?Promise.resolve(a):a,u=(0,e.createAPICaller)(s,l);return(a,l,p)=>{var c,f;let h,m=u;if(m instanceof o.StreamingApiCaller){const e=null!==(f=null===(c=m.descriptor)||void 0===c?void 0:c.gaxStreamingRetries)&&void 0!==f&&f,r=(0,t.convertRetryOptions)(l,e);h=s.merge(r)}else h=s.merge(l);s.isBundling&&!h.isBundling&&(m=(0,e.createAPICaller)(s,void 0));const g=m.init(p);return d.then(e=>{var t,o,a;e=m.wrap(e);const s=null===(t=m.descriptor)||void 0===t?void 0:t.streaming,l=h.retry;if(s&&l&&(l.retryCodes.length>0&&l.shouldRetryFn&&((0,i.warn)("either_retrycodes_or_shouldretryfn","Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes."),l.retryCodes=[]),!m.descriptor.gaxStreamingRetries&&l.getResumptionRequestFn))throw new Error("getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.");if(!s&&l){if(l.shouldRetryFn)throw new Error("Using a function to determine retry eligibility is only supported with server streaming calls");if(l.getResumptionRequestFn)throw new Error("Resumption strategy can only be used with server streaming retries");if(l.retryCodes&&l.retryCodes.length>0)return null!==(o=(a=l.backoffSettings).initialRpcTimeoutMillis)&&void 0!==o||(a.initialRpcTimeoutMillis=h.timeout),(0,r.retryable)(e,h.retry,h.otherArgs,h.apiName)}return(0,n.addTimeoutArg)(e,h.timeout,h.otherArgs)}).then(e=>{m.call(e,a,h,g)}).catch(e=>{m.fail(g,e)}),m.result(g)}};const e=requireApiCaller(),t=requireGax(),r=requireRetries(),n=requireTimeout(),o=requireStreamingApiCaller(),i=requireWarnings();return createApiCall}var interfaces={"google.longrunning.Operations":{retry_codes:{idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"],non_idempotent:[]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:9e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:9e4,total_timeout_millis:6e5}},methods:{GetOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},ListOperations:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},CancelOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},DeleteOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"}}}},require$$3={interfaces:interfaces},nested={google:{nested:{longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"google.golang.org/genproto/googleapis/longrunning;longrunning",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/operations/{name}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/operations/{name}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Empty:{fields:{}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}},require$$4={nested:nested},hasRequiredOperationsClient,hasRequiredSrc$2;function requireOperationsClient(){return hasRequiredOperationsClient||(hasRequiredOperationsClient=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OperationsClientBuilder=e.OperationsClient=e.ALL_SCOPES=e.SERVICE_ADDRESS=void 0;const t=requireCreateApiCall(),r=requireDescriptor(),n=requireGax(),o=require$$3,i=require$$4,a=requireTranscoding();e.SERVICE_ADDRESS="longrunning.googleapis.com";const s=require$$19.version;e.ALL_SCOPES=[];class l{constructor(n,i,a){const l=Object.assign({servicePath:e.SERVICE_ADDRESS,port:443,clientConfig:{}},a),p=["gl-node/"+process.versions.node];l.libName&&l.libVersion&&p.push(l.libName+"/"+l.libVersion),p.push("gapic/0.7.1","gax/"+s),l.fallback?p.push("gl-web/"+s):p.push("grpc/"+n.grpcVersion);const d=n.constructSettings("google.longrunning.Operations",o,l.clientConfig||{},{"x-goog-api-client":p.join(" ")});this.auth=n.auth,this.innerApiCalls={},this.descriptor={listOperations:new r.PageDescriptor("pageToken","nextPageToken","operations")},this.operationsStub=n.createStub(l.fallback?i.lookupService("google.longrunning.Operations"):i.google.longrunning.Operations,l);const u=["getOperation","listOperations","cancelOperation","deleteOperation"];for(const e of u){const r=this.operationsStub.then(t=>(...r)=>t[e].apply(t,r),e=>()=>{throw e});this.innerApiCalls[e]=(0,t.createApiCall)(r,d[e],this.descriptor[e])}}close(){this.operationsStub.then(e=>e.close())}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getOperationInternal(e,t,r){return e=e||{},t=t||{},this.innerApiCalls.getOperation(e,t,r)}getOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.getOperation(e,n,r)}listOperations(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.listOperations(e,n,r)}listOperationsStream(e,t){const r=new n.CallSettings(t);return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations,e,r)}listOperationsAsync(e,t){e=e||{},t=t||{};const r=new n.CallSettings(t);return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations,e,r)}cancelOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.cancelOperation(e,n,r)}deleteOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.deleteOperation(e,n,r)}}e.OperationsClient=l;e.OperationsClientBuilder=class{constructor(e,t){t&&e.httpRules&&(0,a.overrideHttpRules)(e.httpRules,t);const r=null!=t?t:e.loadProtoJSON(i);this.operationsClient=t=>(e.fallback&&(t.fallback=e.fallback),new l(e,r,t)),Object.assign(this.operationsClient,l)}}}(operationsClient)),operationsClient}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializer=e.warn=e.ChannelCredentials=e.makeUUID=e.fallback=e.protobufMinimal=e.protobuf=e.version=e.createByteLengthFunction=e.LocationsClient=e.IamClient=e.OperationsClient=e.LocationProtos=e.IamProtos=e.operationsProtos=e.routingHeader=e.StreamType=e.Status=e.PathTemplate=e.operation=e.Operation=e.GrpcClient=e.GoogleProtoFilesRoot=e.ClientStub=e.GoogleError=e.createMaxRetriesBackoffSettings=e.createDefaultBackoffSettings=e.createBackoffSettings=e.createBundleOptions=e.createRetryOptions=e.RetryOptions=e.constructSettings=e.CallSettings=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=e.BundleDescriptor=e.createApiCall=e.OngoingCall=e.grpc=e.GoogleAuth=void 0,e.lro=b;const t=requireSrc$5();e.grpc=t;const r=requireGrpc(),n=requireIam_service();e.IamProtos=n;const o=requireLocations();e.LocationProtos=o;const i=requireOperations();e.operationsProtos=i;const a=requireOperationsClient(),s=requireRoutingHeader();e.routingHeader=s;var l=require$$3__default.default;Object.defineProperty(e,"GoogleAuth",{enumerable:!0,get:function(){return l.GoogleAuth}});var p=requireCall();Object.defineProperty(e,"OngoingCall",{enumerable:!0,get:function(){return p.OngoingCall}});var d=requireCreateApiCall();Object.defineProperty(e,"createApiCall",{enumerable:!0,get:function(){return d.createApiCall}});var u=requireDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return u.BundleDescriptor}}),Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return u.LongrunningDescriptor}}),Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return u.PageDescriptor}}),Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return u.StreamDescriptor}});var c=requireGax();Object.defineProperty(e,"CallSettings",{enumerable:!0,get:function(){return c.CallSettings}}),Object.defineProperty(e,"constructSettings",{enumerable:!0,get:function(){return c.constructSettings}}),Object.defineProperty(e,"RetryOptions",{enumerable:!0,get:function(){return c.RetryOptions}}),Object.defineProperty(e,"createRetryOptions",{enumerable:!0,get:function(){return c.createRetryOptions}}),Object.defineProperty(e,"createBundleOptions",{enumerable:!0,get:function(){return c.createBundleOptions}}),Object.defineProperty(e,"createBackoffSettings",{enumerable:!0,get:function(){return c.createBackoffSettings}}),Object.defineProperty(e,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return c.createDefaultBackoffSettings}}),Object.defineProperty(e,"createMaxRetriesBackoffSettings",{enumerable:!0,get:function(){return c.createMaxRetriesBackoffSettings}});var f=requireGoogleError();Object.defineProperty(e,"GoogleError",{enumerable:!0,get:function(){return f.GoogleError}});var h=requireGrpc();Object.defineProperty(e,"ClientStub",{enumerable:!0,get:function(){return h.ClientStub}}),Object.defineProperty(e,"GoogleProtoFilesRoot",{enumerable:!0,get:function(){return h.GoogleProtoFilesRoot}}),Object.defineProperty(e,"GrpcClient",{enumerable:!0,get:function(){return h.GrpcClient}});var m=requireLongrunning();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return m.Operation}}),Object.defineProperty(e,"operation",{enumerable:!0,get:function(){return m.operation}});var g=requirePathTemplate();Object.defineProperty(e,"PathTemplate",{enumerable:!0,get:function(){return g.PathTemplate}});var y=requireStatus();Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return y.Status}});var v=requireStreaming();function b(e){e=Object.assign({scopes:b.ALL_SCOPES},e);const t=new r.GrpcClient(e);return new a.OperationsClientBuilder(t)}Object.defineProperty(e,"StreamType",{enumerable:!0,get:function(){return v.StreamType}}),b.SERVICE_ADDRESS=a.SERVICE_ADDRESS,b.ALL_SCOPES=a.ALL_SCOPES;var O=requireOperationsClient();Object.defineProperty(e,"OperationsClient",{enumerable:!0,get:function(){return O.OperationsClient}});var w=requireIamService();Object.defineProperty(e,"IamClient",{enumerable:!0,get:function(){return w.IamClient}});var S=requireLocationService();Object.defineProperty(e,"LocationsClient",{enumerable:!0,get:function(){return S.LocationsClient}}),e.createByteLengthFunction=r.GrpcClient.createByteLengthFunction,e.version=require$$19.version;const _=requireProtobufjs();e.protobuf=_,e.protobufMinimal=requireMinimal();const P=requireFallback();e.fallback=P;var E=requireUtil$2();Object.defineProperty(e,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}});var T=requireSrc$5();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return T.ChannelCredentials}});var C=requireWarnings();Object.defineProperty(e,"warn",{enumerable:!0,get:function(){return C.warn}});const R=requireSrc$3();e.serializer=R}(src$7)),src$7}var srcExports$1=requireSrc$2(),_a,STATUS_TO_STRING_MAP=(_a={},_a[srcExports$1.Status.CANCELLED]="cancelled",_a[srcExports$1.Status.UNKNOWN]="unknown",_a[srcExports$1.Status.INVALID_ARGUMENT]="invalid-argument",_a[srcExports$1.Status.DEADLINE_EXCEEDED]="deadline-exceeded",_a[srcExports$1.Status.NOT_FOUND]="not-found",_a[srcExports$1.Status.ALREADY_EXISTS]="already-exists",_a[srcExports$1.Status.PERMISSION_DENIED]="permission-denied",_a[srcExports$1.Status.RESOURCE_EXHAUSTED]="resource-exhausted",_a[srcExports$1.Status.FAILED_PRECONDITION]="failed-precondition",_a[srcExports$1.Status.ABORTED]="aborted",_a[srcExports$1.Status.OUT_OF_RANGE]="out-of-range",_a[srcExports$1.Status.UNIMPLEMENTED]="unimplemented",_a[srcExports$1.Status.INTERNAL]="internal",_a[srcExports$1.Status.UNAVAILABLE]="unavailable",_a[srcExports$1.Status.DATA_LOSS]="data-loss",_a[srcExports$1.Status.UNAUTHENTICATED]="unauthenticated",_a[srcExports$1.Status.OK]="unknown",_a),FIRESTORE_ERROR_MAPPINGS={"permission-denied":{userMessage:"Unable to access storage. Please try signing in again.",internalMessage:"Firestore permission denied",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"Firestore service unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"not-found":{userMessage:"The requested data could not be found.",internalMessage:"Firestore document not found",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"deadline-exceeded":{userMessage:"The operation took too long. Please try again.",internalMessage:"Firestore operation timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},unauthenticated:{userMessage:"Authentication required. Please sign in again.",internalMessage:"Firestore authentication failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},"already-exists":{userMessage:"This record already exists.",internalMessage:"Firestore document already exists",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"resource-exhausted":{userMessage:"Service is at capacity. Please try again later.",internalMessage:"Firestore quota exceeded",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"failed-precondition":{userMessage:"The operation cannot be completed at this time.",internalMessage:"Firestore precondition failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},aborted:{userMessage:"The operation was cancelled. Please try again.",internalMessage:"Firestore transaction aborted",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"invalid-argument":{userMessage:"Invalid data provided. Please check your input.",internalMessage:"Firestore invalid argument",shouldRetry:!1,severity:exports.ErrorSeverity.Error},cancelled:{userMessage:"The operation was cancelled.",internalMessage:"Firestore operation cancelled",shouldRetry:!1,severity:exports.ErrorSeverity.Info},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Firestore unknown error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"out-of-range":{userMessage:"The requested range is invalid.",internalMessage:"Firestore out of range",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unimplemented:{userMessage:"This feature is not yet available.",internalMessage:"Firestore operation not implemented",shouldRetry:!1,severity:exports.ErrorSeverity.Error},internal:{userMessage:"An internal error occurred. Our team has been notified.",internalMessage:"Firestore internal error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"data-loss":{userMessage:"Data integrity error. Please contact support.",internalMessage:"Firestore data loss detected",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function isGoogleError(e){return e instanceof srcExports$1.GoogleError&&"number"==typeof e.code}function handleFirestoreError(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isGoogleError(e)?(r=void 0!==e.code?STATUS_TO_STRING_MAP[e.code]:void 0,n=e):n=e instanceof Error?e:new Error(String(e));var o=r&&r in FIRESTORE_ERROR_MAPPINGS?FIRESTORE_ERROR_MAPPINGS[r]:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown error type",shouldRetry:!1,severity:exports.ErrorSeverity.Error};throw console.error("[Internal] Error from Firestore: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var src$1={},gaxios={},isStream_1,hasRequiredIsStream;function requireIsStream(){if(hasRequiredIsStream)return isStream_1;hasRequiredIsStream=1;const e=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;return e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,isStream_1=e}var common$1={},util={},name="gaxios",version="6.7.1",description="A simple common HTTP client specifically for Google APIs and services.",main="build/src/index.js",types="build/src/index.d.ts",files=["build/src"],scripts={lint:"gts check",test:"c8 mocha build/test","presystem-test":"npm run compile","system-test":"mocha build/system-test --timeout 80000",compile:"tsc -p .",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"compodoc src/","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},repository="googleapis/gaxios",keywords=["google"],engines={node:">=14"},author="Google, LLC",license="Apache-2.0",devDependencies={"@babel/plugin-proposal-private-methods":"^7.18.6","@compodoc/compodoc":"1.1.19","@types/cors":"^2.8.6","@types/express":"^4.16.1","@types/extend":"^3.0.1","@types/mocha":"^9.0.0","@types/multiparty":"0.0.36","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^17.0.0","@types/tmp":"0.2.6","@types/uuid":"^10.0.0","abort-controller":"^3.0.0",assert:"^2.0.0",browserify:"^17.0.0",c8:"^8.0.0",cheerio:"1.0.0-rc.10",cors:"^2.8.5",execa:"^5.0.0",express:"^4.16.4","form-data":"^4.0.0",gts:"^5.0.0","is-docker":"^2.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",linkinator:"^3.0.0",mocha:"^8.0.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",puppeteer:"^19.0.0",sinon:"^18.0.0","stream-browserify":"^3.0.0",tmp:"0.2.3","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.35.0","webpack-cli":"^4.0.0"},dependencies={extend:"^3.0.2","https-proxy-agent":"^7.0.1","is-stream":"^2.0.0","node-fetch":"^2.6.9",uuid:"^9.0.1"},require$$0={name:name,version:version,description:description,main:main,types:types,files:files,scripts:scripts,repository:repository,keywords:keywords,engines:engines,author:author,license:license,devDependencies:devDependencies,dependencies:dependencies},hasRequiredUtil,hasRequiredCommon$1;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,Object.defineProperty(util,"__esModule",{value:!0}),util.pkg=void 0,util.pkg=require$$0),util}function requireCommon$1(){return hasRequiredCommon$1||(hasRequiredCommon$1=1,function(e){var t,r=common$1&&common$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=function e(t){const r="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function o(e){if(e)for(const t of Object.keys(e))/^authentication$/i.test(t)&&(e[t]=r),/^authorization$/i.test(t)&&(e[t]=r),/secret/i.test(t)&&(e[t]=r)}function i(e,t){if("object"==typeof e&&null!==e&&"string"==typeof e[t]){const n=e[t];(/grant_type=/i.test(n)||/assertion=/i.test(n)||/secret/i.test(n))&&(e[t]=r)}}function a(e){"object"==typeof e&&null!==e&&("grant_type"in e&&(e.grant_type=r),"assertion"in e&&(e.assertion=r),"client_secret"in e&&(e.client_secret=r))}if(t.config){o(t.config.headers),i(t.config,"data"),a(t.config.data),i(t.config,"body"),a(t.config.body);try{const e=new n.URL("",t.config.url);e.searchParams.has("token")&&e.searchParams.set("token",r),e.searchParams.has("client_secret")&&e.searchParams.set("client_secret",r),t.config.url=e.toString()}catch(e){}}t.response&&(e({config:t.response.config}),o(t.response.headers),i(t.response,"data"),a(t.response.data));return t};const n=Url__default.default,o=requireUtil(),i=r(requireExtend());e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${o.pkg.name}-gaxios-error`);class a extends Error{static[(t=e.GAXIOS_ERROR_SYMBOL,Symbol.hasInstance)](t){return!(!t||"object"!=typeof t||!(e.GAXIOS_ERROR_SYMBOL in t)||t[e.GAXIOS_ERROR_SYMBOL]!==o.pkg.version)||Function.prototype[Symbol.hasInstance].call(a,t)}constructor(e,r,n,a){var s;if(super(e),this.config=r,this.response=n,this.error=a,this[t]=o.pkg.version,this.config=(0,i.default)(!0,{},r),this.response&&(this.response.config=(0,i.default)(!0,{},this.response.config)),this.response){try{this.response.data=function(e,t){switch(e){case"stream":default:return t;case"json":return JSON.parse(JSON.stringify(t));case"arraybuffer":return JSON.parse(Buffer.from(t).toString("utf8"));case"blob":return JSON.parse(t.text())}}(this.config.responseType,null===(s=this.response)||void 0===s?void 0:s.data)}catch(e){}this.status=this.response.status}a&&"code"in a&&a.code&&(this.code=a.code),r.errorRedactor&&r.errorRedactor({config:this.config,response:this.response})}}e.GaxiosError=a}(common$1)),common$1}var retry={},hasRequiredRetry;function requireRetry(){if(hasRequiredRetry)return retry;function e(e){var r;const n=t(e);if("AbortError"===e.name||"AbortError"===(null===(r=e.error)||void 0===r?void 0:r.name))return!1;if(!n||0===n.retry)return!1;if(!e.response&&(n.currentRetryAttempt||0)>=n.noResponseRetries)return!1;if(!e.config.method||n.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){let t=!1;for(const[r,o]of n.statusCodesToRetry){const n=e.response.status;if(n>=r&&n<=o){t=!0;break}}if(!t)return!1}return n.currentRetryAttempt=n.currentRetryAttempt||0,!(n.currentRetryAttempt>=n.retry)}function t(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}return hasRequiredRetry=1,Object.defineProperty(retry,"__esModule",{value:!0}),retry.getRetryConfig=async function(r){let n=t(r);if(!r||!r.config||!n&&!r.config.retry)return{shouldRetry:!1};n=n||{},n.currentRetryAttempt=n.currentRetryAttempt||0,n.retry=void 0===n.retry||null===n.retry?3:n.retry,n.httpMethodsToRetry=n.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],n.noResponseRetries=void 0===n.noResponseRetries||null===n.noResponseRetries?2:n.noResponseRetries,n.retryDelayMultiplier=n.retryDelayMultiplier?n.retryDelayMultiplier:2,n.timeOfFirstRequest=n.timeOfFirstRequest?n.timeOfFirstRequest:Date.now(),n.totalTimeout=n.totalTimeout?n.totalTimeout:Number.MAX_SAFE_INTEGER,n.maxRetryDelay=n.maxRetryDelay?n.maxRetryDelay:Number.MAX_SAFE_INTEGER;n.statusCodesToRetry=n.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],r.config.retryConfig=n;const o=n.shouldRetry||e;if(!await o(r))return{shouldRetry:!1,config:r.config};const i=function(e){var t;const r=e.currentRetryAttempt?0:null!==(t=e.retryDelay)&&void 0!==t?t:100,n=r+(Math.pow(e.retryDelayMultiplier,e.currentRetryAttempt)-1)/2*1e3,o=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(n,o,e.maxRetryDelay)}(n);r.config.retryConfig.currentRetryAttempt+=1;const a=n.retryBackoff?n.retryBackoff(r,i):new Promise(e=>{setTimeout(e,i)});n.onRetryAttempt&&n.onRetryAttempt(r);return await a,{shouldRetry:!0,config:r.config}},retry}var interceptor={},hasRequiredInterceptor;function requireInterceptor(){if(hasRequiredInterceptor)return interceptor;hasRequiredInterceptor=1,Object.defineProperty(interceptor,"__esModule",{value:!0}),interceptor.GaxiosInterceptorManager=void 0;class e extends Set{}return interceptor.GaxiosInterceptorManager=e,interceptor}var dist$1={},src={exports:{}},browser={exports:{}},ms,hasRequiredMs,common,hasRequiredCommon,hasRequiredBrowser;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=60*e,r=60*t,n=24*r,o=7*n,i=365.25*n;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return ms=function(s,l){l=l||{};var p=typeof s;if("string"===p&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===p&&isFinite(s))return l.long?function(o){var i=Math.abs(o);if(i>=n)return a(o,i,n,"day");if(i>=r)return a(o,i,r,"hour");if(i>=t)return a(o,i,t,"minute");if(i>=e)return a(o,i,e,"second");return o+" ms"}(s):function(o){var i=Math.abs(o);if(i>=n)return Math.round(o/n)+"d";if(i>=r)return Math.round(o/r)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},ms}function requireCommon(){if(hasRequiredCommon)return common;return hasRequiredCommon=1,common=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=requireMs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},common}function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=requireCommon()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports)),browser.exports}var node={exports:{}},hasFlag,hasRequiredHasFlag,supportsColor_1,hasRequiredSupportsColor,hasRequiredNode,hasRequiredSrc$1;function requireHasFlag(){return hasRequiredHasFlag?hasFlag:(hasRequiredHasFlag=1,hasFlag=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)})}function requireSupportsColor(){if(hasRequiredSupportsColor)return supportsColor_1;hasRequiredSupportsColor=1;const e=require$$0__default$1.default,t=require$$1__default$7.default,r=requireHasFlag(),{env:n}=process;let o;function i(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(t,i){if(0===o)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!i&&void 0===o)return 0;const a=o||0;if("dumb"===n.TERM)return a;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:a;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:a}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in n&&(o="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),supportsColor_1={supportsColor:function(e){return i(a(e,e&&e.isTTY))},stdout:i(a(!0,t.isatty(1))),stderr:i(a(!0,t.isatty(2)))},supportsColor_1}function requireNode(){return hasRequiredNode||(hasRequiredNode=1,function(e,t){const r=require$$1__default$7.default,n=require$$1__default$4.default;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} [0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=requireSupportsColor();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=requireCommon()(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(node,node.exports)),node.exports}function requireSrc$1(){return hasRequiredSrc$1||(hasRequiredSrc$1=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?src.exports=requireBrowser():src.exports=requireNode()),src.exports}var dist={},helpers={},hasRequiredHelpers,hasRequiredDist$1;function requireHelpers(){if(hasRequiredHelpers)return helpers;hasRequiredHelpers=1;var e=helpers&&helpers.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=helpers&&helpers.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=helpers&&helpers.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.req=helpers.json=helpers.toBuffer=void 0;const n=r(http__default.default),o=r(require$$1__default$6.default);async function i(e){let t=0;const r=[];for await(const n of e)t+=n.length,r.push(n);return Buffer.concat(r,t)}return helpers.toBuffer=i,helpers.json=async function(e){const t=(await i(e)).toString("utf8");try{return JSON.parse(t)}catch(e){const r=e;throw r.message+=` (input: ${t})`,r}},helpers.req=function(e,t={}){const r=(("string"==typeof e?e:e.href).startsWith("https:")?o:n).request(e,t),i=new Promise((e,t)=>{r.once("response",e).once("error",t).end()});return r.then=i.then.bind(i),r},helpers}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=dist&&dist.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=dist&&dist.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=dist&&dist.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=dist&&dist.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;const i=n(require$$0__default$2.default),a=n(http__default.default),s=require$$1__default$6.default;o(requireHelpers(),e);const l=Symbol("AgentBaseInternalState");class p extends a.Agent{constructor(e){super(e),this[l]={}}isSecureEndpoint(e){if(e){if("boolean"==typeof e.secureEndpoint)return e.secureEndpoint;if("string"==typeof e.protocol)return"https:"===e.protocol}const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const t=new i.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||null===t)return;const r=this.sockets[e],n=r.indexOf(t);-1!==n&&(r.splice(n,1),this.totalSocketCount--,0===r.length&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){const n={...t,secureEndpoint:this.isSecureEndpoint(t)},o=this.getName(n),i=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,n)).then(s=>{if(this.decrementSockets(o,i),s instanceof a.Agent)try{return s.addRequest(e,n)}catch(e){return r(e)}this[l].currentSocket=s,super.createSocket(e,t,r)},e=>{this.decrementSockets(o,i),r(e)})}createConnection(){const e=this[l].currentSocket;if(this[l].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[l].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(e){this[l]&&(this[l].defaultPort=e)}get protocol(){return this[l].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[l]&&(this[l].protocol=e)}}e.Agent=p}(dist)),dist}var parseProxyResponse={},hasRequiredParseProxyResponse,hasRequiredDist,hasRequiredGaxios,hasRequiredSrc;function requireParseProxyResponse(){if(hasRequiredParseProxyResponse)return parseProxyResponse;hasRequiredParseProxyResponse=1;var e=parseProxyResponse&&parseProxyResponse.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(parseProxyResponse,"__esModule",{value:!0}),parseProxyResponse.parseProxyResponse=void 0;const t=(0,e(requireSrc$1()).default)("https-proxy-agent:parse-proxy-response");return parseProxyResponse.parseProxyResponse=function(e){return new Promise((r,n)=>{let o=0;const i=[];function a(){const l=e.read();l?function(l){i.push(l),o+=l.length;const p=Buffer.concat(i,o),d=p.indexOf("\r\n\r\n");if(-1===d)return t("have not received end of HTTP headers yet..."),void a();const u=p.slice(0,d).toString("ascii").split("\r\n"),c=u.shift();if(!c)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));const f=c.split(" "),h=+f[1],m=f.slice(2).join(" "),g={};for(const t of u){if(!t)continue;const r=t.indexOf(":");if(-1===r)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${t}"`));const o=t.slice(0,r).toLowerCase(),i=t.slice(r+1).trimStart(),a=g[o];"string"==typeof a?g[o]=[a,i]:Array.isArray(a)?a.push(i):g[o]=i}t("got proxy server response: %o %o",c,g),s(),r({connect:{statusCode:h,statusText:m,headers:g},buffered:p})}(l):e.once("readable",a)}function s(){e.removeListener("end",l),e.removeListener("error",p),e.removeListener("readable",a)}function l(){s(),t("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function p(e){s(),t("onerror %o",e),n(e)}e.on("error",p),e.on("end",l),a()})},parseProxyResponse}function requireDist(){if(hasRequiredDist)return dist$1;hasRequiredDist=1;var e=dist$1&&dist$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=dist$1&&dist$1.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=dist$1&&dist$1.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n},n=dist$1&&dist$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dist$1,"__esModule",{value:!0}),dist$1.HttpsProxyAgent=void 0;const o=r(require$$0__default$2.default),i=r(require$$1__default$1.default),a=n(require$$2__default.default),s=n(requireSrc$1()),l=requireDist$1(),p=Url__default.default,d=requireParseProxyResponse(),u=(0,s.default)("https-proxy-agent"),c=e=>void 0===e.servername&&e.host&&!o.isIP(e.host)?{...e,servername:e.host}:e;class f extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy="string"==typeof e?new p.URL(e):e,this.proxyHeaders=t?.headers??{},u("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?m(t,"headers"):null,host:r,port:n}}async connect(e,t){const{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;"https:"===r.protocol?(u("Creating `tls.Socket`: %o",this.connectOpts),n=i.connect(c(this.connectOpts))):(u("Creating `net.Socket`: %o",this.connectOpts),n=o.connect(this.connectOpts));const s="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},l=o.isIPv6(t.host)?`[${t.host}]`:t.host;let p=`CONNECT ${l}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}s.Host=`${l}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(s))p+=`${e}: ${s[e]}\r\n`;const f=(0,d.parseProxyResponse)(n);n.write(`${p}\r\n`);const{connect:g,buffered:y}=await f;if(e.emit("proxyConnect",g),this.emit("proxyConnect",g,e),200===g.statusCode)return e.once("socket",h),t.secureEndpoint?(u("Upgrading socket connection to TLS"),i.connect({...m(c(t),"host","path","port"),socket:n})):n;n.destroy();const v=new o.Socket({writable:!1});return v.readable=!0,e.once("socket",e=>{u("Replaying proxy buffer for failed request"),(0,a.default)(e.listenerCount("data")>0),e.push(y),e.push(null)}),v}}function h(e){e.resume()}function m(e,...t){const r={};let n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}return f.protocols=["http","https"],dist$1.HttpsProxyAgent=f,dist$1}function requireGaxios(){if(hasRequiredGaxios)return gaxios;hasRequiredGaxios=1;var e,t,r,n,o,i,a,s,l=gaxios&&gaxios.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),p=gaxios&&gaxios.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=gaxios&&gaxios.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return p(t,e),t},u=gaxios&&gaxios.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=gaxios&&gaxios.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},f=gaxios&&gaxios.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gaxios,"__esModule",{value:!0}),gaxios.Gaxios=void 0;const h=f(requireExtend()),m=require$$1__default$6.default,g=f(require$$2$1),y=f(require$$0__default$5.default),v=f(requireIsStream()),b=Url__default.default,O=requireCommon$1(),w=requireRetry(),S=Stream__default.default,_=require$$9,P=requireInterceptor(),E="undefined"!=typeof window&&window&&window.fetch?window.fetch:g.default;function T(e,t){return!!C(e,t)}function C(e,t){t=t.toLowerCase();for(const r of Object.keys((null==e?void 0:e.headers)||{}))if(t===r.toLowerCase())return e.headers[r]}class R{constructor(t){e.add(this),this.agentCache=new Map,this.defaults=t||{},this.interceptors={request:new P.GaxiosInterceptorManager,response:new P.GaxiosInterceptorManager}}async request(t={}){return t=await u(this,e,"m",i).call(this,t),t=await u(this,e,"m",n).call(this,t),u(this,e,"m",o).call(this,this._request(t))}async _defaultAdapter(e){const t=e.fetchImplementation||E,r=await t(e.url,e),n=await this.getResponseData(e,r);return this.translateResponse(e,r,n)}async _request(e={}){var t;try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if("stream"===e.responseType){let e="";await new Promise(r=>{(null==t?void 0:t.data).on("data",t=>{e+=t}),(null==t?void 0:t.data).on("end",r)}),t.data=e}throw new O.GaxiosError(`Request failed with status code ${t.status}`,e,t)}return t}catch(r){const n=r instanceof O.GaxiosError?r:new O.GaxiosError(r.message,e,void 0,r),{shouldRetry:o,config:i}=await(0,w.getRetryConfig)(n);if(o&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=null===(t=n.config)||void 0===t?void 0:t.retryConfig,this._request(e);throw n}}async getResponseData(e,t){switch(e.responseType){case"stream":return t.body;case"json":{let e=await t.text();try{e=JSON.parse(e)}catch(e){}return e}case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"text":return t.text();default:return this.getResponseDataFromContentType(t)}}validateStatus(e){return e>=200&&e<300}paramsSerializer(e){return y.default.stringify(e)}translateResponse(e,t,r){const n={};return t.headers.forEach((e,t)=>{n[t]=e}),{config:e,data:r,headers:n,status:t.status,statusText:t.statusText,request:{responseURL:t.url}}}async getResponseDataFromContentType(e){let t=e.headers.get("Content-Type");if(null===t)return e.text();if(t=t.toLowerCase(),t.includes("application/json")){let t=await e.text();try{t=JSON.parse(t)}catch(e){}return t}return t.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,t){const r=`--${t}--`;for(const r of e){const e=`--${t}\r\nContent-Type: ${r.headers["Content-Type"]||"application/octet-stream"}\r\n\r\n`;yield e,"string"==typeof r.content?yield r.content:yield*r.content,yield"\r\n"}yield r}}return gaxios.Gaxios=R,t=R,e=new WeakSet,r=function(e,t=[]){var r,n;const o=new b.URL(e),i=[...t],a=(null===(n=null!==(r=process.env.NO_PROXY)&&void 0!==r?r:process.env.no_proxy)||void 0===n?void 0:n.split(","))||[];for(const e of a)i.push(e.trim());for(const e of i)if(e instanceof RegExp){if(e.test(o.toString()))return!1}else if(e instanceof b.URL){if(e.origin===o.origin)return!1}else if(e.startsWith("*.")||e.startsWith(".")){const t=e.replace(/^\*\./,".");if(o.hostname.endsWith(t))return!1}else if(e===o.origin||e===o.hostname||e===o.href)return!1;return!0},n=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t},o=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t},i=async function(n){var o,i,a,l;const p=(0,h.default)(!0,{},this.defaults,n);if(!p.url)throw new Error("URL is required.");const d=p.baseUrl||p.baseURL;if(d&&(p.url=d.toString()+p.url),p.paramsSerializer=p.paramsSerializer||this.paramsSerializer,p.params&&Object.keys(p.params).length>0){let e=p.paramsSerializer(p.params);e.startsWith("?")&&(e=e.slice(1));const t=p.url.toString().includes("?")?"&":"?";p.url=p.url+t+e}if("number"==typeof n.maxContentLength&&(p.size=n.maxContentLength),"number"==typeof n.maxRedirects&&(p.follow=n.maxRedirects),p.headers=p.headers||{},void 0===p.multipart&&p.data){const e="undefined"!=typeof FormData&&(null==p?void 0:p.data)instanceof FormData;v.default.readable(p.data)?p.body=p.data:"undefined"!=typeof Buffer&&Buffer.isBuffer(p.data)?(p.body=p.data,T(p,"Content-Type")||(p.headers["Content-Type"]="application/json")):"object"==typeof p.data?e||("application/x-www-form-urlencoded"===C(p,"content-type")?p.body=p.paramsSerializer(p.data):(T(p,"Content-Type")||(p.headers["Content-Type"]="application/json"),p.body=JSON.stringify(p.data))):p.body=p.data}else if(p.multipart&&p.multipart.length>0){const e=(0,_.v4)();p.headers["Content-Type"]=`multipart/related; boundary=${e}`;const t=new S.PassThrough;p.body=t,(0,S.pipeline)(this.getMultipartRequest(p.multipart,e),t,()=>{})}p.validateStatus=p.validateStatus||this.validateStatus,p.responseType=p.responseType||"unknown",p.headers.Accept||"json"!==p.responseType||(p.headers.Accept="application/json"),p.method=p.method||"GET";const c=p.proxy||(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.HTTPS_PROXY)||(null===(i=null===process||void 0===process?void 0:process.env)||void 0===i?void 0:i.https_proxy)||(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.HTTP_PROXY)||(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.http_proxy),f=u(this,e,"m",r).call(this,p.url,p.noProxy);if(p.agent);else if(c&&f){const e=await u(t,t,"m",s).call(t);this.agentCache.has(c)?p.agent=this.agentCache.get(c):(p.agent=new e(c,{cert:p.cert,key:p.key}),this.agentCache.set(c,p.agent))}else p.cert&&p.key&&(this.agentCache.has(p.key)?p.agent=this.agentCache.get(p.key):(p.agent=new m.Agent({cert:p.cert,key:p.key}),this.agentCache.set(p.key,p.agent)));return"function"!=typeof p.errorRedactor&&!1!==p.errorRedactor&&(p.errorRedactor=O.defaultErrorRedactor),p},s=async function(){return c(this,t,u(this,t,"f",a)||(await Promise.resolve().then(()=>d(requireDist()))).HttpsProxyAgent,"f",a),u(this,t,"f",a)},a={value:void 0},gaxios}function requireSrc(){return hasRequiredSrc||(hasRequiredSrc=1,function(e){var t=src$1&&src$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=src$1&&src$1.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=async function(t){return e.instance.request(t)};const n=requireGaxios();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return n.Gaxios}});var o=requireCommon$1();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return o.GaxiosError}}),r(requireInterceptor(),e),e.instance=new n.Gaxios}(src$1)),src$1}var srcExports=requireSrc(),mapHTTPStatusToOAuthError=function(e){switch(e){case 400:return"invalid_request";case 401:return"invalid_token";case 403:return"access_denied";case 429:return"network_error";case 500:return"server_error";case 503:return"temporarily_unavailable"}return"unknown"},OAUTH_ERROR_MAPPINGS={invalid_client:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth client credentials invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_grant:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth refresh token expired or revoked",shouldRetry:!1,severity:exports.ErrorSeverity.Error},access_denied:{userMessage:"Access was denied. Please grant permission to continue.",internalMessage:"User denied OAuth permission",shouldRetry:!1,severity:exports.ErrorSeverity.Info},invalid_token:{userMessage:"Your authentication token is invalid. Please sign in again.",internalMessage:"OAuth access token invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},expired_token:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth access token expired",shouldRetry:!1,severity:exports.ErrorSeverity.Error},redirect_uri_mismatch:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth redirect URI mismatch",shouldRetry:!1,severity:exports.ErrorSeverity.Error},insufficient_scope:{userMessage:"Additional permissions are required. Please sign in again.",internalMessage:"OAuth insufficient scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},network_error:{userMessage:"Network error. Please check your connection and try again.",internalMessage:"OAuth network error",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},timeout_error:{userMessage:"Request timed out. Please try again.",internalMessage:"OAuth request timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},invalid_request:{userMessage:"Invalid request. Please try again.",internalMessage:"OAuth invalid request parameters",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unsupported_grant_type:{userMessage:"Authentication method not supported. Please contact support.",internalMessage:"OAuth unsupported grant type",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_scope:{userMessage:"Invalid permissions requested. Please contact support.",internalMessage:"OAuth invalid scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unauthorized_client:{userMessage:"Application not authorized. Please contact support.",internalMessage:"OAuth client not authorized",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown OAuth error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},server_error:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"OAuth server error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},temporarily_unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"OAuth service temporarily unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning}};function isOAuth2Error(e){return e instanceof srcExports.GaxiosError}function extractOAuthErrorCode(e){var t,r,n=null===(r=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.error;return"string"==typeof n?n:"string"==typeof e.code?e.code.startsWith("E")?"ETIMEDOUT"===e.code?"timeout_error":("ENOTFOUND"===e.code||e.code,"network_error"):e.code:e.status?mapHTTPStatusToOAuthError(e.status):"unknown"}function handleGoogleOAuth2Error(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isOAuth2Error(e)?(r=extractOAuthErrorCode(e),n=e):e instanceof Error?(n=e,r="unknown"):(n=new Error(String(e)),r="unknown");var o=r&&r in OAUTH_ERROR_MAPPINGS?OAUTH_ERROR_MAPPINGS[r]:OAUTH_ERROR_MAPPINGS.unknown;throw console.error("[Internal] Error from Google OAuth2: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var ENCRYPTION_ERROR_MAPPINGS={encryption_failed:{userMessage:"Failed to encrypt data. Please try again.",internalMessage:"Encryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},decryption_failed:{userMessage:"Failed to decrypt data. Please contact support.",internalMessage:"Decryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function handleEncryptionError(e,t,r){var n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),n=e instanceof Error?e:new Error(String(e));var o=ENCRYPTION_ERROR_MAPPINGS[r];throw console.error("[Internal] Error from Encryption: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var EncryptionService=function(){function e(e){this.encryptionSecret=e,this.ENCRYPTION_SECRET=e}return e.prototype.encryptString=function(t){try{var r=crypto__default.default.randomBytes(e.SALT_BYTES).toString("hex"),n=crypto__default.default.randomBytes(e.IV_LENGTH),o=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,r,e.ENCRYPTION_KEY_LENGTH),i=crypto__default.default.createCipheriv(e.ALGORITHM,o,n),a=i.update(t,"utf8","hex");return a+=i.final("hex"),"".concat(n.toString("hex"),":").concat(a,":").concat(r)}catch(e){return handleEncryptionError(e,{operation:"encryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to encrypt string",errorType:e instanceof Error?e.name:typeof e}},"encryption_failed")}},e.prototype.decryptString=function(t){try{var r=__read(t.split(":"),3),n=r[0],o=r[1],i=r[2];if(!n||!o||!i)throw new Error("Invalid encrypted string");var a=Buffer.from(n,"hex"),s=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,i,e.ENCRYPTION_KEY_LENGTH),l=crypto__default.default.createDecipheriv(e.ALGORITHM,s,a),p=l.update(o,"hex","utf8");return p+=l.final("utf8")}catch(e){return handleEncryptionError(e,{operation:"decryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to decrypt string",errorType:e instanceof Error?e.name:typeof e}},"decryption_failed")}},e.ALGORITHM="aes-256-cbc",e.IV_LENGTH=16,e.SALT_BYTES=16,e.ENCRYPTION_KEY_LENGTH=32,e}(),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),FirestoreCollections;!function(e){e.CONNECTED_USERS_CREDENTIALS="connectedUsersCredentials",e.CLASSROOM_ATTACHMENTS="classroomAttachments"}(FirestoreCollections||(FirestoreCollections={}));var FirestoreClient=function(){function e(e){this.firestore=e,this._firestore=e}return e.prototype.getConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,userCredentialsEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get users credentials"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=userCredentialsEntitySchema.parse(e),this._firestore.settings({ignoreUndefinedProperties:!0}),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(t.loginHint).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert users credentials",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertClassroomAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=classroomAttachmentEntitySchema.parse(e),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(t.attachmentId).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertClassroomAttachment",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert classroom attachment",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.getClassroomAttachmentById=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,classroomAttachmentEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getClassroomAttachmentById",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get classroom attachment by ID"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e}(),GoogleOAuthClient=function(){function e(e,t,r,n,o){var i=this;if(this.googleClientId=e,this.googleClientSecret=t,this.callbackUrl=r,this.accessToken=n,this.refreshToken=o,!e)throw new Error("Google Client ID is missing");if(!t)throw new Error("Google Client Secret is missing");if(!r)throw new Error("Google OAuth Callback URL is missing");var a=new require$$3$2.OAuth2Client({clientId:e,clientSecret:t,redirectUri:r,forceRefreshOnFailure:!1});"true"===process.env.GOOGLE_CLASSROOM_DEV_MODE&&n&&(a.refreshHandler=function(){return __awaiter(i,void 0,void 0,function(){return __generator$1(this,function(e){return[2,{access_token:n,expiry_date:(new Date).getTime()+36e5}]})})}),(n||o)&&a.setCredentials({access_token:n,refresh_token:o}),this.client=a,this.clientId=e}return e.prototype.getAuthenticateUrl=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);try{var n=r?["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.coursework.me","https://www.googleapis.com/auth/classroom.addons.student"]:["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.courses.readonly","https://www.googleapis.com/auth/classroom.addons.student","https://www.googleapis.com/auth/classroom.addons.teacher"],o=JSON.stringify({subscribeToNewsletter:t});return this.client.generateAuthUrl({access_type:"offline",include_granted_scopes:!0,scope:n,loginHint:e,state:o})}catch(e){return handleGoogleOAuth2Error(e,{operation:"getAuthenticateUrl",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to get authenticate url"}})}},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.client.getToken(e)];case 1:return t=s.sent().tokens,[4,this.client.verifyIdToken({idToken:t.id_token,audience:this.clientId})];case 2:return r=s.sent(),n=r.getPayload(),o={accessToken:t.access_token,loginHint:null==n?void 0:n.sub,refreshToken:t.refresh_token,profilePictureUrl:null==n?void 0:n.picture,email:null==n?void 0:n.email},[2,googleOAuthUserSchema.parse(o)];case 3:return i=s.sent(),a={operation:"exchangeCodeForTokens",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to exchange code for tokens"}},[2,handleGoogleOAuth2Error(i,a)];case 4:return[2]}})})},e.prototype.refreshAccessToken=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.client.setCredentials({refresh_token:e}),[4,this.client.getAccessToken()];case 1:return t=o.sent(),[2,tokenPayloadSchema.parse(t).token];case 2:return r=o.sent(),n={operation:"refreshAccessToken",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to refresh access token"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.isAuthenticated=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.client.getTokenInfo(e)];case 1:return t=o.sent(),t.expiry_date<Date.now()?[2,!1]:[2,!0];case 2:return r=o.sent(),n={operation:"isAuthenticated",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to check if access token is authenticated"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.getOAuth2Client=function(){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,this.client]})})},e}(),OakOAuth=function(){function e(e,t,r){this.googleOAuthClientId=e,this.googleOAuthClientSecret=t,this.googleOAuthCallbackApiRoute=r}return e.prototype.createClient=function(e,t){return new GoogleOAuthClient(this.googleOAuthClientId,this.googleOAuthClientSecret,this.googleOAuthCallbackApiRoute,e,t)},e.prototype.getSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t,r){var n,o;return void 0===t&&(t=!1),void 0===r&&(r=!1),__generator$1(this,function(i){if(n=this.createClient(),!(o=n.getAuthenticateUrl(e,t,r)))throw OakGoogleClassroomException.GoogleOAuthError("Failed to get Google Authentication URL","getSignInUrl");return[2,o]})})},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r;return __generator$1(this,function(n){switch(n.label){case 0:if(!e||"string"!=typeof e||""===e.trim())throw OakGoogleClassroomException.GoogleOAuthError("Invalid OAuth code provided","exchangeCodeForTokens");return[4,this.createClient().exchangeCodeForTokens(e)];case 1:if(!(t=n.sent()))throw OakGoogleClassroomException.GoogleOAuthError("Failed to authenticate Google sign-in","exchangeCodeForTokens");if(r=googleOAuthUserSchema.parse(t),!r.accessToken)throw OakGoogleClassroomException.GoogleOAuthError("Access token missing from OAuth response","exchangeCodeForTokens",{loginHint:r.loginHint});return[2,r]}})})},e.prototype.validateOrRefreshToken=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n;return __generator$1(this,function(o){switch(o.label){case 0:return[4,(r=this.createClient(e,t)).isAuthenticated(e)];case 1:return o.sent()?[2,{token:e,wasRefreshed:!1}]:[4,r.refreshAccessToken(t)];case 2:return(n=o.sent())?[2,{token:n,wasRefreshed:!0}]:[2,null]}})})},e}(),cookie={},hasRequiredCookie;function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID=()=>webCrypto.randomUUID(),getRandomValues=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID,getRandomValues:getRandomValues,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues,randomUUID:randomUUID,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),lodash$1={exports:{}},lodash=lodash$1.exports,hasRequiredLodash;function requireLodash(){return hasRequiredLodash||(hasRequiredLodash=1,function(e,t){(function(){var r,n="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",a=32,s=128,l=256,p=1/0,d=9007199254740991,u=NaN,c=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],h="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",O="[object GeneratorFunction]",w="[object Map]",S="[object Number]",_="[object Object]",P="[object Promise]",E="[object RegExp]",T="[object Set]",C="[object String]",R="[object Symbol]",D="[object WeakMap]",x="[object ArrayBuffer]",k="[object DataView]",j="[object Float32Array]",A="[object Float64Array]",N="[object Int8Array]",I="[object Int16Array]",q="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",F="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,H=RegExp(G.source),W=RegExp(z.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,ce=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,he=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Oe="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ce="['’]",Re="["+Oe+"]",De="["+Te+"]",xe="["+we+"]",ke="\\d+",je="["+Se+"]",Ae="["+_e+"]",Ne="[^"+Oe+Te+ke+Se+_e+Pe+"]",Ie="\\ud83c[\\udffb-\\udfff]",qe="[^"+Oe+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Pe+"]",Be="\\u200d",Ve="(?:"+Ae+"|"+Ne+")",Ue="(?:"+Fe+"|"+Ne+")",$e="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+xe+"|"+Ie+")"+"?",He="["+Ee+"]?",We=He+ze+("(?:"+Be+"(?:"+[qe,Me,Le].join("|")+")"+He+ze+")*"),Je="(?:"+[je,Me,Le].join("|")+")"+We,Ye="(?:"+[qe+xe+"?",xe,Me,Le,Re].join("|")+")",Ke=RegExp(Ce,"g"),Xe=RegExp(xe,"g"),Qe=RegExp(Ie+"(?="+Ie+")|"+Ye+We,"g"),Ze=RegExp([Fe+"?"+Ae+"+"+$e+"(?="+[De,Fe,"$"].join("|")+")",Ue+"+"+Ge+"(?="+[De,Fe+Ve,"$"].join("|")+")",Fe+"?"+Ve+"+"+$e,Fe+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Je].join("|"),"g"),et=RegExp("["+Be+Oe+we+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,ot={};ot[j]=ot[A]=ot[N]=ot[I]=ot[q]=ot[M]=ot[L]=ot[F]=ot[B]=!0,ot[h]=ot[m]=ot[x]=ot[g]=ot[k]=ot[y]=ot[v]=ot[b]=ot[w]=ot[S]=ot[_]=ot[E]=ot[T]=ot[C]=ot[D]=!1;var it={};it[h]=it[m]=it[x]=it[k]=it[g]=it[y]=it[j]=it[A]=it[N]=it[I]=it[q]=it[w]=it[S]=it[_]=it[E]=it[T]=it[C]=it[R]=it[M]=it[L]=it[F]=it[B]=!0,it[v]=it[b]=it[D]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,pt="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,dt="object"==typeof self&&self&&self.Object===Object&&self,ut=pt||dt||Function("return this")(),ct=t&&!t.nodeType&&t,ft=ct&&e&&!e.nodeType&&e,ht=ft&&ft.exports===ct,mt=ht&&pt.process,gt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,bt=gt&>.isMap,Ot=gt&>.isRegExp,wt=gt&>.isSet,St=gt&>.isTypedArray;function _t(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Pt(e,t,r,n){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(n,a,r(a),e)}return n}function Et(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Tt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Rt(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}function Dt(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function xt(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}function kt(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}function jt(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}function At(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function Nt(e,t,r,n){var o=null==e?0:e.length;for(n&&o&&(r=e[--o]);o--;)r=t(r,e[o],o,e);return r}function It(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var qt=$t("length");function Mt(e,t,r){var n;return r(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}function Lt(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Ft(e,t,r){return t==t?function(e,t,r){var n=r-1,o=e.length;for(;++n<o;)if(e[n]===t)return n;return-1}(e,t,r):Lt(e,Vt,r)}function Bt(e,t,r,n){for(var o=r-1,i=e.length;++o<i;)if(n(e[o],t))return o;return-1}function Vt(e){return e!=e}function Ut(e,t){var r=null==e?0:e.length;return r?Ht(e,t)/r:u}function $t(e){return function(t){return null==t?r:t[e]}}function Gt(e){return function(t){return null==e?r:e[t]}}function zt(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r}function Ht(e,t){for(var n,o=-1,i=e.length;++o<i;){var a=t(e[o]);a!==r&&(n=n===r?a:n+a)}return n}function Wt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jt(e){return e?e.slice(0,ur(e)+1).replace(re,""):e}function Yt(e){return function(t){return e(t)}}function Kt(e,t){return kt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&Ft(t,e[r],0)>-1;);return r}function Zt(e,t){for(var r=e.length;r--&&Ft(t,e[r],0)>-1;);return r}var er=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function or(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function ir(e,t){return function(r){return e(t(r))}}function ar(e,t){for(var r=-1,n=e.length,o=0,a=[];++r<n;){var s=e[r];s!==t&&s!==i||(e[r]=i,a[o++]=r)}return a}function sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function pr(e){return nr(e)?function(e){var t=Qe.lastIndex=0;for(;Qe.test(e);)++t;return t}(e):qt(e)}function dr(e){return nr(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function ur(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var cr=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var fr=function e(t){var ne,Oe=(t=null==t?ut:fr.defaults(ut.Object(),t,fr.pick(ut,rt))).Array,we=t.Date,Se=t.Error,_e=t.Function,Pe=t.Math,Ee=t.Object,Te=t.RegExp,Ce=t.String,Re=t.TypeError,De=Oe.prototype,xe=_e.prototype,ke=Ee.prototype,je=t["__core-js_shared__"],Ae=xe.toString,Ne=ke.hasOwnProperty,Ie=0,qe=(ne=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",Me=ke.toString,Le=Ae.call(Ee),Fe=ut._,Be=Te("^"+Ae.call(Ne).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ht?t.Buffer:r,Ue=t.Symbol,$e=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:r,ze=ir(Ee.getPrototypeOf,Ee),He=Ee.create,We=ke.propertyIsEnumerable,Je=De.splice,Ye=Ue?Ue.isConcatSpreadable:r,Qe=Ue?Ue.iterator:r,et=Ue?Ue.toStringTag:r,at=function(){try{var e=ui(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),pt=t.clearTimeout!==ut.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ut.Date.now&&we.now,ct=t.setTimeout!==ut.setTimeout&&t.setTimeout,ft=Pe.ceil,mt=Pe.floor,gt=Ee.getOwnPropertySymbols,qt=Ve?Ve.isBuffer:r,Gt=t.isFinite,hr=De.join,mr=ir(Ee.keys,Ee),gr=Pe.max,yr=Pe.min,vr=we.now,br=t.parseInt,Or=Pe.random,wr=De.reverse,Sr=ui(t,"DataView"),_r=ui(t,"Map"),Pr=ui(t,"Promise"),Er=ui(t,"Set"),Tr=ui(t,"WeakMap"),Cr=ui(Ee,"create"),Rr=Tr&&new Tr,Dr={},xr=Mi(Sr),kr=Mi(_r),jr=Mi(Pr),Ar=Mi(Er),Nr=Mi(Tr),Ir=Ue?Ue.prototype:r,qr=Ir?Ir.valueOf:r,Mr=Ir?Ir.toString:r;function Lr(e){if(es(e)&&!$a(e)&&!(e instanceof Ur)){if(e instanceof Vr)return e;if(Ne.call(e,"__wrapped__"))return Li(e)}return new Vr(e)}var Fr=function(){function e(){}return function(t){if(!Za(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Vr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=c,this.__views__=[]}function $r(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Wr(e){var t=this.__data__=new Gr(e);this.size=t.size}function Jr(e,t){var r=$a(e),n=!r&&Ua(e),o=!r&&!n&&Wa(e),i=!r&&!n&&!o&&ls(e),a=r||n||o||i,s=a?Wt(e.length,Ce):[],l=s.length;for(var p in e)!t&&!Ne.call(e,p)||a&&("length"==p||o&&("offset"==p||"parent"==p)||i&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||vi(p,l))||s.push(p);return s}function Yr(e){var t=e.length;return t?e[Wn(0,t-1)]:r}function Kr(e,t){return Ni(Do(e),an(t,0,e.length))}function Xr(e){return Ni(Do(e))}function Qr(e,t,n){(n!==r&&!Fa(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Zr(e,t,n){var o=e[t];Ne.call(e,t)&&Fa(o,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(Fa(e[r][0],t))return r;return-1}function tn(e,t,r,n){return un(e,function(e,o,i){t(n,e,r(e),i)}),n}function rn(e,t){return e&&xo(t,xs(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,o=t.length,i=Oe(o),a=null==e;++n<o;)i[n]=a?r:Es(e,t[n]);return i}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(e,t,n,o,i,a){var s,l=1&t,p=2&t,d=4&t;if(n&&(s=i?n(e,o,i,a):n(e)),s!==r)return s;if(!Za(e))return e;var u=$a(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Do(e,s)}else{var c=hi(e),f=c==b||c==O;if(Wa(e))return _o(e,l);if(c==_||c==h||f&&!i){if(s=p||f?{}:gi(e),!l)return p?function(e,t){return xo(e,fi(e),t)}(e,function(e,t){return e&&xo(t,ks(t),e)}(s,e)):function(e,t){return xo(e,ci(e),t)}(e,rn(s,e))}else{if(!it[c])return i?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case x:return Po(e);case g:case y:return new n(+e);case k:return function(e,t){var r=t?Po(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case A:case N:case I:case q:case M:case L:case F:case B:return Eo(e,r);case w:return new n;case S:case C:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new n;case R:return o=e,qr?Ee(qr.call(o)):{}}var o}(e,c,l)}}a||(a=new Wr);var m=a.get(e);if(m)return m;a.set(e,s),is(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,o){s.set(o,sn(r,t,n,o,e,a))});var v=u?r:(d?p?oi:ni:p?ks:xs)(e);return Et(v||e,function(r,o){v&&(r=e[o=r]),Zr(s,o,sn(r,t,n,o,e,a))}),s}function ln(e,t,n){var o=n.length;if(null==e)return!o;for(e=Ee(e);o--;){var i=n[o],a=t[i],s=e[i];if(s===r&&!(i in e)||!a(s))return!1}return!0}function pn(e,t,o){if("function"!=typeof e)throw new Re(n);return xi(function(){e.apply(r,o)},t)}function dn(e,t,r,n){var o=-1,i=Dt,a=!0,s=e.length,l=[],p=t.length;if(!s)return l;r&&(t=kt(t,Yt(r))),n?(i=xt,a=!1):t.length>=200&&(i=Xt,a=!1,t=new Hr(t));e:for(;++o<s;){var d=e[o],u=null==r?d:r(d);if(d=n||0!==d?d:0,a&&u==u){for(var c=p;c--;)if(t[c]===u)continue e;l.push(d)}else i(t,u,n)||l.push(d)}return l}Lr.templateSettings={escape:J,evaluate:Y,interpolate:K,variable:"",imports:{_:Lr}},Lr.prototype=Br.prototype,Lr.prototype.constructor=Lr,Vr.prototype=Fr(Br.prototype),Vr.prototype.constructor=Vr,Ur.prototype=Fr(Br.prototype),Ur.prototype.constructor=Ur,$r.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},$r.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$r.prototype.get=function(e){var t=this.__data__;if(Cr){var n=t[e];return n===o?r:n}return Ne.call(t,e)?t[e]:r},$r.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==r:Ne.call(t,e)},$r.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Cr&&t===r?o:t,this},Gr.prototype.clear=function(){this.__data__=[],this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0)&&(r==t.length-1?t.pop():Je.call(t,r,1),--this.size,!0)},Gr.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},Gr.prototype.has=function(e){return en(this.__data__,e)>-1},Gr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new $r,map:new(_r||Gr),string:new $r}},zr.prototype.delete=function(e){var t=pi(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return pi(this,e).get(e)},zr.prototype.has=function(e){return pi(this,e).has(e)},zr.prototype.set=function(e,t){var r=pi(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,o),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.clear=function(){this.__data__=new Gr,this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Wr.prototype.get=function(e){return this.__data__.get(e)},Wr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Gr){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var un=Ao(bn),cn=Ao(On,!0);function fn(e,t){var r=!0;return un(e,function(e,n,o){return r=!!t(e,n,o)}),r}function hn(e,t,n){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(l===r?s==s&&!ss(s):n(s,l)))var l=s,p=a}return p}function mn(e,t){var r=[];return un(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r}function gn(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=yi),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?gn(s,t-1,r,n,o):jt(o,s):n||(o[o.length]=s)}return o}var yn=No(),vn=No(!0);function bn(e,t){return e&&yn(e,t,xs)}function On(e,t){return e&&vn(e,t,xs)}function wn(e,t){return Rt(t,function(t){return Ka(e[t])})}function Sn(e,t){for(var n=0,o=(t=bo(t,e)).length;null!=e&&n<o;)e=e[qi(t[n++])];return n&&n==o?e:r}function _n(e,t,r){var n=t(e);return $a(e)?n:jt(n,r(e))}function Pn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Ee(e)?function(e){var t=Ne.call(e,et),n=e[et];try{e[et]=r;var o=!0}catch(e){}var i=Me.call(e);o&&(t?e[et]=n:delete e[et]);return i}(e):function(e){return Me.call(e)}(e)}function En(e,t){return e>t}function Tn(e,t){return null!=e&&Ne.call(e,t)}function Cn(e,t){return null!=e&&t in Ee(e)}function Rn(e,t,n){for(var o=n?xt:Dt,i=e[0].length,a=e.length,s=a,l=Oe(a),p=1/0,d=[];s--;){var u=e[s];s&&t&&(u=kt(u,Yt(t))),p=yr(u.length,p),l[s]=!n&&(t||i>=120&&u.length>=120)?new Hr(s&&u):r}u=e[0];var c=-1,f=l[0];e:for(;++c<i&&d.length<p;){var h=u[c],m=t?t(h):h;if(h=n||0!==h?h:0,!(f?Xt(f,m):o(d,m,n))){for(s=a;--s;){var g=l[s];if(!(g?Xt(g,m):o(e[s],m,n)))continue e}f&&f.push(m),d.push(h)}}return d}function Dn(e,t,n){var o=null==(e=Ci(e,t=bo(t,e)))?e:e[qi(Yi(t))];return null==o?r:_t(o,e,n)}function xn(e){return es(e)&&Pn(e)==h}function kn(e,t,n,o,i){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,o,i,a){var s=$a(e),l=$a(t),p=s?m:hi(e),d=l?m:hi(t),u=(p=p==h?_:p)==_,c=(d=d==h?_:d)==_,f=p==d;if(f&&Wa(e)){if(!Wa(t))return!1;s=!0,u=!1}if(f&&!u)return a||(a=new Wr),s||ls(e)?ti(e,t,n,o,i,a):function(e,t,r,n,o,i,a){switch(r){case k:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!i(new $e(e),new $e(t)));case g:case y:case S:return Fa(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case C:return e==t+"";case w:var s=or;case T:var l=1&n;if(s||(s=sr),e.size!=t.size&&!l)return!1;var p=a.get(e);if(p)return p==t;n|=2,a.set(e,t);var d=ti(s(e),s(t),n,o,i,a);return a.delete(e),d;case R:if(qr)return qr.call(e)==qr.call(t)}return!1}(e,t,p,n,o,i,a);if(!(1&n)){var b=u&&Ne.call(e,"__wrapped__"),O=c&&Ne.call(t,"__wrapped__");if(b||O){var P=b?e.value():e,D=O?t.value():t;return a||(a=new Wr),i(P,D,n,o,a)}}if(!f)return!1;return a||(a=new Wr),function(e,t,n,o,i,a){var s=1&n,l=ni(e),p=l.length,d=ni(t),u=d.length;if(p!=u&&!s)return!1;var c=p;for(;c--;){var f=l[c];if(!(s?f in t:Ne.call(t,f)))return!1}var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var y=s;for(;++c<p;){var v=e[f=l[c]],b=t[f];if(o)var O=s?o(b,v,f,t,e,a):o(v,b,f,e,t,a);if(!(O===r?v===b||i(v,b,n,o,a):O)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,o,i,a)}(e,t,n,o,kn,i))}function jn(e,t,n,o){var i=n.length,a=i,s=!o;if(null==e)return!a;for(e=Ee(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){var p=(l=n[i])[0],d=e[p],u=l[1];if(s&&l[2]){if(d===r&&!(p in e))return!1}else{var c=new Wr;if(o)var f=o(d,u,p,e,t,c);if(!(f===r?kn(u,d,3,o,c):f))return!1}}return!0}function An(e){return!(!Za(e)||(t=e,qe&&qe in t))&&(Ka(e)?Be:he).test(Mi(e));var t}function Nn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?$a(e)?Bn(e[0],e[1]):Fn(e):ul(e)}function In(e){if(!_i(e))return mr(e);var t=[];for(var r in Ee(e))Ne.call(e,r)&&"constructor"!=r&&t.push(r);return t}function qn(e){if(!Za(e))return function(e){var t=[];if(null!=e)for(var r in Ee(e))t.push(r);return t}(e);var t=_i(e),r=[];for(var n in e)("constructor"!=n||!t&&Ne.call(e,n))&&r.push(n);return r}function Mn(e,t){return e<t}function Ln(e,t){var r=-1,n=za(e)?Oe(e.length):[];return un(e,function(e,o,i){n[++r]=t(e,o,i)}),n}function Fn(e){var t=di(e);return 1==t.length&&t[0][2]?Ei(t[0][0],t[0][1]):function(r){return r===e||jn(r,e,t)}}function Bn(e,t){return Oi(e)&&Pi(t)?Ei(qi(e),t):function(n){var o=Es(n,e);return o===r&&o===t?Ts(n,e):kn(t,o,3)}}function Vn(e,t,n,o,i){e!==t&&yn(t,function(a,s){if(i||(i=new Wr),Za(a))!function(e,t,n,o,i,a,s){var l=Ri(e,n),p=Ri(t,n),d=s.get(p);if(d)return void Qr(e,n,d);var u=a?a(l,p,n+"",e,t,s):r,c=u===r;if(c){var f=$a(p),h=!f&&Wa(p),m=!f&&!h&&ls(p);u=p,f||h||m?$a(l)?u=l:Ha(l)?u=Do(l):h?(c=!1,u=_o(p,!0)):m?(c=!1,u=Eo(p,!0)):u=[]:ns(p)||Ua(p)?(u=l,Ua(l)?u=gs(l):Za(l)&&!Ka(l)||(u=gi(p))):c=!1}c&&(s.set(p,u),i(u,p,o,a,s),s.delete(p));Qr(e,n,u)}(e,t,s,n,Vn,o,i);else{var l=o?o(Ri(e,s),a,s+"",e,t,i):r;l===r&&(l=a),Qr(e,s,l)}},ks)}function Un(e,t){var n=e.length;if(n)return vi(t+=t<0?n:0,n)?e[t]:r}function $n(e,t,r){t=t.length?kt(t,function(e){return $a(e)?function(t){return Sn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=kt(t,Yt(li()));var o=Ln(e,function(e,r,o){var i=kt(t,function(t){return t(e)});return{criteria:i,index:++n,value:e}});return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(o,function(e,t){return function(e,t,r){var n=-1,o=e.criteria,i=t.criteria,a=o.length,s=r.length;for(;++n<a;){var l=To(o[n],i[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)})}function Gn(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=Sn(e,a);r(s,a)&&Qn(i,bo(a,e),s)}return i}function zn(e,t,r,n){var o=n?Bt:Ft,i=-1,a=t.length,s=e;for(e===t&&(t=Do(t)),r&&(s=kt(e,Yt(r)));++i<a;)for(var l=0,p=t[i],d=r?r(p):p;(l=o(s,d,l,n))>-1;)s!==e&&Je.call(s,l,1),Je.call(e,l,1);return e}function Hn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==i){var i=o;vi(o)?Je.call(e,o,1):uo(e,o)}}return e}function Wn(e,t){return e+mt(Or()*(t-e+1))}function Jn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return ki(Ti(e,t,rl),e+"")}function Kn(e){return Yr(Fs(e))}function Xn(e,t){var r=Fs(e);return Ni(r,an(t,0,r.length))}function Qn(e,t,n,o){if(!Za(e))return e;for(var i=-1,a=(t=bo(t,e)).length,s=a-1,l=e;null!=l&&++i<a;){var p=qi(t[i]),d=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(i!=s){var u=l[p];(d=o?o(u,p,l):r)===r&&(d=Za(u)?u:vi(t[i+1])?[]:{})}Zr(l,p,d),l=l[p]}return e}var Zn=Rr?function(e,t){return Rr.set(e,t),e}:rl,eo=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Zs(t),writable:!0})}:rl;function to(e){return Ni(Fs(e))}function ro(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Oe(o);++n<o;)i[n]=e[n+t];return i}function no(e,t){var r;return un(e,function(e,n,o){return!(r=t(e,n,o))}),!!r}function oo(e,t,r){var n=0,o=null==e?n:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;n<o;){var i=n+o>>>1,a=e[i];null!==a&&!ss(a)&&(r?a<=t:a<t)?n=i+1:o=i}return o}return io(e,t,rl,r)}function io(e,t,n,o){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,p=ss(t),d=t===r;i<a;){var u=mt((i+a)/2),c=n(e[u]),f=c!==r,h=null===c,m=c==c,g=ss(c);if(s)var y=o||m;else y=d?m&&(o||f):l?m&&f&&(o||!h):p?m&&f&&!h&&(o||!g):!h&&!g&&(o?c<=t:c<t);y?i=u+1:a=u}return yr(a,4294967294)}function ao(e,t){for(var r=-1,n=e.length,o=0,i=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Fa(s,l)){var l=s;i[o++]=0===a?0:a}}return i}function so(e){return"number"==typeof e?e:ss(e)?u:+e}function lo(e){if("string"==typeof e)return e;if($a(e))return kt(e,lo)+"";if(ss(e))return Mr?Mr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function po(e,t,r){var n=-1,o=Dt,i=e.length,a=!0,s=[],l=s;if(r)a=!1,o=xt;else if(i>=200){var p=t?null:Yo(e);if(p)return sr(p);a=!1,o=Xt,l=new Hr}else l=t?[]:s;e:for(;++n<i;){var d=e[n],u=t?t(d):d;if(d=r||0!==d?d:0,a&&u==u){for(var c=l.length;c--;)if(l[c]===u)continue e;t&&l.push(u),s.push(d)}else o(l,u,r)||(l!==s&&l.push(u),s.push(d))}return s}function uo(e,t){return null==(e=Ci(e,t=bo(t,e)))||delete e[qi(Yi(t))]}function co(e,t,r,n){return Qn(e,t,r(Sn(e,t)),n)}function fo(e,t,r,n){for(var o=e.length,i=n?o:-1;(n?i--:++i<o)&&t(e[i],i,e););return r?ro(e,n?0:i,n?i+1:o):ro(e,n?i+1:0,n?o:i)}function ho(e,t){var r=e;return r instanceof Ur&&(r=r.value()),At(t,function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))},r)}function mo(e,t,r){var n=e.length;if(n<2)return n?po(e[0]):[];for(var o=-1,i=Oe(n);++o<n;)for(var a=e[o],s=-1;++s<n;)s!=o&&(i[o]=dn(i[o]||a,e[s],t,r));return po(gn(i,1),t,r)}function go(e,t,n){for(var o=-1,i=e.length,a=t.length,s={};++o<i;){var l=o<a?t[o]:r;n(s,e[o],l)}return s}function yo(e){return Ha(e)?e:[]}function vo(e){return"function"==typeof e?e:rl}function bo(e,t){return $a(e)?e:Oi(e,t)?[e]:Ii(ys(e))}var Oo=Yn;function wo(e,t,n){var o=e.length;return n=n===r?o:n,!t&&n>=o?e:ro(e,t,n)}var So=pt||function(e){return ut.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var r=e.length,n=Ge?Ge(r):new e.constructor(r);return e.copy(n),n}function Po(e){var t=new e.constructor(e.byteLength);return new $e(t).set(new $e(e)),t}function Eo(e,t){var r=t?Po(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function To(e,t){if(e!==t){var n=e!==r,o=null===e,i=e==e,a=ss(e),s=t!==r,l=null===t,p=t==t,d=ss(t);if(!l&&!d&&!a&&e>t||a&&s&&p&&!l&&!d||o&&s&&p||!n&&p||!i)return 1;if(!o&&!a&&!d&&e<t||d&&n&&i&&!o&&!a||l&&n&&i||!s&&i||!p)return-1}return 0}function Co(e,t,r,n){for(var o=-1,i=e.length,a=r.length,s=-1,l=t.length,p=gr(i-a,0),d=Oe(l+p),u=!n;++s<l;)d[s]=t[s];for(;++o<a;)(u||o<i)&&(d[r[o]]=e[o]);for(;p--;)d[s++]=e[o++];return d}function Ro(e,t,r,n){for(var o=-1,i=e.length,a=-1,s=r.length,l=-1,p=t.length,d=gr(i-s,0),u=Oe(d+p),c=!n;++o<d;)u[o]=e[o];for(var f=o;++l<p;)u[f+l]=t[l];for(;++a<s;)(c||o<i)&&(u[f+r[a]]=e[o++]);return u}function Do(e,t){var r=-1,n=e.length;for(t||(t=Oe(n));++r<n;)t[r]=e[r];return t}function xo(e,t,n,o){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],p=o?o(n[l],e[l],l,n,e):r;p===r&&(p=e[l]),i?nn(n,l,p):Zr(n,l,p)}return n}function ko(e,t){return function(r,n){var o=$a(r)?Pt:tn,i=t?t():{};return o(r,e,li(n,2),i)}}function jo(e){return Yn(function(t,n){var o=-1,i=n.length,a=i>1?n[i-1]:r,s=i>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(i--,a):r,s&&bi(n[0],n[1],s)&&(a=i<3?r:a,i=1),t=Ee(t);++o<i;){var l=n[o];l&&e(t,l,o,a)}return t})}function Ao(e,t){return function(r,n){if(null==r)return r;if(!za(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Ee(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}function No(e){return function(t,r,n){for(var o=-1,i=Ee(t),a=n(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===r(i[l],l,i))break}return t}}function Io(e){return function(t){var n=nr(t=ys(t))?dr(t):r,o=n?n[0]:t.charAt(0),i=n?wo(n,1).join(""):t.slice(1);return o[e]()+i}}function qo(e){return function(t){return At(Ks(Us(t).replace(Ke,"")),e,"")}}function Mo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Za(n)?n:r}}function Lo(e){return function(t,n,o){var i=Ee(t);if(!za(t)){var a=li(n,3);t=xs(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,o);return s>-1?i[a?t[s]:s]:r}}function Fo(e){return ri(function(t){var o=t.length,i=o,a=Vr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Re(n);if(a&&!l&&"wrapper"==ai(s))var l=new Vr([],!0)}for(i=l?i:o;++i<o;){var p=ai(s=t[i]),d="wrapper"==p?ii(s):r;l=d&&wi(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[ai(d[0])].apply(l,d[3]):1==s.length&&wi(s)?l[p]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&$a(r))return l.plant(r).value();for(var n=0,i=o?t[n].apply(this,e):r;++n<o;)i=t[n].call(this,i);return i}})}function Bo(e,t,n,o,i,a,l,p,d,u){var c=t&s,f=1&t,h=2&t,m=24&t,g=512&t,y=h?r:Mo(e);return function s(){for(var v=arguments.length,b=Oe(v),O=v;O--;)b[O]=arguments[O];if(m)var w=si(s),S=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,w);if(o&&(b=Co(b,o,i,m)),a&&(b=Ro(b,a,l,m)),v-=S,m&&v<u){var _=ar(b,w);return Wo(e,t,Bo,s.placeholder,n,b,_,p,d,u-v)}var P=f?n:this,E=h?P[e]:e;return v=b.length,p?b=function(e,t){var n=e.length,o=yr(t.length,n),i=Do(e);for(;o--;){var a=t[o];e[o]=vi(a,n)?i[a]:r}return e}(b,p):g&&v>1&&b.reverse(),c&&d<v&&(b.length=d),this&&this!==ut&&this instanceof s&&(E=y||Mo(E)),E.apply(P,b)}}function Vo(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,o,i){t(n,r(e),o,i)}),n}(r,e,t(n),{})}}function Uo(e,t){return function(n,o){var i;if(n===r&&o===r)return t;if(n!==r&&(i=n),o!==r){if(i===r)return o;"string"==typeof n||"string"==typeof o?(n=lo(n),o=lo(o)):(n=so(n),o=so(o)),i=e(n,o)}return i}}function $o(e){return ri(function(t){return t=kt(t,Yt(li())),Yn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Go(e,t){var n=(t=t===r?" ":lo(t)).length;if(n<2)return n?Jn(t,e):t;var o=Jn(t,ft(e/pr(t)));return nr(t)?wo(dr(o),0,e).join(""):o.slice(0,e)}function zo(e){return function(t,n,o){return o&&"number"!=typeof o&&bi(t,n,o)&&(n=o=r),t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r,n){for(var o=-1,i=gr(ft((t-e)/(r||1)),0),a=Oe(i);i--;)a[n?i:++o]=e,e+=r;return a}(t,n,o=o===r?t<n?1:-1:cs(o),e)}}function Ho(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ms(t),r=ms(r)),e(t,r)}}function Wo(e,t,n,o,i,s,l,p,d,u){var c=8&t;t|=c?a:64,4&(t&=~(c?64:a))||(t&=-4);var f=[e,t,i,c?s:r,c?l:r,c?r:s,c?r:l,p,d,u],h=n.apply(r,f);return wi(e)&&Di(h,f),h.placeholder=o,ji(h,e,t)}function Jo(e){var t=Pe[e];return function(e,r){if(e=ms(e),(r=null==r?0:yr(fs(r),292))&&Gt(e)){var n=(ys(e)+"e").split("e");return+((n=(ys(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yo=Er&&1/sr(new Er([,-0]))[1]==p?function(e){return new Er(e)}:sl;function Ko(e){return function(t){var r=hi(t);return r==w?or(t):r==T?lr(t):function(e,t){return kt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xo(e,t,o,p,d,u,c,f){var h=2&t;if(!h&&"function"!=typeof e)throw new Re(n);var m=p?p.length:0;if(m||(t&=-97,p=d=r),c=c===r?c:gr(fs(c),0),f=f===r?f:fs(f),m-=d?d.length:0,64&t){var g=p,y=d;p=d=r}var v=h?r:ii(e),b=[e,t,o,p,d,g,y,u,c,f];if(v&&function(e,t){var r=e[1],n=t[1],o=r|n,a=o<131,p=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!p)return e;1&n&&(e[2]=t[2],o|=1&r?0:4);var d=t[3];if(d){var u=e[3];e[3]=u?Co(u,d,t[4]):d,e[4]=u?ar(e[3],i):t[4]}d=t[5],d&&(u=e[5],e[5]=u?Ro(u,d,t[6]):d,e[6]=u?ar(e[5],i):t[6]);d=t[7],d&&(e[7]=d);n&s&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(b,v),e=b[0],t=b[1],o=b[2],p=b[3],d=b[4],!(f=b[9]=b[9]===r?h?0:e.length:gr(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)O=8==t||16==t?function(e,t,n){var o=Mo(e);return function i(){for(var a=arguments.length,s=Oe(a),l=a,p=si(i);l--;)s[l]=arguments[l];var d=a<3&&s[0]!==p&&s[a-1]!==p?[]:ar(s,p);return(a-=d.length)<n?Wo(e,t,Bo,i.placeholder,r,s,d,r,r,n-a):_t(this&&this!==ut&&this instanceof i?o:e,this,s)}}(e,t,f):t!=a&&33!=t||d.length?Bo.apply(r,b):function(e,t,r,n){var o=1&t,i=Mo(e);return function t(){for(var a=-1,s=arguments.length,l=-1,p=n.length,d=Oe(p+s),u=this&&this!==ut&&this instanceof t?i:e;++l<p;)d[l]=n[l];for(;s--;)d[l++]=arguments[++a];return _t(u,o?r:this,d)}}(e,t,o,p);else var O=function(e,t,r){var n=1&t,o=Mo(e);return function t(){return(this&&this!==ut&&this instanceof t?o:e).apply(n?r:this,arguments)}}(e,t,o);return ji((v?Zn:Di)(O,b),e,t)}function Qo(e,t,n,o){return e===r||Fa(e,ke[n])&&!Ne.call(o,n)?t:e}function Zo(e,t,n,o,i,a){return Za(e)&&Za(t)&&(a.set(t,e),Vn(e,t,r,Zo,a),a.delete(t)),e}function ei(e){return ns(e)?r:e}function ti(e,t,n,o,i,a){var s=1&n,l=e.length,p=t.length;if(l!=p&&!(s&&p>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var c=-1,f=!0,h=2&n?new Hr:r;for(a.set(e,t),a.set(t,e);++c<l;){var m=e[c],g=t[c];if(o)var y=s?o(g,m,c,t,e,a):o(m,g,c,e,t,a);if(y!==r){if(y)continue;f=!1;break}if(h){if(!It(t,function(e,t){if(!Xt(h,t)&&(m===e||i(m,e,n,o,a)))return h.push(t)})){f=!1;break}}else if(m!==g&&!i(m,g,n,o,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function ri(e){return ki(Ti(e,r,Gi),e+"")}function ni(e){return _n(e,xs,ci)}function oi(e){return _n(e,ks,fi)}var ii=Rr?function(e){return Rr.get(e)}:sl;function ai(e){for(var t=e.name+"",r=Dr[t],n=Ne.call(Dr,t)?r.length:0;n--;){var o=r[n],i=o.func;if(null==i||i==e)return o.name}return t}function si(e){return(Ne.call(Lr,"placeholder")?Lr:e).placeholder}function li(){var e=Lr.iteratee||nl;return e=e===nl?Nn:e,arguments.length?e(arguments[0],arguments[1]):e}function pi(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function di(e){for(var t=xs(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Pi(o)]}return t}function ui(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return An(n)?n:r}var ci=gt?function(e){return null==e?[]:(e=Ee(e),Rt(gt(e),function(t){return We.call(e,t)}))}:hl,fi=gt?function(e){for(var t=[];e;)jt(t,ci(e)),e=ze(e);return t}:hl,hi=Pn;function mi(e,t,r){for(var n=-1,o=(t=bo(t,e)).length,i=!1;++n<o;){var a=qi(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&Qa(o)&&vi(a,o)&&($a(e)||Ua(e))}function gi(e){return"function"!=typeof e.constructor||_i(e)?{}:Fr(ze(e))}function yi(e){return $a(e)||Ua(e)||!!(Ye&&e&&e[Ye])}function vi(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function bi(e,t,r){if(!Za(r))return!1;var n=typeof t;return!!("number"==n?za(r)&&vi(t,r.length):"string"==n&&t in r)&&Fa(r[t],e)}function Oi(e,t){if($a(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||(Q.test(e)||!X.test(e)||null!=t&&e in Ee(t))}function wi(e){var t=ai(e),r=Lr[t];if("function"!=typeof r||!(t in Ur.prototype))return!1;if(e===r)return!0;var n=ii(r);return!!n&&e===n[0]}(Sr&&hi(new Sr(new ArrayBuffer(1)))!=k||_r&&hi(new _r)!=w||Pr&&hi(Pr.resolve())!=P||Er&&hi(new Er)!=T||Tr&&hi(new Tr)!=D)&&(hi=function(e){var t=Pn(e),n=t==_?e.constructor:r,o=n?Mi(n):"";if(o)switch(o){case xr:return k;case kr:return w;case jr:return P;case Ar:return T;case Nr:return D}return t});var Si=je?Ka:ml;function _i(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ke)}function Pi(e){return e==e&&!Za(e)}function Ei(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Ee(n)))}}function Ti(e,t,n){return t=gr(t===r?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=gr(r.length-t,0),a=Oe(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Oe(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),_t(e,this,s)}}function Ci(e,t){return t.length<2?e:Sn(e,ro(t,0,-1))}function Ri(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Di=Ai(Zn),xi=ct||function(e,t){return ut.setTimeout(e,t)},ki=Ai(eo);function ji(e,t,r){var n=t+"";return ki(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Et(f,function(r){var n="_."+r[0];t&r[1]&&!Dt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(ae):[]}(n),r)))}function Ai(e){var t=0,n=0;return function(){var o=vr(),i=16-(o-n);if(n=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ni(e,t){var n=-1,o=e.length,i=o-1;for(t=t===r?o:t;++n<t;){var a=Wn(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ii=function(e){var t=Aa(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Z,function(e,r,n,o){t.push(n?o.replace(pe,"$1"):r||e)}),t});function qi(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mi(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Li(e){if(e instanceof Ur)return e.clone();var t=new Vr(e.__wrapped__,e.__chain__);return t.__actions__=Do(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fi=Yn(function(e,t){return Ha(e)?dn(e,gn(t,1,Ha,!0)):[]}),Bi=Yn(function(e,t){var n=Yi(t);return Ha(n)&&(n=r),Ha(e)?dn(e,gn(t,1,Ha,!0),li(n,2)):[]}),Vi=Yn(function(e,t){var n=Yi(t);return Ha(n)&&(n=r),Ha(e)?dn(e,gn(t,1,Ha,!0),r,n):[]});function Ui(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:fs(r);return o<0&&(o=gr(n+o,0)),Lt(e,li(t,3),o)}function $i(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return n!==r&&(i=fs(n),i=n<0?gr(o+i,0):yr(i,o-1)),Lt(e,li(t,3),i,!0)}function Gi(e){return(null==e?0:e.length)?gn(e,1):[]}function zi(e){return e&&e.length?e[0]:r}var Hi=Yn(function(e){var t=kt(e,yo);return t.length&&t[0]===e[0]?Rn(t):[]}),Wi=Yn(function(e){var t=Yi(e),n=kt(e,yo);return t===Yi(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Rn(n,li(t,2)):[]}),Ji=Yn(function(e){var t=Yi(e),n=kt(e,yo);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Rn(n,r,t):[]});function Yi(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ki=Yn(Xi);function Xi(e,t){return e&&e.length&&t&&t.length?zn(e,t):e}var Qi=ri(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Hn(e,kt(t,function(e){return vi(e,r)?+e:e}).sort(To)),n});function Zi(e){return null==e?e:wr.call(e)}var ea=Yn(function(e){return po(gn(e,1,Ha,!0))}),ta=Yn(function(e){var t=Yi(e);return Ha(t)&&(t=r),po(gn(e,1,Ha,!0),li(t,2))}),ra=Yn(function(e){var t=Yi(e);return t="function"==typeof t?t:r,po(gn(e,1,Ha,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Rt(e,function(e){if(Ha(e))return t=gr(e.length,t),!0}),Wt(t,function(t){return kt(e,$t(t))})}function oa(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:kt(n,function(e){return _t(t,r,e)})}var ia=Yn(function(e,t){return Ha(e)?dn(e,t):[]}),aa=Yn(function(e){return mo(Rt(e,Ha))}),sa=Yn(function(e){var t=Yi(e);return Ha(t)&&(t=r),mo(Rt(e,Ha),li(t,2))}),la=Yn(function(e){var t=Yi(e);return t="function"==typeof t?t:r,mo(Rt(e,Ha),r,t)}),pa=Yn(na);var da=Yn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,oa(e,n)});function ua(e){var t=Lr(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var fa=ri(function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,i=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Ur&&vi(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:ca,args:[i],thisArg:r}),new Vr(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(i)});var ha=ko(function(e,t,r){Ne.call(e,r)?++e[r]:nn(e,r,1)});var ma=Lo(Ui),ga=Lo($i);function ya(e,t){return($a(e)?Et:un)(e,li(t,3))}function va(e,t){return($a(e)?Tt:cn)(e,li(t,3))}var ba=ko(function(e,t,r){Ne.call(e,r)?e[r].push(t):nn(e,r,[t])});var Oa=Yn(function(e,t,r){var n=-1,o="function"==typeof t,i=za(e)?Oe(e.length):[];return un(e,function(e){i[++n]=o?_t(t,e,r):Dn(e,t,r)}),i}),wa=ko(function(e,t,r){nn(e,r,t)});function Sa(e,t){return($a(e)?kt:Ln)(e,li(t,3))}var _a=ko(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var Pa=Yn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bi(e,t[0],t[1])?t=[]:r>2&&bi(t[0],t[1],t[2])&&(t=[t[0]]),$n(e,gn(t,1),[])}),Ea=dt||function(){return ut.Date.now()};function Ta(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Xo(e,s,r,r,r,r,t)}function Ca(e,t){var o;if("function"!=typeof t)throw new Re(n);return e=fs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=r),o}}var Ra=Yn(function(e,t,r){var n=1;if(r.length){var o=ar(r,si(Ra));n|=a}return Xo(e,n,t,r,o)}),Da=Yn(function(e,t,r){var n=3;if(r.length){var o=ar(r,si(Da));n|=a}return Xo(t,n,e,r,o)});function xa(e,t,o){var i,a,s,l,p,d,u=0,c=!1,f=!1,h=!0;if("function"!=typeof e)throw new Re(n);function m(t){var n=i,o=a;return i=a=r,u=t,l=e.apply(o,n)}function g(e){var n=e-d;return d===r||n>=t||n<0||f&&e-u>=s}function y(){var e=Ea();if(g(e))return v(e);p=xi(y,function(e){var r=t-(e-d);return f?yr(r,s-(e-u)):r}(e))}function v(e){return p=r,h&&i?m(e):(i=a=r,l)}function b(){var e=Ea(),n=g(e);if(i=arguments,a=this,d=e,n){if(p===r)return function(e){return u=e,p=xi(y,t),c?m(e):l}(d);if(f)return So(p),p=xi(y,t),m(d)}return p===r&&(p=xi(y,t)),l}return t=ms(t)||0,Za(o)&&(c=!!o.leading,s=(f="maxWait"in o)?gr(ms(o.maxWait)||0,t):s,h="trailing"in o?!!o.trailing:h),b.cancel=function(){p!==r&&So(p),u=0,i=d=a=p=r},b.flush=function(){return p===r?l:v(Ea())},b}var ka=Yn(function(e,t){return pn(e,1,t)}),ja=Yn(function(e,t,r){return pn(e,ms(t)||0,r)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Re(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Aa.Cache||zr),r}function Na(e){if("function"!=typeof e)throw new Re(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=zr;var Ia=Oo(function(e,t){var r=(t=1==t.length&&$a(t[0])?kt(t[0],Yt(li())):kt(gn(t,1),Yt(li()))).length;return Yn(function(n){for(var o=-1,i=yr(n.length,r);++o<i;)n[o]=t[o].call(this,n[o]);return _t(e,this,n)})}),qa=Yn(function(e,t){var n=ar(t,si(qa));return Xo(e,a,r,t,n)}),Ma=Yn(function(e,t){var n=ar(t,si(Ma));return Xo(e,64,r,t,n)}),La=ri(function(e,t){return Xo(e,l,r,r,r,t)});function Fa(e,t){return e===t||e!=e&&t!=t}var Ba=Ho(En),Va=Ho(function(e,t){return e>=t}),Ua=xn(function(){return arguments}())?xn:function(e){return es(e)&&Ne.call(e,"callee")&&!We.call(e,"callee")},$a=Oe.isArray,Ga=yt?Yt(yt):function(e){return es(e)&&Pn(e)==x};function za(e){return null!=e&&Qa(e.length)&&!Ka(e)}function Ha(e){return es(e)&&za(e)}var Wa=qt||ml,Ja=vt?Yt(vt):function(e){return es(e)&&Pn(e)==y};function Ya(e){if(!es(e))return!1;var t=Pn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Za(e))return!1;var t=Pn(e);return t==b||t==O||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==fs(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Yt(bt):function(e){return es(e)&&hi(e)==w};function rs(e){return"number"==typeof e||es(e)&&Pn(e)==S}function ns(e){if(!es(e)||Pn(e)!=_)return!1;var t=ze(e);if(null===t)return!0;var r=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ae.call(r)==Le}var os=Ot?Yt(Ot):function(e){return es(e)&&Pn(e)==E};var is=wt?Yt(wt):function(e){return es(e)&&hi(e)==T};function as(e){return"string"==typeof e||!$a(e)&&es(e)&&Pn(e)==C}function ss(e){return"symbol"==typeof e||es(e)&&Pn(e)==R}var ls=St?Yt(St):function(e){return es(e)&&Qa(e.length)&&!!ot[Pn(e)]};var ps=Ho(Mn),ds=Ho(function(e,t){return e<=t});function us(e){if(!e)return[];if(za(e))return as(e)?dr(e):Do(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=hi(e);return(t==w?or:t==T?sr:Fs)(e)}function cs(e){return e?(e=ms(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=cs(e),r=t%1;return t==t?r?t-r:t:0}function hs(e){return e?an(fs(e),0,c):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return u;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var r=fe.test(e);return r||me.test(e)?lt(e.slice(2),r?2:8):ce.test(e)?u:+e}function gs(e){return xo(e,ks(e))}function ys(e){return null==e?"":lo(e)}var vs=jo(function(e,t){if(_i(t)||za(t))xo(t,xs(t),e);else for(var r in t)Ne.call(t,r)&&Zr(e,r,t[r])}),bs=jo(function(e,t){xo(t,ks(t),e)}),Os=jo(function(e,t,r,n){xo(t,ks(t),e,n)}),ws=jo(function(e,t,r,n){xo(t,xs(t),e,n)}),Ss=ri(on);var _s=Yn(function(e,t){e=Ee(e);var n=-1,o=t.length,i=o>2?t[2]:r;for(i&&bi(t[0],t[1],i)&&(o=1);++n<o;)for(var a=t[n],s=ks(a),l=-1,p=s.length;++l<p;){var d=s[l],u=e[d];(u===r||Fa(u,ke[d])&&!Ne.call(e,d))&&(e[d]=a[d])}return e}),Ps=Yn(function(e){return e.push(r,Zo),_t(As,r,e)});function Es(e,t,n){var o=null==e?r:Sn(e,t);return o===r?n:o}function Ts(e,t){return null!=e&&mi(e,t,Cn)}var Cs=Vo(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=r},Zs(rl)),Rs=Vo(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),Ne.call(e,t)?e[t].push(r):e[t]=[r]},li),Ds=Yn(Dn);function xs(e){return za(e)?Jr(e):In(e)}function ks(e){return za(e)?Jr(e,!0):qn(e)}var js=jo(function(e,t,r){Vn(e,t,r)}),As=jo(function(e,t,r,n){Vn(e,t,r,n)}),Ns=ri(function(e,t){var r={};if(null==e)return r;var n=!1;t=kt(t,function(t){return t=bo(t,e),n||(n=t.length>1),t}),xo(e,oi(e),r),n&&(r=sn(r,7,ei));for(var o=t.length;o--;)uo(r,t[o]);return r});var Is=ri(function(e,t){return null==e?{}:function(e,t){return Gn(e,t,function(t,r){return Ts(e,r)})}(e,t)});function qs(e,t){if(null==e)return{};var r=kt(oi(e),function(e){return[e]});return t=li(t),Gn(e,r,function(e,r){return t(e,r[0])})}var Ms=Ko(xs),Ls=Ko(ks);function Fs(e){return null==e?[]:Kt(e,xs(e))}var Bs=qo(function(e,t,r){return t=t.toLowerCase(),e+(r?Vs(t):t)});function Vs(e){return Ys(ys(e).toLowerCase())}function Us(e){return(e=ys(e))&&e.replace(ye,er).replace(Xe,"")}var $s=qo(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Gs=qo(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),zs=Io("toLowerCase");var Hs=qo(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Ws=qo(function(e,t,r){return e+(r?" ":"")+Ys(t)});var Js=qo(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Ys=Io("toUpperCase");function Ks(e,t,n){return e=ys(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Xs=Yn(function(e,t){try{return _t(e,r,t)}catch(e){return Ya(e)?e:new Se(e)}}),Qs=ri(function(e,t){return Et(t,function(t){t=qi(t),nn(e,t,Ra(e[t],e))}),e});function Zs(e){return function(){return e}}var el=Fo(),tl=Fo(!0);function rl(e){return e}function nl(e){return Nn("function"==typeof e?e:sn(e,1))}var ol=Yn(function(e,t){return function(r){return Dn(r,e,t)}}),il=Yn(function(e,t){return function(r){return Dn(e,r,t)}});function al(e,t,r){var n=xs(t),o=wn(t,n);null!=r||Za(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=wn(t,xs(t)));var i=!(Za(r)&&"chain"in r&&!r.chain),a=Ka(e);return Et(o,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=e(this.__wrapped__);return(r.__actions__=Do(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})}),e}function sl(){}var ll=$o(kt),pl=$o(Ct),dl=$o(It);function ul(e){return Oi(e)?$t(qi(e)):function(e){return function(t){return Sn(t,e)}}(e)}var cl=zo(),fl=zo(!0);function hl(){return[]}function ml(){return!1}var gl=Uo(function(e,t){return e+t},0),yl=Jo("ceil"),vl=Uo(function(e,t){return e/t},1),bl=Jo("floor");var Ol,wl=Uo(function(e,t){return e*t},1),Sl=Jo("round"),_l=Uo(function(e,t){return e-t},0);return Lr.after=function(e,t){if("function"!=typeof t)throw new Re(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Ta,Lr.assign=vs,Lr.assignIn=bs,Lr.assignInWith=Os,Lr.assignWith=ws,Lr.at=Ss,Lr.before=Ca,Lr.bind=Ra,Lr.bindAll=Qs,Lr.bindKey=Da,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Lr.chain=ua,Lr.chunk=function(e,t,n){t=(n?bi(e,t,n):t===r)?1:gr(fs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=Oe(ft(o/t));i<o;)s[a++]=ro(e,i,i+=t);return s},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,o=[];++t<r;){var i=e[t];i&&(o[n++]=i)}return o},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Oe(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return jt($a(r)?Do(r):[r],gn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=li();return e=t?kt(e,function(e){if("function"!=typeof e[1])throw new Re(n);return[r(e[0]),e[1]]}):[],Yn(function(r){for(var n=-1;++n<t;){var o=e[n];if(_t(o[0],this,r))return _t(o[1],this,r)}})},Lr.conforms=function(e){return function(e){var t=xs(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Lr.constant=Zs,Lr.countBy=ha,Lr.create=function(e,t){var r=Fr(e);return null==t?r:rn(r,t)},Lr.curry=function e(t,n,o){var i=Xo(t,8,r,r,r,r,r,n=o?r:n);return i.placeholder=e.placeholder,i},Lr.curryRight=function e(t,n,o){var i=Xo(t,16,r,r,r,r,r,n=o?r:n);return i.placeholder=e.placeholder,i},Lr.debounce=xa,Lr.defaults=_s,Lr.defaultsDeep=Ps,Lr.defer=ka,Lr.delay=ja,Lr.difference=Fi,Lr.differenceBy=Bi,Lr.differenceWith=Vi,Lr.drop=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,(t=n||t===r?1:fs(t))<0?0:t,o):[]},Lr.dropRight=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,0,(t=o-(t=n||t===r?1:fs(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!0):[]},Lr.fill=function(e,t,n,o){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bi(e,t,n)&&(n=0,o=i),function(e,t,n,o){var i=e.length;for((n=fs(n))<0&&(n=-n>i?0:i+n),(o=o===r||o>i?i:fs(o))<0&&(o+=i),o=n>o?0:hs(o);n<o;)e[n++]=t;return e}(e,t,n,o)):[]},Lr.filter=function(e,t){return($a(e)?Rt:mn)(e,li(t,3))},Lr.flatMap=function(e,t){return gn(Sa(e,t),1)},Lr.flatMapDeep=function(e,t){return gn(Sa(e,t),p)},Lr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),gn(Sa(e,t),n)},Lr.flatten=Gi,Lr.flattenDeep=function(e){return(null==e?0:e.length)?gn(e,p):[]},Lr.flattenDepth=function(e,t){return(null==e?0:e.length)?gn(e,t=t===r?1:fs(t)):[]},Lr.flip=function(e){return Xo(e,512)},Lr.flow=el,Lr.flowRight=tl,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var o=e[t];n[o[0]]=o[1]}return n},Lr.functions=function(e){return null==e?[]:wn(e,xs(e))},Lr.functionsIn=function(e){return null==e?[]:wn(e,ks(e))},Lr.groupBy=ba,Lr.initial=function(e){return(null==e?0:e.length)?ro(e,0,-1):[]},Lr.intersection=Hi,Lr.intersectionBy=Wi,Lr.intersectionWith=Ji,Lr.invert=Cs,Lr.invertBy=Rs,Lr.invokeMap=Oa,Lr.iteratee=nl,Lr.keyBy=wa,Lr.keys=xs,Lr.keysIn=ks,Lr.map=Sa,Lr.mapKeys=function(e,t){var r={};return t=li(t,3),bn(e,function(e,n,o){nn(r,t(e,n,o),e)}),r},Lr.mapValues=function(e,t){var r={};return t=li(t,3),bn(e,function(e,n,o){nn(r,n,t(e,n,o))}),r},Lr.matches=function(e){return Fn(sn(e,1))},Lr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Lr.memoize=Aa,Lr.merge=js,Lr.mergeWith=As,Lr.method=ol,Lr.methodOf=il,Lr.mixin=al,Lr.negate=Na,Lr.nthArg=function(e){return e=fs(e),Yn(function(t){return Un(t,e)})},Lr.omit=Ns,Lr.omitBy=function(e,t){return qs(e,Na(li(t)))},Lr.once=function(e){return Ca(2,e)},Lr.orderBy=function(e,t,n,o){return null==e?[]:($a(t)||(t=null==t?[]:[t]),$a(n=o?r:n)||(n=null==n?[]:[n]),$n(e,t,n))},Lr.over=ll,Lr.overArgs=Ia,Lr.overEvery=pl,Lr.overSome=dl,Lr.partial=qa,Lr.partialRight=Ma,Lr.partition=_a,Lr.pick=Is,Lr.pickBy=qs,Lr.property=ul,Lr.propertyOf=function(e){return function(t){return null==e?r:Sn(e,t)}},Lr.pull=Ki,Lr.pullAll=Xi,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?zn(e,t,li(r,2)):e},Lr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?zn(e,t,r,n):e},Lr.pullAt=Qi,Lr.range=cl,Lr.rangeRight=fl,Lr.rearg=La,Lr.reject=function(e,t){return($a(e)?Rt:mn)(e,Na(li(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,o=[],i=e.length;for(t=li(t,3);++n<i;){var a=e[n];t(a,n,e)&&(r.push(a),o.push(n))}return Hn(e,o),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new Re(n);return Yn(e,t=t===r?t:fs(t))},Lr.reverse=Zi,Lr.sampleSize=function(e,t,n){return t=(n?bi(e,t,n):t===r)?1:fs(t),($a(e)?Kr:Xn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Qn(e,t,r)},Lr.setWith=function(e,t,n,o){return o="function"==typeof o?o:r,null==e?e:Qn(e,t,n,o)},Lr.shuffle=function(e){return($a(e)?Xr:to)(e)},Lr.slice=function(e,t,n){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bi(e,t,n)?(t=0,n=o):(t=null==t?0:fs(t),n=n===r?o:fs(n)),ro(e,t,n)):[]},Lr.sortBy=Pa,Lr.sortedUniq=function(e){return e&&e.length?ao(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ao(e,li(t,2)):[]},Lr.split=function(e,t,n){return n&&"number"!=typeof n&&bi(e,t,n)&&(t=n=r),(n=n===r?c:n>>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=lo(t))&&nr(e)?wo(dr(e),0,n):e.split(t,n):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new Re(n);return t=null==t?0:gr(fs(t),0),Yn(function(r){var n=r[t],o=wo(r,0,t);return n&&jt(o,n),_t(e,this,o)})},Lr.tail=function(e){var t=null==e?0:e.length;return t?ro(e,1,t):[]},Lr.take=function(e,t,n){return e&&e.length?ro(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Lr.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,(t=o-(t=n||t===r?1:fs(t)))<0?0:t,o):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?fo(e,li(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new Re(n);return Za(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),xa(e,t,{leading:o,maxWait:t,trailing:i})},Lr.thru=ca,Lr.toArray=us,Lr.toPairs=Ms,Lr.toPairsIn=Ls,Lr.toPath=function(e){return $a(e)?kt(e,qi):ss(e)?[e]:Do(Ii(ys(e)))},Lr.toPlainObject=gs,Lr.transform=function(e,t,r){var n=$a(e),o=n||Wa(e)||ls(e);if(t=li(t,4),null==r){var i=e&&e.constructor;r=o?n?new i:[]:Za(e)&&Ka(i)?Fr(ze(e)):{}}return(o?Et:bn)(e,function(e,n,o){return t(r,e,n,o)}),r},Lr.unary=function(e){return Ta(e,1)},Lr.union=ea,Lr.unionBy=ta,Lr.unionWith=ra,Lr.uniq=function(e){return e&&e.length?po(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?po(e,li(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?po(e,r,t):[]},Lr.unset=function(e,t){return null==e||uo(e,t)},Lr.unzip=na,Lr.unzipWith=oa,Lr.update=function(e,t,r){return null==e?e:co(e,t,vo(r))},Lr.updateWith=function(e,t,n,o){return o="function"==typeof o?o:r,null==e?e:co(e,t,vo(n),o)},Lr.values=Fs,Lr.valuesIn=function(e){return null==e?[]:Kt(e,ks(e))},Lr.without=ia,Lr.words=Ks,Lr.wrap=function(e,t){return qa(vo(t),e)},Lr.xor=aa,Lr.xorBy=sa,Lr.xorWith=la,Lr.zip=pa,Lr.zipObject=function(e,t){return go(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return go(e||[],t||[],Qn)},Lr.zipWith=da,Lr.entries=Ms,Lr.entriesIn=Ls,Lr.extend=bs,Lr.extendWith=Os,al(Lr,Lr),Lr.add=gl,Lr.attempt=Xs,Lr.camelCase=Bs,Lr.capitalize=Vs,Lr.ceil=yl,Lr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ms(n))==n?n:0),t!==r&&(t=(t=ms(t))==t?t:0),an(ms(e),t,n)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Lr.conformsTo=function(e,t){return null==t||ln(e,t,xs(t))},Lr.deburr=Us,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=vl,Lr.endsWith=function(e,t,n){e=ys(e),t=lo(t);var o=e.length,i=n=n===r?o:an(fs(n),0,o);return(n-=t.length)>=0&&e.slice(n,i)==t},Lr.eq=Fa,Lr.escape=function(e){return(e=ys(e))&&W.test(e)?e.replace(z,tr):e},Lr.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Lr.every=function(e,t,n){var o=$a(e)?Ct:fn;return n&&bi(e,t,n)&&(t=r),o(e,li(t,3))},Lr.find=ma,Lr.findIndex=Ui,Lr.findKey=function(e,t){return Mt(e,li(t,3),bn)},Lr.findLast=ga,Lr.findLastIndex=$i,Lr.findLastKey=function(e,t){return Mt(e,li(t,3),On)},Lr.floor=bl,Lr.forEach=ya,Lr.forEachRight=va,Lr.forIn=function(e,t){return null==e?e:yn(e,li(t,3),ks)},Lr.forInRight=function(e,t){return null==e?e:vn(e,li(t,3),ks)},Lr.forOwn=function(e,t){return e&&bn(e,li(t,3))},Lr.forOwnRight=function(e,t){return e&&On(e,li(t,3))},Lr.get=Es,Lr.gt=Ba,Lr.gte=Va,Lr.has=function(e,t){return null!=e&&mi(e,t,Tn)},Lr.hasIn=Ts,Lr.head=zi,Lr.identity=rl,Lr.includes=function(e,t,r,n){e=za(e)?e:Fs(e),r=r&&!n?fs(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),as(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&Ft(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:fs(r);return o<0&&(o=gr(n+o,0)),Ft(e,t,o)},Lr.inRange=function(e,t,n){return t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r){return e>=yr(t,r)&&e<gr(t,r)}(e=ms(e),t,n)},Lr.invoke=Ds,Lr.isArguments=Ua,Lr.isArray=$a,Lr.isArrayBuffer=Ga,Lr.isArrayLike=za,Lr.isArrayLikeObject=Ha,Lr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Pn(e)==g},Lr.isBuffer=Wa,Lr.isDate=Ja,Lr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(za(e)&&($a(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||ls(e)||Ua(e)))return!e.length;var t=hi(e);if(t==w||t==T)return!e.size;if(_i(e))return!In(e).length;for(var r in e)if(Ne.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return kn(e,t)},Lr.isEqualWith=function(e,t,n){var o=(n="function"==typeof n?n:r)?n(e,t):r;return o===r?kn(e,t,r,n):!!o},Lr.isError=Ya,Lr.isFinite=function(e){return"number"==typeof e&&Gt(e)},Lr.isFunction=Ka,Lr.isInteger=Xa,Lr.isLength=Qa,Lr.isMap=ts,Lr.isMatch=function(e,t){return e===t||jn(e,t,di(t))},Lr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,jn(e,t,di(t),n)},Lr.isNaN=function(e){return rs(e)&&e!=+e},Lr.isNative=function(e){if(Si(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return An(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=rs,Lr.isObject=Za,Lr.isObjectLike=es,Lr.isPlainObject=ns,Lr.isRegExp=os,Lr.isSafeInteger=function(e){return Xa(e)&&e>=-9007199254740991&&e<=d},Lr.isSet=is,Lr.isString=as,Lr.isSymbol=ss,Lr.isTypedArray=ls,Lr.isUndefined=function(e){return e===r},Lr.isWeakMap=function(e){return es(e)&&hi(e)==D},Lr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Pn(e)},Lr.join=function(e,t){return null==e?"":hr.call(e,t)},Lr.kebabCase=$s,Lr.last=Yi,Lr.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var i=o;return n!==r&&(i=(i=fs(n))<0?gr(o+i,0):yr(i,o-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):Lt(e,Vt,i,!0)},Lr.lowerCase=Gs,Lr.lowerFirst=zs,Lr.lt=ps,Lr.lte=ds,Lr.max=function(e){return e&&e.length?hn(e,rl,En):r},Lr.maxBy=function(e,t){return e&&e.length?hn(e,li(t,2),En):r},Lr.mean=function(e){return Ut(e,rl)},Lr.meanBy=function(e,t){return Ut(e,li(t,2))},Lr.min=function(e){return e&&e.length?hn(e,rl,Mn):r},Lr.minBy=function(e,t){return e&&e.length?hn(e,li(t,2),Mn):r},Lr.stubArray=hl,Lr.stubFalse=ml,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wl,Lr.nth=function(e,t){return e&&e.length?Un(e,fs(t)):r},Lr.noConflict=function(){return ut._===this&&(ut._=Fe),this},Lr.noop=sl,Lr.now=Ea,Lr.pad=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return Go(mt(o),r)+e+Go(ft(o),r)},Lr.padEnd=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;return t&&n<t?e+Go(t-n,r):e},Lr.padStart=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;return t&&n<t?Go(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(ys(e).replace(re,""),t||0)},Lr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bi(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=cs(e),t===r?(t=e,e=0):t=cs(t)),e>t){var o=e;e=t,t=o}if(n||e%1||t%1){var i=Or();return yr(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return Wn(e,t)},Lr.reduce=function(e,t,r){var n=$a(e)?At:zt,o=arguments.length<3;return n(e,li(t,4),r,o,un)},Lr.reduceRight=function(e,t,r){var n=$a(e)?Nt:zt,o=arguments.length<3;return n(e,li(t,4),r,o,cn)},Lr.repeat=function(e,t,n){return t=(n?bi(e,t,n):t===r)?1:fs(t),Jn(ys(e),t)},Lr.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,n){var o=-1,i=(t=bo(t,e)).length;for(i||(i=1,e=r);++o<i;){var a=null==e?r:e[qi(t[o])];a===r&&(o=i,a=n),e=Ka(a)?a.call(e):a}return e},Lr.round=Sl,Lr.runInContext=e,Lr.sample=function(e){return($a(e)?Yr:Kn)(e)},Lr.size=function(e){if(null==e)return 0;if(za(e))return as(e)?pr(e):e.length;var t=hi(e);return t==w||t==T?e.size:In(e).length},Lr.snakeCase=Hs,Lr.some=function(e,t,n){var o=$a(e)?It:no;return n&&bi(e,t,n)&&(t=r),o(e,li(t,3))},Lr.sortedIndex=function(e,t){return oo(e,t)},Lr.sortedIndexBy=function(e,t,r){return io(e,t,li(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=oo(e,t);if(n<r&&Fa(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return oo(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return io(e,t,li(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=oo(e,t,!0)-1;if(Fa(e[r],t))return r}return-1},Lr.startCase=Ws,Lr.startsWith=function(e,t,r){return e=ys(e),r=null==r?0:an(fs(r),0,e.length),t=lo(t),e.slice(r,r+t.length)==t},Lr.subtract=_l,Lr.sum=function(e){return e&&e.length?Ht(e,rl):0},Lr.sumBy=function(e,t){return e&&e.length?Ht(e,li(t,2)):0},Lr.template=function(e,t,n){var o=Lr.templateSettings;n&&bi(e,t,n)&&(t=r),e=ys(e),t=Os({},t,o,Qo);var i,a,s=Os({},t.imports,o.imports,Qo),l=xs(s),p=Kt(s,l),d=0,u=t.interpolate||ve,c="__p += '",f=Te((t.escape||ve).source+"|"+u.source+"|"+(u===K?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,o,s,l){return n||(n=o),c+=e.slice(d,l).replace(be,rr),r&&(i=!0,c+="' +\n__e("+r+") +\n'"),s&&(a=!0,c+="';\n"+s+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=l+t.length,t}),c+="';\n";var m=Ne.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new Se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(a?c.replace(V,""):c).replace(U,"$1").replace($,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var g=Xs(function(){return _e(l,h+"return "+c).apply(r,p)});if(g.source=c,Ya(g))throw g;return g},Lr.times=function(e,t){if((e=fs(e))<1||e>d)return[];var r=c,n=yr(e,c);t=li(t),e-=c;for(var o=Wt(n,t);++r<e;)t(r);return o},Lr.toFinite=cs,Lr.toInteger=fs,Lr.toLength=hs,Lr.toLower=function(e){return ys(e).toLowerCase()},Lr.toNumber=ms,Lr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,d):0===e?e:0},Lr.toString=ys,Lr.toUpper=function(e){return ys(e).toUpperCase()},Lr.trim=function(e,t,n){if((e=ys(e))&&(n||t===r))return Jt(e);if(!e||!(t=lo(t)))return e;var o=dr(e),i=dr(t);return wo(o,Qt(o,i),Zt(o,i)+1).join("")},Lr.trimEnd=function(e,t,n){if((e=ys(e))&&(n||t===r))return e.slice(0,ur(e)+1);if(!e||!(t=lo(t)))return e;var o=dr(e);return wo(o,0,Zt(o,dr(t))+1).join("")},Lr.trimStart=function(e,t,n){if((e=ys(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=lo(t)))return e;var o=dr(e);return wo(o,Qt(o,dr(t))).join("")},Lr.truncate=function(e,t){var n=30,o="...";if(Za(t)){var i="separator"in t?t.separator:i;n="length"in t?fs(t.length):n,o="omission"in t?lo(t.omission):o}var a=(e=ys(e)).length;if(nr(e)){var s=dr(e);a=s.length}if(n>=a)return e;var l=n-pr(o);if(l<1)return o;var p=s?wo(s,0,l).join(""):e.slice(0,l);if(i===r)return p+o;if(s&&(l+=p.length-l),os(i)){if(e.slice(l).search(i)){var d,u=p;for(i.global||(i=Te(i.source,ys(ue.exec(i))+"g")),i.lastIndex=0;d=i.exec(u);)var c=d.index;p=p.slice(0,c===r?l:c)}}else if(e.indexOf(lo(i),l)!=l){var f=p.lastIndexOf(i);f>-1&&(p=p.slice(0,f))}return p+o},Lr.unescape=function(e){return(e=ys(e))&&H.test(e)?e.replace(G,cr):e},Lr.uniqueId=function(e){var t=++Ie;return ys(e)+t},Lr.upperCase=Js,Lr.upperFirst=Ys,Lr.each=ya,Lr.eachRight=va,Lr.first=zi,al(Lr,(Ol={},bn(Lr,function(e,t){Ne.call(Lr.prototype,t)||(Ol[t]=e)}),Ol),{chain:!1}),Lr.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Lr[e].placeholder=Lr}),Et(["drop","take"],function(e,t){Ur.prototype[e]=function(n){n=n===r?1:gr(fs(n),0);var o=this.__filtered__&&!t?new Ur(this):this.clone();return o.__filtered__?o.__takeCount__=yr(n,o.__takeCount__):o.__views__.push({size:yr(n,c),type:e+(o.__dir__<0?"Right":"")}),o},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Et(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:li(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),Et(["head","last"],function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}}),Et(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}}),Ur.prototype.compact=function(){return this.filter(rl)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=Yn(function(e,t){return"function"==typeof e?new Ur(this):this.map(function(r){return Dn(r,e,t)})}),Ur.prototype.reject=function(e){return this.filter(Na(li(e)))},Ur.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(c)},bn(Ur.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Lr[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Lr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Ur,p=s[0],d=l||$a(t),u=function(e){var t=i.apply(Lr,jt([e],s));return o&&c?t[0]:t};d&&n&&"function"==typeof p&&1!=p.length&&(l=d=!1);var c=this.__chain__,f=!!this.__actions__.length,h=a&&!c,m=l&&!f;if(!a&&d){t=m?t:new Ur(this);var g=e.apply(t,s);return g.__actions__.push({func:ca,args:[u],thisArg:r}),new Vr(g,c)}return h&&m?e.apply(this,s):(g=this.thru(u),h?o?g.value()[0]:g.value():g)})}),Et(["pop","push","shift","sort","splice","unshift"],function(e){var t=De[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($a(o)?o:[],e)}return this[r](function(r){return t.apply($a(r)?r:[],e)})}}),bn(Ur.prototype,function(e,t){var r=Lr[t];if(r){var n=r.name+"";Ne.call(Dr,n)||(Dr[n]=[]),Dr[n].push({name:t,func:r})}}),Dr[Bo(r,2).name]=[{name:"wrapper",func:r}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=Do(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Do(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Do(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$a(e),n=t<0,o=r?e.length:0,i=function(e,t,r){var n=-1,o=r.length;for(;++n<o;){var i=r[n],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yr(t,e+a);break;case"takeRight":e=gr(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,l=s-a,p=n?s:a-1,d=this.__iteratees__,u=d.length,c=0,f=yr(l,this.__takeCount__);if(!r||!n&&o==l&&f==l)return ho(e,this.__actions__);var h=[];e:for(;l--&&c<f;){for(var m=-1,g=e[p+=t];++m<u;){var y=d[m],v=y.iteratee,b=y.type,O=v(g);if(2==b)g=O;else if(!O){if(1==b)continue e;break e}}h[c++]=g}return h},Lr.prototype.at=fa,Lr.prototype.chain=function(){return ua(this)},Lr.prototype.commit=function(){return new Vr(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===r&&(this.__values__=us(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var o=Li(n);o.__index__=0,o.__values__=r,t?i.__wrapped__=o:t=o;var i=o;n=n.__wrapped__}return i.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Zi],thisArg:r}),new Vr(t,this.__chain__)}return this.thru(Zi)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return ho(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Qe&&(Lr.prototype[Qe]=function(){return this}),Lr}();ft?((ft.exports=fr)._=fr,ct._=fr):ut._=fr}).call(lodash)}(lodash$1,lodash$1.exports)),lodash$1.exports}var lodashExports=requireLodash(),OakSessions=function(){function e(e,t,r){this.sessionSecret=e,this.encryptionService=t,this.firestoreClient=r}return e.prototype.sealSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r;return __generator$1(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,sealData({loginHint:e,accessToken:t},{password:this.sessionSecret})];case 1:return[2,n.sent()];case 2:throw r=n.sent(),OakGoogleClassroomException.OakGoogleClassroomError("Failed to seal session","sealSession",{loginHint:e},lodashExports.isError(r)?r:void 0);case 3:return[2]}})})},e.prototype.decryptSession=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator$1(this,function(r){switch(r.label){case 0:return[4,unsealData(e,{password:this.sessionSecret})];case 1:return(null==(t=r.sent())?void 0:t.accessToken)&&(null==t?void 0:t.loginHint)?[2,t]:[2,null]}})})},e.prototype.getSessionAndUser=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.decryptSession(e)];case 1:return(t=i.sent())?[4,this.firestoreClient.getConnectedUserCredentials(t.loginHint)]:[2,null];case 2:return(r=i.sent())?(n=r.refreshToken?this.encryptionService.decryptString(r.refreshToken):void 0,r.refreshToken=n,process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN&&(r.refreshToken=process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN),r.profilePictureUrl&&(o=this.encryptionService.decryptString(r.profilePictureUrl),r.profilePictureUrl=o),[2,{session:t,user:r}]):[2,null]}})})},e.prototype.encryptCredentials=function(e,t){return{encryptedRefreshToken:e?this.encryptionService.encryptString(e):void 0,encryptedProfileUrl:t?this.encryptionService.encryptString(t):void 0}},e.prototype.saveUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.firestoreClient.upsertConnectedUserCredentials(e)];case 1:return t.sent(),[2]}})})},e}(),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.getUrl=function(e){var t=process.env.VERCEL_AUTOMATION_BYPASS_SECRET,r="production"!==process.env.VERCEL_ENV;if(t&&r){var n="x-vercel-protection-bypass=".concat(t,"&x-vercel-set-bypass-cookie=samesitenone");return"".concat(this.baseUrl).concat(e,"?").concat(n)}return"".concat(this.baseUrl).concat(e)},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:this.getUrl("/pupils/programmes/".concat(a,"/units/").concat(s,"/lessons/").concat(i))}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:this.getUrl("/pupils/programmes/".concat(a,"/units/").concat(s,"/lessons/").concat(i))},studentViewUri:{uri:this.getUrl("/classroom/pupil/programmes/".concat(a,"/").concat(s,"/").concat(i))}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),OakAttachment=function(){function e(e,t){this.baseUrl=e,this.firestoreClient=t}return e.prototype.createAttachment=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n;return __generator$1(this,function(o){switch(o.label){case 0:return[4,new GoogleClassroomClient(this.baseUrl,t).createAnnouncementAttachment(e)];case 1:return r=o.sent(),n=__assign(__assign({},r),{attachmentId:r.id,createdAt:(new Date).toISOString()}),[4,this.firestoreClient.upsertClassroomAttachment(n)];case 2:return o.sent(),[4,this.firestoreClient.getClassroomAttachmentById(r.id)];case 3:return[2,o.sent()]}})})},e}(),OakGoogleClassroomAddOn=function(){function e(e,t,r,n,o,i,a){var s=new EncryptionService(e),l=new FirestoreClient(t);this.oauthService=new OakOAuth(r,n,o),this.sessionService=new OakSessions(i,s,l),this.classroomAttachmentService=new OakAttachment(a,l)}return e.prototype.getGoogleSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t){return void 0===t&&(t=!1),__generator$1(this,function(r){return[2,this.oauthService.getSignInUrl(e,t)]})})},e.prototype.getPupilGoogleSignInUrl=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){return[2,this.oauthService.getSignInUrl(e,!1,!0)]})})},e.prototype.handleGoogleSignInCallback=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return[4,this.oauthService.exchangeCodeForTokens(e)];case 1:return r=s.sent(),n=this.sessionService.encryptCredentials(r.refreshToken,r.profilePictureUrl),o=n.encryptedRefreshToken,i=n.encryptedProfileUrl,[4,this.sessionService.sealSession(r.loginHint,r.accessToken)];case 2:return a=s.sent(),[4,this.sessionService.saveUserCredentials({refreshToken:o,profilePictureUrl:i,loginHint:r.loginHint})];case 3:return s.sent(),t&&r.email?[4,t(r.email)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2,{encryptedSession:a,accessToken:r.accessToken,profilePictureUrl:r.profilePictureUrl}]}})})},e.prototype.verifyAuthSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return e&&t?[4,this.sessionService.getSessionAndUser(e)]:[2,null];case 1:return(r=i.sent())&&r.session.accessToken===t?[4,this.oauthService.validateOrRefreshToken(t,r.user.refreshToken)]:[2,null];case 2:return(n=i.sent())?n.wasRefreshed?[4,this.sessionService.sealSession(r.session.loginHint,n.token)]:[3,4]:[2,null];case 3:return o=i.sent(),[3,5];case 4:o=e,i.label=5;case 5:return[2,{session:o,token:n.token,userProfilePicUrl:r.user.profilePictureUrl}]}})})},e.prototype.createAttachment=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.sessionService.getSessionAndUser(r)];case 1:if(!(n=i.sent())||t!==n.session.accessToken)throw OakGoogleClassroomException.OakGoogleClassroomError("Invalid Google Classroom session","createAttachment",{args:e});return o=this.oauthService.createClient(t,n.user.refreshToken),[2,this.classroomAttachmentService.createAttachment(e,o)]}})})},e}();exports.OakGoogleClassroomAddOn=OakGoogleClassroomAddOn,exports.OakGoogleClassroomException=OakGoogleClassroomException;
|
|
99
|
+
const privateData=new WeakMap,wrappers=new WeakMap;function pd(e){const t=privateData.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function setCancelFlag(e){null==e.passiveListener?e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault()):"undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}function Event(e,t){privateData.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(t);for(let e=0;e<r.length;++e){const t=r[e];t in this||Object.defineProperty(this,t,defineRedirectDescriptor(t))}}function defineRedirectDescriptor(e){return{get(){return pd(this).event[e]},set(t){pd(this).event[e]=t},configurable:!0,enumerable:!0}}function defineCallDescriptor(e){return{value(){const t=pd(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function defineWrapper(e,t){const r=Object.keys(t);if(0===r.length)return e;function n(t,r){e.call(this,t,r)}n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<r.length;++o){const i=r[o];if(!(i in e.prototype)){const e="function"==typeof Object.getOwnPropertyDescriptor(t,i).value;Object.defineProperty(n.prototype,i,e?defineCallDescriptor(i):defineRedirectDescriptor(i))}}return n}function getWrapper(e){if(null==e||e===Object.prototype)return Event;let t=wrappers.get(e);return null==t&&(t=defineWrapper(getWrapper(Object.getPrototypeOf(e)),e),wrappers.set(e,t)),t}function wrapEvent(e,t){return new(getWrapper(Object.getPrototypeOf(t)))(e,t)}function isStopped(e){return pd(e).immediateStopped}function setEventPhase(e,t){pd(e).eventPhase=t}function setCurrentTarget(e,t){pd(e).currentTarget=t}function setPassiveListener(e,t){pd(e).passiveListener=t}Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const e=pd(this).currentTarget;return null==e?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const e=pd(this);e.stopped=!0,"function"==typeof e.event.stopPropagation&&e.event.stopPropagation()},stopImmediatePropagation(){const e=pd(this);e.stopped=!0,e.immediateStopped=!0,"function"==typeof e.event.stopImmediatePropagation&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(pd(this).event.bubbles)},get cancelable(){return Boolean(pd(this).event.cancelable)},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return Boolean(pd(this).event.composed)},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(e){if(!e)return;const t=pd(this);t.stopped=!0,"boolean"==typeof t.event.cancelBubble&&(t.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(e){e||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));const listenersMap=new WeakMap,CAPTURE=1,BUBBLE=2,ATTRIBUTE=3;function isObject(e){return null!==e&&"object"==typeof e}function getListeners(e){const t=listenersMap.get(e);if(null==t)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function defineEventAttributeDescriptor(e){return{get(){let t=getListeners(this).get(e);for(;null!=t;){if(t.listenerType===ATTRIBUTE)return t.listener;t=t.next}return null},set(t){"function"==typeof t||isObject(t)||(t=null);const r=getListeners(this);let n=null,o=r.get(e);for(;null!=o;)o.listenerType===ATTRIBUTE?null!==n?n.next=o.next:null!==o.next?r.set(e,o.next):r.delete(e):n=o,o=o.next;if(null!==t){const o={listener:t,listenerType:ATTRIBUTE,passive:!1,once:!1,next:null};null===n?r.set(e,o):n.next=o}},configurable:!0,enumerable:!0}}function defineEventAttribute(e,t){Object.defineProperty(e,`on${t}`,defineEventAttributeDescriptor(t))}function defineCustomEventTarget(e){function t(){EventTarget.call(this)}t.prototype=Object.create(EventTarget.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r<e.length;++r)defineEventAttribute(t.prototype,e[r]);return t}function EventTarget(){if(!(this instanceof EventTarget)){if(1===arguments.length&&Array.isArray(arguments[0]))return defineCustomEventTarget(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return defineCustomEventTarget(e)}throw new TypeError("Cannot call a class as a function")}listenersMap.set(this,new Map)}EventTarget.prototype={addEventListener(e,t,r){if(null==t)return;if("function"!=typeof t&&!isObject(t))throw new TypeError("'listener' should be a function or an object.");const n=getListeners(this),o=isObject(r),i=(o?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE,a={listener:t,listenerType:i,passive:o&&Boolean(r.passive),once:o&&Boolean(r.once),next:null};let s=n.get(e);if(void 0===s)return void n.set(e,a);let l=null;for(;null!=s;){if(s.listener===t&&s.listenerType===i)return;l=s,s=s.next}l.next=a},removeEventListener(e,t,r){if(null==t)return;const n=getListeners(this),o=(isObject(r)?Boolean(r.capture):Boolean(r))?CAPTURE:BUBBLE;let i=null,a=n.get(e);for(;null!=a;){if(a.listener===t&&a.listenerType===o)return void(null!==i?i.next=a.next:null!==a.next?n.set(e,a.next):n.delete(e));i=a,a=a.next}},dispatchEvent(e){if(null==e||"string"!=typeof e.type)throw new TypeError('"event.type" should be a string.');const t=getListeners(this),r=e.type;let n=t.get(r);if(null==n)return!0;const o=wrapEvent(this,e);let i=null;for(;null!=n;){if(n.once?null!==i?i.next=n.next:null!==n.next?t.set(r,n.next):t.delete(r):i=n,setPassiveListener(o,n.passive?n.listener:null),"function"==typeof n.listener)try{n.listener.call(this,o)}catch(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}else n.listenerType!==ATTRIBUTE&&"function"==typeof n.listener.handleEvent&&n.listener.handleEvent(o);if(isStopped(o))break;n=n.next}return setPassiveListener(o,null),setEventPhase(o,0),setCurrentTarget(o,null),!o.defaultPrevented}},Object.defineProperty(EventTarget.prototype,"constructor",{value:EventTarget,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf(EventTarget.prototype,window.EventTarget.prototype);class AbortSignal extends EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const e=abortedFlags.get(this);if("boolean"!=typeof e)throw new TypeError("Expected 'this' to be an 'AbortSignal' object, but got "+(null===this?"null":typeof this));return e}}function createAbortSignal(){const e=Object.create(AbortSignal.prototype);return EventTarget.call(e),abortedFlags.set(e,!1),e}function abortSignal(e){!1===abortedFlags.get(e)&&(abortedFlags.set(e,!0),e.dispatchEvent({type:"abort"}))}defineEventAttribute(AbortSignal.prototype,"abort");const abortedFlags=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});let AbortController$1=class{constructor(){signals.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}};const signals=new WeakMap;function getSignal(e){const t=signals.get(e);if(null==t)throw new TypeError("Expected 'this' to be an 'AbortController' object, but got "+(null===e?"null":typeof e));return t}Object.defineProperties(AbortController$1.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(AbortController$1.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});var abortController=Object.freeze({__proto__:null,AbortController:AbortController$1,AbortSignal:AbortSignal,default:AbortController$1}),require$$1=getAugmentedNamespace(abortController),streamArrayParser={},hasRequiredStreamArrayParser,hasRequiredFallbackServiceStub;function requireStreamArrayParser(){if(hasRequiredStreamArrayParser)return streamArrayParser;hasRequiredStreamArrayParser=1,Object.defineProperty(streamArrayParser,"__esModule",{value:!0}),streamArrayParser.StreamArrayParser=void 0;const e=require$$1,t=Stream__default.default,r=requireFallbackRest(),n=requireFeatureDetection();class o extends t.Transform{constructor(t,r){super(Object.assign({},r,{readableObjectMode:!0})),this._done=!1,this._prevBlock=Buffer.from(""),this._isInString=!1,this._isSkipped=!1,this._level=0,this.rpc=t,this.cancelController=(0,n.hasAbortController)()?new AbortController:new e.AbortController,this.cancelSignal=this.cancelController.signal,this.cancelRequested=!1}_transform(e,t,n){let o=0,i=0;for(0===this._level&&0===i&&("["!==String.fromCharCode(e[0])&&this.emit("error",new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(e[0])}`)),i++,this._level++);i<e.length;){const t=String.fromCharCode(e[i]);if(this._isSkipped)this._isSkipped=!1;else switch(t){case"{":this._isInString||this._level++,this._isInString||2!==this._level||(o=i);break;case'"':this._isInString=!this._isInString;break;case"}":if(this._isInString||this._level--,!this._isInString&&1===this._level){const t=Buffer.concat([this._prevBlock,e.slice(o,i+1)]);try{const e=(0,r.decodeResponse)(this.rpc,!0,t);this.push(e)}catch(e){this.emit("error",e)}o=i+1,this._prevBlock=Buffer.from("")}break;case"]":this._isInString||1!==this._level||(this._done=!0,this.push(null));break;case"\\":this._isSkipped=!0}i++}this._level>1&&(this._prevBlock=Buffer.concat([this._prevBlock,e.slice(o,i)])),n()}_flush(e){e()}cancel(){this._done=!0,this.cancelRequested=!0,this.cancelController.abort(),this.end()}}return streamArrayParser.StreamArrayParser=o,streamArrayParser}function requireFallbackServiceStub(){if(hasRequiredFallbackServiceStub)return fallbackServiceStub;hasRequiredFallbackServiceStub=1,Object.defineProperty(fallbackServiceStub,"__esModule",{value:!0}),fallbackServiceStub.generateServiceStub=function(i,a,s,l,p,d,u,c){const f=(0,r.hasWindowFetch)()?window.fetch:e.default,h={close:()=>({cancel:()=>{}})};for(const[e,m]of Object.entries(i))h[e]=(e,i,h,g)=>{let y;null!=i||(i={});try{y=d(m,a,s,l,e,c)}catch(e){return g&&g(e),{cancel(){}}}const v=(0,r.hasAbortController)()?new AbortController:new t.AbortController,b=v.signal;let O=!1;const w=y.url,S=y.headers;for(const e of Object.keys(i))S[e]=i[e][0];const _=new n.StreamArrayParser(m);return p.getRequestHeaders().then(e=>{const t={headers:{...e,...S},body:y.body,method:y.method,signal:b};return"GET"!==y.method&&"DELETE"!==y.method||delete t.body,f(w,t)}).then(e=>e.ok&&m.responseStream?void(0,o.pipeline)(e.body,_,e=>{e&&(!O||e instanceof Error&&"AbortError"!==e.name)&&(g&&g(e),_.emit("error",e))}):Promise.all([Promise.resolve(e.ok),e.arrayBuffer()]).then(([e,t])=>{const r=u(m,e,t);g(null,r)}).catch(e=>{if(!O||"AbortError"!==e.name)if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}})).catch(e=>{if(m.responseStream)g&&g(e),_.emit("error",e);else{if(!g)throw e;g(e)}}),m.responseStream?_:{cancel:()=>{O=!0,v.abort()}}};return h};const e=require$$2$1,t=require$$1,r=requireFeatureDetection(),n=requireStreamArrayParser(),o=Stream__default.default;return fallbackServiceStub}var streaming={},readable={exports:{}},stream,hasRequiredStream,buffer_list,hasRequiredBuffer_list,destroy_1,hasRequiredDestroy;function requireStream(){return hasRequiredStream?stream:(hasRequiredStream=1,stream=Stream__default.default)}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var i=require$$0__default$7.default.Buffer,a=require$$1__default$4.default.inspect,s=a&&a.custom||"inspect";function l(e,t,r){i.prototype.copy.call(e,t,r)}return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return n(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t=i.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0===(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:s,value:function(e,r){return a(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;function e(e,n){r(e,n),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy=1,destroy_1={destroy:function(n,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(r){!o&&r?i._writableState?i._writableState.errorEmitted?process.nextTick(t,i):(i._writableState.errorEmitted=!0,process.nextTick(e,i,r)):process.nextTick(e,i,r):o?(process.nextTick(t,i),o(r)):process.nextTick(t,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},destroy_1}var errors={},hasRequiredErrors,state,hasRequiredState;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;const e={};function t(t,r,n){n||(n=Error);class o extends n{constructor(e,t,n){super(function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(e,t,n))}}o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function r(e,t){if(Array.isArray(e)){const r=e.length;return e=e.map(e=>String(e)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}return t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(e,t,n){let o;var i;let a;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a=`The ${e} ${o} ${r(t,"type")}`;else{const n=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a=`The "${e}" ${n} ${o} ${r(t,"type")}`}return a+=". Received type "+typeof n,a},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errors.codes=e,errors}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrors().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,n,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,o,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new e(o?n:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}}var inherits={exports:{}},inherits_browser={exports:{}},hasRequiredInherits_browser,hasRequiredInherits,node$1,hasRequiredNode$1,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireInherits(){if(hasRequiredInherits)return inherits.exports;hasRequiredInherits=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";inherits.exports=e.inherits}catch(e){inherits.exports=requireInherits_browser()}return inherits.exports}function requireNode$1(){return hasRequiredNode$1?node$1:(hasRequiredNode$1=1,node$1=require$$1__default$4.default.deprecate)}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable=1,_stream_writable=w,w.WritableState=O;var r={deprecate:requireNode$1()},n=requireStream(),o=require$$0__default$7.default.Buffer,i=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,s=requireDestroy(),l=requireState().getHighWaterMark,p=requireErrors().codes,d=p.ERR_INVALID_ARG_TYPE,u=p.ERR_METHOD_NOT_IMPLEMENTED,c=p.ERR_MULTIPLE_CALLBACK,f=p.ERR_STREAM_CANNOT_PIPE,h=p.ERR_STREAM_DESTROYED,m=p.ERR_STREAM_NULL_VALUES,g=p.ERR_STREAM_WRITE_AFTER_END,y=p.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function b(){}function O(r,n,o){t=t||require_stream_duplex(),r=r||{},"boolean"!=typeof o&&(o=n instanceof t),this.objectMode=!!r.objectMode,o&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=l(this,r,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===r.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,v(e,n)):(o(n),e._writableState.errorEmitted=!0,v(e,n),C(e,t))}(e,r,n,t,o);else{var i=E(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),n?process.nextTick(_,e,r,i,o):_(e,r,i,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function w(e){var r=this instanceof(t=t||require_stream_duplex());if(!r&&!a.call(w,this))return new w(e);this._writableState=new O(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),n.call(this)}function S(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new h("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function P(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var o=r.bufferedRequestCount,i=new Array(o),a=r.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,S(t,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var p=n.chunk,d=n.encoding,u=n.callback;if(S(t,r,!1,r.objectMode?1:p.length,p,d,u),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var r=E(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return requireInherits()(w,n),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===w&&(e&&e._writableState instanceof O)}})):a=function(e){return e instanceof this},w.prototype.pipe=function(){v(this,new f)},w.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,l=!a.objectMode&&(n=e,o.isBuffer(n)||n instanceof i);return l&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),l?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=b),a.ending?function(e,t){var r=new g;v(e,r),process.nextTick(t,r)}(this,r):(l||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(v(e,o),process.nextTick(n,o),!1)}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var l=t.objectMode?1:n.length;t.length+=l;var p=t.length<t.highWaterMark;p||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,l,n,i,a);return p}(this,a,l,e,t,r)),s},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},w.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(e,t,r){r(new u("_write()"))},w.prototype._writev=null,w.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),w.prototype.destroy=s.destroy,w.prototype._undestroy=s.undestroy,w.prototype._destroy=function(e,t){t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=a;var t=require_stream_readable(),r=require_stream_writable();requireInherits()(a,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var i=n[o];a.prototype[i]||(a.prototype[i]=r.prototype[i])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||process.nextTick(l,this)}function l(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex}var string_decoder={},safeBuffer={exports:{}},hasRequiredSafeBuffer,hasRequiredString_decoder,endOfStream$1,hasRequiredEndOfStream$1,async_iterator,hasRequiredAsync_iterator,from_1,hasRequiredFrom,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,pipeline_1,hasRequiredPipeline,hasRequiredReadable;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=require$$0__default$7.default,n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=i,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=s,this.end=l,n=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var o=t.length-1;if(o<r)return 0;var i=n(t[o]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--o<r||-2===i)return 0;if(i=n(t[o]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var o=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},string_decoder}function requireEndOfStream$1(){if(hasRequiredEndOfStream$1)return endOfStream$1;hasRequiredEndOfStream$1=1;var e=requireErrors().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream$1=function r(n,o,i){if("function"==typeof o)return r(n,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||t);var a=o.readable||!1!==o.readable&&n.readable,s=o.writable||!1!==o.writable&&n.writable,l=function(){n.writable||d()},p=n._writableState&&n._writableState.finished,d=function(){s=!1,p=!0,a||i.call(n)},u=n._readableState&&n._readableState.endEmitted,c=function(){a=!1,u=!0,s||i.call(n)},f=function(e){i.call(n,e)},h=function(){var t;return a&&!u?(n._readableState&&n._readableState.ended||(t=new e),i.call(n,t)):s&&!p?(n._writableState&&n._writableState.ended||(t=new e),i.call(n,t)):void 0},m=function(){n.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(n)?s&&!n._writableState&&(n.on("end",l),n.on("close",l)):(n.on("complete",d),n.on("abort",h),n.req?m():n.on("request",m)),n.on("end",c),n.on("finish",d),!1!==o.error&&n.on("error",f),n.on("close",h),function(){n.removeListener("complete",d),n.removeListener("abort",h),n.removeListener("request",m),n.req&&n.req.removeListener("finish",d),n.removeListener("end",l),n.removeListener("close",l),n.removeListener("finish",d),n.removeListener("end",c),n.removeListener("error",f),n.removeListener("close",h)}},endOfStream$1}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream$1(),n=Symbol("lastResolve"),o=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),l=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function u(e){var t=e[n];if(null!==t){var r=e[p].read();null!==r&&(e[s]=null,e[n]=null,e[o]=null,t(d(r,!1)))}}function c(e){process.nextTick(u,e)}var f=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var e=this,t=this[i];if(null!==t)return Promise.reject(t);if(this[a])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){process.nextTick(function(){e[i]?r(e[i]):t(d(void 0,!0))})});var r,n=this[s];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[a]?r(d(void 0,!0)):t[l](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[l])}return this[s]=r,r}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),e),f);return async_iterator=function(e){var u,f=Object.create(h,(t(u={},p,{value:e,writable:!0}),t(u,n,{value:null,writable:!0}),t(u,o,{value:null,writable:!0}),t(u,i,{value:null,writable:!0}),t(u,a,{value:e._readableState.endEmitted,writable:!0}),t(u,l,{value:function(e,t){var r=f[p].read();r?(f[s]=null,f[n]=null,f[o]=null,e(d(r,!1))):(f[n]=e,f[o]=t)},writable:!0}),u));return f[s]=null,r(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[o];return null!==t&&(f[s]=null,f[n]=null,f[o]=null,t(e)),void(f[i]=e)}var r=f[n];null!==r&&(f[s]=null,f[n]=null,f[o]=null,r(d(void 0,!0))),f[a]=!0}),e.on("readable",c.bind(null,f)),f},async_iterator}function requireFrom(){if(hasRequiredFrom)return from_1;function e(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredFrom=1;var n=requireErrors().codes.ERR_INVALID_ARG_TYPE;return from_1=function(o,i,a){var s;if(i&&"function"==typeof i.next)s=i;else if(i&&i[Symbol.asyncIterator])s=i[Symbol.asyncIterator]();else{if(!i||!i[Symbol.iterator])throw new n("iterable",["Iterable"],i);s=i[Symbol.iterator]()}var l=new o(function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}({objectMode:!0},a)),p=!1;function d(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var e=yield s.next(),t=e.value;e.done?l.push(null):l.push(yield t)?d():p=!1}catch(e){l.destroy(e)}},u=function(){var r=this,n=arguments;return new Promise(function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,l,"next",t)}function l(t){e(a,o,i,s,l,"throw",t)}s(void 0)})},u.apply(this,arguments)}return l._read=function(){p||(p=!0,d())},l},from_1}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;var e;hasRequired_stream_readable=1,_stream_readable=w,w.ReadableState=O,require$$0__default$3.default.EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStream(),n=require$$0__default$7.default.Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var i,a=require$$1__default$4.default;i=a&&a.debuglog?a.debuglog("stream"):function(){};var s,l,p,d=requireBuffer_list(),u=requireDestroy(),c=requireState().getHighWaterMark,f=requireErrors().codes,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_STREAM_PUSH_AFTER_EOF,g=f.ERR_METHOD_NOT_IMPLEMENTED,y=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits()(w,r);var v=u.errorOrDestroy,b=["error","close","destroy","pause","resume"];function O(t,r,n){e=e||require_stream_duplex(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s||(s=requireString_decoder().StringDecoder),this.decoder=new s(t.encoding),this.encoding=t.encoding)}function w(t){if(e=e||require_stream_duplex(),!(this instanceof w))return new w(t);var n=this instanceof e;this._readableState=new O(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function S(e,t,r,a,s){i("readableAddChunk",t);var l,p=e._readableState;if(null===t)p.reading=!1,function(e,t){if(i("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,p);else if(s||(l=function(e,t){var r;i=t,n.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new h("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(p,t)),l)v(e,l);else if(p.objectMode||t&&t.length>0)if("string"==typeof t||p.objectMode||Object.getPrototypeOf(t)===n.prototype||(t=function(e){return n.from(e)}(t)),a)p.endEmitted?v(e,new y):_(e,p,t,!0);else if(p.ended)v(e,new m);else{if(p.destroyed)return!1;p.reading=!1,p.decoder&&!r?(t=p.decoder.write(t),p.objectMode||0!==t.length?_(e,p,t,!1):R(e,p)):_(e,p,t,!1)}else a||(p.reading=!1,R(e,p));return!p.ended&&(p.length<p.highWaterMark||0===p.length)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),R(e,t)}Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=u.destroy,w.prototype._undestroy=u.undestroy,w.prototype._destroy=function(e,t){t(e)},w.prototype.push=function(e,t){var r,o=this._readableState;return o.objectMode?r=!0:"string"==typeof e&&((t=t||o.defaultEncoding)!==o.encoding&&(e=n.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},w.prototype.unshift=function(e){return S(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){s||(s=requireString_decoder().StringDecoder);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var P=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,A(e)}function R(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function j(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function I(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(q,t,e))}function q(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return w.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){v(this,new g("_read()"))},w.prototype.pipe=function(e,r){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||!1!==r.end)&&e!==process.stdout&&e!==process.stderr?l:m;function s(t,r){i("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",p),e.removeListener("error",c),e.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",u),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){i("onend"),e.end()}o.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",s);var p=function(e){return function(){var r=e._readableState;i("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,A(e))}}(n);e.on("drain",p);var d=!1;function u(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!d&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function c(r){i("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&v(e,r)}function f(){e.removeListener("finish",h),m()}function h(){i("onfinish"),e.removeListener("close",f),m()}function m(){i("unpipe"),n.unpipe(e)}return n.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",f),e.once("finish",h),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,i("on readable",o.length,o.reading),o.length?T(this):o.reading||process.nextTick(k,this))),n},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(e,t){var n=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(x,this),n},w.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(x,this),t},w.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(j,e,t))}(this,e)),e.paused=!1,this},w.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<b.length;a++)e.on(b[a],this.emit.bind(this,b[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(w.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=requireAsync_iterator()),l(this)}),Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(w.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(w.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),w._fromList=N,Object.defineProperty(w.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(w.from=function(e,t){return void 0===p&&(p=requireFrom()),p(w,e,t)}),_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=s;var e=requireErrors().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,n=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=require_stream_duplex();function a(e,t){var n=this._transformState;n.transforming=!1;var o=n.writecb;if(null===o)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),o(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush(function(t,r){p(e,t,r)})}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new n;return e.push(null)}return requireInherits()(s,i),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},s.prototype._transform=function(e,r,n){n(new t("_transform()"))},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},s.prototype._destroy=function(e,t){i.prototype._destroy.call(this,e,function(e){t(e)})},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=t;var e=require_stream_transform();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrors().codes,r=t.ERR_MISSING_ARGS,n=t.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function i(e){e()}function a(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,s=new Array(t),l=0;l<t;l++)s[l]=arguments[l];var p,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new r("streams");var u=s.map(function(t,r){var o=r<s.length-1;return function(t,r,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var a=!1;t.on("close",function(){a=!0}),void 0===e&&(e=requireEndOfStream$1()),e(t,{readable:r,writable:o},function(e){if(e)return i(e);a=!0,i()});var s=!1;return function(e){if(!a&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new n("pipe"))}}(t,o,r>0,function(e){p||(p=e),e&&u.forEach(i),o||(u.forEach(i),d(p))})});return s.reduce(a)},pipeline_1}function requireReadable(){return hasRequiredReadable||(hasRequiredReadable=1,function(e,t){var r=Stream__default.default;"disable"===process.env.READABLE_STREAM&&r?(e.exports=r.Readable,Object.assign(e.exports,r),e.exports.Stream=r):((t=e.exports=require_stream_readable()).Stream=r||t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough(),t.finished=requireEndOfStream$1(),t.pipeline=requirePipeline())}(readable,readable.exports)),readable.exports}var once={exports:{}},wrappy_1,hasRequiredWrappy,hasRequiredOnce,endOfStream,hasRequiredEndOfStream,streamShift,hasRequiredStreamShift,duplexify,hasRequiredDuplexify;function requireWrappy(){if(hasRequiredWrappy)return wrappy_1;return hasRequiredWrappy=1,wrappy_1=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}},wrappy_1}function requireOnce(){if(hasRequiredOnce)return once.exports;hasRequiredOnce=1;var e=requireWrappy();function t(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function r(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}return once.exports=e(t),once.exports.strict=e(r),t.proto=t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}),once.exports}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireOnce(),t=function(){},r=commonjsGlobal.Bare?queueMicrotask:process.nextTick.bind(process),n=function(o,i,a){if("function"==typeof i)return n(o,null,i);i||(i={}),a=e(a||t);var s=o._writableState,l=o._readableState,p=i.readable||!1!==i.readable&&o.readable,d=i.writable||!1!==i.writable&&o.writable,u=!1,c=function(){o.writable||f()},f=function(){d=!1,p||a.call(o)},h=function(){p=!1,d||a.call(o)},m=function(e){a.call(o,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(o,e)},y=function(){r(v)},v=function(){if(!u)return(!p||l&&l.ended&&!l.destroyed)&&(!d||s&&s.ended&&!s.destroyed)?void 0:a.call(o,new Error("premature close"))},b=function(){o.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(o)?d&&!s&&(o.on("end",c),o.on("close",c)):(o.on("complete",f),o.on("abort",y),o.req?b():o.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(o)&&o.on("exit",m),o.on("end",h),o.on("finish",f),!1!==i.error&&o.on("error",g),o.on("close",y),function(){u=!0,o.removeListener("complete",f),o.removeListener("abort",y),o.removeListener("request",b),o.req&&o.req.removeListener("finish",f),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",f),o.removeListener("exit",m),o.removeListener("end",h),o.removeListener("error",g),o.removeListener("close",y)}};return endOfStream=n}function requireStreamShift(){if(hasRequiredStreamShift)return streamShift;return hasRequiredStreamShift=1,streamShift=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null},streamShift}function requireDuplexify(){if(hasRequiredDuplexify)return duplexify;hasRequiredDuplexify=1;var e=requireReadable(),t=requireEndOfStream(),r=requireInherits(),n=requireStreamShift(),o=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),i=function(e,t){e._corked?e.once("uncork",t):t()},a=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===r.message?null:r):t&&!e._ended&&e.end()}},s=function(){},l=function(t,r,n){if(!(this instanceof l))return new l(t,r,n);e.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),r&&this.setReadable(r)};return r(l,e.Duplex),l.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new l(e,t,r)},l.prototype.cork=function(){1===++this._corked&&this.emit("cork")},l.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},l.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var r=this,n=t(e,{writable:!0,readable:!1},a(this,this._forwardEnd)),o=function(){var e=r._ondrain;r._ondrain=null,e&&e()};this._unwrite&&process.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=function(){r._writable.removeListener("drain",o),n()},this.uncork()}else this.end()},l.prototype.setReadable=function(r){if(this._unread&&this._unread(),this.destroyed)r&&r.destroy&&r.destroy();else{if(null===r||!1===r)return this.push(null),void this.resume();var n,o=this,i=t(r,{writable:!1,readable:!0},a(this)),s=function(){o._forward()},l=function(){o.push(null)};this._drained=!0,this._readable=r,this._readable2=r._readableState?r:(n=r,new e.Readable({objectMode:!0,highWaterMark:16}).wrap(n)),this._readable2.on("readable",s),this._readable2.on("end",l),this._unread=function(){o._readable2.removeListener("readable",s),o._readable2.removeListener("end",l),i()},this._forward()}},l.prototype._read=function(){this._drained=!0,this._forward()},l.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=n(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},l.prototype.destroy=function(e,t){if(t||(t=s),this.destroyed)return t(null);this.destroyed=!0;var r=this;process.nextTick(function(){r._destroy(e),t(null)})},l.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},l.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?i(this,this._write.bind(this,e,t,r)):e===o?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},l.prototype._finish=function(e){var t=this;this.emit("preend"),i(this,function(){var r,n;r=t._forwardEnd&&t._writable,n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),i(t,e)},r?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()})},l.prototype.end=function(t,r,n){return"function"==typeof t?this.end(null,null,t):"function"==typeof r?this.end(t,null,r):(this._ended=!0,t&&this.write(t),this._writableState.ending||this._writableState.destroyed||this.write(o),e.Writable.prototype.end.call(this,n))},duplexify=l}var retryRequest={exports:{}},extend,hasRequiredExtend,hasRequiredRetryRequest,hasRequiredStreaming;function requireExtend(){if(hasRequiredExtend)return extend;hasRequiredExtend=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return extend=function e(){var t,r,n,l,p,d,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c<f;++c)if(null!=(t=arguments[c]))for(r in t)n=s(u,r),u!==(l=s(t,r))&&(h&&l&&(i(l)||(p=o(l)))?(p?(p=!1,d=n&&o(n)?n:[]):d=n&&i(n)?n:{},a(u,{name:r,newValue:e(h,d,l)})):void 0!==l&&a(u,{name:r,newValue:l}));return u},extend}function requireRetryRequest(){if(hasRequiredRetryRequest)return retryRequest.exports;hasRequiredRetryRequest=1;const{PassThrough:e}=Stream__default.default,t=requireExtend();let r=()=>{};"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env&&"retry-request"===process.env.DEBUG&&(r=e=>{console.log("retry-request:",e)});const n={objectMode:!1,retries:2,maxRetryDelay:64,retryDelayMultiplier:2,totalTimeout:600,noResponseRetries:2,currentRetryAttempt:0,shouldRetryFn:function(e){const t=[[100,199],[429,429],[500,599]],n=e.statusCode;let o;for(r(`Response status: ${n}`);o=t.shift();)if(n>=o[0]&&n<=o[1])return!0}};function o(e){const{maxRetryDelay:t,retryDelayMultiplier:r,retryNumber:n,timeOfFirstRequest:o,totalTimeout:i}=e,a=1e3*t,s=1e3*i,l=Math.floor(1e3*Math.random()),p=1e3*Math.pow(r,n)+l,d=s-(Date.now()-o);return Math.min(p,d,a)}return retryRequest.exports=function(i,a,s){"string"==typeof i&&(i={url:i});const l="function"!=typeof arguments[arguments.length-1];"function"==typeof a&&(s=a);const p=a&&"number"==typeof a.currentRetryAttempt;if(void 0===(a=t({},n,a)).request)throw new Error("A request library must be provided to retry-request.");let d,u,c,f,h=a.currentRetryAttempt,m=0,g=!1;const y={abort:function(){f&&f.abort&&f.abort()}};l&&(d=new e({objectMode:a.objectMode}),d.abort=b);const v=Date.now();return h>0?w(h):O(),l?d:y;function b(){c=null,u&&(u.abort&&u.abort(),u.cancel&&u.cancel(),u.destroy?u.destroy():u.end&&u.end())}function O(){let t=!1;function n(e=[]){t||(t=!0,d.emit("complete",...e))}h++,r(`Current retry attempt: ${h}`),l?(g=!1,c=new e({objectMode:a.objectMode}),u=a.request(i),setImmediate(()=>{d.emit("request")}),u.on("error",e=>{g||(g=!0,S(e))}).on("response",(e,t)=>{g||(g=!0,S(null,e,t))}).on("complete",(...e)=>n(e)).on("finish",(...e)=>n(e)),u.pipe(c)):f=a.request(i,S)}function w(e){l&&b();const t=o({maxRetryDelay:a.maxRetryDelay,retryDelayMultiplier:a.retryDelayMultiplier,retryNumber:e,timeOfFirstRequest:v,totalTimeout:a.totalTimeout});r(`Next retry delay: ${t}`),t<=0?m=a.noResponseRetries+1:setTimeout(O,t)}function S(e,t,r){if(e)return m++,void(m<=a.noResponseRetries?w(m):l?(d.emit("error",e),d.end()):s(e,t,r));(p?h:h-1)<a.retries&&a.shouldRetryFn(t)?w(h):l?(d.emit("response",t),c.pipe(d),u.on("error",e=>{d.destroy(e)})):s(e,t,r)}},retryRequest.exports.defaults=n,retryRequest.exports.getNextRetryDelay=o,retryRequest.exports}function requireStreaming(){if(hasRequiredStreaming)return streaming;hasRequiredStreaming=1,Object.defineProperty(streaming,"__esModule",{value:!0}),streaming.StreamProxy=streaming.StreamType=void 0;const e=requireGax(),t=requireGoogleError(),r=requireStatus(),n=Stream__default.default,o=requireDuplexify(),i=requireRetryRequest();var a;!function(e){e[e.SERVER_STREAMING=1]="SERVER_STREAMING",e[e.CLIENT_STREAMING=2]="CLIENT_STREAMING",e[e.BIDI_STREAMING=3]="BIDI_STREAMING"}(a||(streaming.StreamType=a={}));return streaming.StreamProxy=class extends o{constructor(e,t,r,n){super(void 0,void 0,{objectMode:!0,readable:e!==a.CLIENT_STREAMING,writable:e!==a.SERVER_STREAMING}),this.type=e,this._callback=t,this._isCancelCalled=!1,this._responseHasSent=!1,this.rest=r,this.gaxServerStreamingRetries=n}shouldRetryRequest(e,r){const n=t.GoogleError.parseGRPCStatusDetails(e);let o=this.defaultShouldRetry(n,r);return r.shouldRetryFn&&(o=r.shouldRetryFn(n)),o}cancel(){this.stream?this.stream.cancel():this._isCancelCalled=!0}throwIfMaxRetriesOrTotalTimeoutExceeded(e,n,o,i,a,s){const l=(new Date).getTime();if(a&&(0===o||o<0||e&&l>=e)){const e=new t.GoogleError(`Total timeout of API exceeded ${a} milliseconds ${i?`retrying error ${i} `:""} before any response was received.`);throw e.code=r.Status.DEADLINE_EXCEEDED,e}if(0===n){const e=i;throw e.note="Max retries is set to zero.",e}if(s&&s>=n){const e=new t.GoogleError("Exceeded maximum number of retries "+(i?`retrying error ${i} `:"")+"before any response was received");throw e.code=r.Status.DEADLINE_EXCEEDED,e}}eventForwardHelper(e){["metadata","response","status"].forEach(t=>{e.on(t,this.emit.bind(this,t))})}statusMetadataHelper(e){e.on("status",()=>{this._responseHasSent||e.emit("response",{code:200,details:"",message:"OK"})}),e.on("metadata",t=>{e.emit("response",{code:200,details:"",message:"OK",metadata:t}),this._responseHasSent=!0})}forwardEvents(e){this.eventForwardHelper(e),this.statusMetadataHelper(e),e.on("error",e=>{t.GoogleError.parseGRPCStatusDetails(e)})}defaultShouldRetry(e,t){return!(t.retryCodes.length>0&&t.retryCodes.indexOf(e.code)<0||0===t.retryCodes.length)}setStream(e,t,r={},n){if(this.apiCall=e,this.argument=t,this.type===a.SERVER_STREAMING){if(this.rest){const r=e(t,this._callback);this.stream=r,this.setReadable(r)}else if(this.gaxServerStreamingRetries){const r=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return e(t,this._callback)},o=this.newStreamingRetryRequest({request:r,retry:n});this.stream=o,this.eventForwardHelper(o),this.setReadable(o)}else{const n=i(null,{objectMode:!0,request:()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());const r=e(t,this._callback);return this.stream=r,this.forwardEvents(r),r},retries:r.retries,currentRetryAttempt:r.currentRetryAttempt,noResponseRetries:r.noResponseRetries,shouldRetryFn:r.shouldRetryFn});this.setReadable(n)}return}const o=e(t,this._callback);this.stream=o,this.forwardEvents(o),this.type===a.CLIENT_STREAMING&&this.setWritable(o),this.type===a.BIDI_STREAMING&&(this.setReadable(o),this.setWritable(o)),this._isCancelCalled&&this.stream&&this.stream.cancel()}newStreamingRetryRequest(o){var i,a,s,l;const p=null!==(i=o.retry)&&void 0!==i?i:{retryCodes:[],backoffSettings:(0,e.createDefaultBackoffSettings)()};let d=0;const u=new n.PassThrough({objectMode:!0}),c=null!==(a=p.backoffSettings.totalTimeoutMillis)&&void 0!==a?a:void 0,f=null!==(s=p.backoffSettings.maxRetries)&&void 0!==s?s:void 0;let h=null!==(l=p.backoffSettings.initialRpcTimeoutMillis)&&void 0!==l?l:void 0,m=new Date,g=0;c&&(g=m.getTime()+c);const y=(e,r)=>{const n=t.GoogleError.parseGRPCStatusDetails(e);return n.note="Exception occurred in retry method that was not classified as transient",r.destroy(),u.destroy(n),u},v=e=>{let n=!1,i=!1,a=!1;const s=e.request(null);u.cancel=s.cancel;return["metadata","response","status"].forEach(e=>{s.on(e,u.emit.bind(u,e))}),this.statusMetadataHelper(s),s.on("data",e=>{d=0,this.emit.bind(this,"data")(e)}),s.on("status",()=>(i=!0,n&&u.end(),u)),s.on("end",()=>(a||(n=!0,i&&u.end()),u)),s.on("error",e=>{if(a=!0,void 0!==typeof f||void 0!==typeof c){if(this.shouldRetryRequest(e,p)){if(f&&c){const e=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");return e.code=r.Status.INVALID_ARGUMENT,s.destroy(),u.destroy(e),u}{try{this.throwIfMaxRetriesOrTotalTimeoutExceeded(g,f,h,e,c,d)}catch(e){const r=t.GoogleError.parseGRPCStatusDetails(e);return s.destroy(),u.destroy(r),u}const r=p.backoffSettings.retryDelayMultiplier,n=p.backoffSettings.maxRetryDelayMillis,i=p.backoffSettings.rpcTimeoutMultiplier,a=p.backoffSettings.maxRpcTimeoutMillis;let l=p.backoffSettings.initialRetryDelayMillis;const y=Math.random()*l;return(()=>{setTimeout(()=>{if(h){m=new Date,l=Math.min(l*r,n);const e=h&&i?h*i:0,t=a||0,o=g?g-m.getTime():0;h=Math.min(e,t,o)}d++;let e=this.argument;void 0!==p.getResumptionRequestFn&&(e=p.getResumptionRequestFn(e));return o.request=()=>{if(this._isCancelCalled)return void(this.stream&&this.stream.cancel());return this.apiCall(e,this._callback)},v(o)},y)})()}}return y(e,s)}return y(e,s)}),u};return v(o)}},streaming}var pathTemplate={},hasRequiredPathTemplate;function requirePathTemplate(){if(hasRequiredPathTemplate)return pathTemplate;hasRequiredPathTemplate=1,Object.defineProperty(pathTemplate,"__esModule",{value:!0}),pathTemplate.PathTemplate=void 0;return pathTemplate.PathTemplate=class{constructor(e){this.bindings={},this.data=e,this.segments=this.parsePathTemplate(e),this.size=this.segments.length}match(e){let t=e.split("/");const r={};if(t.length!==this.segments.length){if(!this.data.includes("**"))throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same.`);if(t.length!==this.segments.length+1)throw new TypeError(`This path ${e} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`)}for(let e=0;e<this.segments.length&&t.length>0;e++)if(this.segments[e]!==t[0]){if(!this.segments[e].includes("*"))throw new TypeError(`segment does not match, ${this.segments[e]} and ${t[e]}.`);{let n=this.segments[e];const o=n.match(/\{[$0-9a-zA-Z_]+=.*?\}/g);if(!o)throw new Error(`Error processing path template segment ${n}`);const i=o.map(e=>e.replace(/^\{/,"").replace(/=.*/,""));if(n.includes("**"))r[i[0]]=t[0]+"/"+t[1],t=t.slice(2);else{if(1===i.length)r[i[0]]=t[0];else{const o=t[0].split(/[-_.~]/);if(o.length!==i.length)throw new Error(`segment ${n} does not match ${t[0]}`);for(const e of i)r[e]=o[0],n=n.replace(`{${e}=*}`,`${o[0]}`),o.shift();if(n!==t[0])throw new TypeError(`non slash resource pattern ${this.segments[e]} and ${t[0]} should have same separator`)}t.shift()}}}else t.shift();return r}render(e){if(Object.keys(e).length!==Object.keys(this.bindings).length)throw new TypeError(`The number of variables ${Object.keys(e).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`);let t=this.inspect();for(const r of Object.keys(e)){const n=e[r].toString();if(!this.bindings[r])throw new TypeError(`render fails for not matching ${e[r]}`);const o=this.bindings[r];if("*"===o){if(!n.match(/[^/{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=*}`,`${n}`)}else if("**"===o){if(!n.match(/[^{}]+/))throw new TypeError(`render fails for not matching ${n}`);t=t.replace(`{${r}=**}`,`${n}`)}}return t}inspect(){return this.segments.join("/")}parsePathTemplate(e){const t=function(e){let t=0,r=0,n=0;const o=[];for(;r>=t&&r<e.length;){if("{"===e.charAt(r))n+=1;else if("}"===e.charAt(r))n-=1;else if("/"===e.charAt(r)){if(r===e.length-1)throw new TypeError("Invalid path, it can not be ended by /");0===n&&(o.push(e.substring(t,r)),t=r+1)}if(r===e.length-1){if(0!==n)throw new TypeError("Brackets are invalid.");o.push(e.substring(t))}r+=1}return o}(e);let r=0,n=0;const o=[];let i;if(t.forEach(e=>{if("*"===e||"**"===e)this.bindings[`$${r}`]=e,o.push(`{$${r}=${e}}`),r+=1,"**"===e&&++n;else if(i=e.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g)){for(const t of i){const r=t.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/);if(!r)throw new Error(`Cannot process path template segment ${t}`);const o=r[1];let i=r[2];i?"*"===i?this.bindings[o]=i:"**"===i&&(++n,this.bindings[o]=i):(i="*",e=e.replace(o,o+"=*"),this.bindings[o]=i)}o.push(e)}else e.match(/[0-9a-zA-Z-.~_]+/)&&o.push(e)}),n>1)throw new TypeError("Can not have more than one wildcard.");return o}},pathTemplate}var version$1="4.6.1",require$$19={version:version$1},descriptor={},longRunningDescriptor={},longRunningApiCaller={},longrunning={},hasRequiredLongrunning,hasRequiredLongRunningApiCaller,hasRequiredLongRunningDescriptor;function requireLongrunning(){if(hasRequiredLongrunning)return longrunning;hasRequiredLongrunning=1,Object.defineProperty(longrunning,"__esModule",{value:!0}),longrunning.Operation=void 0,longrunning.operation=function(e,t,r,n){return new o(e,t,r,n)};const e=require$$0__default$3.default,t=requireStatus(),r=requireGoogleError(),n=requireOperations();class o extends e.EventEmitter{constructor(e,t,r,n){super(),this.completeListeners=0,this.hasActiveListeners=!1,this.latestResponse=e,this.name=this.latestResponse.name,this.done=this.latestResponse.done,this.error=this.latestResponse.error,this.longrunningDescriptor=t,this.result=null,this.metadata=null,this.backoffSettings=r,this._unpackResponse(e),this._listenForEvents(),this._callOptions=n}_listenForEvents(){this.on("newListener",e=>{"complete"===e&&(this.completeListeners++,this.hasActiveListeners||(this.hasActiveListeners=!0,this.startPolling_()))}),this.on("removeListener",e=>{"complete"===e&&0===--this.completeListeners&&(this.hasActiveListeners=!1)})}cancel(){this.currentCallPromise_&&this.currentCallPromise_.cancel();const e=this.longrunningDescriptor.operationsClient,t=new n.google.longrunning.CancelOperationRequest;return t.name=this.latestResponse.name,e.cancelOperation(t)}getOperation(e){const t=this,o=this.longrunningDescriptor.operationsClient;function i(){if(!e)return new Promise((e,n)=>{if(t.latestResponse.error){const e=new r.GoogleError(t.latestResponse.error.message);e.code=t.latestResponse.error.code,n(e)}else e([t.result,t.metadata,t.latestResponse])})}if(this.latestResponse.done)return this._unpackResponse(this.latestResponse,e),i();const a=new n.google.longrunning.GetOperationRequest;a.name=this.latestResponse.name,this.currentCallPromise_=o.getOperationInternal(a,this._callOptions);const s=this.currentCallPromise_.then(r=>(t.latestResponse=r[0],t._unpackResponse(r[0],e),i()),t=>{if(!e)return Promise.reject(t);e(t)});return e?void 0:s}_unpackResponse(e,t){const n=this.longrunningDescriptor.responseDecoder,o=this.longrunningDescriptor.metadataDecoder;let i,a;if(e.done){if("error"===e.result){const n=new r.GoogleError(e.error.message);return n.code=e.error.code,this.error=n,void(t&&t(n))}n&&e.response&&(this.response=e.response,i=n(e.response.value),this.result=i,this.done=!0)}o&&e.metadata&&(a=o(e.metadata.value),this.metadata=a),t&&t(null,i,a,e)}startPolling_(){const e=this;let n=new Date;const o=this.backoffSettings.retryDelayMultiplier,i=this.backoffSettings.maxRetryDelayMillis;let a,s=this.backoffSettings.initialRetryDelayMillis,l=1/0;function p(t,...r){e.emit(t,...r)}this.backoffSettings.totalTimeoutMillis&&(l=n.getTime()+this.backoffSettings.totalTimeoutMillis),this.latestResponse.metadata&&(a=this.latestResponse.metadata.value),function d(){if(e.hasActiveListeners){if(n.getTime()>=l){const e=new r.GoogleError("Total timeout exceeded before any response was received");return e.code=t.Status.DEADLINE_EXCEEDED,void setImmediate(p,"error",e)}e.getOperation((e,t,r,l)=>{if(!e)return t?void setImmediate(p,"complete",t,r,l):(l.metadata&&(!a||l&&!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;++r)if(e[r]!==t[r])return!1;return!0}(l.metadata.value,a))&&(setImmediate(p,"progress",r,l),a=l.metadata.value),l.done?void setImmediate(p,"complete",{},r,l):void setTimeout(()=>{n=new Date,s=Math.min(s*o,i),d()},s));setImmediate(p,"error",e)})}}()}promise(){return new Promise((e,t)=>{this.on("error",t).on("complete",(t,r,n)=>{e([t,r,n])})})}}return longrunning.Operation=o,longrunning}function requireLongRunningApiCaller(){if(hasRequiredLongRunningApiCaller)return longRunningApiCaller;hasRequiredLongRunningApiCaller=1,Object.defineProperty(longRunningApiCaller,"__esModule",{value:!0}),longRunningApiCaller.LongrunningApiCaller=void 0;const e=requireCall(),t=requireGax(),r=requireLongrunning();return longRunningApiCaller.LongrunningApiCaller=class{constructor(e){this.longrunningDescriptor=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call((t,n)=>this._wrapOperation(e,r,t,n),t)}_wrapOperation(e,n,o,i){let a=n.longrunning;a||(a=(0,t.createDefaultBackoffSettings)());const s=this.longrunningDescriptor;return e(o,(e,t)=>{if(e)return void i(e,null,null,t);const o=new r.Operation(t,s,a,n);i(null,o,t)})}fail(e,t){e.callback(t)}result(e){return e.promise}},longRunningApiCaller}function requireLongRunningDescriptor(){if(hasRequiredLongRunningDescriptor)return longRunningDescriptor;hasRequiredLongRunningDescriptor=1,Object.defineProperty(longRunningDescriptor,"__esModule",{value:!0}),longRunningDescriptor.LongRunningDescriptor=void 0;const e=requireLongRunningApiCaller();return longRunningDescriptor.LongRunningDescriptor=class{constructor(e,t,r){this.operationsClient=e,this.responseDecoder=t,this.metadataDecoder=r}getApiCaller(){return new e.LongrunningApiCaller(this)}},longRunningDescriptor}var pageDescriptor={},pagedApiCaller={},resourceCollector={},hasRequiredResourceCollector,hasRequiredPagedApiCaller,hasRequiredPageDescriptor;function requireResourceCollector(){if(hasRequiredResourceCollector)return resourceCollector;hasRequiredResourceCollector=1,Object.defineProperty(resourceCollector,"__esModule",{value:!0}),resourceCollector.ResourceCollector=void 0;return resourceCollector.ResourceCollector=class{constructor(e,t=-1){this.apiCall=e,this.resources=[],this.maxResults=t}callback(e,t,r){if(e)return void this.rejectCallback(e);for(const e of t)if(this.resources.push(e),this.resources.length===this.maxResults){r=null;break}if(!r)return void this.resolveCallback(this.resources);setImmediate(this.apiCall,r,(...e)=>this.callback(...e))}processAllPages(e){return new Promise((t,r)=>{this.resolveCallback=t,this.rejectCallback=r;setImmediate(this.apiCall,e,(...e)=>this.callback(...e))})}},resourceCollector}function requirePagedApiCaller(){if(hasRequiredPagedApiCaller)return pagedApiCaller;hasRequiredPagedApiCaller=1,Object.defineProperty(pagedApiCaller,"__esModule",{value:!0}),pagedApiCaller.PagedApiCaller=void 0;const e=requireCall(),t=requireGoogleError(),r=requireResourceCollector(),n=requireWarnings();return pagedApiCaller.PagedApiCaller=class{constructor(e){this.pageDescriptor=e}generateParseResponseCallback(e,r){const n=this.pageDescriptor.resourceField,o=this.pageDescriptor.responsePageTokenField,i=this.pageDescriptor.requestPageTokenField;return(a,s)=>{if(a)return void r(a);if(!e)return void r(new t.GoogleError("Undefined request in pagination method callback."));if(!s)return void r(new t.GoogleError("Undefined response in pagination method callback."));const l=s[n]||[],p=s[o];let d=null;p&&(d=Object.assign({},e),d[i]=p),r(a,l,d,s)}}wrap(e){const t=this;return function(r,n,o,i){return e(r,n,o,t.generateParseResponseCallback(r,i))}}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}call(e,t,o,i){if(t=Object.assign({},t),!o.autoPaginate)return void i.call(e,t);t.pageSize&&o.autoPaginate&&(0,n.warn)("autoPaginate true","Providing a pageSize without setting autoPaginate to false will still return all results. See https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure manual paging","AutopaginateTrueWarning");const a=o.maxResults||-1;new r.ResourceCollector(e,a).processAllPages(t).then(e=>i.callback(null,e),e=>i.callback(e))}fail(e,t){e.callback(t)}result(e){return e.promise}},pagedApiCaller}function requirePageDescriptor(){if(hasRequiredPageDescriptor)return pageDescriptor;hasRequiredPageDescriptor=1,Object.defineProperty(pageDescriptor,"__esModule",{value:!0}),pageDescriptor.PageDescriptor=void 0;const e=Stream__default.default,t=requireNormalApiCaller(),r=requireWarnings(),n=requirePagedApiCaller();return pageDescriptor.PageDescriptor=class{constructor(e,t,r){this.requestPageTokenField=e,this.responsePageTokenField=t,this.resourceField=r}createStream(t,n,o){(null==o?void 0:o.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning");const i=new e.PassThrough({objectMode:!0}),a="maxResults"in(o=Object.assign({},o,{autoPaginate:!1}))?o.maxResults:-1;let s=0,l=!1;function p(e,r,d,u){if(e)i.emit("error",e);else{i.emit("response",u);for(let e=0;e<r.length;++e){if(i._readableState.ended)return;null!==r[e]&&(i.push(r[e]),s++,s===a&&i.end())}i._readableState.ended||(d?("pageToken"in o&&delete o.pageToken,i.isPaused()?(n=d,l=!1):setImmediate(t,d,o,p)):i.end())}}return i.on("resume",()=>{l||(l=!0,t(n,o,p))}),i}asyncIterate(e,t,n){(null==n?void 0:n.autoPaginate)&&(0,r.warn)("autoPaginate true","Autopaginate will always be set to false in Async paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls","AutopaginateTrueWarning"),n=Object.assign({},n,{autoPaginate:!1});return this.createIterator(e,t,n)}createIterator(e,t,r){const n={[Symbol.asyncIterator](){let n=t;const o=[];return{async next(){if(o.length>0)return Promise.resolve({done:!1,value:o.shift()});let t=0;for(;0===o.length&&n;){let i;if([i,n]=await e(n,r),i&&!Array.isArray(i))for(const[e,t]of Object.entries(i))o.push([e,t]);else o.push(...i);if(0===o.length&&(++t,t>10))break}return 0===o.length?Promise.resolve({done:!0,value:void 0}):Promise.resolve({done:!1,value:o.shift()})}}}};return n}getApiCaller(e){return e.autoPaginate?new n.PagedApiCaller(this):new t.NormalApiCaller}},pageDescriptor}var streamDescriptor={},streamingApiCaller={},hasRequiredStreamingApiCaller,hasRequiredStreamDescriptor;function requireStreamingApiCaller(){if(hasRequiredStreamingApiCaller)return streamingApiCaller;hasRequiredStreamingApiCaller=1,Object.defineProperty(streamingApiCaller,"__esModule",{value:!0}),streamingApiCaller.StreamingApiCaller=void 0;const e=requireWarnings(),t=requireStreaming();return streamingApiCaller.StreamingApiCaller=class{constructor(e){this.descriptor=e}init(e){return new t.StreamProxy(this.descriptor.type,e,this.descriptor.rest,this.descriptor.gaxStreamingRetries)}wrap(r){switch(this.descriptor.type){case t.StreamType.SERVER_STREAMING:return(e,t,n)=>r(e,t,n);case t.StreamType.CLIENT_STREAMING:return(e,t,n,o)=>r(t,n,o);case t.StreamType.BIDI_STREAMING:return(e,t,n)=>r(t,n);default:(0,e.warn)("streaming_wrap_unknown_stream_type",`Unknown stream type: ${this.descriptor.type}`)}return r}call(e,t,r,n){n.setStream(e,t,r.retryRequestOptions,r.retry)}fail(e,t){e.emit("error",t)}result(e){return e}},streamingApiCaller}function requireStreamDescriptor(){if(hasRequiredStreamDescriptor)return streamDescriptor;hasRequiredStreamDescriptor=1,Object.defineProperty(streamDescriptor,"__esModule",{value:!0}),streamDescriptor.StreamDescriptor=void 0;const e=requireStreamingApiCaller();return streamDescriptor.StreamDescriptor=class{constructor(e,t,r){this.type=e,this.streaming=!0,this.rest=t,this.gaxStreamingRetries=r}getApiCaller(){return new e.StreamingApiCaller(this)}},streamDescriptor}var bundleDescriptor={},bundleApiCaller={},hasRequiredBundleApiCaller;function requireBundleApiCaller(){if(hasRequiredBundleApiCaller)return bundleApiCaller;hasRequiredBundleApiCaller=1,Object.defineProperty(bundleApiCaller,"__esModule",{value:!0}),bundleApiCaller.BundleApiCaller=void 0;const e=requireCall(),t=requireGoogleError();return bundleApiCaller.BundleApiCaller=class{constructor(e){this.bundler=e}init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,r,n,o){if(!n.isBundling)throw new t.GoogleError("Bundling enabled with no isBundling!");o.call((t,r)=>(this.bundler.schedule(e,t,r),o),r)}fail(e,t){e.callback(t)}result(e){return e.promise}},bundleApiCaller}var bundleExecutor={},bundlingUtils={},hasRequiredBundlingUtils;function requireBundlingUtils(){if(hasRequiredBundlingUtils)return bundlingUtils;function e(e,t){const r=t.split(".");let n=e;for(const e of r)n=null==n?void 0:n[e];return n}return hasRequiredBundlingUtils=1,Object.defineProperty(bundlingUtils,"__esModule",{value:!0}),bundlingUtils.computeBundleId=function(t,r){const n=[];let o=!1;for(const i of r){const r=e(t,i);void 0===r?n.push(null):(o=!0,n.push(r))}if(!o)return;return JSON.stringify(n)},bundlingUtils}var task={},hasRequiredTask,hasRequiredBundleExecutor,hasRequiredBundleDescriptor,hasRequiredDescriptor;function requireTask(){if(hasRequiredTask)return task;hasRequiredTask=1,Object.defineProperty(task,"__esModule",{value:!0}),task.Task=void 0,task.deepCopyForResponse=r;const e=requireStatus(),t=requireGoogleError();function r(e,t){let n;return null===e?null:void 0!==e?Array.isArray(e)?(n=[],e.forEach(e=>{n.push(r(e,null))}),n):void 0!==e.copy?e.copy():e instanceof ArrayBuffer?e.slice(0):"object"==typeof e?(n={},Object.keys(e).forEach(o=>{t&&o===t.field&&Array.isArray(e[o])?n[o]=e[o].slice(t.start,t.end):n[o]=r(e[o],null)}),n):e:void 0}return task.Task=class{constructor(e,t,r,n){this._apiCall=e,this._request=t,this._bundledField=r,this._subresponseField=n,this._data=[]}getElementCount(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].elements.length;return e}getRequestByteSize(){let e=0;for(let t=0;t<this._data.length;++t)e+=this._data[t].bytes;return e}run(){if(0===this._data.length)return[];const n=this._request,o=[],i=[];for(let e=0;e<this._data.length;++e)o.push(...this._data[e].elements),i.push(this._data[e].callback.id);n[this._bundledField]=o;const a=this;return this.callCanceller=this._apiCall(n,(n,o)=>{const i=[];if(n)a._data.forEach(()=>{i.push(void 0)});else{let e=null;a._subresponseField&&(e={field:a._subresponseField,start:0}),a._data.forEach(t=>{e&&(e.end=e.start+t.elements.length),i.push(r(o,e)),e&&(e.start=e.end)})}for(let r=0;r<a._data.length;++r)if(a._data[r].cancelled){const n=new t.GoogleError("cancelled");n.code=e.Status.CANCELLED,a._data[r].callback(n)}else a._data[r].callback(n,i[r])}),i}extend(e,t,r){this._data.push({elements:e,bytes:t,callback:r})}cancel(r){if(this.callCanceller){let e=!0;return this._data.forEach(t=>{t.callback.id===r&&(t.cancelled=!0),t.cancelled||(e=!1)}),e&&this.callCanceller.cancel(),e}for(let n=0;n<this._data.length;++n)if(this._data[n].callback.id===r){const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this._data[n].callback(r),this._data.splice(n,1);break}return 0===this._data.length}},task}function requireBundleExecutor(){if(hasRequiredBundleExecutor)return bundleExecutor;hasRequiredBundleExecutor=1,Object.defineProperty(bundleExecutor,"__esModule",{value:!0}),bundleExecutor.BundleExecutor=void 0;const e=requireStatus(),t=requireGoogleError(),r=requireWarnings(),n=requireBundlingUtils(),o=requireTask();function i(){}return bundleExecutor.BundleExecutor=class{constructor(e,t){this._options=e,this._descriptor=t,this._tasks={},this._timers={},this._invocations={},this._invocationId=0}schedule(a,s,l){const p=(0,n.computeBundleId)(s,this._descriptor.requestDiscriminatorFields);if(l=l||i,void 0===p)return(0,r.warn)("bundling_schedule_bundleid_undefined",`The request does not have enough information for request bundling. Invoking immediately. Request: ${JSON.stringify(s)} discriminator fields: ${this._descriptor.requestDiscriminatorFields}`),a(s,l);if(void 0===s[this._descriptor.bundledField])return(0,r.warn)("bundling_no_bundled_field",`Request does not contain field ${this._descriptor.bundledField} that must present for bundling. Invoking immediately. Request: ${JSON.stringify(s)}`),a(s,l);p in this._tasks||(this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField));let d=this._tasks[p];l.id=String(this._invocationId++),this._invocations[l.id]=p;const u=s[this._descriptor.bundledField],c=u.length;let f=0;const h=this;u.forEach(e=>{f+=this._descriptor.byteLengthFunction(e)});const m=this._options.elementCountLimit||0,g=this._options.requestByteLimit||0;if(m>0&&c>m||g>0&&f>=g){let r;r=m>0&&c>m?"The number of elements "+c+" exceeds the limit "+this._options.elementCountLimit:"The required bytes "+f+" exceeds the limit "+this._options.requestByteLimit;const n=new t.GoogleError(r);return n.code=e.Status.INVALID_ARGUMENT,l(n),{cancel:i}}const y=d.getElementCount(),v=d.getRequestByteSize();(m>0&&c+y>=m||g>0&&f+v>=g)&&(this._runNow(p),this._tasks[p]=new o.Task(a,s,this._descriptor.bundledField,this._descriptor.subresponseField),d=this._tasks[p]),d.extend(u,f,l);const b={cancel(){h._cancel(l.id)}},O=this._options.elementCountThreshold||0,w=this._options.requestByteThreshold||0;return O>0&&d.getElementCount()>=O||w>0&&d.getRequestByteSize()>=w?(this._runNow(p),b):(!(p in this._timers)&&this._options.delayThreshold>0&&(this._timers[p]=setTimeout(()=>{delete this._timers[p],this._runNow(p)},this._options.delayThreshold)),b)}_maybeClearTimeout(e){if(e in this._timers){const t=this._timers[e];delete this._timers[e],clearTimeout(t)}}_cancel(e){if(!(e in this._invocations))return;const t=this._invocations[e];if(!(t in this._tasks))return;const r=this._tasks[t];delete this._invocations[e],r.cancel(e)&&(this._maybeClearTimeout(t),delete this._tasks[t])}_runNow(e){if(!(e in this._tasks))return void(0,r.warn)("bundle_runnow_bundleid_unknown",`No such bundleid: ${e}`);this._maybeClearTimeout(e);const t=this._tasks[e];delete this._tasks[e],t.run().forEach(e=>{delete this._invocations[e]})}},bundleExecutor}function requireBundleDescriptor(){if(hasRequiredBundleDescriptor)return bundleDescriptor;hasRequiredBundleDescriptor=1,Object.defineProperty(bundleDescriptor,"__esModule",{value:!0}),bundleDescriptor.BundleDescriptor=void 0;const e=requireNormalApiCaller(),t=requireBundleApiCaller(),r=requireBundleExecutor(),n=requireUtil$2();return bundleDescriptor.BundleDescriptor=class{constructor(e,t,r,o){o||"function"!=typeof r||(o=r,r=null),this.bundledField=e,this.requestDiscriminatorFields=t.map(n.toCamelCase),this.subresponseField=r,this.byteLengthFunction=o}getApiCaller(n){return!1===n.isBundling?new e.NormalApiCaller:new t.BundleApiCaller(new r.BundleExecutor(n.bundleOptions,this))}},bundleDescriptor}function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BundleDescriptor=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=void 0;var t=requireLongRunningDescriptor();Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return t.LongRunningDescriptor}});var r=requirePageDescriptor();Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return r.PageDescriptor}});var n=requireStreamDescriptor();Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return n.StreamDescriptor}});var o=requireBundleDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return o.BundleDescriptor}})}(descriptor)),descriptor}var iamService={},interfaces$2={"google.iam.v1.IAMPolicy":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:2e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:2e4,total_timeout_millis:6e5}},methods:{GetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},SetIamPolicy:{retry_codes_name:"non_idempotent",retry_params_name:"default"},TestIamPermissions:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$2={interfaces:interfaces$2},nested$3={google:{nested:{iam:{nested:{v1:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.Cloud.Iam.V1",go_package:"google.golang.org/genproto/googleapis/iam/v1;iam",java_multiple_files:!0,java_outer_classname:"PolicyProto",java_package:"com.google.iam.v1",php_namespace:"Google\\Cloud\\Iam\\V1"},nested:{IAMPolicy:{options:{"(google.api.default_host)":"iam-meta-api.googleapis.com"},methods:{SetIamPolicy:{requestType:"SetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:setIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:setIamPolicy",body:"*"}}]},GetIamPolicy:{requestType:"GetIamPolicyRequest",responseType:"Policy",options:{"(google.api.http).post":"/v1/{resource=**}:getIamPolicy","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:getIamPolicy",body:"*"}}]},TestIamPermissions:{requestType:"TestIamPermissionsRequest",responseType:"TestIamPermissionsResponse",options:{"(google.api.http).post":"/v1/{resource=**}:testIamPermissions","(google.api.http).body":"*"},parsedOptions:[{"(google.api.http)":{post:"/v1/{resource=**}:testIamPermissions",body:"*"}}]}}},SetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},policy:{type:"Policy",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},GetIamPolicyRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},options:{type:"GetPolicyOptions",id:2}}},TestIamPermissionsRequest:{fields:{resource:{type:"string",id:1,options:{"(google.api.field_behavior)":"REQUIRED","(google.api.resource_reference).type":"*"}},permissions:{rule:"repeated",type:"string",id:2,options:{"(google.api.field_behavior)":"REQUIRED"}}}},TestIamPermissionsResponse:{fields:{permissions:{rule:"repeated",type:"string",id:1}}},GetPolicyOptions:{fields:{requestedPolicyVersion:{type:"int32",id:1}}},Policy:{fields:{version:{type:"int32",id:1},bindings:{rule:"repeated",type:"Binding",id:4},etag:{type:"bytes",id:3}}},Binding:{fields:{role:{type:"string",id:1},members:{rule:"repeated",type:"string",id:2},condition:{type:"google.type.Expr",id:3}}},PolicyDelta:{fields:{bindingDeltas:{rule:"repeated",type:"BindingDelta",id:1},auditConfigDeltas:{rule:"repeated",type:"AuditConfigDelta",id:2}}},BindingDelta:{fields:{action:{type:"Action",id:1},role:{type:"string",id:2},member:{type:"string",id:3},condition:{type:"google.type.Expr",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},AuditConfigDelta:{fields:{action:{type:"Action",id:1},service:{type:"string",id:2},exemptedMember:{type:"string",id:3},logType:{type:"string",id:4}},nested:{Action:{values:{ACTION_UNSPECIFIED:0,ADD:1,REMOVE:2}}}},logging:{options:{csharp_namespace:"Google.Cloud.Iam.V1.Logging",go_package:"google.golang.org/genproto/googleapis/iam/v1/logging;logging",java_multiple_files:!0,java_outer_classname:"AuditDataProto",java_package:"com.google.iam.v1.logging"},nested:{AuditData:{fields:{policyDelta:{type:"google.iam.v1.PolicyDelta",id:2}}}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ResourceProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"},fieldBehavior:{rule:"repeated",type:"google.api.FieldBehavior",id:1052,extend:"google.protobuf.FieldOptions"},FieldBehavior:{values:{FIELD_BEHAVIOR_UNSPECIFIED:0,OPTIONAL:1,REQUIRED:2,OUTPUT_ONLY:3,INPUT_ONLY:4,IMMUTABLE:5}},resourceReference:{type:"google.api.ResourceReference",id:1055,extend:"google.protobuf.FieldOptions"},resourceDefinition:{rule:"repeated",type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.FileOptions"},resource:{type:"google.api.ResourceDescriptor",id:1053,extend:"google.protobuf.MessageOptions"},ResourceDescriptor:{fields:{type:{type:"string",id:1},pattern:{rule:"repeated",type:"string",id:2},nameField:{type:"string",id:3},history:{type:"History",id:4},plural:{type:"string",id:5},singular:{type:"string",id:6}},nested:{History:{values:{HISTORY_UNSPECIFIED:0,ORIGINALLY_SINGLE_PATTERN:1,FUTURE_MULTI_PATTERN:2}}}},ResourceReference:{fields:{type:{type:"string",id:1},childType:{type:"string",id:2}}}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}},type:{options:{go_package:"google.golang.org/genproto/googleapis/type/expr;expr",java_multiple_files:!0,java_outer_classname:"ExprProto",java_package:"com.google.type",objc_class_prefix:"GTP"},nested:{Expr:{fields:{expression:{type:"string",id:1},title:{type:"string",id:2},description:{type:"string",id:3},location:{type:"string",id:4}}}}}}}},require$$5$1={nested:nested$3},hasRequiredIamService;function requireIamService(){if(hasRequiredIamService)return iamService;hasRequiredIamService=1,Object.defineProperty(iamService,"__esModule",{value:!0}),iamService.IamClient=void 0;const e=requireCreateApiCall(),t=requireRoutingHeader(),r=require$$2,n=requireFallback();let o=require$$19.version;const i=require$$5$1;return iamService.IamClient=class{constructor(e,t){this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{}},this.innerApiCalls={},this.gaxGrpc=e;const a=Object.assign({servicePath:t.servicePath,port:t.port,clientConfig:t.clientConfig,apiEndpoint:t.apiEndpoint,fallback:t.fallback},t);o=a.fallback?n.version:o,a.scopes=this.constructor.scopes,this._opts=a,this.auth=e.auth;const s=[`gax/${o}`,`gapic/${o}`];"undefined"!=typeof process&&"versions"in process?s.push(`gl-node/${process.versions.node}`):s.push(`gl-web/${o}`),a.fallback||s.push(`grpc/${e.grpcVersion}`),a.libName&&a.libVersion&&s.push(`${a.libName}/${a.libVersion}`),this._protos=this.gaxGrpc.loadProtoJSON(i),this._defaults=e.constructSettings("google.iam.v1.IAMPolicy",r,a.clientConfig||{},{"x-goog-api-client":s.join(" ")}),this.innerApiCalls={}}initialize(){if(this.iamPolicyStub)return this.iamPolicyStub;this.iamPolicyStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.iam.v1.IAMPolicy"):this._protos.google.iam.v1.IAMPolicy,this._opts);const t=["getIamPolicy","setIamPolicy","testIamPermissions"];for(const r of t){const t=this.iamPolicyStub.then(e=>(...t)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[r].apply(e,t)},e=>()=>{throw e});this.innerApiCalls[r]=(0,e.createApiCall)(t,this._defaults[r],this.descriptors.page[r])}return this.iamPolicyStub}static get servicePath(){return"cloudkms.googleapis.com"}static get apiEndpoint(){return"cloudkms.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudkms"]}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.getIamPolicy(e,o,n)}setIamPolicy(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.setIamPolicy(e,o,n)}testIamPermissions(e,r,n){let o;return r instanceof Function&&void 0===n?(n=r,o={}):o=r,e=e||{},o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=t.fromParams({resource:e.resource}),this.initialize(),this.innerApiCalls.testIamPermissions(e,o,n)}close(){return this.initialize(),this._terminated?Promise.resolve():this.iamPolicyStub.then(e=>{this._terminated=!0,e.close()})}},iamService}var locationService={},nested$2={google:{nested:{cloud:{nested:{location:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/cloud/location;location",java_multiple_files:!0,java_outer_classname:"LocationsProto",java_package:"com.google.cloud.location"},nested:{Locations:{options:{"(google.api.default_host)":"cloud.googleapis.com","(google.api.oauth_scopes)":"https://www.googleapis.com/auth/cloud-platform"},methods:{ListLocations:{requestType:"ListLocationsRequest",responseType:"ListLocationsResponse",options:{"(google.api.http).get":"/v1/{name=locations}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*}/locations"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations}",additional_bindings:{get:"/v1/{name=projects/*}/locations"}}}]},GetLocation:{requestType:"GetLocationRequest",responseType:"Location",options:{"(google.api.http).get":"/v1/{name=locations/*}","(google.api.http).additional_bindings.get":"/v1/{name=projects/*/locations/*}"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=locations/*}",additional_bindings:{get:"/v1/{name=projects/*/locations/*}"}}}]}}},ListLocationsRequest:{fields:{name:{type:"string",id:1},filter:{type:"string",id:2},pageSize:{type:"int32",id:3},pageToken:{type:"string",id:4}}},ListLocationsResponse:{fields:{locations:{rule:"repeated",type:"Location",id:1},nextPageToken:{type:"string",id:2}}},GetLocationRequest:{fields:{name:{type:"string",id:1}}},Location:{fields:{name:{type:"string",id:1},locationId:{type:"string",id:4},displayName:{type:"string",id:5},labels:{keyType:"string",type:"string",id:2},metadata:{type:"google.protobuf.Any",id:3}}}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}}}}},require$$5={nested:nested$2},interfaces$1={"google.cloud.location.Locations":{retry_codes:{non_idempotent:[],idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:6e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:6e4,total_timeout_millis:6e5}},methods:{ListLocations:{retry_codes_name:"non_idempotent",retry_params_name:"default"},GetLocation:{retry_codes_name:"non_idempotent",retry_params_name:"default"}}}},require$$6={interfaces:interfaces$1},hasRequiredLocationService,hasRequiredFallback;function requireLocationService(){if(hasRequiredLocationService)return locationService;hasRequiredLocationService=1,Object.defineProperty(locationService,"__esModule",{value:!0}),locationService.LocationsClient=void 0;const e=requireGax(),t=requireWarnings(),r=requireCreateApiCall(),n=requireRoutingHeader(),o=requirePageDescriptor(),i=require$$5,a=require$$6,s=require$$19.version;return locationService.LocationsClient=class{constructor(e,r){var n,l;this._terminated=!1,this.descriptors={page:{},stream:{},longrunning:{},batching:{}},this.gaxGrpc=e;const p=this.constructor,d=(null==r?void 0:r.servicePath)||(null==r?void 0:r.apiEndpoint)||p.servicePath;this._providedCustomServicePath=!(!(null==r?void 0:r.servicePath)&&!(null==r?void 0:r.apiEndpoint));const u=(null==r?void 0:r.port)||p.port,c=null!==(n=null==r?void 0:r.clientConfig)&&void 0!==n?n:{},f=null!==(l=null==r?void 0:r.fallback)&&void 0!==l?l:"undefined"!=typeof window&&"function"==typeof(null===window||void 0===window?void 0:window.fetch);r=Object.assign({servicePath:d,port:u,clientConfig:c,fallback:f},r),d===p.servicePath||"scopes"in r||(r.scopes=p.scopes),this._opts=r,this.auth=e.auth,d===p.servicePath&&(this.auth.defaultScopes=p.scopes);const h=[`gax/${s}`,`gapic/${s}`];"undefined"!=typeof process&&"versions"in process?h.push(`gl-node/${process.versions.node}`):h.push(`gl-web/${s}`),r.fallback?"rest"===r.fallback&&h.push(`rest/${e.grpcVersion}`):h.push(`grpc/${e.grpcVersion}`),r.libName&&r.libVersion&&h.push(`${r.libName}/${r.libVersion}`),this._protos=e.loadProtoJSON(i),this.descriptors.page={listLocations:new o.PageDescriptor("pageToken","nextPageToken","locations")},this._defaults=e.constructSettings("google.cloud.location.Locations",a,r.clientConfig||{},{"x-goog-api-client":h.join(" ")}),this.innerApiCalls={},this.warn=t.warn}initialize(){if(this.locationsStub)return this.locationsStub;this.locationsStub=this.gaxGrpc.createStub(this._opts.fallback?this._protos.lookupService("google.cloud.location.Locations"):this._protos.google.cloud.location.Locations,this._opts,this._providedCustomServicePath);const e=["listLocations","getLocation"];for(const t of e){const e=this.locationsStub.then(e=>(...r)=>{if(this._terminated)return Promise.reject("The client has already been closed.");return e[t].apply(e,r)},e=>()=>{throw e}),n=this.descriptors.page[t]||void 0,o=(0,r.createApiCall)(e,this._defaults[t],n);this.innerApiCalls[t]=o}return this.locationsStub}static get servicePath(){return"cloud.googleapis.com"}static get apiEndpoint(){return"cloud.googleapis.com"}static get port(){return 443}static get scopes(){return["https://www.googleapis.com/auth/cloud-platform"]}getProjectId(e){if(!e)return this.auth.getProjectId();this.auth.getProjectId(e)}getLocation(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.getLocation(e,o,r)}listLocations(e,t,r){let o;return e=e||{},"function"==typeof t&&void 0===r?(r=t,o={}):o=t,o=o||{},o.otherArgs=o.otherArgs||{},o.otherArgs.headers=o.otherArgs.headers||{},o.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:e.name||""}),this.initialize(),this.innerApiCalls.listLocations(e,o,r)}listLocationsAsync(t,r){t=t||{},(r=r||{}).otherArgs=r.otherArgs||{},r.otherArgs.headers=r.otherArgs.headers||{},r.otherArgs.headers["x-goog-request-params"]=n.fromParams({name:t.name||""}),r=r||{};const o=new e.CallSettings(r);return this.initialize(),this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls.listLocations,t,o)}close(){return this.initialize(),this._terminated?Promise.resolve():this.locationsStub.then(e=>{this._terminated=!0,e.close()})}},locationService}function requireFallback(){return hasRequiredFallback||(hasRequiredFallback=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=t.GoogleError=t.operation=t.Operation=t.warn=t.protobufMinimal=t.protobuf=t.LocationProtos=t.IamProtos=t.operationsProtos=t.GrpcClient=t.defaultToObjectOptions=t.makeUUID=t.LocationsClient=t.IamClient=t.OperationsClient=t.StreamType=t.StreamDescriptor=t.PageDescriptor=t.LongrunningDescriptor=t.BundleDescriptor=t.version=t.createDefaultBackoffSettings=t.RetryOptions=t.constructSettings=t.CallSettings=t.routingHeader=t.PathTemplate=void 0,t.lro=function(e){(e=Object.assign({scopes:[]},e)).protoJson&&(e=Object.assign(e,{fallback:!0}));const t=new C(e);return new l.OperationsClientBuilder(t,e.protoJson)},t.createApiCall=function(e,t,r,n){if(r&&"streaming"in r&&r.type!==f.StreamType.SERVER_STREAMING)return()=>{throw new Error("The REST transport currently does not support client-streaming or bidi-stream calls.")};if(r&&"streaming"in r&&!(0,u.isNodeJS)())return()=>{throw new Error("Server streaming over the REST transport is only supported in Node.js.")};return(0,p.createApiCall)(e,t,r)};const r=requireObjectHash(),n=requireProtobufjs();t.protobuf=n;const o=requireGax(),i=requireRoutingHeader();t.routingHeader=i;const a=requireStatus(),s=require$$3__default.default,l=requireOperationsClient(),p=requireCreateApiCall(),d=requireFallbackRest(),u=requireFeatureDetection(),c=requireFallbackServiceStub(),f=requireStreaming(),h=requireUtil$2(),m=requireIam_service();t.IamProtos=m;const g=requireLocations();t.LocationProtos=g;const y=requireOperations();t.operationsProtos=y;var v=requirePathTemplate();Object.defineProperty(t,"PathTemplate",{enumerable:!0,get:function(){return v.PathTemplate}});var b=requireGax();Object.defineProperty(t,"CallSettings",{enumerable:!0,get:function(){return b.CallSettings}}),Object.defineProperty(t,"constructSettings",{enumerable:!0,get:function(){return b.constructSettings}}),Object.defineProperty(t,"RetryOptions",{enumerable:!0,get:function(){return b.RetryOptions}}),Object.defineProperty(t,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return b.createDefaultBackoffSettings}}),t.version=require$$19.version+"-fallback";var O=requireDescriptor();Object.defineProperty(t,"BundleDescriptor",{enumerable:!0,get:function(){return O.BundleDescriptor}}),Object.defineProperty(t,"LongrunningDescriptor",{enumerable:!0,get:function(){return O.LongrunningDescriptor}}),Object.defineProperty(t,"PageDescriptor",{enumerable:!0,get:function(){return O.PageDescriptor}}),Object.defineProperty(t,"StreamDescriptor",{enumerable:!0,get:function(){return O.StreamDescriptor}});var w=requireStreaming();Object.defineProperty(t,"StreamType",{enumerable:!0,get:function(){return w.StreamType}});var S=requireOperationsClient();Object.defineProperty(t,"OperationsClient",{enumerable:!0,get:function(){return S.OperationsClient}});var _=requireIamService();Object.defineProperty(t,"IamClient",{enumerable:!0,get:function(){return _.IamClient}});var P=requireLocationService();Object.defineProperty(t,"LocationsClient",{enumerable:!0,get:function(){return P.LocationsClient}});var E=requireUtil$2();Object.defineProperty(t,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}}),t.defaultToObjectOptions={keepCase:!1,longs:String,enums:String,defaults:!0,oneofs:!0};const T="x-goog-api-client";class C{static clearProtoCache(){C.protoCache.clear()}constructor(e={}){var t;if((0,u.isNodeJS)())this.auth=e.auth||new s.GoogleAuth(e);else{if(!e.auth)throw new Error(JSON.stringify(e)+"You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.");this.auth=e.auth}this.fallback=!!e.fallback,this.grpcVersion=require$$19.version,this.httpRules=e.httpRules,this.numericEnums=null!==(t=e.numericEnums)&&void 0!==t&&t}loadProto(e){return n.Root.fromJSON(e)}loadProtoJSON(e,t=!1){const o=r(JSON.stringify(e)).toString(),i=C.protoCache.get(o);if(i&&!t)return i;const a=n.Root.fromJSON(e);return C.protoCache.set(o,a),a}static getServiceMethods(e){const t={};for(const[r,n]of Object.entries(e.methods)){t[(0,h.toLowerCamelCase)(r)]=n}return t}constructSettings(e,r,n,i){return o.constructSettings(e,r,n,a.Status,{metadataBuilder:function(e,r){const n={};i||(i={});for(const e in i)n[e]=Array.isArray(i[e])?i[e]:[i[e]];const o=[];if(n[T]&&n[T][0]&&o.push(...n[T][0].split(" ")),o.push(`grpc-web/${t.version}`),n[T]=[o.join(" ")],!r)return n;for(const e in r)if(e.toLowerCase()!==T){const t=r[e];if(Array.isArray(t))if(void 0===n[e])n[e]=t;else{if(!Array.isArray(n[e]))throw new Error(`Can not add value ${t} to the call metadata.`);n[e].push(...t)}else n[e]=[t]}return n}})}async createStub(e,t,r){if(this.authClient||(this.auth&&"getClient"in this.auth?this.authClient=await this.auth.getClient():this.auth&&"getRequestHeaders"in this.auth&&(this.authClient=this.auth)),!this.authClient)throw new Error("No authentication was provided");if(t.universeDomain||(t.universeDomain="googleapis.com"),t.universeDomain){const e=this.authClient.universeDomain;if(e&&t.universeDomain!==e)throw new Error(`The configured universe domain (${t.universeDomain}) does not match the universe domain found in the credentials (${e}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`)}e.resolveAll();const n=C.getServiceMethods(e),o=t.protocol||"https";let i,a=t.servicePath;if(!a&&e.options&&e.options["(google.api.default_host)"]&&(a=e.options["(google.api.default_host)"]),!a)throw new Error(`Cannot determine service API path for service ${e.name}.`);const s=a.match(/^(.*):(\d+)$/);s&&(a=s[1],i=parseInt(s[2])),t.port?i=t.port:i||(i=443);const l=d.encodeRequest,p=d.decodeResponse;return(0,c.generateServiceStub)(n,o,a,i,this.authClient,l,p,this.numericEnums)}static createByteLengthFunction(e){return o.createByteLengthFunction(e)}}t.GrpcClient=C,C.protoCache=new Map,t.protobufMinimal=requireMinimal();var R=requireWarnings();Object.defineProperty(t,"warn",{enumerable:!0,get:function(){return R.warn}});var D=requireLongrunning();Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return D.Operation}}),Object.defineProperty(t,"operation",{enumerable:!0,get:function(){return D.operation}});var x=requireGoogleError();Object.defineProperty(t,"GoogleError",{enumerable:!0,get:function(){return x.GoogleError}});const k=e.exports;t.fallback=k}(fallback,fallback.exports)),fallback.exports}var nested$1={google:{nested:{protobuf:{nested:{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",java_multiple_files:!0,java_outer_classname:"ErrorDetailsProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}},RetryInfo:{fields:{retryDelay:{type:"google.protobuf.Duration",id:1}}},DebugInfo:{fields:{stackEntries:{rule:"repeated",type:"string",id:1},detail:{type:"string",id:2}}},QuotaFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{subject:{type:"string",id:1},description:{type:"string",id:2}}}}},ErrorInfo:{fields:{reason:{type:"string",id:1},domain:{type:"string",id:2},metadata:{keyType:"string",type:"string",id:3}}},PreconditionFailure:{fields:{violations:{rule:"repeated",type:"Violation",id:1}},nested:{Violation:{fields:{type:{type:"string",id:1},subject:{type:"string",id:2},description:{type:"string",id:3}}}}},BadRequest:{fields:{fieldViolations:{rule:"repeated",type:"FieldViolation",id:1}},nested:{FieldViolation:{fields:{field:{type:"string",id:1},description:{type:"string",id:2}}}}},RequestInfo:{fields:{requestId:{type:"string",id:1},servingData:{type:"string",id:2}}},ResourceInfo:{fields:{resourceType:{type:"string",id:1},resourceName:{type:"string",id:2},owner:{type:"string",id:3},description:{type:"string",id:4}}},Help:{fields:{links:{rule:"repeated",type:"Link",id:1}},nested:{Link:{fields:{description:{type:"string",id:1},url:{type:"string",id:2}}}}},LocalizedMessage:{fields:{locale:{type:"string",id:1},message:{type:"string",id:2}}}}}}}},require$$4$1={nested:nested$1},hasRequiredGoogleError,hasRequiredCall,hasRequiredNormalApiCaller,hasRequiredApiCaller;function requireGoogleError(){if(hasRequiredGoogleError)return googleError;hasRequiredGoogleError=1,Object.defineProperty(googleError,"__esModule",{value:!0}),googleError.GoogleErrorDecoder=googleError.GoogleError=void 0;const e=requireStatus(),t=requireProtobufjs(),r=requireSrc$3(),n=requireFallback();class o extends Error{static parseGRPCStatusDetails(e){const t=new i;try{if(e.metadata&&e.metadata.get("grpc-status-details-bin")){const r=t.decodeGRPCStatusDetails(e.metadata.get("grpc-status-details-bin"));r&&r.details&&r.details.length>0&&(e.statusDetails=r.details),r&&r.errorInfo&&(e.reason=r.errorInfo.reason,e.domain=r.errorInfo.domain,e.errorInfoMetadata=r.errorInfo.metadata)}}catch(e){}return e}static parseHttpError(t){Array.isArray(t)&&(t=t.find(e=>"error"in e)),t.error||(t.error={},Object.keys(t).filter(e=>"error"!==e).forEach(e=>{t.error[e]=t[e],delete t[e]}));const r=new i,n=r.decodeHTTPError(t.error),a=Object.assign(new o(t.error.message),n);if(t.error.code?a.code=(0,e.rpcCodeFromHttpStatusCode)(t.error.code):delete a.code,a.details)try{const e=r.decodeHttpStatusDetails(a.details);e&&e.details&&e.details.length>0&&(a.statusDetails=e.details),e&&e.errorInfo&&(a.reason=e.errorInfo.reason,a.domain=e.errorInfo.domain,a.errorInfoMetadata=e.errorInfo.metadata)}catch(e){}return a}}googleError.GoogleError=o;class i{constructor(){const e=require$$4$1;this.root=t.Root.fromJSON(e),this.anyType=this.root.lookupType("google.protobuf.Any"),this.statusType=this.root.lookupType("google.rpc.Status")}decodeProtobufAny(e){const t=e.type_url.match(/^type.googleapis.com\/(.*)/);if(!t)throw new Error(`Unknown type encoded in google.protobuf.any: ${e.type_url}`);const r=t[1],n=this.root.lookupType(r);if(!n)throw new Error(`Cannot lookup type ${r}`);return n.decode(e.value)}decodeRpcStatus(e){const t=new Uint8Array(e),r=this.statusType.decode(t),n=[];let o;for(const e of r.details)try{const t=this.decodeProtobufAny(e);n.push(t),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(o=t)}catch(e){}return{code:r.code,message:r.message,statusDetails:n,reason:null==o?void 0:o.reason,domain:null==o?void 0:o.domain,errorInfoMetadata:null==o?void 0:o.metadata}}callErrorFromStatus(t){return t.message=`${t.code} ${e.Status[t.code]}: ${t.message}`,Object.assign(new o(t.message),t)}decodeErrorFromBuffer(e){return this.callErrorFromStatus(this.decodeRpcStatus(e))}decodeGRPCStatusDetails(e){const t=[];let r;e.forEach(e=>{const n=new Uint8Array(e),o=this.statusType.decode(n);for(const e of o.details)try{const n=this.decodeProtobufAny(e);t.push(n),"type.googleapis.com/google.rpc.ErrorInfo"===e.type_url&&(r=n)}catch(e){}});return{details:t,errorInfo:r}}decodeHTTPError(e){const t=r.fromProto3JSON(this.statusType,e);if(!t)throw new Error(`Received error message ${e}, but failed to serialize as proto3 message`);return this.statusType.toObject(t,n.defaultToObjectOptions)}decodeHttpStatusDetails(e){const t=[];let r;for(const n of e)try{const e=this.decodeProtobufAny(n);t.push(e),"type.googleapis.com/google.rpc.ErrorInfo"===n.type_url&&(r=e)}catch(e){}return{details:t,errorInfo:r}}}return googleError.GoogleErrorDecoder=i,googleError}function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.OngoingCallPromise=call.OngoingCall=void 0;const e=requireStatus(),t=requireGoogleError();class r{constructor(e){this.callback=e,this.completed=!1}cancel(){if(!this.completed)if(this.completed=!0,this.cancelFunc)this.cancelFunc();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,this.callback(r)}}call(e,r){if(this.completed)return;const n=e(r,(e,t,r,n)=>{this.completed=!0,setImmediate(this.callback,e,t,r,n)});n instanceof Promise&&n.catch(e=>{setImmediate(this.callback,new t.GoogleError(e),null,null,null)}),this.cancelFunc=()=>n.cancel()}}call.OngoingCall=r;return call.OngoingCallPromise=class extends r{constructor(){let e,r;const n=new Promise((t,n)=>{e=t,r=n});super((n,o,i,a)=>{if(n)n.metadata?r(t.GoogleError.parseGRPCStatusDetails(n)):r(n);else{if(void 0===o)throw new t.GoogleError("Neither error nor response are defined");e([o,i||null,a||null])}}),this.promise=n,this.promise.cancel=()=>{this.cancel()}}},call}function requireNormalApiCaller(){if(hasRequiredNormalApiCaller)return normalApiCaller;hasRequiredNormalApiCaller=1,Object.defineProperty(normalApiCaller,"__esModule",{value:!0}),normalApiCaller.NormalApiCaller=void 0;const e=requireCall();return normalApiCaller.NormalApiCaller=class{init(t){return t?new e.OngoingCall(t):new e.OngoingCallPromise}wrap(e){return e}call(e,t,r,n){n.call(e,t)}fail(e,t){e.callback(t)}result(e){return e.promise}},normalApiCaller}function requireApiCaller(){if(hasRequiredApiCaller)return apiCaller;hasRequiredApiCaller=1,Object.defineProperty(apiCaller,"__esModule",{value:!0}),apiCaller.createAPICaller=function(t,r){if(!r)return new e.NormalApiCaller;return r.getApiCaller(t)};const e=requireNormalApiCaller();return apiCaller}var retries={},timeout={},hasRequiredTimeout,hasRequiredRetries,hasRequiredCreateApiCall;function requireTimeout(){if(hasRequiredTimeout)return timeout;return hasRequiredTimeout=1,Object.defineProperty(timeout,"__esModule",{value:!0}),timeout.addTimeoutArg=function(e,t,r,n){return(o,i)=>{const a=new Date,s=r.options||{};s.deadline=new Date(a.getTime()+t);const l=r.metadataBuilder?r.metadataBuilder(n,r.headers||{}):null;return e(o,l,s,i)}},timeout}function requireRetries(){if(hasRequiredRetries)return retries;hasRequiredRetries=1,Object.defineProperty(retries,"__esModule",{value:!0}),retries.retryable=function(n,o,i,a){const s=o.backoffSettings.retryDelayMultiplier,l=o.backoffSettings.maxRetryDelayMillis,p=o.backoffSettings.rpcTimeoutMultiplier,d=o.backoffSettings.maxRpcTimeoutMillis;let u=o.backoffSettings.initialRetryDelayMillis,c=o.backoffSettings.initialRpcTimeoutMillis;return(f,h)=>{let m,g,y,v=new Date;o.backoffSettings.totalTimeoutMillis&&(y=v.getTime()+o.backoffSettings.totalTimeoutMillis);let b=0;const O=o.backoffSettings.maxRetries;if(O&&y){const r=new t.GoogleError("Cannot set both totalTimeoutMillis and maxRetries in backoffSettings.");r.code=e.Status.INVALID_ARGUMENT,h(r)}else!function w(S){if(g=null,y&&v.getTime()>=y){const r=new t.GoogleError(`Total timeout of API ${a} exceeded ${o.backoffSettings.totalTimeoutMillis} milliseconds ${S?`retrying error ${S} `:""} before any response was received.`);return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}if(b&&b>=O){const r=new t.GoogleError("Exceeded maximum number of retries "+(S?`retrying error ${S} `:"")+"before any response was received");return r.code=e.Status.DEADLINE_EXCEEDED,void h(r)}b++;let _=S;const P=(0,r.addTimeoutArg)(n,c,i);m=P(f,(e,t,r,n)=>{if(e&&4!==e.code&&(_=e),e)if(m=null,o.retryCodes.length>0&&o.retryCodes.indexOf(e.code)<0)e.note="Exception occurred in retry method that was not classified as transient",h(e);else{const e=Math.random()*u;g=setTimeout(()=>{v=new Date,u=Math.min(u*s,l);const e=c&&p?c*p:0,t=d||0,r=y?y-v.getTime():0;c=Math.min(e,t,r),w(_)},e)}else h(null,t,r,n)}),m instanceof Promise&&m.catch(e=>{h(new t.GoogleError(e))})}();return{cancel(){if(g&&clearTimeout(g),m)m.cancel();else{const r=new t.GoogleError("cancelled");r.code=e.Status.CANCELLED,h(r)}}}}};const e=requireStatus(),t=requireGoogleError(),r=requireTimeout();return retries}function requireCreateApiCall(){if(hasRequiredCreateApiCall)return createApiCall;hasRequiredCreateApiCall=1,Object.defineProperty(createApiCall,"__esModule",{value:!0}),createApiCall.createApiCall=function(a,s,l,p){const d="function"==typeof a?Promise.resolve(a):a,u=(0,e.createAPICaller)(s,l);return(a,l,p)=>{var c,f;let h,m=u;if(m instanceof o.StreamingApiCaller){const e=null!==(f=null===(c=m.descriptor)||void 0===c?void 0:c.gaxStreamingRetries)&&void 0!==f&&f,r=(0,t.convertRetryOptions)(l,e);h=s.merge(r)}else h=s.merge(l);s.isBundling&&!h.isBundling&&(m=(0,e.createAPICaller)(s,void 0));const g=m.init(p);return d.then(e=>{var t,o,a;e=m.wrap(e);const s=null===(t=m.descriptor)||void 0===t?void 0:t.streaming,l=h.retry;if(s&&l&&(l.retryCodes.length>0&&l.shouldRetryFn&&((0,i.warn)("either_retrycodes_or_shouldretryfn","Only one of retryCodes or shouldRetryFn may be defined. Ignoring retryCodes."),l.retryCodes=[]),!m.descriptor.gaxStreamingRetries&&l.getResumptionRequestFn))throw new Error("getResumptionRequestFn can only be used when gaxStreamingRetries is set to true.");if(!s&&l){if(l.shouldRetryFn)throw new Error("Using a function to determine retry eligibility is only supported with server streaming calls");if(l.getResumptionRequestFn)throw new Error("Resumption strategy can only be used with server streaming retries");if(l.retryCodes&&l.retryCodes.length>0)return null!==(o=(a=l.backoffSettings).initialRpcTimeoutMillis)&&void 0!==o||(a.initialRpcTimeoutMillis=h.timeout),(0,r.retryable)(e,h.retry,h.otherArgs,h.apiName)}return(0,n.addTimeoutArg)(e,h.timeout,h.otherArgs)}).then(e=>{m.call(e,a,h,g)}).catch(e=>{m.fail(g,e)}),m.result(g)}};const e=requireApiCaller(),t=requireGax(),r=requireRetries(),n=requireTimeout(),o=requireStreamingApiCaller(),i=requireWarnings();return createApiCall}var interfaces={"google.longrunning.Operations":{retry_codes:{idempotent:["DEADLINE_EXCEEDED","UNAVAILABLE"],non_idempotent:[]},retry_params:{default:{initial_retry_delay_millis:100,retry_delay_multiplier:1.3,max_retry_delay_millis:6e4,initial_rpc_timeout_millis:9e4,rpc_timeout_multiplier:1,max_rpc_timeout_millis:9e4,total_timeout_millis:6e5}},methods:{GetOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},ListOperations:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},CancelOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"},DeleteOperation:{timeout_millis:6e4,retry_codes_name:"idempotent",retry_params_name:"default"}}}},require$$3={interfaces:interfaces},nested={google:{nested:{longrunning:{options:{cc_enable_arenas:!0,csharp_namespace:"Google.LongRunning",go_package:"google.golang.org/genproto/googleapis/longrunning;longrunning",java_multiple_files:!0,java_outer_classname:"OperationsProto",java_package:"com.google.longrunning",php_namespace:"Google\\LongRunning"},nested:{operationInfo:{type:"google.longrunning.OperationInfo",id:1049,extend:"google.protobuf.MethodOptions"},Operations:{options:{"(google.api.default_host)":"longrunning.googleapis.com"},methods:{ListOperations:{requestType:"ListOperationsRequest",responseType:"ListOperationsResponse",options:{"(google.api.http).get":"/v1/{name=operations}","(google.api.method_signature)":"name,filter"},parsedOptions:[{"(google.api.http)":{get:"/v1/{name=operations}"}},{"(google.api.method_signature)":"name,filter"}]},GetOperation:{requestType:"GetOperationRequest",responseType:"Operation",options:{"(google.api.http).get":"/v1/operations/{name}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{get:"/v1/operations/{name}"}},{"(google.api.method_signature)":"name"}]},DeleteOperation:{requestType:"DeleteOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).delete":"/v1/{name=operations/**}","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{delete:"/v1/{name=operations/**}"}},{"(google.api.method_signature)":"name"}]},CancelOperation:{requestType:"CancelOperationRequest",responseType:"google.protobuf.Empty",options:{"(google.api.http).post":"/v1/{name=operations/**}:cancel","(google.api.http).body":"*","(google.api.method_signature)":"name"},parsedOptions:[{"(google.api.http)":{post:"/v1/{name=operations/**}:cancel",body:"*"}},{"(google.api.method_signature)":"name"}]},WaitOperation:{requestType:"WaitOperationRequest",responseType:"Operation"}}},Operation:{oneofs:{result:{oneof:["error","response"]}},fields:{name:{type:"string",id:1},metadata:{type:"google.protobuf.Any",id:2},done:{type:"bool",id:3},error:{type:"google.rpc.Status",id:4},response:{type:"google.protobuf.Any",id:5}}},GetOperationRequest:{fields:{name:{type:"string",id:1}}},ListOperationsRequest:{fields:{name:{type:"string",id:4},filter:{type:"string",id:1},pageSize:{type:"int32",id:2},pageToken:{type:"string",id:3}}},ListOperationsResponse:{fields:{operations:{rule:"repeated",type:"Operation",id:1},nextPageToken:{type:"string",id:2}}},CancelOperationRequest:{fields:{name:{type:"string",id:1}}},DeleteOperationRequest:{fields:{name:{type:"string",id:1}}},WaitOperationRequest:{fields:{name:{type:"string",id:1},timeout:{type:"google.protobuf.Duration",id:2}}},OperationInfo:{fields:{responseType:{type:"string",id:1},metadataType:{type:"string",id:2}}}}},api:{options:{go_package:"google.golang.org/genproto/googleapis/api/annotations;annotations",java_multiple_files:!0,java_outer_classname:"ClientProto",java_package:"com.google.api",objc_class_prefix:"GAPI",cc_enable_arenas:!0},nested:{http:{type:"HttpRule",id:72295728,extend:"google.protobuf.MethodOptions"},Http:{fields:{rules:{rule:"repeated",type:"HttpRule",id:1},fullyDecodeReservedExpansion:{type:"bool",id:2}}},HttpRule:{oneofs:{pattern:{oneof:["get","put","post","delete","patch","custom"]}},fields:{selector:{type:"string",id:1},get:{type:"string",id:2},put:{type:"string",id:3},post:{type:"string",id:4},delete:{type:"string",id:5},patch:{type:"string",id:6},custom:{type:"CustomHttpPattern",id:8},body:{type:"string",id:7},responseBody:{type:"string",id:12},additionalBindings:{rule:"repeated",type:"HttpRule",id:11}}},CustomHttpPattern:{fields:{kind:{type:"string",id:1},path:{type:"string",id:2}}},methodSignature:{rule:"repeated",type:"string",id:1051,extend:"google.protobuf.MethodOptions"},defaultHost:{type:"string",id:1049,extend:"google.protobuf.ServiceOptions"},oauthScopes:{type:"string",id:1050,extend:"google.protobuf.ServiceOptions"}}},protobuf:{options:{go_package:"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weakDependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5,options:{default:!1}},serverStreaming:{type:"bool",id:6,options:{default:!1}}}},FileOptions:{fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10,options:{default:!1}},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27,options:{default:!1}},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16,options:{default:!1}},javaGenericServices:{type:"bool",id:17,options:{default:!1}},pyGenericServices:{type:"bool",id:18,options:{default:!1}},phpGenericServices:{type:"bool",id:42,options:{default:!1}},deprecated:{type:"bool",id:23,options:{default:!1}},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{messageSetWireFormat:{type:"bool",id:1,options:{default:!1}},noStandardDescriptorAccessor:{type:"bool",id:2,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},mapEntry:{type:"bool",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8],[9,9]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5,options:{default:!1}},deprecated:{type:"bool",id:3,options:{default:!1}},weak:{type:"bool",id:10,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33,options:{default:!1}},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},Duration:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}},Empty:{fields:{}}}},rpc:{options:{cc_enable_arenas:!0,go_package:"google.golang.org/genproto/googleapis/rpc/status;status",java_multiple_files:!0,java_outer_classname:"StatusProto",java_package:"com.google.rpc",objc_class_prefix:"RPC"},nested:{Status:{fields:{code:{type:"int32",id:1},message:{type:"string",id:2},details:{rule:"repeated",type:"google.protobuf.Any",id:3}}}}}}}},require$$4={nested:nested},hasRequiredOperationsClient,hasRequiredSrc$2;function requireOperationsClient(){return hasRequiredOperationsClient||(hasRequiredOperationsClient=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OperationsClientBuilder=e.OperationsClient=e.ALL_SCOPES=e.SERVICE_ADDRESS=void 0;const t=requireCreateApiCall(),r=requireDescriptor(),n=requireGax(),o=require$$3,i=require$$4,a=requireTranscoding();e.SERVICE_ADDRESS="longrunning.googleapis.com";const s=require$$19.version;e.ALL_SCOPES=[];class l{constructor(n,i,a){const l=Object.assign({servicePath:e.SERVICE_ADDRESS,port:443,clientConfig:{}},a),p=["gl-node/"+process.versions.node];l.libName&&l.libVersion&&p.push(l.libName+"/"+l.libVersion),p.push("gapic/0.7.1","gax/"+s),l.fallback?p.push("gl-web/"+s):p.push("grpc/"+n.grpcVersion);const d=n.constructSettings("google.longrunning.Operations",o,l.clientConfig||{},{"x-goog-api-client":p.join(" ")});this.auth=n.auth,this.innerApiCalls={},this.descriptor={listOperations:new r.PageDescriptor("pageToken","nextPageToken","operations")},this.operationsStub=n.createStub(l.fallback?i.lookupService("google.longrunning.Operations"):i.google.longrunning.Operations,l);const u=["getOperation","listOperations","cancelOperation","deleteOperation"];for(const e of u){const r=this.operationsStub.then(t=>(...r)=>t[e].apply(t,r),e=>()=>{throw e});this.innerApiCalls[e]=(0,t.createApiCall)(r,d[e],this.descriptor[e])}}close(){this.operationsStub.then(e=>e.close())}getProjectId(e){return this.auth&&"getProjectId"in this.auth?this.auth.getProjectId(e):e?void e(new Error("Cannot determine project ID.")):Promise.reject("Cannot determine project ID.")}getOperationInternal(e,t,r){return e=e||{},t=t||{},this.innerApiCalls.getOperation(e,t,r)}getOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.getOperation(e,n,r)}listOperations(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.listOperations(e,n,r)}listOperationsStream(e,t){const r=new n.CallSettings(t);return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations,e,r)}listOperationsAsync(e,t){e=e||{},t=t||{};const r=new n.CallSettings(t);return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations,e,r)}cancelOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.cancelOperation(e,n,r)}deleteOperation(e,t,r){let n;return t instanceof Function&&void 0===r?(r=t,n={}):n=t,e=e||{},n=n||{},this.innerApiCalls.deleteOperation(e,n,r)}}e.OperationsClient=l;e.OperationsClientBuilder=class{constructor(e,t){t&&e.httpRules&&(0,a.overrideHttpRules)(e.httpRules,t);const r=null!=t?t:e.loadProtoJSON(i);this.operationsClient=t=>(e.fallback&&(t.fallback=e.fallback),new l(e,r,t)),Object.assign(this.operationsClient,l)}}}(operationsClient)),operationsClient}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializer=e.warn=e.ChannelCredentials=e.makeUUID=e.fallback=e.protobufMinimal=e.protobuf=e.version=e.createByteLengthFunction=e.LocationsClient=e.IamClient=e.OperationsClient=e.LocationProtos=e.IamProtos=e.operationsProtos=e.routingHeader=e.StreamType=e.Status=e.PathTemplate=e.operation=e.Operation=e.GrpcClient=e.GoogleProtoFilesRoot=e.ClientStub=e.GoogleError=e.createMaxRetriesBackoffSettings=e.createDefaultBackoffSettings=e.createBackoffSettings=e.createBundleOptions=e.createRetryOptions=e.RetryOptions=e.constructSettings=e.CallSettings=e.StreamDescriptor=e.PageDescriptor=e.LongrunningDescriptor=e.BundleDescriptor=e.createApiCall=e.OngoingCall=e.grpc=e.GoogleAuth=void 0,e.lro=b;const t=requireSrc$5();e.grpc=t;const r=requireGrpc(),n=requireIam_service();e.IamProtos=n;const o=requireLocations();e.LocationProtos=o;const i=requireOperations();e.operationsProtos=i;const a=requireOperationsClient(),s=requireRoutingHeader();e.routingHeader=s;var l=require$$3__default.default;Object.defineProperty(e,"GoogleAuth",{enumerable:!0,get:function(){return l.GoogleAuth}});var p=requireCall();Object.defineProperty(e,"OngoingCall",{enumerable:!0,get:function(){return p.OngoingCall}});var d=requireCreateApiCall();Object.defineProperty(e,"createApiCall",{enumerable:!0,get:function(){return d.createApiCall}});var u=requireDescriptor();Object.defineProperty(e,"BundleDescriptor",{enumerable:!0,get:function(){return u.BundleDescriptor}}),Object.defineProperty(e,"LongrunningDescriptor",{enumerable:!0,get:function(){return u.LongrunningDescriptor}}),Object.defineProperty(e,"PageDescriptor",{enumerable:!0,get:function(){return u.PageDescriptor}}),Object.defineProperty(e,"StreamDescriptor",{enumerable:!0,get:function(){return u.StreamDescriptor}});var c=requireGax();Object.defineProperty(e,"CallSettings",{enumerable:!0,get:function(){return c.CallSettings}}),Object.defineProperty(e,"constructSettings",{enumerable:!0,get:function(){return c.constructSettings}}),Object.defineProperty(e,"RetryOptions",{enumerable:!0,get:function(){return c.RetryOptions}}),Object.defineProperty(e,"createRetryOptions",{enumerable:!0,get:function(){return c.createRetryOptions}}),Object.defineProperty(e,"createBundleOptions",{enumerable:!0,get:function(){return c.createBundleOptions}}),Object.defineProperty(e,"createBackoffSettings",{enumerable:!0,get:function(){return c.createBackoffSettings}}),Object.defineProperty(e,"createDefaultBackoffSettings",{enumerable:!0,get:function(){return c.createDefaultBackoffSettings}}),Object.defineProperty(e,"createMaxRetriesBackoffSettings",{enumerable:!0,get:function(){return c.createMaxRetriesBackoffSettings}});var f=requireGoogleError();Object.defineProperty(e,"GoogleError",{enumerable:!0,get:function(){return f.GoogleError}});var h=requireGrpc();Object.defineProperty(e,"ClientStub",{enumerable:!0,get:function(){return h.ClientStub}}),Object.defineProperty(e,"GoogleProtoFilesRoot",{enumerable:!0,get:function(){return h.GoogleProtoFilesRoot}}),Object.defineProperty(e,"GrpcClient",{enumerable:!0,get:function(){return h.GrpcClient}});var m=requireLongrunning();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return m.Operation}}),Object.defineProperty(e,"operation",{enumerable:!0,get:function(){return m.operation}});var g=requirePathTemplate();Object.defineProperty(e,"PathTemplate",{enumerable:!0,get:function(){return g.PathTemplate}});var y=requireStatus();Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return y.Status}});var v=requireStreaming();function b(e){e=Object.assign({scopes:b.ALL_SCOPES},e);const t=new r.GrpcClient(e);return new a.OperationsClientBuilder(t)}Object.defineProperty(e,"StreamType",{enumerable:!0,get:function(){return v.StreamType}}),b.SERVICE_ADDRESS=a.SERVICE_ADDRESS,b.ALL_SCOPES=a.ALL_SCOPES;var O=requireOperationsClient();Object.defineProperty(e,"OperationsClient",{enumerable:!0,get:function(){return O.OperationsClient}});var w=requireIamService();Object.defineProperty(e,"IamClient",{enumerable:!0,get:function(){return w.IamClient}});var S=requireLocationService();Object.defineProperty(e,"LocationsClient",{enumerable:!0,get:function(){return S.LocationsClient}}),e.createByteLengthFunction=r.GrpcClient.createByteLengthFunction,e.version=require$$19.version;const _=requireProtobufjs();e.protobuf=_,e.protobufMinimal=requireMinimal();const P=requireFallback();e.fallback=P;var E=requireUtil$2();Object.defineProperty(e,"makeUUID",{enumerable:!0,get:function(){return E.makeUUID}});var T=requireSrc$5();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return T.ChannelCredentials}});var C=requireWarnings();Object.defineProperty(e,"warn",{enumerable:!0,get:function(){return C.warn}});const R=requireSrc$3();e.serializer=R}(src$7)),src$7}var srcExports$1=requireSrc$2(),_a,STATUS_TO_STRING_MAP=(_a={},_a[srcExports$1.Status.CANCELLED]="cancelled",_a[srcExports$1.Status.UNKNOWN]="unknown",_a[srcExports$1.Status.INVALID_ARGUMENT]="invalid-argument",_a[srcExports$1.Status.DEADLINE_EXCEEDED]="deadline-exceeded",_a[srcExports$1.Status.NOT_FOUND]="not-found",_a[srcExports$1.Status.ALREADY_EXISTS]="already-exists",_a[srcExports$1.Status.PERMISSION_DENIED]="permission-denied",_a[srcExports$1.Status.RESOURCE_EXHAUSTED]="resource-exhausted",_a[srcExports$1.Status.FAILED_PRECONDITION]="failed-precondition",_a[srcExports$1.Status.ABORTED]="aborted",_a[srcExports$1.Status.OUT_OF_RANGE]="out-of-range",_a[srcExports$1.Status.UNIMPLEMENTED]="unimplemented",_a[srcExports$1.Status.INTERNAL]="internal",_a[srcExports$1.Status.UNAVAILABLE]="unavailable",_a[srcExports$1.Status.DATA_LOSS]="data-loss",_a[srcExports$1.Status.UNAUTHENTICATED]="unauthenticated",_a[srcExports$1.Status.OK]="unknown",_a),FIRESTORE_ERROR_MAPPINGS={"permission-denied":{userMessage:"Unable to access storage. Please try signing in again.",internalMessage:"Firestore permission denied",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"Firestore service unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"not-found":{userMessage:"The requested data could not be found.",internalMessage:"Firestore document not found",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"deadline-exceeded":{userMessage:"The operation took too long. Please try again.",internalMessage:"Firestore operation timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},unauthenticated:{userMessage:"Authentication required. Please sign in again.",internalMessage:"Firestore authentication failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},"already-exists":{userMessage:"This record already exists.",internalMessage:"Firestore document already exists",shouldRetry:!1,severity:exports.ErrorSeverity.Info},"resource-exhausted":{userMessage:"Service is at capacity. Please try again later.",internalMessage:"Firestore quota exceeded",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"failed-precondition":{userMessage:"The operation cannot be completed at this time.",internalMessage:"Firestore precondition failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},aborted:{userMessage:"The operation was cancelled. Please try again.",internalMessage:"Firestore transaction aborted",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},"invalid-argument":{userMessage:"Invalid data provided. Please check your input.",internalMessage:"Firestore invalid argument",shouldRetry:!1,severity:exports.ErrorSeverity.Error},cancelled:{userMessage:"The operation was cancelled.",internalMessage:"Firestore operation cancelled",shouldRetry:!1,severity:exports.ErrorSeverity.Info},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Firestore unknown error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"out-of-range":{userMessage:"The requested range is invalid.",internalMessage:"Firestore out of range",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unimplemented:{userMessage:"This feature is not yet available.",internalMessage:"Firestore operation not implemented",shouldRetry:!1,severity:exports.ErrorSeverity.Error},internal:{userMessage:"An internal error occurred. Our team has been notified.",internalMessage:"Firestore internal error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},"data-loss":{userMessage:"Data integrity error. Please contact support.",internalMessage:"Firestore data loss detected",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function isGoogleError(e){return e instanceof srcExports$1.GoogleError&&"number"==typeof e.code}function handleFirestoreError(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isGoogleError(e)?(r=void 0!==e.code?STATUS_TO_STRING_MAP[e.code]:void 0,n=e):n=e instanceof Error?e:new Error(String(e));var o=r&&r in FIRESTORE_ERROR_MAPPINGS?FIRESTORE_ERROR_MAPPINGS[r]:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown error type",shouldRetry:!1,severity:exports.ErrorSeverity.Error};throw console.error("[Internal] Error from Firestore: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var src$1={},gaxios={},isStream_1,hasRequiredIsStream;function requireIsStream(){if(hasRequiredIsStream)return isStream_1;hasRequiredIsStream=1;const e=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;return e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,isStream_1=e}var common$1={},util={},name="gaxios",version="6.7.1",description="A simple common HTTP client specifically for Google APIs and services.",main="build/src/index.js",types="build/src/index.d.ts",files=["build/src"],scripts={lint:"gts check",test:"c8 mocha build/test","presystem-test":"npm run compile","system-test":"mocha build/system-test --timeout 80000",compile:"tsc -p .",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"compodoc src/","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},repository="googleapis/gaxios",keywords=["google"],engines={node:">=14"},author="Google, LLC",license="Apache-2.0",devDependencies={"@babel/plugin-proposal-private-methods":"^7.18.6","@compodoc/compodoc":"1.1.19","@types/cors":"^2.8.6","@types/express":"^4.16.1","@types/extend":"^3.0.1","@types/mocha":"^9.0.0","@types/multiparty":"0.0.36","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^20.0.0","@types/node-fetch":"^2.5.7","@types/sinon":"^17.0.0","@types/tmp":"0.2.6","@types/uuid":"^10.0.0","abort-controller":"^3.0.0",assert:"^2.0.0",browserify:"^17.0.0",c8:"^8.0.0",cheerio:"1.0.0-rc.10",cors:"^2.8.5",execa:"^5.0.0",express:"^4.16.4","form-data":"^4.0.0",gts:"^5.0.0","is-docker":"^2.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"5.0.0",linkinator:"^3.0.0",mocha:"^8.0.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^13.0.0","null-loader":"^4.0.0",puppeteer:"^19.0.0",sinon:"^18.0.0","stream-browserify":"^3.0.0",tmp:"0.2.3","ts-loader":"^8.0.0",typescript:"^5.1.6",webpack:"^5.35.0","webpack-cli":"^4.0.0"},dependencies={extend:"^3.0.2","https-proxy-agent":"^7.0.1","is-stream":"^2.0.0","node-fetch":"^2.6.9",uuid:"^9.0.1"},require$$0={name:name,version:version,description:description,main:main,types:types,files:files,scripts:scripts,repository:repository,keywords:keywords,engines:engines,author:author,license:license,devDependencies:devDependencies,dependencies:dependencies},hasRequiredUtil,hasRequiredCommon$1;function requireUtil(){return hasRequiredUtil||(hasRequiredUtil=1,Object.defineProperty(util,"__esModule",{value:!0}),util.pkg=void 0,util.pkg=require$$0),util}function requireCommon$1(){return hasRequiredCommon$1||(hasRequiredCommon$1=1,function(e){var t,r=common$1&&common$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=function e(t){const r="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function o(e){if(e)for(const t of Object.keys(e))/^authentication$/i.test(t)&&(e[t]=r),/^authorization$/i.test(t)&&(e[t]=r),/secret/i.test(t)&&(e[t]=r)}function i(e,t){if("object"==typeof e&&null!==e&&"string"==typeof e[t]){const n=e[t];(/grant_type=/i.test(n)||/assertion=/i.test(n)||/secret/i.test(n))&&(e[t]=r)}}function a(e){"object"==typeof e&&null!==e&&("grant_type"in e&&(e.grant_type=r),"assertion"in e&&(e.assertion=r),"client_secret"in e&&(e.client_secret=r))}if(t.config){o(t.config.headers),i(t.config,"data"),a(t.config.data),i(t.config,"body"),a(t.config.body);try{const e=new n.URL("",t.config.url);e.searchParams.has("token")&&e.searchParams.set("token",r),e.searchParams.has("client_secret")&&e.searchParams.set("client_secret",r),t.config.url=e.toString()}catch(e){}}t.response&&(e({config:t.response.config}),o(t.response.headers),i(t.response,"data"),a(t.response.data));return t};const n=Url__default.default,o=requireUtil(),i=r(requireExtend());e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${o.pkg.name}-gaxios-error`);class a extends Error{static[(t=e.GAXIOS_ERROR_SYMBOL,Symbol.hasInstance)](t){return!(!t||"object"!=typeof t||!(e.GAXIOS_ERROR_SYMBOL in t)||t[e.GAXIOS_ERROR_SYMBOL]!==o.pkg.version)||Function.prototype[Symbol.hasInstance].call(a,t)}constructor(e,r,n,a){var s;if(super(e),this.config=r,this.response=n,this.error=a,this[t]=o.pkg.version,this.config=(0,i.default)(!0,{},r),this.response&&(this.response.config=(0,i.default)(!0,{},this.response.config)),this.response){try{this.response.data=function(e,t){switch(e){case"stream":default:return t;case"json":return JSON.parse(JSON.stringify(t));case"arraybuffer":return JSON.parse(Buffer.from(t).toString("utf8"));case"blob":return JSON.parse(t.text())}}(this.config.responseType,null===(s=this.response)||void 0===s?void 0:s.data)}catch(e){}this.status=this.response.status}a&&"code"in a&&a.code&&(this.code=a.code),r.errorRedactor&&r.errorRedactor({config:this.config,response:this.response})}}e.GaxiosError=a}(common$1)),common$1}var retry={},hasRequiredRetry;function requireRetry(){if(hasRequiredRetry)return retry;function e(e){var r;const n=t(e);if("AbortError"===e.name||"AbortError"===(null===(r=e.error)||void 0===r?void 0:r.name))return!1;if(!n||0===n.retry)return!1;if(!e.response&&(n.currentRetryAttempt||0)>=n.noResponseRetries)return!1;if(!e.config.method||n.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){let t=!1;for(const[r,o]of n.statusCodesToRetry){const n=e.response.status;if(n>=r&&n<=o){t=!0;break}}if(!t)return!1}return n.currentRetryAttempt=n.currentRetryAttempt||0,!(n.currentRetryAttempt>=n.retry)}function t(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}return hasRequiredRetry=1,Object.defineProperty(retry,"__esModule",{value:!0}),retry.getRetryConfig=async function(r){let n=t(r);if(!r||!r.config||!n&&!r.config.retry)return{shouldRetry:!1};n=n||{},n.currentRetryAttempt=n.currentRetryAttempt||0,n.retry=void 0===n.retry||null===n.retry?3:n.retry,n.httpMethodsToRetry=n.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],n.noResponseRetries=void 0===n.noResponseRetries||null===n.noResponseRetries?2:n.noResponseRetries,n.retryDelayMultiplier=n.retryDelayMultiplier?n.retryDelayMultiplier:2,n.timeOfFirstRequest=n.timeOfFirstRequest?n.timeOfFirstRequest:Date.now(),n.totalTimeout=n.totalTimeout?n.totalTimeout:Number.MAX_SAFE_INTEGER,n.maxRetryDelay=n.maxRetryDelay?n.maxRetryDelay:Number.MAX_SAFE_INTEGER;n.statusCodesToRetry=n.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],r.config.retryConfig=n;const o=n.shouldRetry||e;if(!await o(r))return{shouldRetry:!1,config:r.config};const i=function(e){var t;const r=e.currentRetryAttempt?0:null!==(t=e.retryDelay)&&void 0!==t?t:100,n=r+(Math.pow(e.retryDelayMultiplier,e.currentRetryAttempt)-1)/2*1e3,o=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(n,o,e.maxRetryDelay)}(n);r.config.retryConfig.currentRetryAttempt+=1;const a=n.retryBackoff?n.retryBackoff(r,i):new Promise(e=>{setTimeout(e,i)});n.onRetryAttempt&&n.onRetryAttempt(r);return await a,{shouldRetry:!0,config:r.config}},retry}var interceptor={},hasRequiredInterceptor;function requireInterceptor(){if(hasRequiredInterceptor)return interceptor;hasRequiredInterceptor=1,Object.defineProperty(interceptor,"__esModule",{value:!0}),interceptor.GaxiosInterceptorManager=void 0;class e extends Set{}return interceptor.GaxiosInterceptorManager=e,interceptor}var dist$1={},src={exports:{}},browser={exports:{}},ms,hasRequiredMs,common,hasRequiredCommon,hasRequiredBrowser;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var e=1e3,t=60*e,r=60*t,n=24*r,o=7*n,i=365.25*n;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return ms=function(s,l){l=l||{};var p=typeof s;if("string"===p&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===p&&isFinite(s))return l.long?function(o){var i=Math.abs(o);if(i>=n)return a(o,i,n,"day");if(i>=r)return a(o,i,r,"hour");if(i>=t)return a(o,i,t,"minute");if(i>=e)return a(o,i,e,"second");return o+" ms"}(s):function(o){var i=Math.abs(o);if(i>=n)return Math.round(o/n)+"d";if(i>=r)return Math.round(o/r)+"h";if(i>=t)return Math.round(o/t)+"m";if(i>=e)return Math.round(o/e)+"s";return o+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},ms}function requireCommon(){if(hasRequiredCommon)return common;return hasRequiredCommon=1,common=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=requireMs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},common}function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=requireCommon()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports)),browser.exports}var node={exports:{}},hasFlag,hasRequiredHasFlag,supportsColor_1,hasRequiredSupportsColor,hasRequiredNode,hasRequiredSrc$1;function requireHasFlag(){return hasRequiredHasFlag?hasFlag:(hasRequiredHasFlag=1,hasFlag=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)})}function requireSupportsColor(){if(hasRequiredSupportsColor)return supportsColor_1;hasRequiredSupportsColor=1;const e=require$$0__default$1.default,t=require$$1__default$7.default,r=requireHasFlag(),{env:n}=process;let o;function i(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function a(t,i){if(0===o)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!i&&void 0===o)return 0;const a=o||0;if("dumb"===n.TERM)return a;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:a;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:a}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?o=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(o=1),"FORCE_COLOR"in n&&(o="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),supportsColor_1={supportsColor:function(e){return i(a(e,e&&e.isTTY))},stdout:i(a(!0,t.isatty(1))),stderr:i(a(!0,t.isatty(2)))},supportsColor_1}function requireNode(){return hasRequiredNode||(hasRequiredNode=1,function(e,t){const r=require$$1__default$7.default,n=require$$1__default$4.default;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} [0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=requireSupportsColor();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=requireCommon()(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(node,node.exports)),node.exports}function requireSrc$1(){return hasRequiredSrc$1||(hasRequiredSrc$1=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?src.exports=requireBrowser():src.exports=requireNode()),src.exports}var dist={},helpers={},hasRequiredHelpers,hasRequiredDist$1;function requireHelpers(){if(hasRequiredHelpers)return helpers;hasRequiredHelpers=1;var e=helpers&&helpers.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=helpers&&helpers.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=helpers&&helpers.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.req=helpers.json=helpers.toBuffer=void 0;const n=r(http__default.default),o=r(require$$1__default$6.default);async function i(e){let t=0;const r=[];for await(const n of e)t+=n.length,r.push(n);return Buffer.concat(r,t)}return helpers.toBuffer=i,helpers.json=async function(e){const t=(await i(e)).toString("utf8");try{return JSON.parse(t)}catch(e){const r=e;throw r.message+=` (input: ${t})`,r}},helpers.req=function(e,t={}){const r=(("string"==typeof e?e:e.href).startsWith("https:")?o:n).request(e,t),i=new Promise((e,t)=>{r.once("response",e).once("error",t).end()});return r.then=i.then.bind(i),r},helpers}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=dist&&dist.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=dist&&dist.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=dist&&dist.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);return r(n,e),n},o=dist&&dist.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;const i=n(require$$0__default$2.default),a=n(http__default.default),s=require$$1__default$6.default;o(requireHelpers(),e);const l=Symbol("AgentBaseInternalState");class p extends a.Agent{constructor(e){super(e),this[l]={}}isSecureEndpoint(e){if(e){if("boolean"==typeof e.secureEndpoint)return e.secureEndpoint;if("string"==typeof e.protocol)return"https:"===e.protocol}const{stack:t}=new Error;return"string"==typeof t&&t.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const t=new i.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||null===t)return;const r=this.sockets[e],n=r.indexOf(t);-1!==n&&(r.splice(n,1),this.totalSocketCount--,0===r.length&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?s.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){const n={...t,secureEndpoint:this.isSecureEndpoint(t)},o=this.getName(n),i=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,n)).then(s=>{if(this.decrementSockets(o,i),s instanceof a.Agent)try{return s.addRequest(e,n)}catch(e){return r(e)}this[l].currentSocket=s,super.createSocket(e,t,r)},e=>{this.decrementSockets(o,i),r(e)})}createConnection(){const e=this[l].currentSocket;if(this[l].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[l].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(e){this[l]&&(this[l].defaultPort=e)}get protocol(){return this[l].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[l]&&(this[l].protocol=e)}}e.Agent=p}(dist)),dist}var parseProxyResponse={},hasRequiredParseProxyResponse,hasRequiredDist,hasRequiredGaxios,hasRequiredSrc;function requireParseProxyResponse(){if(hasRequiredParseProxyResponse)return parseProxyResponse;hasRequiredParseProxyResponse=1;var e=parseProxyResponse&&parseProxyResponse.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(parseProxyResponse,"__esModule",{value:!0}),parseProxyResponse.parseProxyResponse=void 0;const t=(0,e(requireSrc$1()).default)("https-proxy-agent:parse-proxy-response");return parseProxyResponse.parseProxyResponse=function(e){return new Promise((r,n)=>{let o=0;const i=[];function a(){const l=e.read();l?function(l){i.push(l),o+=l.length;const p=Buffer.concat(i,o),d=p.indexOf("\r\n\r\n");if(-1===d)return t("have not received end of HTTP headers yet..."),void a();const u=p.slice(0,d).toString("ascii").split("\r\n"),c=u.shift();if(!c)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));const f=c.split(" "),h=+f[1],m=f.slice(2).join(" "),g={};for(const t of u){if(!t)continue;const r=t.indexOf(":");if(-1===r)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${t}"`));const o=t.slice(0,r).toLowerCase(),i=t.slice(r+1).trimStart(),a=g[o];"string"==typeof a?g[o]=[a,i]:Array.isArray(a)?a.push(i):g[o]=i}t("got proxy server response: %o %o",c,g),s(),r({connect:{statusCode:h,statusText:m,headers:g},buffered:p})}(l):e.once("readable",a)}function s(){e.removeListener("end",l),e.removeListener("error",p),e.removeListener("readable",a)}function l(){s(),t("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function p(e){s(),t("onerror %o",e),n(e)}e.on("error",p),e.on("end",l),a()})},parseProxyResponse}function requireDist(){if(hasRequiredDist)return dist$1;hasRequiredDist=1;var e=dist$1&&dist$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=dist$1&&dist$1.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=dist$1&&dist$1.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var o in r)"default"!==o&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);return t(n,r),n},n=dist$1&&dist$1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dist$1,"__esModule",{value:!0}),dist$1.HttpsProxyAgent=void 0;const o=r(require$$0__default$2.default),i=r(require$$1__default$1.default),a=n(require$$2__default.default),s=n(requireSrc$1()),l=requireDist$1(),p=Url__default.default,d=requireParseProxyResponse(),u=(0,s.default)("https-proxy-agent"),c=e=>void 0===e.servername&&e.host&&!o.isIP(e.host)?{...e,servername:e.host}:e;class f extends l.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy="string"==typeof e?new p.URL(e):e,this.proxyHeaders=t?.headers??{},u("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?m(t,"headers"):null,host:r,port:n}}async connect(e,t){const{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;"https:"===r.protocol?(u("Creating `tls.Socket`: %o",this.connectOpts),n=i.connect(c(this.connectOpts))):(u("Creating `net.Socket`: %o",this.connectOpts),n=o.connect(this.connectOpts));const s="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},l=o.isIPv6(t.host)?`[${t.host}]`:t.host;let p=`CONNECT ${l}:${t.port} HTTP/1.1\r\n`;if(r.username||r.password){const e=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(e).toString("base64")}`}s.Host=`${l}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(s))p+=`${e}: ${s[e]}\r\n`;const f=(0,d.parseProxyResponse)(n);n.write(`${p}\r\n`);const{connect:g,buffered:y}=await f;if(e.emit("proxyConnect",g),this.emit("proxyConnect",g,e),200===g.statusCode)return e.once("socket",h),t.secureEndpoint?(u("Upgrading socket connection to TLS"),i.connect({...m(c(t),"host","path","port"),socket:n})):n;n.destroy();const v=new o.Socket({writable:!1});return v.readable=!0,e.once("socket",e=>{u("Replaying proxy buffer for failed request"),(0,a.default)(e.listenerCount("data")>0),e.push(y),e.push(null)}),v}}function h(e){e.resume()}function m(e,...t){const r={};let n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}return f.protocols=["http","https"],dist$1.HttpsProxyAgent=f,dist$1}function requireGaxios(){if(hasRequiredGaxios)return gaxios;hasRequiredGaxios=1;var e,t,r,n,o,i,a,s,l=gaxios&&gaxios.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),p=gaxios&&gaxios.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=gaxios&&gaxios.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return p(t,e),t},u=gaxios&&gaxios.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=gaxios&&gaxios.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},f=gaxios&&gaxios.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gaxios,"__esModule",{value:!0}),gaxios.Gaxios=void 0;const h=f(requireExtend()),m=require$$1__default$6.default,g=f(require$$2$1),y=f(require$$0__default$5.default),v=f(requireIsStream()),b=Url__default.default,O=requireCommon$1(),w=requireRetry(),S=Stream__default.default,_=require$$9,P=requireInterceptor(),E="undefined"!=typeof window&&window&&window.fetch?window.fetch:g.default;function T(e,t){return!!C(e,t)}function C(e,t){t=t.toLowerCase();for(const r of Object.keys((null==e?void 0:e.headers)||{}))if(t===r.toLowerCase())return e.headers[r]}class R{constructor(t){e.add(this),this.agentCache=new Map,this.defaults=t||{},this.interceptors={request:new P.GaxiosInterceptorManager,response:new P.GaxiosInterceptorManager}}async request(t={}){return t=await u(this,e,"m",i).call(this,t),t=await u(this,e,"m",n).call(this,t),u(this,e,"m",o).call(this,this._request(t))}async _defaultAdapter(e){const t=e.fetchImplementation||E,r=await t(e.url,e),n=await this.getResponseData(e,r);return this.translateResponse(e,r,n)}async _request(e={}){var t;try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if("stream"===e.responseType){let e="";await new Promise(r=>{(null==t?void 0:t.data).on("data",t=>{e+=t}),(null==t?void 0:t.data).on("end",r)}),t.data=e}throw new O.GaxiosError(`Request failed with status code ${t.status}`,e,t)}return t}catch(r){const n=r instanceof O.GaxiosError?r:new O.GaxiosError(r.message,e,void 0,r),{shouldRetry:o,config:i}=await(0,w.getRetryConfig)(n);if(o&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=null===(t=n.config)||void 0===t?void 0:t.retryConfig,this._request(e);throw n}}async getResponseData(e,t){switch(e.responseType){case"stream":return t.body;case"json":{let e=await t.text();try{e=JSON.parse(e)}catch(e){}return e}case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"text":return t.text();default:return this.getResponseDataFromContentType(t)}}validateStatus(e){return e>=200&&e<300}paramsSerializer(e){return y.default.stringify(e)}translateResponse(e,t,r){const n={};return t.headers.forEach((e,t)=>{n[t]=e}),{config:e,data:r,headers:n,status:t.status,statusText:t.statusText,request:{responseURL:t.url}}}async getResponseDataFromContentType(e){let t=e.headers.get("Content-Type");if(null===t)return e.text();if(t=t.toLowerCase(),t.includes("application/json")){let t=await e.text();try{t=JSON.parse(t)}catch(e){}return t}return t.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,t){const r=`--${t}--`;for(const r of e){const e=`--${t}\r\nContent-Type: ${r.headers["Content-Type"]||"application/octet-stream"}\r\n\r\n`;yield e,"string"==typeof r.content?yield r.content:yield*r.content,yield"\r\n"}yield r}}return gaxios.Gaxios=R,t=R,e=new WeakSet,r=function(e,t=[]){var r,n;const o=new b.URL(e),i=[...t],a=(null===(n=null!==(r=process.env.NO_PROXY)&&void 0!==r?r:process.env.no_proxy)||void 0===n?void 0:n.split(","))||[];for(const e of a)i.push(e.trim());for(const e of i)if(e instanceof RegExp){if(e.test(o.toString()))return!1}else if(e instanceof b.URL){if(e.origin===o.origin)return!1}else if(e.startsWith("*.")||e.startsWith(".")){const t=e.replace(/^\*\./,".");if(o.hostname.endsWith(t))return!1}else if(e===o.origin||e===o.hostname||e===o.href)return!1;return!0},n=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t},o=async function(e){let t=Promise.resolve(e);for(const e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t},i=async function(n){var o,i,a,l;const p=(0,h.default)(!0,{},this.defaults,n);if(!p.url)throw new Error("URL is required.");const d=p.baseUrl||p.baseURL;if(d&&(p.url=d.toString()+p.url),p.paramsSerializer=p.paramsSerializer||this.paramsSerializer,p.params&&Object.keys(p.params).length>0){let e=p.paramsSerializer(p.params);e.startsWith("?")&&(e=e.slice(1));const t=p.url.toString().includes("?")?"&":"?";p.url=p.url+t+e}if("number"==typeof n.maxContentLength&&(p.size=n.maxContentLength),"number"==typeof n.maxRedirects&&(p.follow=n.maxRedirects),p.headers=p.headers||{},void 0===p.multipart&&p.data){const e="undefined"!=typeof FormData&&(null==p?void 0:p.data)instanceof FormData;v.default.readable(p.data)?p.body=p.data:"undefined"!=typeof Buffer&&Buffer.isBuffer(p.data)?(p.body=p.data,T(p,"Content-Type")||(p.headers["Content-Type"]="application/json")):"object"==typeof p.data?e||("application/x-www-form-urlencoded"===C(p,"content-type")?p.body=p.paramsSerializer(p.data):(T(p,"Content-Type")||(p.headers["Content-Type"]="application/json"),p.body=JSON.stringify(p.data))):p.body=p.data}else if(p.multipart&&p.multipart.length>0){const e=(0,_.v4)();p.headers["Content-Type"]=`multipart/related; boundary=${e}`;const t=new S.PassThrough;p.body=t,(0,S.pipeline)(this.getMultipartRequest(p.multipart,e),t,()=>{})}p.validateStatus=p.validateStatus||this.validateStatus,p.responseType=p.responseType||"unknown",p.headers.Accept||"json"!==p.responseType||(p.headers.Accept="application/json"),p.method=p.method||"GET";const c=p.proxy||(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.HTTPS_PROXY)||(null===(i=null===process||void 0===process?void 0:process.env)||void 0===i?void 0:i.https_proxy)||(null===(a=null===process||void 0===process?void 0:process.env)||void 0===a?void 0:a.HTTP_PROXY)||(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.http_proxy),f=u(this,e,"m",r).call(this,p.url,p.noProxy);if(p.agent);else if(c&&f){const e=await u(t,t,"m",s).call(t);this.agentCache.has(c)?p.agent=this.agentCache.get(c):(p.agent=new e(c,{cert:p.cert,key:p.key}),this.agentCache.set(c,p.agent))}else p.cert&&p.key&&(this.agentCache.has(p.key)?p.agent=this.agentCache.get(p.key):(p.agent=new m.Agent({cert:p.cert,key:p.key}),this.agentCache.set(p.key,p.agent)));return"function"!=typeof p.errorRedactor&&!1!==p.errorRedactor&&(p.errorRedactor=O.defaultErrorRedactor),p},s=async function(){return c(this,t,u(this,t,"f",a)||(await Promise.resolve().then(()=>d(requireDist()))).HttpsProxyAgent,"f",a),u(this,t,"f",a)},a={value:void 0},gaxios}function requireSrc(){return hasRequiredSrc||(hasRequiredSrc=1,function(e){var t=src$1&&src$1.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=src$1&&src$1.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=async function(t){return e.instance.request(t)};const n=requireGaxios();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return n.Gaxios}});var o=requireCommon$1();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return o.GaxiosError}}),r(requireInterceptor(),e),e.instance=new n.Gaxios}(src$1)),src$1}var srcExports=requireSrc(),mapHTTPStatusToOAuthError=function(e){switch(e){case 400:return"invalid_request";case 401:return"invalid_token";case 403:return"access_denied";case 429:return"network_error";case 500:return"server_error";case 503:return"temporarily_unavailable"}return"unknown"},OAUTH_ERROR_MAPPINGS={invalid_client:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth client credentials invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_grant:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth refresh token expired or revoked",shouldRetry:!1,severity:exports.ErrorSeverity.Error},access_denied:{userMessage:"Access was denied. Please grant permission to continue.",internalMessage:"User denied OAuth permission",shouldRetry:!1,severity:exports.ErrorSeverity.Info},invalid_token:{userMessage:"Your authentication token is invalid. Please sign in again.",internalMessage:"OAuth access token invalid",shouldRetry:!1,severity:exports.ErrorSeverity.Error},expired_token:{userMessage:"Your session has expired. Please sign in again.",internalMessage:"OAuth access token expired",shouldRetry:!1,severity:exports.ErrorSeverity.Error},redirect_uri_mismatch:{userMessage:"Authentication configuration error. Please contact support.",internalMessage:"OAuth redirect URI mismatch",shouldRetry:!1,severity:exports.ErrorSeverity.Error},insufficient_scope:{userMessage:"Additional permissions are required. Please sign in again.",internalMessage:"OAuth insufficient scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},network_error:{userMessage:"Network error. Please check your connection and try again.",internalMessage:"OAuth network error",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},timeout_error:{userMessage:"Request timed out. Please try again.",internalMessage:"OAuth request timeout",shouldRetry:!0,severity:exports.ErrorSeverity.Warning},invalid_request:{userMessage:"Invalid request. Please try again.",internalMessage:"OAuth invalid request parameters",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unsupported_grant_type:{userMessage:"Authentication method not supported. Please contact support.",internalMessage:"OAuth unsupported grant type",shouldRetry:!1,severity:exports.ErrorSeverity.Error},invalid_scope:{userMessage:"Invalid permissions requested. Please contact support.",internalMessage:"OAuth invalid scope",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unauthorized_client:{userMessage:"Application not authorized. Please contact support.",internalMessage:"OAuth client not authorized",shouldRetry:!1,severity:exports.ErrorSeverity.Error},unknown:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"Unknown OAuth error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},server_error:{userMessage:"An unexpected error occurred. Please try again.",internalMessage:"OAuth server error",shouldRetry:!0,severity:exports.ErrorSeverity.Error},temporarily_unavailable:{userMessage:"Service temporarily unavailable. Please try again in a moment.",internalMessage:"OAuth service temporarily unavailable",shouldRetry:!0,severity:exports.ErrorSeverity.Warning}};function isOAuth2Error(e){return e instanceof srcExports.GaxiosError}function extractOAuthErrorCode(e){var t,r,n=null===(r=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===r?void 0:r.error;return"string"==typeof n?n:"string"==typeof e.code?e.code.startsWith("E")?"ETIMEDOUT"===e.code?"timeout_error":("ENOTFOUND"===e.code||e.code,"network_error"):e.code:e.status?mapHTTPStatusToOAuthError(e.status):"unknown"}function handleGoogleOAuth2Error(e,t){var r,n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),isOAuth2Error(e)?(r=extractOAuthErrorCode(e),n=e):e instanceof Error?(n=e,r="unknown"):(n=new Error(String(e)),r="unknown");var o=r&&r in OAUTH_ERROR_MAPPINGS?OAUTH_ERROR_MAPPINGS[r]:OAUTH_ERROR_MAPPINGS.unknown;throw console.error("[Internal] Error from Google OAuth2: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var ENCRYPTION_ERROR_MAPPINGS={encryption_failed:{userMessage:"Failed to encrypt data. Please try again.",internalMessage:"Encryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error},decryption_failed:{userMessage:"Failed to decrypt data. Please contact support.",internalMessage:"Decryption operation failed",shouldRetry:!1,severity:exports.ErrorSeverity.Error}};function handleEncryptionError(e,t,r){var n;console.error("[".concat(t.service,"] Error in ").concat(t.operation,":"),e),n=e instanceof Error?e:new Error(String(e));var o=ENCRYPTION_ERROR_MAPPINGS[r];throw console.error("[Internal] Error from Encryption: ".concat(o.internalMessage),{code:r,operation:t.operation,metadata:t.metadata}),new OakGoogleClassroomException(o.userMessage,t.service,{code:r,shouldRetry:o.shouldRetry,severity:o.severity,context:t,originalError:n})}var EncryptionService=function(){function e(e){this.encryptionSecret=e,this.ENCRYPTION_SECRET=e}return e.prototype.encryptString=function(t){try{var r=crypto__default.default.randomBytes(e.SALT_BYTES).toString("hex"),n=crypto__default.default.randomBytes(e.IV_LENGTH),o=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,r,e.ENCRYPTION_KEY_LENGTH),i=crypto__default.default.createCipheriv(e.ALGORITHM,o,n),a=i.update(t,"utf8","hex");return a+=i.final("hex"),"".concat(n.toString("hex"),":").concat(a,":").concat(r)}catch(e){return handleEncryptionError(e,{operation:"encryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to encrypt string",errorType:e instanceof Error?e.name:typeof e}},"encryption_failed")}},e.prototype.decryptString=function(t){try{var r=__read(t.split(":"),3),n=r[0],o=r[1],i=r[2];if(!n||!o||!i)throw new Error("Invalid encrypted string");var a=Buffer.from(n,"hex"),s=crypto__default.default.scryptSync(this.ENCRYPTION_SECRET,i,e.ENCRYPTION_KEY_LENGTH),l=crypto__default.default.createDecipheriv(e.ALGORITHM,s,a),p=l.update(o,"hex","utf8");return p+=l.final("utf8")}catch(e){return handleEncryptionError(e,{operation:"decryptString",service:exports.ExceptionType.Encryption,metadata:{message:"Failed to decrypt string",errorType:e instanceof Error?e.name:typeof e}},"decryption_failed")}},e.ALGORITHM="aes-256-cbc",e.IV_LENGTH=16,e.SALT_BYTES=16,e.ENCRYPTION_KEY_LENGTH=32,e}(),createAnnouncementAttachmentArgsSchema=z__default.default.object({courseId:z__default.default.string(),itemId:z__default.default.string(),addOnToken:z__default.default.string(),title:z__default.default.string(),lessonSlug:z__default.default.string(),programmeSlug:z__default.default.string(),unitSlug:z__default.default.string(),maxPoints:z__default.default.number().optional(),teacherLoginHint:z__default.default.string().optional()}),classroomAttachmentSchema=z__default.default.object({courseId:z__default.default.string(),postId:z__default.default.string(),id:z__default.default.string(),title:z__default.default.string(),teacherViewUri:z__default.default.object({uri:z__default.default.string()}),studentViewUri:z__default.default.object({uri:z__default.default.string()}),studentWorkReviewUri:z__default.default.object({uri:z__default.default.string()}).optional(),itemId:z__default.default.string(),maxPoints:z__default.default.number().optional()});z__default.default.string();var googleOAuthUserSchema=z__default.default.object({accessToken:z__default.default.string(),loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional(),email:z__default.default.string().optional()}),tokenPayloadSchema=z__default.default.object({token:z__default.default.string()});z__default.default.tuple([createAnnouncementAttachmentArgsSchema,z__default.default.string().min(1),z__default.default.string().min(1)]);var classroomAttachmentEntitySchema=classroomAttachmentSchema.extend({attachmentId:z__default.default.string(),createdAt:z__default.default.string(),teacherLoginHint:z__default.default.string().optional()}),userCredentialsEntitySchema=z__default.default.object({loginHint:z__default.default.string(),refreshToken:z__default.default.string().optional(),profilePictureUrl:z__default.default.string().optional()}),FirestoreCollections;!function(e){e.CONNECTED_USERS_CREDENTIALS="connectedUsersCredentials",e.CLASSROOM_ATTACHMENTS="classroomAttachments"}(FirestoreCollections||(FirestoreCollections={}));var FirestoreClient=function(){function e(e){this.firestore=e,this._firestore=e}return e.prototype.getConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,userCredentialsEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get users credentials"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertConnectedUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=userCredentialsEntitySchema.parse(e),this._firestore.settings({ignoreUndefinedProperties:!0}),[4,this._firestore.collection(FirestoreCollections.CONNECTED_USERS_CREDENTIALS).doc(t.loginHint).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertConnectedUserCredentials",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert users credentials",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.upsertClassroomAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t=classroomAttachmentEntitySchema.parse(e),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(t.attachmentId).set(t)];case 1:return o.sent(),[3,3];case 2:return r=o.sent(),n={operation:"upsertClassroomAttachment",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to upsert classroom attachment",originalError:r}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e.prototype.getClassroomAttachmentById=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._firestore.collection(FirestoreCollections.CLASSROOM_ATTACHMENTS).doc(e).get()];case 1:return(t=o.sent()).exists?[2,classroomAttachmentEntitySchema.parse(t.data())]:[2,null];case 2:return r=o.sent(),n={operation:"getClassroomAttachmentById",service:exports.ExceptionType.Firestore,metadata:{message:"Failed to get classroom attachment by ID"}},handleFirestoreError(r,n),[3,3];case 3:return[2]}})})},e}(),GoogleOAuthClient=function(){function e(e,t,r,n,o){var i=this;if(this.googleClientId=e,this.googleClientSecret=t,this.callbackUrl=r,this.accessToken=n,this.refreshToken=o,!e)throw new Error("Google Client ID is missing");if(!t)throw new Error("Google Client Secret is missing");if(!r)throw new Error("Google OAuth Callback URL is missing");var a=new require$$3$2.OAuth2Client({clientId:e,clientSecret:t,redirectUri:r,forceRefreshOnFailure:!1});"true"===process.env.GOOGLE_CLASSROOM_DEV_MODE&&n&&(a.refreshHandler=function(){return __awaiter(i,void 0,void 0,function(){return __generator$1(this,function(e){return[2,{access_token:n,expiry_date:(new Date).getTime()+36e5}]})})}),(n||o)&&a.setCredentials({access_token:n,refresh_token:o}),this.client=a,this.clientId=e}return e.prototype.getAuthenticateUrl=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);try{var n=r?["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.coursework.me","https://www.googleapis.com/auth/classroom.addons.student"]:["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/classroom.courses.readonly","https://www.googleapis.com/auth/classroom.addons.student","https://www.googleapis.com/auth/classroom.addons.teacher"],o=JSON.stringify({subscribeToNewsletter:t});return this.client.generateAuthUrl({access_type:"offline",include_granted_scopes:!0,scope:n,loginHint:e,state:o})}catch(e){return handleGoogleOAuth2Error(e,{operation:"getAuthenticateUrl",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to get authenticate url"}})}},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.client.getToken(e)];case 1:return t=s.sent().tokens,[4,this.client.verifyIdToken({idToken:t.id_token,audience:this.clientId})];case 2:return r=s.sent(),n=r.getPayload(),o={accessToken:t.access_token,loginHint:null==n?void 0:n.sub,refreshToken:t.refresh_token,profilePictureUrl:null==n?void 0:n.picture,email:null==n?void 0:n.email},[2,googleOAuthUserSchema.parse(o)];case 3:return i=s.sent(),a={operation:"exchangeCodeForTokens",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to exchange code for tokens"}},[2,handleGoogleOAuth2Error(i,a)];case 4:return[2]}})})},e.prototype.refreshAccessToken=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.client.setCredentials({refresh_token:e}),[4,this.client.getAccessToken()];case 1:return t=o.sent(),[2,tokenPayloadSchema.parse(t).token];case 2:return r=o.sent(),n={operation:"refreshAccessToken",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to refresh access token"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.isAuthenticated=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n;return __generator$1(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.client.getTokenInfo(e)];case 1:return t=o.sent(),t.expiry_date<Date.now()?[2,!1]:[2,!0];case 2:return r=o.sent(),n={operation:"isAuthenticated",service:exports.ExceptionType.GoogleOAuth,metadata:{message:"Failed to check if access token is authenticated"}},[2,handleGoogleOAuth2Error(r,n)];case 3:return[2]}})})},e.prototype.getOAuth2Client=function(){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,this.client]})})},e}(),OakOAuth=function(){function e(e,t,r){this.googleOAuthClientId=e,this.googleOAuthClientSecret=t,this.googleOAuthCallbackApiRoute=r}return e.prototype.createClient=function(e,t){return new GoogleOAuthClient(this.googleOAuthClientId,this.googleOAuthClientSecret,this.googleOAuthCallbackApiRoute,e,t)},e.prototype.getSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t,r){var n,o;return void 0===t&&(t=!1),void 0===r&&(r=!1),__generator$1(this,function(i){if(n=this.createClient(),!(o=n.getAuthenticateUrl(e,t,r)))throw OakGoogleClassroomException.GoogleOAuthError("Failed to get Google Authentication URL","getSignInUrl");return[2,o]})})},e.prototype.exchangeCodeForTokens=function(e){return __awaiter(this,void 0,void 0,function(){var t,r;return __generator$1(this,function(n){switch(n.label){case 0:if(!e||"string"!=typeof e||""===e.trim())throw OakGoogleClassroomException.GoogleOAuthError("Invalid OAuth code provided","exchangeCodeForTokens");return[4,this.createClient().exchangeCodeForTokens(e)];case 1:if(!(t=n.sent()))throw OakGoogleClassroomException.GoogleOAuthError("Failed to authenticate Google sign-in","exchangeCodeForTokens");if(r=googleOAuthUserSchema.parse(t),!r.accessToken)throw OakGoogleClassroomException.GoogleOAuthError("Access token missing from OAuth response","exchangeCodeForTokens",{loginHint:r.loginHint});return[2,r]}})})},e.prototype.validateOrRefreshToken=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n;return __generator$1(this,function(o){switch(o.label){case 0:return[4,(r=this.createClient(e,t)).isAuthenticated(e)];case 1:return o.sent()?[2,{token:e,wasRefreshed:!1}]:[4,r.refreshAccessToken(t)];case 2:return(n=o.sent())?[2,{token:n,wasRefreshed:!0}]:[2,null]}})})},e}(),cookie={},hasRequiredCookie;function requireCookie(){if(hasRequiredCookie)return cookie;hasRequiredCookie=1,cookie.parse=function(e,r){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=r&&r.decode||l,d=0,u=0,c=0;do{if(-1===(u=e.indexOf("=",d)))break;if(-1===(c=e.indexOf(";",d)))c=o;else if(u>c){d=e.lastIndexOf(";",u-1)+1;continue}var f=a(e,d,u),h=s(e,u,f),m=e.slice(f,h);if(!t.call(n,m)){var g=a(e,u+1,c),y=s(e,c,g);34===e.charCodeAt(g)&&34===e.charCodeAt(y-1)&&(g++,y--);var v=e.slice(g,y);n[m]=p(v,i)}d=c+1}while(d<o);return n},cookie.serialize=function(t,a,s){var l=s&&s.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!r.test(t))throw new TypeError("argument name is invalid");var p=l(a);if(!n.test(p))throw new TypeError("argument val is invalid");var d=t+"="+p;if(!s)return d;if(null!=s.maxAge){var u=Math.floor(s.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+u}if(s.domain){if(!o.test(s.domain))throw new TypeError("option domain is invalid");d+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");d+="; Path="+s.path}if(s.expires){var c=s.expires;if(!function(t){return"[object Date]"===e.call(t)}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+c.toUTCString()}s.httpOnly&&(d+="; HttpOnly");s.secure&&(d+="; Secure");s.partitioned&&(d+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d};var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,n=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,o=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function a(e,t,r){do{var n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<r);return r}function s(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return r}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function p(e,t){try{return t(e)}catch(t){return e}}return cookie}requireCookie();var alphabetByEncoding={},alphabetByValue=Array.from({length:64});for(let e=0,t="A".charCodeAt(0),r="Z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t);alphabetByEncoding[r]=e,alphabetByValue[e]=r}for(let e=0,t="a".charCodeAt(0),r="z".charCodeAt(0);e+t<=r;e++){const r=String.fromCharCode(e+t),n=e+26;alphabetByEncoding[r]=n,alphabetByValue[n]=r}for(let e=0;e<10;e++){alphabetByEncoding[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;alphabetByEncoding[t]=r,alphabetByValue[r]=t}alphabetByEncoding["-"]=62,alphabetByValue[62]="-",alphabetByEncoding._=63,alphabetByValue[63]="_";var bitsPerLetter=6,bitsPerByte=8,maxLetterValue=63,stringToBuffer=e=>(new TextEncoder).encode(e),bufferToString=e=>(new TextDecoder).decode(e),base64urlDecode=e=>{const t=e+"=".repeat((4-e.length%4)%4);let r=t.length/4*3;t.endsWith("==")?r-=2:t.endsWith("=")&&r--;const n=new ArrayBuffer(r),o=new DataView(n);for(let e=0;e<t.length;e+=4){let r=0,n=0;for(let o=e,i=e+3;o<=i;o++)if("="===t[o])r>>=bitsPerLetter;else{if(!(t[o]in alphabetByEncoding))throw new TypeError(`Invalid character ${t[o]} in base64 string.`);r|=alphabetByEncoding[t[o]]<<(i-o)*bitsPerLetter,n+=bitsPerLetter}const i=e/4*3;r>>=n%bitsPerByte;const a=Math.floor(n/bitsPerByte);for(let e=0;e<a;e++){const t=(a-e-1)*bitsPerByte;o.setUint8(i+e,(r&255<<t)>>t)}}return new Uint8Array(n)},base64urlEncode=e=>{const t="string"==typeof e?stringToBuffer(e):e;let r="";for(let e=0;e<t.length;e+=3){let n=0,o=0;for(let r=e,i=Math.min(e+3,t.length);r<i;r++)n|=t[r]<<(i-r-1)*bitsPerByte,o+=bitsPerByte;const i=Math.ceil(o/bitsPerLetter);n<<=i*bitsPerLetter-o;for(let e=1;e<=i;e++){const t=(i-e)*bitsPerLetter;r+=alphabetByValue[(n&maxLetterValue<<t)>>t]}}return r},defaults={encryption:{saltBits:256,algorithm:"aes-256-cbc",iterations:1,minPasswordlength:32},integrity:{saltBits:256,algorithm:"sha256",iterations:1,minPasswordlength:32},ttl:0,timestampSkewSec:60,localtimeOffsetMsec:0},clone=e=>({...e,encryption:{...e.encryption},integrity:{...e.integrity}}),algorithms={"aes-128-ctr":{keyBits:128,ivBits:128,name:"AES-CTR"},"aes-256-cbc":{keyBits:256,ivBits:128,name:"AES-CBC"},sha256:{keyBits:256,name:"SHA-256"}},macPrefix="Fe26.2",randomBytes=(e,t)=>{const r=new Uint8Array(t);return e.getRandomValues(r),r},randomBits=(e,t)=>{if(t<1)throw new Error("Invalid random bits count");const r=Math.ceil(t/8);return randomBytes(e,r)},pbkdf2=async(e,t,r,n,o,i)=>{const a=stringToBuffer(t),s=await e.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),l={name:"PBKDF2",hash:i,salt:stringToBuffer(r),iterations:n};return await e.subtle.deriveBits(l,s,8*o)},generateKey=async(e,t,r)=>{var n;if(!(null==t?void 0:t.length))throw new Error("Empty password");if(null==r||"object"!=typeof r)throw new Error("Bad options");if(!(r.algorithm in algorithms))throw new Error(`Unknown algorithm: ${r.algorithm}`);const o=algorithms[r.algorithm],i={},a=null!=(n=r.hmac)&&n,s=a?{name:"HMAC",hash:o.name}:{name:o.name},l=a?["sign","verify"]:["encrypt","decrypt"];if("string"==typeof t){if(t.length<r.minPasswordlength)throw new Error(`Password string too short (min ${r.minPasswordlength} characters required)`);let{salt:n=""}=r;if(!n){const{saltBits:t=0}=r;if(!t)throw new Error("Missing salt and saltBits options");const o=randomBits(e,t);n=[...new Uint8Array(o)].map(e=>e.toString(16).padStart(2,"0")).join("")}const a=await pbkdf2(e,t,n,r.iterations,o.keyBits/8,"SHA-1"),p=await e.subtle.importKey("raw",a,s,!1,l);i.key=p,i.salt=n}else{if(t.length<o.keyBits/8)throw new Error("Key buffer (password) too small");i.key=await e.subtle.importKey("raw",t,s,!1,l),i.salt=""}return r.iv?i.iv=r.iv:"ivBits"in o&&(i.iv=randomBits(e,o.ivBits)),i},getEncryptParams=(e,t,r)=>["aes-128-ctr"===e?{name:"AES-CTR",counter:t.iv,length:128}:{name:"AES-CBC",iv:t.iv},t.key,"string"==typeof r?stringToBuffer(r):r],encrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.encrypt(...getEncryptParams(r.algorithm,o,n));return{encrypted:new Uint8Array(i),key:o}},decrypt=async(e,t,r,n)=>{const o=await generateKey(e,t,r),i=await e.subtle.decrypt(...getEncryptParams(r.algorithm,o,n));return bufferToString(new Uint8Array(i))},hmacWithPassword=async(e,t,r,n)=>{const o=await generateKey(e,t,{...r,hmac:!0}),i=stringToBuffer(n),a=await e.subtle.sign({name:"HMAC"},o.key,i);return{digest:base64urlEncode(new Uint8Array(a)),salt:o.salt}},normalizePassword=e=>"string"==typeof e||e instanceof Uint8Array?{encryption:e,integrity:e}:"secret"in e?{id:e.id,encryption:e.secret,integrity:e.secret}:{id:e.id,encryption:e.encryption,integrity:e.integrity},seal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=JSON.stringify(t),s=normalizePassword(r),{id:l="",encryption:p,integrity:d}=s;if(l&&!/^\w+$/.test(l))throw new Error("Invalid password id");const{encrypted:u,key:c}=await encrypt(e,p,o.encryption,a),f=base64urlEncode(new Uint8Array(u)),h=base64urlEncode(c.iv),m=o.ttl?i+o.ttl:"",g=`${macPrefix}*${l}*${c.salt}*${h}*${f}*${m}`,y=await hmacWithPassword(e,d,o.integrity,g);return`${g}*${y.salt}*${y.digest}`},fixedTimeComparison=(e,t)=>{let r=e.length===t.length?0:1;r&&(t=e);for(let n=0;n<e.length;n+=1)r|=e.charCodeAt(n)^t.charCodeAt(n);return 0===r},unseal=async(e,t,r,n)=>{if(!r)throw new Error("Empty password");const o=clone(n),i=Date.now()+(o.localtimeOffsetMsec||0),a=t.split("*");if(8!==a.length)throw new Error("Incorrect number of sealed components");const s=a[0];let l=a[1];const p=a[2],d=a[3],u=a[4],c=a[5],f=a[6],h=a[7],m=`${s}*${l}*${p}*${d}*${u}*${c}`;if(macPrefix!==s)throw new Error("Wrong mac prefix");if(c){if(!/^\d+$/.test(c))throw new Error("Invalid expiration");if(Number.parseInt(c,10)<=i-1e3*o.timestampSkewSec)throw new Error("Expired seal")}let g="";if(l=l||"default","string"==typeof r||r instanceof Uint8Array)g=r;else{if(!(l in r))throw new Error(`Cannot find password: ${l}`);g=r[l]}g=normalizePassword(g);const y=o.integrity;y.salt=f;const v=await hmacWithPassword(e,g.integrity,y,m);if(!fixedTimeComparison(v.digest,h))throw new Error("Bad hmac value");const b=base64urlDecode(u),O=o.encryption;O.salt=p,O.iv=base64urlDecode(d);const w=await decrypt(e,g.encryption,O,b);return w?JSON.parse(w):null};const webCrypto=globalThis.crypto,subtle=webCrypto.subtle,randomUUID=()=>webCrypto.randomUUID(),getRandomValues=e=>webCrypto.getRandomValues(e),_crypto={randomUUID:randomUUID,getRandomValues:getRandomValues,subtle:subtle};var crypto$1=Object.freeze({__proto__:null,default:_crypto,getRandomValues:getRandomValues,randomUUID:randomUUID,subtle:subtle}),fourteenDaysInSeconds=1209600,currentMajorVersion=2,versionDelimiter="~";function normalizeStringPasswordToMap(e){return"string"==typeof e?{1:e}:e}function parseSeal(e){const[t,r]=e.split(versionDelimiter);return{sealWithoutVersion:t,tokenVersion:null==r?null:parseInt(r,10)}}function createSealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),i=Math.max(...Object.keys(o).map(Number)),a={id:i.toString(),secret:o[i]};return`${await seal(e,t,a,{...defaults,ttl:1e3*n})}${versionDelimiter}${currentMajorVersion}`}}function createUnsealData(e){return async function(t,{password:r,ttl:n=fourteenDaysInSeconds}){const o=normalizeStringPasswordToMap(r),{sealWithoutVersion:i,tokenVersion:a}=parseSeal(t);try{const t=await unseal(e,i,o,{...defaults,ttl:1e3*n})??{};return 2===a?t:{...t.persistent}}catch(e){if(e instanceof Error&&/^(Expired seal|Bad hmac value|Cannot find password|Incorrect number of sealed components)/.test(e.message))return{};throw e}}}var sealData=createSealData(crypto$1),unsealData=createUnsealData(crypto$1),lodash$1={exports:{}},lodash=lodash$1.exports,hasRequiredLodash;function requireLodash(){return hasRequiredLodash||(hasRequiredLodash=1,function(e,t){(function(){var r,n="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",a=32,s=128,l=256,p=1/0,d=9007199254740991,u=NaN,c=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],h="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",v="[object Error]",b="[object Function]",O="[object GeneratorFunction]",w="[object Map]",S="[object Number]",_="[object Object]",P="[object Promise]",E="[object RegExp]",T="[object Set]",C="[object String]",R="[object Symbol]",D="[object WeakMap]",x="[object ArrayBuffer]",k="[object DataView]",j="[object Float32Array]",A="[object Float64Array]",N="[object Int8Array]",I="[object Int16Array]",q="[object Int32Array]",M="[object Uint8Array]",L="[object Uint8ClampedArray]",F="[object Uint16Array]",B="[object Uint32Array]",V=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,H=RegExp(G.source),W=RegExp(z.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,ce=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,he=/^\[object .+?Constructor\]$/,me=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Oe="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ce="['’]",Re="["+Oe+"]",De="["+Te+"]",xe="["+we+"]",ke="\\d+",je="["+Se+"]",Ae="["+_e+"]",Ne="[^"+Oe+Te+ke+Se+_e+Pe+"]",Ie="\\ud83c[\\udffb-\\udfff]",qe="[^"+Oe+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Pe+"]",Be="\\u200d",Ve="(?:"+Ae+"|"+Ne+")",Ue="(?:"+Fe+"|"+Ne+")",$e="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+xe+"|"+Ie+")"+"?",He="["+Ee+"]?",We=He+ze+("(?:"+Be+"(?:"+[qe,Me,Le].join("|")+")"+He+ze+")*"),Je="(?:"+[je,Me,Le].join("|")+")"+We,Ye="(?:"+[qe+xe+"?",xe,Me,Le,Re].join("|")+")",Ke=RegExp(Ce,"g"),Xe=RegExp(xe,"g"),Qe=RegExp(Ie+"(?="+Ie+")|"+Ye+We,"g"),Ze=RegExp([Fe+"?"+Ae+"+"+$e+"(?="+[De,Fe,"$"].join("|")+")",Ue+"+"+Ge+"(?="+[De,Fe+Ve,"$"].join("|")+")",Fe+"?"+Ve+"+"+$e,Fe+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Je].join("|"),"g"),et=RegExp("["+Be+Oe+we+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,ot={};ot[j]=ot[A]=ot[N]=ot[I]=ot[q]=ot[M]=ot[L]=ot[F]=ot[B]=!0,ot[h]=ot[m]=ot[x]=ot[g]=ot[k]=ot[y]=ot[v]=ot[b]=ot[w]=ot[S]=ot[_]=ot[E]=ot[T]=ot[C]=ot[D]=!1;var it={};it[h]=it[m]=it[x]=it[k]=it[g]=it[y]=it[j]=it[A]=it[N]=it[I]=it[q]=it[w]=it[S]=it[_]=it[E]=it[T]=it[C]=it[R]=it[M]=it[L]=it[F]=it[B]=!0,it[v]=it[b]=it[D]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,pt="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,dt="object"==typeof self&&self&&self.Object===Object&&self,ut=pt||dt||Function("return this")(),ct=t&&!t.nodeType&&t,ft=ct&&e&&!e.nodeType&&e,ht=ft&&ft.exports===ct,mt=ht&&pt.process,gt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,bt=gt&>.isMap,Ot=gt&>.isRegExp,wt=gt&>.isSet,St=gt&>.isTypedArray;function _t(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Pt(e,t,r,n){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(n,a,r(a),e)}return n}function Et(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Tt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Rt(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}function Dt(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function xt(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}function kt(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}function jt(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}function At(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function Nt(e,t,r,n){var o=null==e?0:e.length;for(n&&o&&(r=e[--o]);o--;)r=t(r,e[o],o,e);return r}function It(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var qt=$t("length");function Mt(e,t,r){var n;return r(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}function Lt(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Ft(e,t,r){return t==t?function(e,t,r){var n=r-1,o=e.length;for(;++n<o;)if(e[n]===t)return n;return-1}(e,t,r):Lt(e,Vt,r)}function Bt(e,t,r,n){for(var o=r-1,i=e.length;++o<i;)if(n(e[o],t))return o;return-1}function Vt(e){return e!=e}function Ut(e,t){var r=null==e?0:e.length;return r?Ht(e,t)/r:u}function $t(e){return function(t){return null==t?r:t[e]}}function Gt(e){return function(t){return null==e?r:e[t]}}function zt(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r}function Ht(e,t){for(var n,o=-1,i=e.length;++o<i;){var a=t(e[o]);a!==r&&(n=n===r?a:n+a)}return n}function Wt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jt(e){return e?e.slice(0,ur(e)+1).replace(re,""):e}function Yt(e){return function(t){return e(t)}}function Kt(e,t){return kt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&Ft(t,e[r],0)>-1;);return r}function Zt(e,t){for(var r=e.length;r--&&Ft(t,e[r],0)>-1;);return r}var er=Gt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function or(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function ir(e,t){return function(r){return e(t(r))}}function ar(e,t){for(var r=-1,n=e.length,o=0,a=[];++r<n;){var s=e[r];s!==t&&s!==i||(e[r]=i,a[o++]=r)}return a}function sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function pr(e){return nr(e)?function(e){var t=Qe.lastIndex=0;for(;Qe.test(e);)++t;return t}(e):qt(e)}function dr(e){return nr(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function ur(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var cr=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var fr=function e(t){var ne,Oe=(t=null==t?ut:fr.defaults(ut.Object(),t,fr.pick(ut,rt))).Array,we=t.Date,Se=t.Error,_e=t.Function,Pe=t.Math,Ee=t.Object,Te=t.RegExp,Ce=t.String,Re=t.TypeError,De=Oe.prototype,xe=_e.prototype,ke=Ee.prototype,je=t["__core-js_shared__"],Ae=xe.toString,Ne=ke.hasOwnProperty,Ie=0,qe=(ne=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",Me=ke.toString,Le=Ae.call(Ee),Fe=ut._,Be=Te("^"+Ae.call(Ne).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=ht?t.Buffer:r,Ue=t.Symbol,$e=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:r,ze=ir(Ee.getPrototypeOf,Ee),He=Ee.create,We=ke.propertyIsEnumerable,Je=De.splice,Ye=Ue?Ue.isConcatSpreadable:r,Qe=Ue?Ue.iterator:r,et=Ue?Ue.toStringTag:r,at=function(){try{var e=ui(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),pt=t.clearTimeout!==ut.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ut.Date.now&&we.now,ct=t.setTimeout!==ut.setTimeout&&t.setTimeout,ft=Pe.ceil,mt=Pe.floor,gt=Ee.getOwnPropertySymbols,qt=Ve?Ve.isBuffer:r,Gt=t.isFinite,hr=De.join,mr=ir(Ee.keys,Ee),gr=Pe.max,yr=Pe.min,vr=we.now,br=t.parseInt,Or=Pe.random,wr=De.reverse,Sr=ui(t,"DataView"),_r=ui(t,"Map"),Pr=ui(t,"Promise"),Er=ui(t,"Set"),Tr=ui(t,"WeakMap"),Cr=ui(Ee,"create"),Rr=Tr&&new Tr,Dr={},xr=Mi(Sr),kr=Mi(_r),jr=Mi(Pr),Ar=Mi(Er),Nr=Mi(Tr),Ir=Ue?Ue.prototype:r,qr=Ir?Ir.valueOf:r,Mr=Ir?Ir.toString:r;function Lr(e){if(es(e)&&!$a(e)&&!(e instanceof Ur)){if(e instanceof Vr)return e;if(Ne.call(e,"__wrapped__"))return Li(e)}return new Vr(e)}var Fr=function(){function e(){}return function(t){if(!Za(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Vr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=c,this.__views__=[]}function $r(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new zr;++t<r;)this.add(e[t])}function Wr(e){var t=this.__data__=new Gr(e);this.size=t.size}function Jr(e,t){var r=$a(e),n=!r&&Ua(e),o=!r&&!n&&Wa(e),i=!r&&!n&&!o&&ls(e),a=r||n||o||i,s=a?Wt(e.length,Ce):[],l=s.length;for(var p in e)!t&&!Ne.call(e,p)||a&&("length"==p||o&&("offset"==p||"parent"==p)||i&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||vi(p,l))||s.push(p);return s}function Yr(e){var t=e.length;return t?e[Wn(0,t-1)]:r}function Kr(e,t){return Ni(Do(e),an(t,0,e.length))}function Xr(e){return Ni(Do(e))}function Qr(e,t,n){(n!==r&&!Fa(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Zr(e,t,n){var o=e[t];Ne.call(e,t)&&Fa(o,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(Fa(e[r][0],t))return r;return-1}function tn(e,t,r,n){return un(e,function(e,o,i){t(n,e,r(e),i)}),n}function rn(e,t){return e&&xo(t,xs(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,o=t.length,i=Oe(o),a=null==e;++n<o;)i[n]=a?r:Es(e,t[n]);return i}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(e,t,n,o,i,a){var s,l=1&t,p=2&t,d=4&t;if(n&&(s=i?n(e,o,i,a):n(e)),s!==r)return s;if(!Za(e))return e;var u=$a(e);if(u){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Do(e,s)}else{var c=hi(e),f=c==b||c==O;if(Wa(e))return _o(e,l);if(c==_||c==h||f&&!i){if(s=p||f?{}:gi(e),!l)return p?function(e,t){return xo(e,fi(e),t)}(e,function(e,t){return e&&xo(t,ks(t),e)}(s,e)):function(e,t){return xo(e,ci(e),t)}(e,rn(s,e))}else{if(!it[c])return i?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case x:return Po(e);case g:case y:return new n(+e);case k:return function(e,t){var r=t?Po(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case A:case N:case I:case q:case M:case L:case F:case B:return Eo(e,r);case w:return new n;case S:case C:return new n(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new n;case R:return o=e,qr?Ee(qr.call(o)):{}}var o}(e,c,l)}}a||(a=new Wr);var m=a.get(e);if(m)return m;a.set(e,s),is(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,o){s.set(o,sn(r,t,n,o,e,a))});var v=u?r:(d?p?oi:ni:p?ks:xs)(e);return Et(v||e,function(r,o){v&&(r=e[o=r]),Zr(s,o,sn(r,t,n,o,e,a))}),s}function ln(e,t,n){var o=n.length;if(null==e)return!o;for(e=Ee(e);o--;){var i=n[o],a=t[i],s=e[i];if(s===r&&!(i in e)||!a(s))return!1}return!0}function pn(e,t,o){if("function"!=typeof e)throw new Re(n);return xi(function(){e.apply(r,o)},t)}function dn(e,t,r,n){var o=-1,i=Dt,a=!0,s=e.length,l=[],p=t.length;if(!s)return l;r&&(t=kt(t,Yt(r))),n?(i=xt,a=!1):t.length>=200&&(i=Xt,a=!1,t=new Hr(t));e:for(;++o<s;){var d=e[o],u=null==r?d:r(d);if(d=n||0!==d?d:0,a&&u==u){for(var c=p;c--;)if(t[c]===u)continue e;l.push(d)}else i(t,u,n)||l.push(d)}return l}Lr.templateSettings={escape:J,evaluate:Y,interpolate:K,variable:"",imports:{_:Lr}},Lr.prototype=Br.prototype,Lr.prototype.constructor=Lr,Vr.prototype=Fr(Br.prototype),Vr.prototype.constructor=Vr,Ur.prototype=Fr(Br.prototype),Ur.prototype.constructor=Ur,$r.prototype.clear=function(){this.__data__=Cr?Cr(null):{},this.size=0},$r.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$r.prototype.get=function(e){var t=this.__data__;if(Cr){var n=t[e];return n===o?r:n}return Ne.call(t,e)?t[e]:r},$r.prototype.has=function(e){var t=this.__data__;return Cr?t[e]!==r:Ne.call(t,e)},$r.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Cr&&t===r?o:t,this},Gr.prototype.clear=function(){this.__data__=[],this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0)&&(r==t.length-1?t.pop():Je.call(t,r,1),--this.size,!0)},Gr.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},Gr.prototype.has=function(e){return en(this.__data__,e)>-1},Gr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new $r,map:new(_r||Gr),string:new $r}},zr.prototype.delete=function(e){var t=pi(this,e).delete(e);return this.size-=t?1:0,t},zr.prototype.get=function(e){return pi(this,e).get(e)},zr.prototype.has=function(e){return pi(this,e).has(e)},zr.prototype.set=function(e,t){var r=pi(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,o),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.clear=function(){this.__data__=new Gr,this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Wr.prototype.get=function(e){return this.__data__.get(e)},Wr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Gr){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(e,t),this.size=r.size,this};var un=Ao(bn),cn=Ao(On,!0);function fn(e,t){var r=!0;return un(e,function(e,n,o){return r=!!t(e,n,o)}),r}function hn(e,t,n){for(var o=-1,i=e.length;++o<i;){var a=e[o],s=t(a);if(null!=s&&(l===r?s==s&&!ss(s):n(s,l)))var l=s,p=a}return p}function mn(e,t){var r=[];return un(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r}function gn(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=yi),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?gn(s,t-1,r,n,o):jt(o,s):n||(o[o.length]=s)}return o}var yn=No(),vn=No(!0);function bn(e,t){return e&&yn(e,t,xs)}function On(e,t){return e&&vn(e,t,xs)}function wn(e,t){return Rt(t,function(t){return Ka(e[t])})}function Sn(e,t){for(var n=0,o=(t=bo(t,e)).length;null!=e&&n<o;)e=e[qi(t[n++])];return n&&n==o?e:r}function _n(e,t,r){var n=t(e);return $a(e)?n:jt(n,r(e))}function Pn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Ee(e)?function(e){var t=Ne.call(e,et),n=e[et];try{e[et]=r;var o=!0}catch(e){}var i=Me.call(e);o&&(t?e[et]=n:delete e[et]);return i}(e):function(e){return Me.call(e)}(e)}function En(e,t){return e>t}function Tn(e,t){return null!=e&&Ne.call(e,t)}function Cn(e,t){return null!=e&&t in Ee(e)}function Rn(e,t,n){for(var o=n?xt:Dt,i=e[0].length,a=e.length,s=a,l=Oe(a),p=1/0,d=[];s--;){var u=e[s];s&&t&&(u=kt(u,Yt(t))),p=yr(u.length,p),l[s]=!n&&(t||i>=120&&u.length>=120)?new Hr(s&&u):r}u=e[0];var c=-1,f=l[0];e:for(;++c<i&&d.length<p;){var h=u[c],m=t?t(h):h;if(h=n||0!==h?h:0,!(f?Xt(f,m):o(d,m,n))){for(s=a;--s;){var g=l[s];if(!(g?Xt(g,m):o(e[s],m,n)))continue e}f&&f.push(m),d.push(h)}}return d}function Dn(e,t,n){var o=null==(e=Ci(e,t=bo(t,e)))?e:e[qi(Yi(t))];return null==o?r:_t(o,e,n)}function xn(e){return es(e)&&Pn(e)==h}function kn(e,t,n,o,i){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,o,i,a){var s=$a(e),l=$a(t),p=s?m:hi(e),d=l?m:hi(t),u=(p=p==h?_:p)==_,c=(d=d==h?_:d)==_,f=p==d;if(f&&Wa(e)){if(!Wa(t))return!1;s=!0,u=!1}if(f&&!u)return a||(a=new Wr),s||ls(e)?ti(e,t,n,o,i,a):function(e,t,r,n,o,i,a){switch(r){case k:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!i(new $e(e),new $e(t)));case g:case y:case S:return Fa(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case C:return e==t+"";case w:var s=or;case T:var l=1&n;if(s||(s=sr),e.size!=t.size&&!l)return!1;var p=a.get(e);if(p)return p==t;n|=2,a.set(e,t);var d=ti(s(e),s(t),n,o,i,a);return a.delete(e),d;case R:if(qr)return qr.call(e)==qr.call(t)}return!1}(e,t,p,n,o,i,a);if(!(1&n)){var b=u&&Ne.call(e,"__wrapped__"),O=c&&Ne.call(t,"__wrapped__");if(b||O){var P=b?e.value():e,D=O?t.value():t;return a||(a=new Wr),i(P,D,n,o,a)}}if(!f)return!1;return a||(a=new Wr),function(e,t,n,o,i,a){var s=1&n,l=ni(e),p=l.length,d=ni(t),u=d.length;if(p!=u&&!s)return!1;var c=p;for(;c--;){var f=l[c];if(!(s?f in t:Ne.call(t,f)))return!1}var h=a.get(e),m=a.get(t);if(h&&m)return h==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var y=s;for(;++c<p;){var v=e[f=l[c]],b=t[f];if(o)var O=s?o(b,v,f,t,e,a):o(v,b,f,e,t,a);if(!(O===r?v===b||i(v,b,n,o,a):O)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var w=e.constructor,S=t.constructor;w==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof S&&S instanceof S||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,o,i,a)}(e,t,n,o,kn,i))}function jn(e,t,n,o){var i=n.length,a=i,s=!o;if(null==e)return!a;for(e=Ee(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){var p=(l=n[i])[0],d=e[p],u=l[1];if(s&&l[2]){if(d===r&&!(p in e))return!1}else{var c=new Wr;if(o)var f=o(d,u,p,e,t,c);if(!(f===r?kn(u,d,3,o,c):f))return!1}}return!0}function An(e){return!(!Za(e)||(t=e,qe&&qe in t))&&(Ka(e)?Be:he).test(Mi(e));var t}function Nn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?$a(e)?Bn(e[0],e[1]):Fn(e):ul(e)}function In(e){if(!_i(e))return mr(e);var t=[];for(var r in Ee(e))Ne.call(e,r)&&"constructor"!=r&&t.push(r);return t}function qn(e){if(!Za(e))return function(e){var t=[];if(null!=e)for(var r in Ee(e))t.push(r);return t}(e);var t=_i(e),r=[];for(var n in e)("constructor"!=n||!t&&Ne.call(e,n))&&r.push(n);return r}function Mn(e,t){return e<t}function Ln(e,t){var r=-1,n=za(e)?Oe(e.length):[];return un(e,function(e,o,i){n[++r]=t(e,o,i)}),n}function Fn(e){var t=di(e);return 1==t.length&&t[0][2]?Ei(t[0][0],t[0][1]):function(r){return r===e||jn(r,e,t)}}function Bn(e,t){return Oi(e)&&Pi(t)?Ei(qi(e),t):function(n){var o=Es(n,e);return o===r&&o===t?Ts(n,e):kn(t,o,3)}}function Vn(e,t,n,o,i){e!==t&&yn(t,function(a,s){if(i||(i=new Wr),Za(a))!function(e,t,n,o,i,a,s){var l=Ri(e,n),p=Ri(t,n),d=s.get(p);if(d)return void Qr(e,n,d);var u=a?a(l,p,n+"",e,t,s):r,c=u===r;if(c){var f=$a(p),h=!f&&Wa(p),m=!f&&!h&&ls(p);u=p,f||h||m?$a(l)?u=l:Ha(l)?u=Do(l):h?(c=!1,u=_o(p,!0)):m?(c=!1,u=Eo(p,!0)):u=[]:ns(p)||Ua(p)?(u=l,Ua(l)?u=gs(l):Za(l)&&!Ka(l)||(u=gi(p))):c=!1}c&&(s.set(p,u),i(u,p,o,a,s),s.delete(p));Qr(e,n,u)}(e,t,s,n,Vn,o,i);else{var l=o?o(Ri(e,s),a,s+"",e,t,i):r;l===r&&(l=a),Qr(e,s,l)}},ks)}function Un(e,t){var n=e.length;if(n)return vi(t+=t<0?n:0,n)?e[t]:r}function $n(e,t,r){t=t.length?kt(t,function(e){return $a(e)?function(t){return Sn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=kt(t,Yt(li()));var o=Ln(e,function(e,r,o){var i=kt(t,function(t){return t(e)});return{criteria:i,index:++n,value:e}});return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(o,function(e,t){return function(e,t,r){var n=-1,o=e.criteria,i=t.criteria,a=o.length,s=r.length;for(;++n<a;){var l=To(o[n],i[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)})}function Gn(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=Sn(e,a);r(s,a)&&Qn(i,bo(a,e),s)}return i}function zn(e,t,r,n){var o=n?Bt:Ft,i=-1,a=t.length,s=e;for(e===t&&(t=Do(t)),r&&(s=kt(e,Yt(r)));++i<a;)for(var l=0,p=t[i],d=r?r(p):p;(l=o(s,d,l,n))>-1;)s!==e&&Je.call(s,l,1),Je.call(e,l,1);return e}function Hn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var o=t[r];if(r==n||o!==i){var i=o;vi(o)?Je.call(e,o,1):uo(e,o)}}return e}function Wn(e,t){return e+mt(Or()*(t-e+1))}function Jn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return ki(Ti(e,t,rl),e+"")}function Kn(e){return Yr(Fs(e))}function Xn(e,t){var r=Fs(e);return Ni(r,an(t,0,r.length))}function Qn(e,t,n,o){if(!Za(e))return e;for(var i=-1,a=(t=bo(t,e)).length,s=a-1,l=e;null!=l&&++i<a;){var p=qi(t[i]),d=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(i!=s){var u=l[p];(d=o?o(u,p,l):r)===r&&(d=Za(u)?u:vi(t[i+1])?[]:{})}Zr(l,p,d),l=l[p]}return e}var Zn=Rr?function(e,t){return Rr.set(e,t),e}:rl,eo=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Zs(t),writable:!0})}:rl;function to(e){return Ni(Fs(e))}function ro(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Oe(o);++n<o;)i[n]=e[n+t];return i}function no(e,t){var r;return un(e,function(e,n,o){return!(r=t(e,n,o))}),!!r}function oo(e,t,r){var n=0,o=null==e?n:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;n<o;){var i=n+o>>>1,a=e[i];null!==a&&!ss(a)&&(r?a<=t:a<t)?n=i+1:o=i}return o}return io(e,t,rl,r)}function io(e,t,n,o){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,p=ss(t),d=t===r;i<a;){var u=mt((i+a)/2),c=n(e[u]),f=c!==r,h=null===c,m=c==c,g=ss(c);if(s)var y=o||m;else y=d?m&&(o||f):l?m&&f&&(o||!h):p?m&&f&&!h&&(o||!g):!h&&!g&&(o?c<=t:c<t);y?i=u+1:a=u}return yr(a,4294967294)}function ao(e,t){for(var r=-1,n=e.length,o=0,i=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Fa(s,l)){var l=s;i[o++]=0===a?0:a}}return i}function so(e){return"number"==typeof e?e:ss(e)?u:+e}function lo(e){if("string"==typeof e)return e;if($a(e))return kt(e,lo)+"";if(ss(e))return Mr?Mr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function po(e,t,r){var n=-1,o=Dt,i=e.length,a=!0,s=[],l=s;if(r)a=!1,o=xt;else if(i>=200){var p=t?null:Yo(e);if(p)return sr(p);a=!1,o=Xt,l=new Hr}else l=t?[]:s;e:for(;++n<i;){var d=e[n],u=t?t(d):d;if(d=r||0!==d?d:0,a&&u==u){for(var c=l.length;c--;)if(l[c]===u)continue e;t&&l.push(u),s.push(d)}else o(l,u,r)||(l!==s&&l.push(u),s.push(d))}return s}function uo(e,t){return null==(e=Ci(e,t=bo(t,e)))||delete e[qi(Yi(t))]}function co(e,t,r,n){return Qn(e,t,r(Sn(e,t)),n)}function fo(e,t,r,n){for(var o=e.length,i=n?o:-1;(n?i--:++i<o)&&t(e[i],i,e););return r?ro(e,n?0:i,n?i+1:o):ro(e,n?i+1:0,n?o:i)}function ho(e,t){var r=e;return r instanceof Ur&&(r=r.value()),At(t,function(e,t){return t.func.apply(t.thisArg,jt([e],t.args))},r)}function mo(e,t,r){var n=e.length;if(n<2)return n?po(e[0]):[];for(var o=-1,i=Oe(n);++o<n;)for(var a=e[o],s=-1;++s<n;)s!=o&&(i[o]=dn(i[o]||a,e[s],t,r));return po(gn(i,1),t,r)}function go(e,t,n){for(var o=-1,i=e.length,a=t.length,s={};++o<i;){var l=o<a?t[o]:r;n(s,e[o],l)}return s}function yo(e){return Ha(e)?e:[]}function vo(e){return"function"==typeof e?e:rl}function bo(e,t){return $a(e)?e:Oi(e,t)?[e]:Ii(ys(e))}var Oo=Yn;function wo(e,t,n){var o=e.length;return n=n===r?o:n,!t&&n>=o?e:ro(e,t,n)}var So=pt||function(e){return ut.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var r=e.length,n=Ge?Ge(r):new e.constructor(r);return e.copy(n),n}function Po(e){var t=new e.constructor(e.byteLength);return new $e(t).set(new $e(e)),t}function Eo(e,t){var r=t?Po(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function To(e,t){if(e!==t){var n=e!==r,o=null===e,i=e==e,a=ss(e),s=t!==r,l=null===t,p=t==t,d=ss(t);if(!l&&!d&&!a&&e>t||a&&s&&p&&!l&&!d||o&&s&&p||!n&&p||!i)return 1;if(!o&&!a&&!d&&e<t||d&&n&&i&&!o&&!a||l&&n&&i||!s&&i||!p)return-1}return 0}function Co(e,t,r,n){for(var o=-1,i=e.length,a=r.length,s=-1,l=t.length,p=gr(i-a,0),d=Oe(l+p),u=!n;++s<l;)d[s]=t[s];for(;++o<a;)(u||o<i)&&(d[r[o]]=e[o]);for(;p--;)d[s++]=e[o++];return d}function Ro(e,t,r,n){for(var o=-1,i=e.length,a=-1,s=r.length,l=-1,p=t.length,d=gr(i-s,0),u=Oe(d+p),c=!n;++o<d;)u[o]=e[o];for(var f=o;++l<p;)u[f+l]=t[l];for(;++a<s;)(c||o<i)&&(u[f+r[a]]=e[o++]);return u}function Do(e,t){var r=-1,n=e.length;for(t||(t=Oe(n));++r<n;)t[r]=e[r];return t}function xo(e,t,n,o){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],p=o?o(n[l],e[l],l,n,e):r;p===r&&(p=e[l]),i?nn(n,l,p):Zr(n,l,p)}return n}function ko(e,t){return function(r,n){var o=$a(r)?Pt:tn,i=t?t():{};return o(r,e,li(n,2),i)}}function jo(e){return Yn(function(t,n){var o=-1,i=n.length,a=i>1?n[i-1]:r,s=i>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(i--,a):r,s&&bi(n[0],n[1],s)&&(a=i<3?r:a,i=1),t=Ee(t);++o<i;){var l=n[o];l&&e(t,l,o,a)}return t})}function Ao(e,t){return function(r,n){if(null==r)return r;if(!za(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Ee(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}function No(e){return function(t,r,n){for(var o=-1,i=Ee(t),a=n(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===r(i[l],l,i))break}return t}}function Io(e){return function(t){var n=nr(t=ys(t))?dr(t):r,o=n?n[0]:t.charAt(0),i=n?wo(n,1).join(""):t.slice(1);return o[e]()+i}}function qo(e){return function(t){return At(Ks(Us(t).replace(Ke,"")),e,"")}}function Mo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Fr(e.prototype),n=e.apply(r,t);return Za(n)?n:r}}function Lo(e){return function(t,n,o){var i=Ee(t);if(!za(t)){var a=li(n,3);t=xs(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,o);return s>-1?i[a?t[s]:s]:r}}function Fo(e){return ri(function(t){var o=t.length,i=o,a=Vr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Re(n);if(a&&!l&&"wrapper"==ai(s))var l=new Vr([],!0)}for(i=l?i:o;++i<o;){var p=ai(s=t[i]),d="wrapper"==p?ii(s):r;l=d&&wi(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[ai(d[0])].apply(l,d[3]):1==s.length&&wi(s)?l[p]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&$a(r))return l.plant(r).value();for(var n=0,i=o?t[n].apply(this,e):r;++n<o;)i=t[n].call(this,i);return i}})}function Bo(e,t,n,o,i,a,l,p,d,u){var c=t&s,f=1&t,h=2&t,m=24&t,g=512&t,y=h?r:Mo(e);return function s(){for(var v=arguments.length,b=Oe(v),O=v;O--;)b[O]=arguments[O];if(m)var w=si(s),S=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,w);if(o&&(b=Co(b,o,i,m)),a&&(b=Ro(b,a,l,m)),v-=S,m&&v<u){var _=ar(b,w);return Wo(e,t,Bo,s.placeholder,n,b,_,p,d,u-v)}var P=f?n:this,E=h?P[e]:e;return v=b.length,p?b=function(e,t){var n=e.length,o=yr(t.length,n),i=Do(e);for(;o--;){var a=t[o];e[o]=vi(a,n)?i[a]:r}return e}(b,p):g&&v>1&&b.reverse(),c&&d<v&&(b.length=d),this&&this!==ut&&this instanceof s&&(E=y||Mo(E)),E.apply(P,b)}}function Vo(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,o,i){t(n,r(e),o,i)}),n}(r,e,t(n),{})}}function Uo(e,t){return function(n,o){var i;if(n===r&&o===r)return t;if(n!==r&&(i=n),o!==r){if(i===r)return o;"string"==typeof n||"string"==typeof o?(n=lo(n),o=lo(o)):(n=so(n),o=so(o)),i=e(n,o)}return i}}function $o(e){return ri(function(t){return t=kt(t,Yt(li())),Yn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Go(e,t){var n=(t=t===r?" ":lo(t)).length;if(n<2)return n?Jn(t,e):t;var o=Jn(t,ft(e/pr(t)));return nr(t)?wo(dr(o),0,e).join(""):o.slice(0,e)}function zo(e){return function(t,n,o){return o&&"number"!=typeof o&&bi(t,n,o)&&(n=o=r),t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r,n){for(var o=-1,i=gr(ft((t-e)/(r||1)),0),a=Oe(i);i--;)a[n?i:++o]=e,e+=r;return a}(t,n,o=o===r?t<n?1:-1:cs(o),e)}}function Ho(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ms(t),r=ms(r)),e(t,r)}}function Wo(e,t,n,o,i,s,l,p,d,u){var c=8&t;t|=c?a:64,4&(t&=~(c?64:a))||(t&=-4);var f=[e,t,i,c?s:r,c?l:r,c?r:s,c?r:l,p,d,u],h=n.apply(r,f);return wi(e)&&Di(h,f),h.placeholder=o,ji(h,e,t)}function Jo(e){var t=Pe[e];return function(e,r){if(e=ms(e),(r=null==r?0:yr(fs(r),292))&&Gt(e)){var n=(ys(e)+"e").split("e");return+((n=(ys(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yo=Er&&1/sr(new Er([,-0]))[1]==p?function(e){return new Er(e)}:sl;function Ko(e){return function(t){var r=hi(t);return r==w?or(t):r==T?lr(t):function(e,t){return kt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xo(e,t,o,p,d,u,c,f){var h=2&t;if(!h&&"function"!=typeof e)throw new Re(n);var m=p?p.length:0;if(m||(t&=-97,p=d=r),c=c===r?c:gr(fs(c),0),f=f===r?f:fs(f),m-=d?d.length:0,64&t){var g=p,y=d;p=d=r}var v=h?r:ii(e),b=[e,t,o,p,d,g,y,u,c,f];if(v&&function(e,t){var r=e[1],n=t[1],o=r|n,a=o<131,p=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!p)return e;1&n&&(e[2]=t[2],o|=1&r?0:4);var d=t[3];if(d){var u=e[3];e[3]=u?Co(u,d,t[4]):d,e[4]=u?ar(e[3],i):t[4]}d=t[5],d&&(u=e[5],e[5]=u?Ro(u,d,t[6]):d,e[6]=u?ar(e[5],i):t[6]);d=t[7],d&&(e[7]=d);n&s&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(b,v),e=b[0],t=b[1],o=b[2],p=b[3],d=b[4],!(f=b[9]=b[9]===r?h?0:e.length:gr(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)O=8==t||16==t?function(e,t,n){var o=Mo(e);return function i(){for(var a=arguments.length,s=Oe(a),l=a,p=si(i);l--;)s[l]=arguments[l];var d=a<3&&s[0]!==p&&s[a-1]!==p?[]:ar(s,p);return(a-=d.length)<n?Wo(e,t,Bo,i.placeholder,r,s,d,r,r,n-a):_t(this&&this!==ut&&this instanceof i?o:e,this,s)}}(e,t,f):t!=a&&33!=t||d.length?Bo.apply(r,b):function(e,t,r,n){var o=1&t,i=Mo(e);return function t(){for(var a=-1,s=arguments.length,l=-1,p=n.length,d=Oe(p+s),u=this&&this!==ut&&this instanceof t?i:e;++l<p;)d[l]=n[l];for(;s--;)d[l++]=arguments[++a];return _t(u,o?r:this,d)}}(e,t,o,p);else var O=function(e,t,r){var n=1&t,o=Mo(e);return function t(){return(this&&this!==ut&&this instanceof t?o:e).apply(n?r:this,arguments)}}(e,t,o);return ji((v?Zn:Di)(O,b),e,t)}function Qo(e,t,n,o){return e===r||Fa(e,ke[n])&&!Ne.call(o,n)?t:e}function Zo(e,t,n,o,i,a){return Za(e)&&Za(t)&&(a.set(t,e),Vn(e,t,r,Zo,a),a.delete(t)),e}function ei(e){return ns(e)?r:e}function ti(e,t,n,o,i,a){var s=1&n,l=e.length,p=t.length;if(l!=p&&!(s&&p>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var c=-1,f=!0,h=2&n?new Hr:r;for(a.set(e,t),a.set(t,e);++c<l;){var m=e[c],g=t[c];if(o)var y=s?o(g,m,c,t,e,a):o(m,g,c,e,t,a);if(y!==r){if(y)continue;f=!1;break}if(h){if(!It(t,function(e,t){if(!Xt(h,t)&&(m===e||i(m,e,n,o,a)))return h.push(t)})){f=!1;break}}else if(m!==g&&!i(m,g,n,o,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function ri(e){return ki(Ti(e,r,Gi),e+"")}function ni(e){return _n(e,xs,ci)}function oi(e){return _n(e,ks,fi)}var ii=Rr?function(e){return Rr.get(e)}:sl;function ai(e){for(var t=e.name+"",r=Dr[t],n=Ne.call(Dr,t)?r.length:0;n--;){var o=r[n],i=o.func;if(null==i||i==e)return o.name}return t}function si(e){return(Ne.call(Lr,"placeholder")?Lr:e).placeholder}function li(){var e=Lr.iteratee||nl;return e=e===nl?Nn:e,arguments.length?e(arguments[0],arguments[1]):e}function pi(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function di(e){for(var t=xs(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Pi(o)]}return t}function ui(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return An(n)?n:r}var ci=gt?function(e){return null==e?[]:(e=Ee(e),Rt(gt(e),function(t){return We.call(e,t)}))}:hl,fi=gt?function(e){for(var t=[];e;)jt(t,ci(e)),e=ze(e);return t}:hl,hi=Pn;function mi(e,t,r){for(var n=-1,o=(t=bo(t,e)).length,i=!1;++n<o;){var a=qi(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&Qa(o)&&vi(a,o)&&($a(e)||Ua(e))}function gi(e){return"function"!=typeof e.constructor||_i(e)?{}:Fr(ze(e))}function yi(e){return $a(e)||Ua(e)||!!(Ye&&e&&e[Ye])}function vi(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function bi(e,t,r){if(!Za(r))return!1;var n=typeof t;return!!("number"==n?za(r)&&vi(t,r.length):"string"==n&&t in r)&&Fa(r[t],e)}function Oi(e,t){if($a(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||(Q.test(e)||!X.test(e)||null!=t&&e in Ee(t))}function wi(e){var t=ai(e),r=Lr[t];if("function"!=typeof r||!(t in Ur.prototype))return!1;if(e===r)return!0;var n=ii(r);return!!n&&e===n[0]}(Sr&&hi(new Sr(new ArrayBuffer(1)))!=k||_r&&hi(new _r)!=w||Pr&&hi(Pr.resolve())!=P||Er&&hi(new Er)!=T||Tr&&hi(new Tr)!=D)&&(hi=function(e){var t=Pn(e),n=t==_?e.constructor:r,o=n?Mi(n):"";if(o)switch(o){case xr:return k;case kr:return w;case jr:return P;case Ar:return T;case Nr:return D}return t});var Si=je?Ka:ml;function _i(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ke)}function Pi(e){return e==e&&!Za(e)}function Ei(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Ee(n)))}}function Ti(e,t,n){return t=gr(t===r?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=gr(r.length-t,0),a=Oe(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Oe(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),_t(e,this,s)}}function Ci(e,t){return t.length<2?e:Sn(e,ro(t,0,-1))}function Ri(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Di=Ai(Zn),xi=ct||function(e,t){return ut.setTimeout(e,t)},ki=Ai(eo);function ji(e,t,r){var n=t+"";return ki(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Et(f,function(r){var n="_."+r[0];t&r[1]&&!Dt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(ae):[]}(n),r)))}function Ai(e){var t=0,n=0;return function(){var o=vr(),i=16-(o-n);if(n=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ni(e,t){var n=-1,o=e.length,i=o-1;for(t=t===r?o:t;++n<t;){var a=Wn(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Ii=function(e){var t=Aa(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Z,function(e,r,n,o){t.push(n?o.replace(pe,"$1"):r||e)}),t});function qi(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mi(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Li(e){if(e instanceof Ur)return e.clone();var t=new Vr(e.__wrapped__,e.__chain__);return t.__actions__=Do(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fi=Yn(function(e,t){return Ha(e)?dn(e,gn(t,1,Ha,!0)):[]}),Bi=Yn(function(e,t){var n=Yi(t);return Ha(n)&&(n=r),Ha(e)?dn(e,gn(t,1,Ha,!0),li(n,2)):[]}),Vi=Yn(function(e,t){var n=Yi(t);return Ha(n)&&(n=r),Ha(e)?dn(e,gn(t,1,Ha,!0),r,n):[]});function Ui(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:fs(r);return o<0&&(o=gr(n+o,0)),Lt(e,li(t,3),o)}function $i(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return n!==r&&(i=fs(n),i=n<0?gr(o+i,0):yr(i,o-1)),Lt(e,li(t,3),i,!0)}function Gi(e){return(null==e?0:e.length)?gn(e,1):[]}function zi(e){return e&&e.length?e[0]:r}var Hi=Yn(function(e){var t=kt(e,yo);return t.length&&t[0]===e[0]?Rn(t):[]}),Wi=Yn(function(e){var t=Yi(e),n=kt(e,yo);return t===Yi(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Rn(n,li(t,2)):[]}),Ji=Yn(function(e){var t=Yi(e),n=kt(e,yo);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Rn(n,r,t):[]});function Yi(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ki=Yn(Xi);function Xi(e,t){return e&&e.length&&t&&t.length?zn(e,t):e}var Qi=ri(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Hn(e,kt(t,function(e){return vi(e,r)?+e:e}).sort(To)),n});function Zi(e){return null==e?e:wr.call(e)}var ea=Yn(function(e){return po(gn(e,1,Ha,!0))}),ta=Yn(function(e){var t=Yi(e);return Ha(t)&&(t=r),po(gn(e,1,Ha,!0),li(t,2))}),ra=Yn(function(e){var t=Yi(e);return t="function"==typeof t?t:r,po(gn(e,1,Ha,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Rt(e,function(e){if(Ha(e))return t=gr(e.length,t),!0}),Wt(t,function(t){return kt(e,$t(t))})}function oa(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:kt(n,function(e){return _t(t,r,e)})}var ia=Yn(function(e,t){return Ha(e)?dn(e,t):[]}),aa=Yn(function(e){return mo(Rt(e,Ha))}),sa=Yn(function(e){var t=Yi(e);return Ha(t)&&(t=r),mo(Rt(e,Ha),li(t,2))}),la=Yn(function(e){var t=Yi(e);return t="function"==typeof t?t:r,mo(Rt(e,Ha),r,t)}),pa=Yn(na);var da=Yn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,oa(e,n)});function ua(e){var t=Lr(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var fa=ri(function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,i=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Ur&&vi(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:ca,args:[i],thisArg:r}),new Vr(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(i)});var ha=ko(function(e,t,r){Ne.call(e,r)?++e[r]:nn(e,r,1)});var ma=Lo(Ui),ga=Lo($i);function ya(e,t){return($a(e)?Et:un)(e,li(t,3))}function va(e,t){return($a(e)?Tt:cn)(e,li(t,3))}var ba=ko(function(e,t,r){Ne.call(e,r)?e[r].push(t):nn(e,r,[t])});var Oa=Yn(function(e,t,r){var n=-1,o="function"==typeof t,i=za(e)?Oe(e.length):[];return un(e,function(e){i[++n]=o?_t(t,e,r):Dn(e,t,r)}),i}),wa=ko(function(e,t,r){nn(e,r,t)});function Sa(e,t){return($a(e)?kt:Ln)(e,li(t,3))}var _a=ko(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var Pa=Yn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bi(e,t[0],t[1])?t=[]:r>2&&bi(t[0],t[1],t[2])&&(t=[t[0]]),$n(e,gn(t,1),[])}),Ea=dt||function(){return ut.Date.now()};function Ta(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Xo(e,s,r,r,r,r,t)}function Ca(e,t){var o;if("function"!=typeof t)throw new Re(n);return e=fs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=r),o}}var Ra=Yn(function(e,t,r){var n=1;if(r.length){var o=ar(r,si(Ra));n|=a}return Xo(e,n,t,r,o)}),Da=Yn(function(e,t,r){var n=3;if(r.length){var o=ar(r,si(Da));n|=a}return Xo(t,n,e,r,o)});function xa(e,t,o){var i,a,s,l,p,d,u=0,c=!1,f=!1,h=!0;if("function"!=typeof e)throw new Re(n);function m(t){var n=i,o=a;return i=a=r,u=t,l=e.apply(o,n)}function g(e){var n=e-d;return d===r||n>=t||n<0||f&&e-u>=s}function y(){var e=Ea();if(g(e))return v(e);p=xi(y,function(e){var r=t-(e-d);return f?yr(r,s-(e-u)):r}(e))}function v(e){return p=r,h&&i?m(e):(i=a=r,l)}function b(){var e=Ea(),n=g(e);if(i=arguments,a=this,d=e,n){if(p===r)return function(e){return u=e,p=xi(y,t),c?m(e):l}(d);if(f)return So(p),p=xi(y,t),m(d)}return p===r&&(p=xi(y,t)),l}return t=ms(t)||0,Za(o)&&(c=!!o.leading,s=(f="maxWait"in o)?gr(ms(o.maxWait)||0,t):s,h="trailing"in o?!!o.trailing:h),b.cancel=function(){p!==r&&So(p),u=0,i=d=a=p=r},b.flush=function(){return p===r?l:v(Ea())},b}var ka=Yn(function(e,t){return pn(e,1,t)}),ja=Yn(function(e,t,r){return pn(e,ms(t)||0,r)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Re(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Aa.Cache||zr),r}function Na(e){if("function"!=typeof e)throw new Re(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=zr;var Ia=Oo(function(e,t){var r=(t=1==t.length&&$a(t[0])?kt(t[0],Yt(li())):kt(gn(t,1),Yt(li()))).length;return Yn(function(n){for(var o=-1,i=yr(n.length,r);++o<i;)n[o]=t[o].call(this,n[o]);return _t(e,this,n)})}),qa=Yn(function(e,t){var n=ar(t,si(qa));return Xo(e,a,r,t,n)}),Ma=Yn(function(e,t){var n=ar(t,si(Ma));return Xo(e,64,r,t,n)}),La=ri(function(e,t){return Xo(e,l,r,r,r,t)});function Fa(e,t){return e===t||e!=e&&t!=t}var Ba=Ho(En),Va=Ho(function(e,t){return e>=t}),Ua=xn(function(){return arguments}())?xn:function(e){return es(e)&&Ne.call(e,"callee")&&!We.call(e,"callee")},$a=Oe.isArray,Ga=yt?Yt(yt):function(e){return es(e)&&Pn(e)==x};function za(e){return null!=e&&Qa(e.length)&&!Ka(e)}function Ha(e){return es(e)&&za(e)}var Wa=qt||ml,Ja=vt?Yt(vt):function(e){return es(e)&&Pn(e)==y};function Ya(e){if(!es(e))return!1;var t=Pn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Za(e))return!1;var t=Pn(e);return t==b||t==O||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==fs(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Yt(bt):function(e){return es(e)&&hi(e)==w};function rs(e){return"number"==typeof e||es(e)&&Pn(e)==S}function ns(e){if(!es(e)||Pn(e)!=_)return!1;var t=ze(e);if(null===t)return!0;var r=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ae.call(r)==Le}var os=Ot?Yt(Ot):function(e){return es(e)&&Pn(e)==E};var is=wt?Yt(wt):function(e){return es(e)&&hi(e)==T};function as(e){return"string"==typeof e||!$a(e)&&es(e)&&Pn(e)==C}function ss(e){return"symbol"==typeof e||es(e)&&Pn(e)==R}var ls=St?Yt(St):function(e){return es(e)&&Qa(e.length)&&!!ot[Pn(e)]};var ps=Ho(Mn),ds=Ho(function(e,t){return e<=t});function us(e){if(!e)return[];if(za(e))return as(e)?dr(e):Do(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=hi(e);return(t==w?or:t==T?sr:Fs)(e)}function cs(e){return e?(e=ms(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=cs(e),r=t%1;return t==t?r?t-r:t:0}function hs(e){return e?an(fs(e),0,c):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return u;if(Za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var r=fe.test(e);return r||me.test(e)?lt(e.slice(2),r?2:8):ce.test(e)?u:+e}function gs(e){return xo(e,ks(e))}function ys(e){return null==e?"":lo(e)}var vs=jo(function(e,t){if(_i(t)||za(t))xo(t,xs(t),e);else for(var r in t)Ne.call(t,r)&&Zr(e,r,t[r])}),bs=jo(function(e,t){xo(t,ks(t),e)}),Os=jo(function(e,t,r,n){xo(t,ks(t),e,n)}),ws=jo(function(e,t,r,n){xo(t,xs(t),e,n)}),Ss=ri(on);var _s=Yn(function(e,t){e=Ee(e);var n=-1,o=t.length,i=o>2?t[2]:r;for(i&&bi(t[0],t[1],i)&&(o=1);++n<o;)for(var a=t[n],s=ks(a),l=-1,p=s.length;++l<p;){var d=s[l],u=e[d];(u===r||Fa(u,ke[d])&&!Ne.call(e,d))&&(e[d]=a[d])}return e}),Ps=Yn(function(e){return e.push(r,Zo),_t(As,r,e)});function Es(e,t,n){var o=null==e?r:Sn(e,t);return o===r?n:o}function Ts(e,t){return null!=e&&mi(e,t,Cn)}var Cs=Vo(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),e[t]=r},Zs(rl)),Rs=Vo(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Me.call(t)),Ne.call(e,t)?e[t].push(r):e[t]=[r]},li),Ds=Yn(Dn);function xs(e){return za(e)?Jr(e):In(e)}function ks(e){return za(e)?Jr(e,!0):qn(e)}var js=jo(function(e,t,r){Vn(e,t,r)}),As=jo(function(e,t,r,n){Vn(e,t,r,n)}),Ns=ri(function(e,t){var r={};if(null==e)return r;var n=!1;t=kt(t,function(t){return t=bo(t,e),n||(n=t.length>1),t}),xo(e,oi(e),r),n&&(r=sn(r,7,ei));for(var o=t.length;o--;)uo(r,t[o]);return r});var Is=ri(function(e,t){return null==e?{}:function(e,t){return Gn(e,t,function(t,r){return Ts(e,r)})}(e,t)});function qs(e,t){if(null==e)return{};var r=kt(oi(e),function(e){return[e]});return t=li(t),Gn(e,r,function(e,r){return t(e,r[0])})}var Ms=Ko(xs),Ls=Ko(ks);function Fs(e){return null==e?[]:Kt(e,xs(e))}var Bs=qo(function(e,t,r){return t=t.toLowerCase(),e+(r?Vs(t):t)});function Vs(e){return Ys(ys(e).toLowerCase())}function Us(e){return(e=ys(e))&&e.replace(ye,er).replace(Xe,"")}var $s=qo(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Gs=qo(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),zs=Io("toLowerCase");var Hs=qo(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Ws=qo(function(e,t,r){return e+(r?" ":"")+Ys(t)});var Js=qo(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Ys=Io("toUpperCase");function Ks(e,t,n){return e=ys(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Xs=Yn(function(e,t){try{return _t(e,r,t)}catch(e){return Ya(e)?e:new Se(e)}}),Qs=ri(function(e,t){return Et(t,function(t){t=qi(t),nn(e,t,Ra(e[t],e))}),e});function Zs(e){return function(){return e}}var el=Fo(),tl=Fo(!0);function rl(e){return e}function nl(e){return Nn("function"==typeof e?e:sn(e,1))}var ol=Yn(function(e,t){return function(r){return Dn(r,e,t)}}),il=Yn(function(e,t){return function(r){return Dn(e,r,t)}});function al(e,t,r){var n=xs(t),o=wn(t,n);null!=r||Za(t)&&(o.length||!n.length)||(r=t,t=e,e=this,o=wn(t,xs(t)));var i=!(Za(r)&&"chain"in r&&!r.chain),a=Ka(e);return Et(o,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=e(this.__wrapped__);return(r.__actions__=Do(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})}),e}function sl(){}var ll=$o(kt),pl=$o(Ct),dl=$o(It);function ul(e){return Oi(e)?$t(qi(e)):function(e){return function(t){return Sn(t,e)}}(e)}var cl=zo(),fl=zo(!0);function hl(){return[]}function ml(){return!1}var gl=Uo(function(e,t){return e+t},0),yl=Jo("ceil"),vl=Uo(function(e,t){return e/t},1),bl=Jo("floor");var Ol,wl=Uo(function(e,t){return e*t},1),Sl=Jo("round"),_l=Uo(function(e,t){return e-t},0);return Lr.after=function(e,t){if("function"!=typeof t)throw new Re(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=Ta,Lr.assign=vs,Lr.assignIn=bs,Lr.assignInWith=Os,Lr.assignWith=ws,Lr.at=Ss,Lr.before=Ca,Lr.bind=Ra,Lr.bindAll=Qs,Lr.bindKey=Da,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Lr.chain=ua,Lr.chunk=function(e,t,n){t=(n?bi(e,t,n):t===r)?1:gr(fs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=Oe(ft(o/t));i<o;)s[a++]=ro(e,i,i+=t);return s},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,o=[];++t<r;){var i=e[t];i&&(o[n++]=i)}return o},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Oe(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return jt($a(r)?Do(r):[r],gn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=li();return e=t?kt(e,function(e){if("function"!=typeof e[1])throw new Re(n);return[r(e[0]),e[1]]}):[],Yn(function(r){for(var n=-1;++n<t;){var o=e[n];if(_t(o[0],this,r))return _t(o[1],this,r)}})},Lr.conforms=function(e){return function(e){var t=xs(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Lr.constant=Zs,Lr.countBy=ha,Lr.create=function(e,t){var r=Fr(e);return null==t?r:rn(r,t)},Lr.curry=function e(t,n,o){var i=Xo(t,8,r,r,r,r,r,n=o?r:n);return i.placeholder=e.placeholder,i},Lr.curryRight=function e(t,n,o){var i=Xo(t,16,r,r,r,r,r,n=o?r:n);return i.placeholder=e.placeholder,i},Lr.debounce=xa,Lr.defaults=_s,Lr.defaultsDeep=Ps,Lr.defer=ka,Lr.delay=ja,Lr.difference=Fi,Lr.differenceBy=Bi,Lr.differenceWith=Vi,Lr.drop=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,(t=n||t===r?1:fs(t))<0?0:t,o):[]},Lr.dropRight=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,0,(t=o-(t=n||t===r?1:fs(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!0):[]},Lr.fill=function(e,t,n,o){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bi(e,t,n)&&(n=0,o=i),function(e,t,n,o){var i=e.length;for((n=fs(n))<0&&(n=-n>i?0:i+n),(o=o===r||o>i?i:fs(o))<0&&(o+=i),o=n>o?0:hs(o);n<o;)e[n++]=t;return e}(e,t,n,o)):[]},Lr.filter=function(e,t){return($a(e)?Rt:mn)(e,li(t,3))},Lr.flatMap=function(e,t){return gn(Sa(e,t),1)},Lr.flatMapDeep=function(e,t){return gn(Sa(e,t),p)},Lr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),gn(Sa(e,t),n)},Lr.flatten=Gi,Lr.flattenDeep=function(e){return(null==e?0:e.length)?gn(e,p):[]},Lr.flattenDepth=function(e,t){return(null==e?0:e.length)?gn(e,t=t===r?1:fs(t)):[]},Lr.flip=function(e){return Xo(e,512)},Lr.flow=el,Lr.flowRight=tl,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var o=e[t];n[o[0]]=o[1]}return n},Lr.functions=function(e){return null==e?[]:wn(e,xs(e))},Lr.functionsIn=function(e){return null==e?[]:wn(e,ks(e))},Lr.groupBy=ba,Lr.initial=function(e){return(null==e?0:e.length)?ro(e,0,-1):[]},Lr.intersection=Hi,Lr.intersectionBy=Wi,Lr.intersectionWith=Ji,Lr.invert=Cs,Lr.invertBy=Rs,Lr.invokeMap=Oa,Lr.iteratee=nl,Lr.keyBy=wa,Lr.keys=xs,Lr.keysIn=ks,Lr.map=Sa,Lr.mapKeys=function(e,t){var r={};return t=li(t,3),bn(e,function(e,n,o){nn(r,t(e,n,o),e)}),r},Lr.mapValues=function(e,t){var r={};return t=li(t,3),bn(e,function(e,n,o){nn(r,n,t(e,n,o))}),r},Lr.matches=function(e){return Fn(sn(e,1))},Lr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Lr.memoize=Aa,Lr.merge=js,Lr.mergeWith=As,Lr.method=ol,Lr.methodOf=il,Lr.mixin=al,Lr.negate=Na,Lr.nthArg=function(e){return e=fs(e),Yn(function(t){return Un(t,e)})},Lr.omit=Ns,Lr.omitBy=function(e,t){return qs(e,Na(li(t)))},Lr.once=function(e){return Ca(2,e)},Lr.orderBy=function(e,t,n,o){return null==e?[]:($a(t)||(t=null==t?[]:[t]),$a(n=o?r:n)||(n=null==n?[]:[n]),$n(e,t,n))},Lr.over=ll,Lr.overArgs=Ia,Lr.overEvery=pl,Lr.overSome=dl,Lr.partial=qa,Lr.partialRight=Ma,Lr.partition=_a,Lr.pick=Is,Lr.pickBy=qs,Lr.property=ul,Lr.propertyOf=function(e){return function(t){return null==e?r:Sn(e,t)}},Lr.pull=Ki,Lr.pullAll=Xi,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?zn(e,t,li(r,2)):e},Lr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?zn(e,t,r,n):e},Lr.pullAt=Qi,Lr.range=cl,Lr.rangeRight=fl,Lr.rearg=La,Lr.reject=function(e,t){return($a(e)?Rt:mn)(e,Na(li(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,o=[],i=e.length;for(t=li(t,3);++n<i;){var a=e[n];t(a,n,e)&&(r.push(a),o.push(n))}return Hn(e,o),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new Re(n);return Yn(e,t=t===r?t:fs(t))},Lr.reverse=Zi,Lr.sampleSize=function(e,t,n){return t=(n?bi(e,t,n):t===r)?1:fs(t),($a(e)?Kr:Xn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Qn(e,t,r)},Lr.setWith=function(e,t,n,o){return o="function"==typeof o?o:r,null==e?e:Qn(e,t,n,o)},Lr.shuffle=function(e){return($a(e)?Xr:to)(e)},Lr.slice=function(e,t,n){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bi(e,t,n)?(t=0,n=o):(t=null==t?0:fs(t),n=n===r?o:fs(n)),ro(e,t,n)):[]},Lr.sortBy=Pa,Lr.sortedUniq=function(e){return e&&e.length?ao(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ao(e,li(t,2)):[]},Lr.split=function(e,t,n){return n&&"number"!=typeof n&&bi(e,t,n)&&(t=n=r),(n=n===r?c:n>>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=lo(t))&&nr(e)?wo(dr(e),0,n):e.split(t,n):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new Re(n);return t=null==t?0:gr(fs(t),0),Yn(function(r){var n=r[t],o=wo(r,0,t);return n&&jt(o,n),_t(e,this,o)})},Lr.tail=function(e){var t=null==e?0:e.length;return t?ro(e,1,t):[]},Lr.take=function(e,t,n){return e&&e.length?ro(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Lr.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?ro(e,(t=o-(t=n||t===r?1:fs(t)))<0?0:t,o):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?fo(e,li(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?fo(e,li(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new Re(n);return Za(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),xa(e,t,{leading:o,maxWait:t,trailing:i})},Lr.thru=ca,Lr.toArray=us,Lr.toPairs=Ms,Lr.toPairsIn=Ls,Lr.toPath=function(e){return $a(e)?kt(e,qi):ss(e)?[e]:Do(Ii(ys(e)))},Lr.toPlainObject=gs,Lr.transform=function(e,t,r){var n=$a(e),o=n||Wa(e)||ls(e);if(t=li(t,4),null==r){var i=e&&e.constructor;r=o?n?new i:[]:Za(e)&&Ka(i)?Fr(ze(e)):{}}return(o?Et:bn)(e,function(e,n,o){return t(r,e,n,o)}),r},Lr.unary=function(e){return Ta(e,1)},Lr.union=ea,Lr.unionBy=ta,Lr.unionWith=ra,Lr.uniq=function(e){return e&&e.length?po(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?po(e,li(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?po(e,r,t):[]},Lr.unset=function(e,t){return null==e||uo(e,t)},Lr.unzip=na,Lr.unzipWith=oa,Lr.update=function(e,t,r){return null==e?e:co(e,t,vo(r))},Lr.updateWith=function(e,t,n,o){return o="function"==typeof o?o:r,null==e?e:co(e,t,vo(n),o)},Lr.values=Fs,Lr.valuesIn=function(e){return null==e?[]:Kt(e,ks(e))},Lr.without=ia,Lr.words=Ks,Lr.wrap=function(e,t){return qa(vo(t),e)},Lr.xor=aa,Lr.xorBy=sa,Lr.xorWith=la,Lr.zip=pa,Lr.zipObject=function(e,t){return go(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return go(e||[],t||[],Qn)},Lr.zipWith=da,Lr.entries=Ms,Lr.entriesIn=Ls,Lr.extend=bs,Lr.extendWith=Os,al(Lr,Lr),Lr.add=gl,Lr.attempt=Xs,Lr.camelCase=Bs,Lr.capitalize=Vs,Lr.ceil=yl,Lr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ms(n))==n?n:0),t!==r&&(t=(t=ms(t))==t?t:0),an(ms(e),t,n)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Lr.conformsTo=function(e,t){return null==t||ln(e,t,xs(t))},Lr.deburr=Us,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=vl,Lr.endsWith=function(e,t,n){e=ys(e),t=lo(t);var o=e.length,i=n=n===r?o:an(fs(n),0,o);return(n-=t.length)>=0&&e.slice(n,i)==t},Lr.eq=Fa,Lr.escape=function(e){return(e=ys(e))&&W.test(e)?e.replace(z,tr):e},Lr.escapeRegExp=function(e){return(e=ys(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Lr.every=function(e,t,n){var o=$a(e)?Ct:fn;return n&&bi(e,t,n)&&(t=r),o(e,li(t,3))},Lr.find=ma,Lr.findIndex=Ui,Lr.findKey=function(e,t){return Mt(e,li(t,3),bn)},Lr.findLast=ga,Lr.findLastIndex=$i,Lr.findLastKey=function(e,t){return Mt(e,li(t,3),On)},Lr.floor=bl,Lr.forEach=ya,Lr.forEachRight=va,Lr.forIn=function(e,t){return null==e?e:yn(e,li(t,3),ks)},Lr.forInRight=function(e,t){return null==e?e:vn(e,li(t,3),ks)},Lr.forOwn=function(e,t){return e&&bn(e,li(t,3))},Lr.forOwnRight=function(e,t){return e&&On(e,li(t,3))},Lr.get=Es,Lr.gt=Ba,Lr.gte=Va,Lr.has=function(e,t){return null!=e&&mi(e,t,Tn)},Lr.hasIn=Ts,Lr.head=zi,Lr.identity=rl,Lr.includes=function(e,t,r,n){e=za(e)?e:Fs(e),r=r&&!n?fs(r):0;var o=e.length;return r<0&&(r=gr(o+r,0)),as(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&Ft(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:fs(r);return o<0&&(o=gr(n+o,0)),Ft(e,t,o)},Lr.inRange=function(e,t,n){return t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r){return e>=yr(t,r)&&e<gr(t,r)}(e=ms(e),t,n)},Lr.invoke=Ds,Lr.isArguments=Ua,Lr.isArray=$a,Lr.isArrayBuffer=Ga,Lr.isArrayLike=za,Lr.isArrayLikeObject=Ha,Lr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Pn(e)==g},Lr.isBuffer=Wa,Lr.isDate=Ja,Lr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(za(e)&&($a(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||ls(e)||Ua(e)))return!e.length;var t=hi(e);if(t==w||t==T)return!e.size;if(_i(e))return!In(e).length;for(var r in e)if(Ne.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return kn(e,t)},Lr.isEqualWith=function(e,t,n){var o=(n="function"==typeof n?n:r)?n(e,t):r;return o===r?kn(e,t,r,n):!!o},Lr.isError=Ya,Lr.isFinite=function(e){return"number"==typeof e&&Gt(e)},Lr.isFunction=Ka,Lr.isInteger=Xa,Lr.isLength=Qa,Lr.isMap=ts,Lr.isMatch=function(e,t){return e===t||jn(e,t,di(t))},Lr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,jn(e,t,di(t),n)},Lr.isNaN=function(e){return rs(e)&&e!=+e},Lr.isNative=function(e){if(Si(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return An(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=rs,Lr.isObject=Za,Lr.isObjectLike=es,Lr.isPlainObject=ns,Lr.isRegExp=os,Lr.isSafeInteger=function(e){return Xa(e)&&e>=-9007199254740991&&e<=d},Lr.isSet=is,Lr.isString=as,Lr.isSymbol=ss,Lr.isTypedArray=ls,Lr.isUndefined=function(e){return e===r},Lr.isWeakMap=function(e){return es(e)&&hi(e)==D},Lr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Pn(e)},Lr.join=function(e,t){return null==e?"":hr.call(e,t)},Lr.kebabCase=$s,Lr.last=Yi,Lr.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var i=o;return n!==r&&(i=(i=fs(n))<0?gr(o+i,0):yr(i,o-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):Lt(e,Vt,i,!0)},Lr.lowerCase=Gs,Lr.lowerFirst=zs,Lr.lt=ps,Lr.lte=ds,Lr.max=function(e){return e&&e.length?hn(e,rl,En):r},Lr.maxBy=function(e,t){return e&&e.length?hn(e,li(t,2),En):r},Lr.mean=function(e){return Ut(e,rl)},Lr.meanBy=function(e,t){return Ut(e,li(t,2))},Lr.min=function(e){return e&&e.length?hn(e,rl,Mn):r},Lr.minBy=function(e,t){return e&&e.length?hn(e,li(t,2),Mn):r},Lr.stubArray=hl,Lr.stubFalse=ml,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=wl,Lr.nth=function(e,t){return e&&e.length?Un(e,fs(t)):r},Lr.noConflict=function(){return ut._===this&&(ut._=Fe),this},Lr.noop=sl,Lr.now=Ea,Lr.pad=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return Go(mt(o),r)+e+Go(ft(o),r)},Lr.padEnd=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;return t&&n<t?e+Go(t-n,r):e},Lr.padStart=function(e,t,r){e=ys(e);var n=(t=fs(t))?pr(e):0;return t&&n<t?Go(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(ys(e).replace(re,""),t||0)},Lr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bi(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=cs(e),t===r?(t=e,e=0):t=cs(t)),e>t){var o=e;e=t,t=o}if(n||e%1||t%1){var i=Or();return yr(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return Wn(e,t)},Lr.reduce=function(e,t,r){var n=$a(e)?At:zt,o=arguments.length<3;return n(e,li(t,4),r,o,un)},Lr.reduceRight=function(e,t,r){var n=$a(e)?Nt:zt,o=arguments.length<3;return n(e,li(t,4),r,o,cn)},Lr.repeat=function(e,t,n){return t=(n?bi(e,t,n):t===r)?1:fs(t),Jn(ys(e),t)},Lr.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,n){var o=-1,i=(t=bo(t,e)).length;for(i||(i=1,e=r);++o<i;){var a=null==e?r:e[qi(t[o])];a===r&&(o=i,a=n),e=Ka(a)?a.call(e):a}return e},Lr.round=Sl,Lr.runInContext=e,Lr.sample=function(e){return($a(e)?Yr:Kn)(e)},Lr.size=function(e){if(null==e)return 0;if(za(e))return as(e)?pr(e):e.length;var t=hi(e);return t==w||t==T?e.size:In(e).length},Lr.snakeCase=Hs,Lr.some=function(e,t,n){var o=$a(e)?It:no;return n&&bi(e,t,n)&&(t=r),o(e,li(t,3))},Lr.sortedIndex=function(e,t){return oo(e,t)},Lr.sortedIndexBy=function(e,t,r){return io(e,t,li(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=oo(e,t);if(n<r&&Fa(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return oo(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return io(e,t,li(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=oo(e,t,!0)-1;if(Fa(e[r],t))return r}return-1},Lr.startCase=Ws,Lr.startsWith=function(e,t,r){return e=ys(e),r=null==r?0:an(fs(r),0,e.length),t=lo(t),e.slice(r,r+t.length)==t},Lr.subtract=_l,Lr.sum=function(e){return e&&e.length?Ht(e,rl):0},Lr.sumBy=function(e,t){return e&&e.length?Ht(e,li(t,2)):0},Lr.template=function(e,t,n){var o=Lr.templateSettings;n&&bi(e,t,n)&&(t=r),e=ys(e),t=Os({},t,o,Qo);var i,a,s=Os({},t.imports,o.imports,Qo),l=xs(s),p=Kt(s,l),d=0,u=t.interpolate||ve,c="__p += '",f=Te((t.escape||ve).source+"|"+u.source+"|"+(u===K?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,o,s,l){return n||(n=o),c+=e.slice(d,l).replace(be,rr),r&&(i=!0,c+="' +\n__e("+r+") +\n'"),s&&(a=!0,c+="';\n"+s+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=l+t.length,t}),c+="';\n";var m=Ne.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new Se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(a?c.replace(V,""):c).replace(U,"$1").replace($,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var g=Xs(function(){return _e(l,h+"return "+c).apply(r,p)});if(g.source=c,Ya(g))throw g;return g},Lr.times=function(e,t){if((e=fs(e))<1||e>d)return[];var r=c,n=yr(e,c);t=li(t),e-=c;for(var o=Wt(n,t);++r<e;)t(r);return o},Lr.toFinite=cs,Lr.toInteger=fs,Lr.toLength=hs,Lr.toLower=function(e){return ys(e).toLowerCase()},Lr.toNumber=ms,Lr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,d):0===e?e:0},Lr.toString=ys,Lr.toUpper=function(e){return ys(e).toUpperCase()},Lr.trim=function(e,t,n){if((e=ys(e))&&(n||t===r))return Jt(e);if(!e||!(t=lo(t)))return e;var o=dr(e),i=dr(t);return wo(o,Qt(o,i),Zt(o,i)+1).join("")},Lr.trimEnd=function(e,t,n){if((e=ys(e))&&(n||t===r))return e.slice(0,ur(e)+1);if(!e||!(t=lo(t)))return e;var o=dr(e);return wo(o,0,Zt(o,dr(t))+1).join("")},Lr.trimStart=function(e,t,n){if((e=ys(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=lo(t)))return e;var o=dr(e);return wo(o,Qt(o,dr(t))).join("")},Lr.truncate=function(e,t){var n=30,o="...";if(Za(t)){var i="separator"in t?t.separator:i;n="length"in t?fs(t.length):n,o="omission"in t?lo(t.omission):o}var a=(e=ys(e)).length;if(nr(e)){var s=dr(e);a=s.length}if(n>=a)return e;var l=n-pr(o);if(l<1)return o;var p=s?wo(s,0,l).join(""):e.slice(0,l);if(i===r)return p+o;if(s&&(l+=p.length-l),os(i)){if(e.slice(l).search(i)){var d,u=p;for(i.global||(i=Te(i.source,ys(ue.exec(i))+"g")),i.lastIndex=0;d=i.exec(u);)var c=d.index;p=p.slice(0,c===r?l:c)}}else if(e.indexOf(lo(i),l)!=l){var f=p.lastIndexOf(i);f>-1&&(p=p.slice(0,f))}return p+o},Lr.unescape=function(e){return(e=ys(e))&&H.test(e)?e.replace(G,cr):e},Lr.uniqueId=function(e){var t=++Ie;return ys(e)+t},Lr.upperCase=Js,Lr.upperFirst=Ys,Lr.each=ya,Lr.eachRight=va,Lr.first=zi,al(Lr,(Ol={},bn(Lr,function(e,t){Ne.call(Lr.prototype,t)||(Ol[t]=e)}),Ol),{chain:!1}),Lr.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Lr[e].placeholder=Lr}),Et(["drop","take"],function(e,t){Ur.prototype[e]=function(n){n=n===r?1:gr(fs(n),0);var o=this.__filtered__&&!t?new Ur(this):this.clone();return o.__filtered__?o.__takeCount__=yr(n,o.__takeCount__):o.__views__.push({size:yr(n,c),type:e+(o.__dir__<0?"Right":"")}),o},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Et(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:li(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),Et(["head","last"],function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}}),Et(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}}),Ur.prototype.compact=function(){return this.filter(rl)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=Yn(function(e,t){return"function"==typeof e?new Ur(this):this.map(function(r){return Dn(r,e,t)})}),Ur.prototype.reject=function(e){return this.filter(Na(li(e)))},Ur.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ur(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(c)},bn(Ur.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Lr[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Lr.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Ur,p=s[0],d=l||$a(t),u=function(e){var t=i.apply(Lr,jt([e],s));return o&&c?t[0]:t};d&&n&&"function"==typeof p&&1!=p.length&&(l=d=!1);var c=this.__chain__,f=!!this.__actions__.length,h=a&&!c,m=l&&!f;if(!a&&d){t=m?t:new Ur(this);var g=e.apply(t,s);return g.__actions__.push({func:ca,args:[u],thisArg:r}),new Vr(g,c)}return h&&m?e.apply(this,s):(g=this.thru(u),h?o?g.value()[0]:g.value():g)})}),Et(["pop","push","shift","sort","splice","unshift"],function(e){var t=De[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply($a(o)?o:[],e)}return this[r](function(r){return t.apply($a(r)?r:[],e)})}}),bn(Ur.prototype,function(e,t){var r=Lr[t];if(r){var n=r.name+"";Ne.call(Dr,n)||(Dr[n]=[]),Dr[n].push({name:t,func:r})}}),Dr[Bo(r,2).name]=[{name:"wrapper",func:r}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=Do(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Do(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Do(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$a(e),n=t<0,o=r?e.length:0,i=function(e,t,r){var n=-1,o=r.length;for(;++n<o;){var i=r[n],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yr(t,e+a);break;case"takeRight":e=gr(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,s=i.end,l=s-a,p=n?s:a-1,d=this.__iteratees__,u=d.length,c=0,f=yr(l,this.__takeCount__);if(!r||!n&&o==l&&f==l)return ho(e,this.__actions__);var h=[];e:for(;l--&&c<f;){for(var m=-1,g=e[p+=t];++m<u;){var y=d[m],v=y.iteratee,b=y.type,O=v(g);if(2==b)g=O;else if(!O){if(1==b)continue e;break e}}h[c++]=g}return h},Lr.prototype.at=fa,Lr.prototype.chain=function(){return ua(this)},Lr.prototype.commit=function(){return new Vr(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===r&&(this.__values__=us(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var o=Li(n);o.__index__=0,o.__values__=r,t?i.__wrapped__=o:t=o;var i=o;n=n.__wrapped__}return i.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Zi],thisArg:r}),new Vr(t,this.__chain__)}return this.thru(Zi)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return ho(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Qe&&(Lr.prototype[Qe]=function(){return this}),Lr}();ft?((ft.exports=fr)._=fr,ct._=fr):ut._=fr}).call(lodash)}(lodash$1,lodash$1.exports)),lodash$1.exports}var lodashExports=requireLodash(),OakSessions=function(){function e(e,t,r){this.sessionSecret=e,this.encryptionService=t,this.firestoreClient=r}return e.prototype.sealSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r;return __generator$1(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,sealData({loginHint:e,accessToken:t},{password:this.sessionSecret})];case 1:return[2,n.sent()];case 2:throw r=n.sent(),OakGoogleClassroomException.OakGoogleClassroomError("Failed to seal session","sealSession",{loginHint:e},lodashExports.isError(r)?r:void 0);case 3:return[2]}})})},e.prototype.decryptSession=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator$1(this,function(r){switch(r.label){case 0:return[4,unsealData(e,{password:this.sessionSecret})];case 1:return(null==(t=r.sent())?void 0:t.accessToken)&&(null==t?void 0:t.loginHint)?[2,t]:[2,null]}})})},e.prototype.getSessionAndUser=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.decryptSession(e)];case 1:return(t=i.sent())?[4,this.firestoreClient.getConnectedUserCredentials(t.loginHint)]:[2,null];case 2:return(r=i.sent())?(n=r.refreshToken?this.encryptionService.decryptString(r.refreshToken):void 0,r.refreshToken=n,process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN&&(r.refreshToken=process.env.GOOGLE_CLASSROOM_DEV_REFRESH_TOKEN),r.profilePictureUrl&&(o=this.encryptionService.decryptString(r.profilePictureUrl),r.profilePictureUrl=o),[2,{session:t,user:r}]):[2,null]}})})},e.prototype.encryptCredentials=function(e,t){return{encryptedRefreshToken:e?this.encryptionService.encryptString(e):void 0,encryptedProfileUrl:t?this.encryptionService.encryptString(t):void 0}},e.prototype.saveUserCredentials=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.firestoreClient.upsertConnectedUserCredentials(e)];case 1:return t.sent(),[2]}})})},e}(),GoogleClassroomClient=function(){function e(e,t){this.baseUrl=e,this.oAuthClient=t,this.baseUrl=e,this.oAuthClient=t}return e.prototype.getClassroomClient=function(){return __awaiter(this,void 0,void 0,function(){var e;return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.oAuthClient.getOAuth2Client()];case 1:return e=t.sent(),[2,new classroom.classroom_v1.Classroom({auth:e})]}})})},e.prototype.getUrl=function(e){var t=process.env.VERCEL_AUTOMATION_BYPASS_SECRET,r="production"!==process.env.VERCEL_ENV;if(t&&r){var n="x-vercel-protection-bypass=".concat(t,"&x-vercel-set-bypass-cookie=samesitenone");return"".concat(this.baseUrl).concat(e,"?").concat(n)}return"".concat(this.baseUrl).concat(e)},e.prototype.createAnnouncementAttachment=function(e){return __awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a,s,l,p,d,u,c,f;return __generator$1(this,function(h){switch(h.label){case 0:return t=e.courseId,r=e.itemId,n=e.addOnToken,o=e.title,i=e.lessonSlug,a=e.programmeSlug,s=e.unitSlug,l=e.maxPoints,[4,this.getClassroomClient()];case 1:return p=h.sent(),d=l?{maxPoints:l,studentWorkReviewUri:{uri:this.getUrl("/pupils/programmes/".concat(a,"/units/").concat(s,"/lessons/").concat(i))}}:{},[4,p.courses.courseWork.addOnAttachments.create({courseId:t,itemId:r,addOnToken:n,requestBody:__assign({title:o,teacherViewUri:{uri:this.getUrl("/pupils/programmes/".concat(a,"/units/").concat(s,"/lessons/").concat(i))},studentViewUri:{uri:this.getUrl("/classroom/pupil/programmes/".concat(a,"/").concat(s,"/").concat(i))}},d)})];case 2:return u=h.sent(),c=classroomAttachmentSchema.parse(u.data),f=c.maxPoints?{maxPoints:c.maxPoints,studentWorkReviewUri:c.studentWorkReviewUri}:{},[2,__assign({courseId:c.courseId,postId:c.postId,id:c.id,title:c.title,teacherViewUri:c.teacherViewUri,studentViewUri:c.studentViewUri,itemId:c.itemId},f)]}})})},e.prototype.submitPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.patch({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId,updateMask:"pointsEarned",requestBody:{pointsEarned:e.pointsEarned}})];case 2:return[2,t.sent().data]}})})},e.prototype.fetchPupilResponse=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){switch(t.label){case 0:return[4,this.getClassroomClient()];case 1:return[4,t.sent().courses.courseWork.addOnAttachments.studentSubmissions.get({courseId:e.courseId,itemId:e.itemId,attachmentId:e.attachmentId,submissionId:e.submissionId})];case 2:return[2,t.sent().data]}})})},e}(),OakAttachment=function(){function e(e,t){this.baseUrl=e,this.firestoreClient=t}return e.prototype.createAttachment=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n;return __generator$1(this,function(o){switch(o.label){case 0:return[4,new GoogleClassroomClient(this.baseUrl,t).createAnnouncementAttachment(e)];case 1:return r=o.sent(),n=__assign(__assign(__assign({},r),{attachmentId:r.id,createdAt:(new Date).toISOString()}),e.teacherLoginHint?{teacherLoginHint:e.teacherLoginHint}:{}),[4,this.firestoreClient.upsertClassroomAttachment(n)];case 2:return o.sent(),[4,this.firestoreClient.getClassroomAttachmentById(r.id)];case 3:return[2,o.sent()]}})})},e}(),OakGoogleClassroomAddOn=function(){function e(e,t,r,n,o,i,a){var s=new EncryptionService(e),l=new FirestoreClient(t);this.oauthService=new OakOAuth(r,n,o),this.sessionService=new OakSessions(i,s,l),this.classroomAttachmentService=new OakAttachment(a,l)}return e.prototype.getGoogleSignInUrl=function(e){return __awaiter(this,arguments,void 0,function(e,t){return void 0===t&&(t=!1),__generator$1(this,function(r){return[2,this.oauthService.getSignInUrl(e,t)]})})},e.prototype.getPupilGoogleSignInUrl=function(e){return __awaiter(this,void 0,void 0,function(){return __generator$1(this,function(t){return[2,this.oauthService.getSignInUrl(e,!1,!0)]})})},e.prototype.handleGoogleSignInCallback=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a;return __generator$1(this,function(s){switch(s.label){case 0:return[4,this.oauthService.exchangeCodeForTokens(e)];case 1:return r=s.sent(),n=this.sessionService.encryptCredentials(r.refreshToken,r.profilePictureUrl),o=n.encryptedRefreshToken,i=n.encryptedProfileUrl,[4,this.sessionService.sealSession(r.loginHint,r.accessToken)];case 2:return a=s.sent(),[4,this.sessionService.saveUserCredentials({refreshToken:o,profilePictureUrl:i,loginHint:r.loginHint})];case 3:return s.sent(),t&&r.email?[4,t(r.email)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2,{encryptedSession:a,accessToken:r.accessToken,profilePictureUrl:r.profilePictureUrl}]}})})},e.prototype.verifyAuthSession=function(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o;return __generator$1(this,function(i){switch(i.label){case 0:return e&&t?[4,this.sessionService.getSessionAndUser(e)]:[2,null];case 1:return(r=i.sent())&&r.session.accessToken===t?[4,this.oauthService.validateOrRefreshToken(t,r.user.refreshToken)]:[2,null];case 2:return(n=i.sent())?n.wasRefreshed?[4,this.sessionService.sealSession(r.session.loginHint,n.token)]:[3,4]:[2,null];case 3:return o=i.sent(),[3,5];case 4:o=e,i.label=5;case 5:return[2,{session:o,token:n.token,userProfilePicUrl:r.user.profilePictureUrl}]}})})},e.prototype.createAttachment=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var n,o;return __generator$1(this,function(i){switch(i.label){case 0:return[4,this.sessionService.getSessionAndUser(r)];case 1:if(!(n=i.sent())||t!==n.session.accessToken)throw OakGoogleClassroomException.OakGoogleClassroomError("Invalid Google Classroom session","createAttachment",{args:e});return o=this.oauthService.createClient(t,n.user.refreshToken),[2,this.classroomAttachmentService.createAttachment(__assign(__assign({},e),{teacherLoginHint:n.session.loginHint}),o)]}})})},e}();exports.OakGoogleClassroomAddOn=OakGoogleClassroomAddOn,exports.OakGoogleClassroomException=OakGoogleClassroomException;
|
|
100
100
|
//# sourceMappingURL=index.js.map
|